From f3823f10612b7b0c6796a1041187999ba4afd887 Mon Sep 17 00:00:00 2001 From: Regis Merlino Date: Thu, 21 Mar 2013 11:03:51 +0100 Subject: Update libgee to 0.9.92 (3462b25) --- ChangeLog | 440 +- Makefile.am | 4 +- Makefile.decl | 3 + Makefile.in | 13 +- NEWS | 94 +- README | 46 +- aclocal.m4 | 30 + benchmark/Makefile.am | 43 +- benchmark/Makefile.in | 127 +- benchmark/benchmark.c | 156 +- benchmark/benchmark.vala | 31 + benchmark/benchmarks.vala.stamp | 0 benchmark/benchmarks_vala.stamp | 1 + benchmark/benchmarksorts.c | 744 ++- benchmark/benchmarksorts.vala | 97 +- benchmark/mergesort.c | 705 --- benchmark/mergesort.vala | 110 - configure | 132 +- configure.ac | 14 +- doc/Makefile.am | 28 +- doc/Makefile.in | 26 +- gee-0.8.pc.in | 13 + gee-1.0.pc.in | 13 - gee/Gee-0.8.gir | 8644 ++++++++++++++++++++++++++ gee/Gee-1.0.gir | 5206 ---------------- gee/Makefile.am | 111 +- gee/Makefile.in | 1224 +++- gee/abstractbidirlist.c | 724 +++ gee/abstractbidirlist.vala | 58 + gee/abstractbidirsortedmap.c | 860 +++ gee/abstractbidirsortedmap.vala | 65 + gee/abstractbidirsortedset.c | 760 +++ gee/abstractbidirsortedset.vala | 65 + gee/abstractcollection.c | 1624 +---- gee/abstractcollection.vala | 231 +- gee/abstractlist.c | 363 +- gee/abstractlist.vala | 46 +- gee/abstractmap.c | 777 ++- gee/abstractmap.vala | 102 +- gee/abstractmultimap.c | 2877 +++++++-- gee/abstractmultimap.vala | 261 +- gee/abstractmultiset.c | 600 +- gee/abstractmultiset.vala | 81 +- gee/abstractqueue.c | 285 +- gee/abstractqueue.vala | 20 +- gee/abstractset.c | 257 +- gee/abstractset.vala | 12 + gee/abstractsortedmap.c | 786 +++ gee/abstractsortedmap.vala | 77 + gee/abstractsortedset.c | 849 +++ gee/abstractsortedset.vala | 110 + gee/arraylist.c | 873 ++- gee/arraylist.vala | 102 +- gee/arrayqueue.c | 1959 ++++++ gee/arrayqueue.vala | 341 ++ gee/assemblyinfo.vala | 2 +- gee/bidiriterator.c | 74 +- gee/bidiriterator.vala | 8 + gee/bidirlist.c | 297 + gee/bidirlist.vala | 35 + gee/bidirlistiterator.c | 194 + gee/bidirlistiterator.vala | 30 + gee/bidirmapiterator.c | 162 + gee/bidirmapiterator.vala | 56 + gee/bidirsortedmap.c | 457 ++ gee/bidirsortedmap.vala | 45 + gee/bidirsortedset.c | 364 ++ gee/bidirsortedset.vala | 46 + gee/collection.c | 1505 ++++- gee/collection.vala | 222 +- gee/comparable.c | 2 + gee/comparable.vala | 2 + gee/concurrentlist.c | 2773 +++++++++ gee/concurrentlist.vala | 586 ++ gee/concurrentset.c | 8065 ++++++++++++++++++++++++ gee/concurrentset.vala | 1362 +++++ gee/deque.c | 84 +- gee/deque.vala | 1 + gee/functions.c | 543 +- gee/functions.vala | 105 +- gee/gee-0.8.vapi | 724 +++ gee/gee-1.0.vapi | 414 -- gee/gee-internals-0.8.vapi | 971 +++ gee/gee-internals.h | 2315 +++++++ gee/gee.h | 1129 +++- gee/gee.vala.stamp | 0 gee/hashable.c | 101 + gee/hashable.vala | 44 + gee/hashmap.c | 1184 +++- gee/hashmap.vala | 169 +- gee/hashmultimap.c | 507 +- gee/hashmultimap.vala | 18 +- gee/hashmultiset.c | 226 +- gee/hashmultiset.vala | 6 +- gee/hashset.c | 548 +- gee/hashset.vala | 66 +- gee/hazardpointer.c | 2278 +++++++ gee/hazardpointer.vala | 768 +++ gee/iterable.c | 86 +- gee/iterable.vala | 8 +- gee/iterator.c | 306 +- gee/iterator.vala | 69 +- gee/lazy.c | 367 ++ gee/lazy.vala | 60 + gee/libgee_0_8_la_vala.stamp | 1 + gee/linkedlist.c | 924 ++- gee/linkedlist.vala | 117 +- gee/list.c | 295 +- gee/list.vala | 23 +- gee/listiterator.c | 88 +- gee/listiterator.vala | 8 +- gee/map.c | 412 +- gee/map.vala | 73 +- gee/mapiterator.c | 238 +- gee/mapiterator.vala | 81 +- gee/multimap.c | 200 +- gee/multimap.vala | 30 + gee/multiset.c | 205 +- gee/multiset.vala | 20 + gee/priorityqueue.c | 1454 ++--- gee/priorityqueue.vala | 89 +- gee/queue.c | 152 +- gee/queue.vala | 15 +- gee/readonlybidirlist.c | 795 +++ gee/readonlybidirlist.vala | 73 + gee/readonlybidirsortedmap.c | 879 +++ gee/readonlybidirsortedmap.vala | 71 + gee/readonlybidirsortedset.c | 719 +++ gee/readonlybidirsortedset.vala | 71 + gee/readonlycollection.c | 456 +- gee/readonlycollection.vala | 75 +- gee/readonlylist.c | 218 +- gee/readonlylist.vala | 24 +- gee/readonlymap.c | 514 +- gee/readonlymap.vala | 59 +- gee/readonlymultimap.c | 725 +++ gee/readonlymultimap.vala | 131 + gee/readonlymultiset.c | 401 ++ gee/readonlymultiset.vala | 57 + gee/readonlyset.c | 99 +- gee/readonlysortedmap.c | 645 ++ gee/readonlysortedmap.vala | 81 + gee/readonlysortedset.c | 694 +++ gee/readonlysortedset.vala | 123 + gee/set.c | 89 +- gee/set.vala | 1 + gee/sortedmap.c | 500 ++ gee/sortedmap.vala | 66 + gee/sortedset.c | 238 +- gee/sortedset.vala | 26 +- gee/timsort.c | 597 +- gee/timsort.vala | 31 +- gee/traversable.c | 1901 ++++++ gee/traversable.vala | 381 ++ gee/treemap.c | 11788 ++++++++++++++++++++++++++++++------ gee/treemap.vala | 1500 ++++- gee/treemultimap.c | 420 +- gee/treemultimap.vala | 11 +- gee/treemultiset.c | 218 +- gee/treemultiset.vala | 4 +- gee/treeset.c | 1216 +++- gee/treeset.vala | 156 +- gee/unfolditerator.c | 567 ++ gee/unfolditerator.vala | 102 + packaging/libgee.spec | 8 +- tests/Makefile.am | 55 +- tests/Makefile.in | 934 ++- tests/testarraylist.c | 100 +- tests/testarraylist.vala | 19 +- tests/testarrayqueue.c | 208 + tests/testarrayqueue.vala | 38 + tests/testbidirlist.c | 498 ++ tests/testbidirlist.vala | 107 + tests/testbidirsortedmap.c | 2251 +++++++ tests/testbidirsortedmap.vala | 430 ++ tests/testbidirsortedset.c | 1326 ++++ tests/testbidirsortedset.vala | 275 + tests/testcase.c | 46 +- tests/testcase.vala | 10 +- tests/testcollection.c | 4044 +++++++++---- tests/testcollection.vala | 660 +- tests/testcomparable.c | 258 - tests/testcomparable.vala | 54 - tests/testconcurrentlist.c | 188 + tests/testconcurrentlist.vala | 38 + tests/testconcurrentset.c | 209 + tests/testconcurrentset.vala | 38 + tests/testdata.c | 1103 ++++ tests/testdata.vala | 111 + tests/testdeque.c | 2068 +++++-- tests/testdeque.vala | 196 +- tests/testfunctions.c | 1203 ++++ tests/testfunctions.vala | 238 + tests/testhashmap.c | 120 +- tests/testhashmap.vala | 37 - tests/testhashmultimap.c | 34 +- tests/testhashmultimap.vala | 6 - tests/testhashmultiset.c | 20 +- tests/testhashmultiset.vala | 4 - tests/testhashset.c | 98 +- tests/testhashset.vala | 31 - tests/testlinkedlist.c | 105 +- tests/testlinkedlist.vala | 27 +- tests/testlinkedlistasdeque.c | 13 +- tests/testlinkedlistasdeque.vala | 3 - tests/testlist.c | 363 +- tests/testlist.vala | 39 +- tests/testmain.c | 344 +- tests/testmain.vala | 8 +- tests/testmap.c | 1029 ++-- tests/testmap.vala | 74 +- tests/testmultimap.c | 38 +- tests/testmultimap.vala | 10 + tests/testmultiset.c | 4 +- tests/testpriorityqueue.c | 72 +- tests/testpriorityqueue.vala | 25 - tests/testqueue.c | 10 +- tests/testreadonlybidirlist.c | 525 ++ tests/testreadonlybidirlist.vala | 119 + tests/testreadonlycollection.c | 161 +- tests/testreadonlycollection.vala | 6 +- tests/testreadonlylist.c | 372 +- tests/testreadonlylist.vala | 26 +- tests/testreadonlymap.c | 122 +- tests/testreadonlymap.vala | 4 +- tests/testreadonlyset.c | 2 +- tests/tests.vala.stamp | 0 tests/tests_vala.stamp | 1 + tests/testset.c | 4 +- tests/testsortedmap.c | 6438 ++++++++++++++++++++ tests/testsortedmap.vala | 1174 ++++ tests/testsortedset.c | 1549 ++--- tests/testsortedset.vala | 206 +- tests/testtreemap.c | 309 +- tests/testtreemap.vala | 81 +- tests/testtreemultimap.c | 45 +- tests/testtreemultimap.vala | 12 - tests/testtreemultiset.c | 38 +- tests/testtreemultiset.vala | 11 - tests/testtreeset.c | 105 +- tests/testtreeset.vala | 27 +- 241 files changed, 103022 insertions(+), 21293 deletions(-) delete mode 100644 benchmark/benchmarks.vala.stamp create mode 100644 benchmark/benchmarks_vala.stamp delete mode 100644 benchmark/mergesort.c delete mode 100644 benchmark/mergesort.vala create mode 100644 gee-0.8.pc.in delete mode 100644 gee-1.0.pc.in create mode 100644 gee/Gee-0.8.gir delete mode 100644 gee/Gee-1.0.gir create mode 100644 gee/abstractbidirlist.c create mode 100644 gee/abstractbidirlist.vala create mode 100644 gee/abstractbidirsortedmap.c create mode 100644 gee/abstractbidirsortedmap.vala create mode 100644 gee/abstractbidirsortedset.c create mode 100644 gee/abstractbidirsortedset.vala create mode 100644 gee/abstractsortedmap.c create mode 100644 gee/abstractsortedmap.vala create mode 100644 gee/abstractsortedset.c create mode 100644 gee/abstractsortedset.vala create mode 100644 gee/arrayqueue.c create mode 100644 gee/arrayqueue.vala create mode 100644 gee/bidirlist.c create mode 100644 gee/bidirlist.vala create mode 100644 gee/bidirlistiterator.c create mode 100644 gee/bidirlistiterator.vala create mode 100644 gee/bidirmapiterator.c create mode 100644 gee/bidirmapiterator.vala create mode 100644 gee/bidirsortedmap.c create mode 100644 gee/bidirsortedmap.vala create mode 100644 gee/bidirsortedset.c create mode 100644 gee/bidirsortedset.vala create mode 100644 gee/concurrentlist.c create mode 100644 gee/concurrentlist.vala create mode 100644 gee/concurrentset.c create mode 100644 gee/concurrentset.vala create mode 100644 gee/gee-0.8.vapi delete mode 100644 gee/gee-1.0.vapi create mode 100644 gee/gee-internals-0.8.vapi create mode 100644 gee/gee-internals.h delete mode 100644 gee/gee.vala.stamp create mode 100644 gee/hashable.c create mode 100644 gee/hashable.vala create mode 100644 gee/hazardpointer.c create mode 100644 gee/hazardpointer.vala create mode 100644 gee/lazy.c create mode 100644 gee/lazy.vala create mode 100644 gee/libgee_0_8_la_vala.stamp create mode 100644 gee/readonlybidirlist.c create mode 100644 gee/readonlybidirlist.vala create mode 100644 gee/readonlybidirsortedmap.c create mode 100644 gee/readonlybidirsortedmap.vala create mode 100644 gee/readonlybidirsortedset.c create mode 100644 gee/readonlybidirsortedset.vala create mode 100644 gee/readonlymultimap.c create mode 100644 gee/readonlymultimap.vala create mode 100644 gee/readonlymultiset.c create mode 100644 gee/readonlymultiset.vala create mode 100644 gee/readonlysortedmap.c create mode 100644 gee/readonlysortedmap.vala create mode 100644 gee/readonlysortedset.c create mode 100644 gee/readonlysortedset.vala create mode 100644 gee/sortedmap.c create mode 100644 gee/sortedmap.vala create mode 100644 gee/traversable.c create mode 100644 gee/traversable.vala create mode 100644 gee/unfolditerator.c create mode 100644 gee/unfolditerator.vala create mode 100644 tests/testarrayqueue.c create mode 100644 tests/testarrayqueue.vala create mode 100644 tests/testbidirlist.c create mode 100644 tests/testbidirlist.vala create mode 100644 tests/testbidirsortedmap.c create mode 100644 tests/testbidirsortedmap.vala create mode 100644 tests/testbidirsortedset.c create mode 100644 tests/testbidirsortedset.vala delete mode 100644 tests/testcomparable.c delete mode 100644 tests/testcomparable.vala create mode 100644 tests/testconcurrentlist.c create mode 100644 tests/testconcurrentlist.vala create mode 100644 tests/testconcurrentset.c create mode 100644 tests/testconcurrentset.vala create mode 100644 tests/testdata.c create mode 100644 tests/testdata.vala create mode 100644 tests/testfunctions.c create mode 100644 tests/testfunctions.vala create mode 100644 tests/testreadonlybidirlist.c create mode 100644 tests/testreadonlybidirlist.vala delete mode 100644 tests/tests.vala.stamp create mode 100644 tests/tests_vala.stamp create mode 100644 tests/testsortedmap.c create mode 100644 tests/testsortedmap.vala diff --git a/ChangeLog b/ChangeLog index 7a9e415..a7cbbf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,27 +1,228 @@ -2012-11-10 Maciej Piechotka +2013-03-05 Maciej Piechotka - Release 0.6.6.1 + Release 0.9.92 + +2013-03-04 Maciej Piechotka + + Fix memory leak in TreeSet and TreeMap + +2013-02-17 Maciej Piechotka + + Release 0.9.91 + + Fix the valadoc documentation + + Add missing gee/readonlymultimap.vala + +2013-02-16 Maciej Piechotka + + Add read_only_view to Gee.MultiMap, fixes bug #687158 + + Add read_only_view to Gee.MultiSet + + Allow creation of ArrayList from array + + Add add/contains/remove_all working on array, partial fix of bug #685175 + Full fix which would allow overloading methods by subclasses requires + fixing bug #693455. + +2013-02-07 Maciej Piechotka + + Add generic type arguments to HashMultiMap, TreeMultiSet constructor + +2012-12-26 Maciej Piechotka + + Fix compilation error, fixes bug #690723 + +2012-12-25 Maciej Piechotka + + Make ConcurrentSet implement SortedSet + +2012-12-03 Maciej Piechotka + + Release 0.9.0 + + Add missing fixes for ConcurrentSet from feature local branch + +2012-12-02 Maciej Piechotka + + Fix warnings and bump requirements to GLib 2.32 + + Remove unused lookup of function from AbstractMultiMap + + Small improvements to PriorityQueue + + Fix starting of HazardPointer policy + + Fix missing http:// in link to paper + + Initial implementation of ConcurrentSet + + Small improvement to ConcurrentList.Iterator + + Various small fixes to ConcurrentList + + Fix releasing NULL pointers during atomic exchange + + Making PriorityQueue.NodePair a compact class + +2012-11-25 Maciej Piechotka + + Refactor testing - do more with less + Tests had a lot of repetitive code. It was factored out and this allowed + to test much more cases per run. + + Fix Gee.List.Iterator.next + + PriorityQueue: fix segfault discovered during stress-testing + If node P is removed then set P to R, as described in paper, instead of + NULL. + +2012-11-11 Jasper Lievisse Adriaanse + + Use a portable sed(1) construct to retrieve $libgee_dlname, fixes bug #688106 + +2012-11-04 Evan Nemerson + + Add generic type arguments to HashSet constructor delegate parameters. + +2012-11-04 Maciej Piechotka + + Add .mailmap file + +2012-10-20 Daniel Espinosa + + Fixed commit 9e2e24f4. + + GObject Introspection support improved. * Added shared library for g-ir-compiler. * See bug #67987, Bug #658002 and Bug #585116 2012-10-14 Maciej Piechotka - Release 0.6.6 + Release 0.8.1 2012-10-06 Maciej Piechotka - Ommited change to fix build + Use the highier-level functions in the default methods of Collection Fix Iterator.remove in PriorityQueue +2012-09-30 Maciej Piechotka + + Remove use of explicit iterators + + Specialize foreach functions for ArrayList and LinkedList + +2012-09-27 Maciej Piechotka + + Pass slice in ReadOnlyList, fixes bug 684915 + +2012-09-24 Maciej Piechotka + + Release 0.8.0 + + Update README + + Move everything to GenericAccessors + + Add tests for Traversable methods implemented by Collections + +2012-09-21 Maciej Piechotka + + Remove unnecessary stream override in AbstractCollection + + Fix Traversable.chop method, fixes bug #684348 + +2012-08-28 Maciej Piechotka + + Release 0.7.90 + + Allow early termination of iteration + + Use views instead of copies inside MultiMap and don't cache Set.empty + +2012-08-27 Maciej Piechotka + + Remove outdated method from AbstractSortedMap + +2012-08-27 Philip Withnall + + Don’t notify on changes to hash/equal functions + +2012-08-26 Maciej Piechotka + + Update copyright and whitespaces + +2012-08-23 Maciej Piechotka + + Release 0.7.4.1 + +2012-08-23 Alban Browaeys + + tests: implement read_only in testmap Entry + +2012-08-21 Maciej Piechotka + + Release 0.7.4 + + Bump vala requirements + + Fix warnings about lack of new keyword + +2012-08-20 Maciej Piechotka + + Add read_only to Map.Entry + + Move *_type to interfaces and remove the ones from classes + + Move key_type/value_type implementation to multimap interface + + Add map_iterator to MultiMap, partial fix for bug #675067 + + Add reserved methods to allow future-proof ABI + +2012-08-19 Maciej Piechotka + + Move stream_impl to Traversable + + Move virtual methods to List interface + + Move virtual methods to Map interface + + Move virtual methods to Queue interface + + Move virtual methods to Collection interface + +2012-08-09 Maciej Piechotka + + Add GenericAccessors attributes to interfaces and remove _impl methods. + 2012-08-06 Maciej Piechotka - Release 0.6.5 + Release 0.7.3 Disable introspection during distcheck -2012-03-07 Sebastian Pölsterl + Fixes to ConcurrentList + - Fix using of freed memory in hazard pointers + - Remove memory leak on freeing node in debug build + - Set release policy to main loop by default + - Re-enable the ConcurrentList tests + +2012-08-06 Evan Nemerson + + Use generics for HashDataFunc and EqualDataFunc, fixes bug 680491 - Fixed compiler error - 'NULL' was used instead of 'null' + Add missing CompareDataFunc type arguments, fixes bug 624005 + +2012-07-30 Maciej Piechotka + + Temporary disable broken test. + +2012-03-28 Maciej Piechotka + + Small typo in file header + + Split SortedMap/SortedSet into bi-directional and uni-directional parts 2012-03-06 Maciej Piechotka @@ -30,13 +231,19 @@ the iteration order. It meant that some elements might not be visited and some might be visited twice. -2012-01-24 Florian Brosch +2012-02-19 Maciej Piechotka + + Refactor benchmarks + + Convert the documentations to valadoc new Note syntax + +2012-01-23 Florian Brosch Fix valadoc documentation 2012-01-22 Maciej Piechotka - Release 0.6.4 + Release 0.7.2 Remove --shared-library from .typelib, see bug #667529 for details @@ -44,20 +251,32 @@ 2012-01-20 Maciej Piechotka - Fix gir_namespace and gir_version attributes, fixes bug #666208 + Fix problem of partially releasing hp context Fix compilation with vala master + Extend Gee.Deque tests + + Add ArrayQueue + + Add default implementation of AbstractQueue.drain + + Fix warnings + +2012-01-11 Daniel Espinosa + + Fixed documentation typo in gee/traversable.vala + 2011-12-19 Maciej Piechotka + Add *_type property for all collections, fixes bug #663337 + + Fix compilation of priorityqueue.vala on vala from git + Add gir_namespace and gir_version attributes, fixes bug #666208 Currently they are specified in assemblyinfo.vala which needs to be first file passed to vala. See bug # 666478 for details. -2011-11-09 Maciej Piechotka - - Release 0.6.3 - 2011-10-08 Diego Escalante Urrelo PriorityQueue: build fix for wrong variable name @@ -67,23 +286,131 @@ PriorityQueue: Fix underflow while updating degree, fixes bug #647162 -2011-09-14 Maciej Piechotka +2011-09-29 Maciej Piechotka + + Require more realistic version of Vala + +2011-09-25 Maciej Piechotka Post-release version bump - Release 0.6.2.1 + Release 0.7.1 + + Implement ConcurrentList + - After porting to volatile the freeing of data does not work + + Split List interface into List and BidirList + + Add Gee.HazardPointer + + Remove compilation warnings from tests + +2011-09-23 Maciej Piechotka + + Use VALAFLAGS during building tests + +2011-09-20 Maciej Piechotka + + Move to new syntax of out parameters Add check-news to AM_INIT_AUTOMAKE +2011-09-14 Maciej Piechotka + + Revert "hazardpointer - work in progress" + This reverts commit f39a9175b63f9f6f58a019621e9d8c41c801ff73. + + hazardpointer - work in progress + +2011-08-19 Maciej Piechotka + Post-release version bump - Release 0.6.2 + Release 0.7.0 + +2011-08-17 Maciej Piechotka + + Fix standard functions for nullable types + + Add Traversable.chop function + + Fix default Traversable.stream implementation for Iterator + The implementation assumed in unfolding function that the stream some + value - however it might not be the case. + + Add filter tests + +2011-08-15 Maciej Piechotka + + Allow to install libgee 0.6 and 0.8 in parallel + +2011-08-09 Maciej Piechotka + + Fix ordering of prerequests + + Update documentation + +2011-08-01 Maciej Piechotka + + Add Traversable.filter method + + Fix Traversable.stream in ReadOnlyCollection + +2011-07-25 Maciej Piechotka + + Preserve laziness in Stream + +2011-07-23 Maciej Piechotka + + Add Gee.Traversable requirement to Gee.Iterable + +2011-07-22 Maciej Piechotka + + Export the function part of interface into Traversable + +2011-06-25 Maciej Piechotka + + Add Iterator.scan method + + Add Iterator.map method + + Add Iterator.stream method based on stream fusion + + Add Iterator.concat function + + Add Iterator.unfold function + + Add Gee.Lazy class (call-by-need) + +2011-05-02 Maciej Piechotka + + Add read_only_view to SortedMap + + Add read_only_view to SortedSet + + Add SortedMap interface + + Fix wrong copyright information + + Preparation for new Map.set method + +2011-04-30 Maciej Piechotka + + Fix memory leak in default implementation of foreach and fold 2011-04-29 Maciej Piechotka Change Gee.TreeSet.Range to class It fixes problem that may occured when key used as boundary is freed +2011-04-26 Maciej Piechotka + + Change default implementation of fold + +2011-04-20 Maciej Piechotka + + Add custom foreach function + 2011-04-08 Maciej Piechotka Fix adding second element to priority queue, fixes bug #647162 @@ -100,14 +427,20 @@ 2011-01-28 Jürg Billeter - Post-release version bump - - Release 0.6.1 - Fix memory leak in LinkedList.clear Based on patch by Travis Reitter, fixes bug 639254. -2011-01-20 Maciej Piechotka +2011-01-04 Maciej Piechotka + + Add read_only method to Collection, Map and MultiMap + + Add highier-order functions to MapIterator + + Update copyright notices + + Add read_only property to Iterator and MapIterator + +2010-12-27 Maciej Piechotka Remove depending on order of iteration in read-only collections' test @@ -116,11 +449,21 @@ Fix memory leak on freeing LinkedList If fixes issue described in bug #635224 -2010-09-26 Jürg Billeter +2010-11-07 Maciej Piechotka - Post-release version bump + Add Gee.Iterator.foreach method + + Fix several spelling mistakes and leftover debug code + +2010-10-17 Maciej Piechotka + + Rename Iterator.at_element to Iterator.valid + + Add Iterator.fold aggregative function - Release 0.6.0 + Add Iterator.at_element property to check when other calls are legal + + Move first from Iterator to BidirIterator and remove from MapIterator 2010-09-18 Maciej Piechotka @@ -128,11 +471,9 @@ It fixes build issue described in bug #629933 and make the behavior compatible with ArrayList. -2010-09-16 Jürg Billeter - - Post-release version bump +2010-08-31 Maciej Piechotka - Release 0.5.3 + Version bump to avoid confusion 2010-08-26 Maciej Piechotka @@ -140,6 +481,32 @@ This patch converts using of pointers into proper use of weak and normal references and adds the destructor to Gee.TimSort.Slice. +2010-08-24 Maciej Piechotka + + Correct naming of variables + + Add Gee.Hashable interface + +2010-08-21 Maciej Piechotka + + Small typo in tests (it might cuased some false passes but it didn't) + + Remove ComparableTests as they have been integrated in functions tests + + Reintroduce tests + + Assure get_equal_func_for behavies correctly for Comparable + +2010-08-17 Alban Browaeys + + gee: move the delegates into the Gee namespace. + Fix for the gir generation breakage where callbacks where + out of the namespace. + +2010-08-17 Maciej Piechotka + + Move to non-static delegates + 2010-08-03 Maciej Piechotka Fix memory leak in Gee.LinkedList @@ -148,6 +515,15 @@ Fix the unfreeing on clear in TreeMap/TreeSet +2010-08-02 Maciej Piechotka + + Use automake 1.11 vala support + cleaning of the Makefile.am: + - Checks the vala version + - All flags are 'local' (i.e. taget_name_(VALA|C|LD)FLAGS) + - Target variables are next to each other + - All lists are one-item-per-line with $(NULL) at the end + - No newline at the end of file + 2010-08-02 Didier 'Ptitjes Post-release version bump @@ -742,3 +1118,7 @@ Fix build with Vala 0.7 Based on patch by Thijs Vermeir, fixes bug 579182. + + Generate ChangeLog from git log + Add gitlog-to-changelog script from gnulib and a dist-hook to + generate ChangeLog file when creating tarballs. diff --git a/Makefile.am b/Makefile.am index 55dacaa..5ecbad6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,7 @@ endif .PHONY: coverage pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gee-1.0.pc +pkgconfig_DATA = gee-0.8.pc dist-hook: gen-ChangeLog @@ -53,6 +53,6 @@ EXTRA_DIST += \ ChangeLog.pre-0-1-5 \ gitlog-to-changelog \ MAINTAINERS \ - gee-1.0.pc.in \ + gee-0.8.pc.in \ $(NULL) diff --git a/Makefile.decl b/Makefile.decl index 20ad96d..f93ba04 100644 --- a/Makefile.decl +++ b/Makefile.decl @@ -7,6 +7,9 @@ GTESTER_REPORT = gtester-report EXTRA_DIST = TEST_PROGS = +# useful constants +NULL = + ### testing rules # test: run all tests in cwd and subdirs diff --git a/Makefile.in b/Makefile.in index d5103dc..27978fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -55,7 +55,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/gee-1.0.pc.in $(top_srcdir)/Makefile.decl \ + $(srcdir)/gee-0.8.pc.in $(top_srcdir)/Makefile.decl \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ compile config.guess config.sub depcomp install-sh ltmain.sh \ missing @@ -71,7 +71,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = gee-1.0.pc +CONFIG_CLEAN_FILES = gee-0.8.pc CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) @@ -310,8 +310,11 @@ GTESTER_REPORT = gtester-report # initialize variables for unconditional += appending EXTRA_DIST = ChangeLog.pre-0-1-5 gitlog-to-changelog MAINTAINERS \ - gee-1.0.pc.in $(NULL) + gee-0.8.pc.in $(NULL) TEST_PROGS = + +# useful constants +NULL = ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-introspection=no @ENABLE_DOC_TRUE@DOC_SUBDIR = \ @@ -330,7 +333,7 @@ SUBDIRS = \ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gee-1.0.pc +pkgconfig_DATA = gee-0.8.pc gen_start_date = 2009-04-30 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -386,7 +389,7 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -gee-1.0.pc: $(top_builddir)/config.status $(srcdir)/gee-1.0.pc.in +gee-0.8.pc: $(top_builddir)/config.status $(srcdir)/gee-0.8.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: diff --git a/NEWS b/NEWS index f935a61..66b2c1e 100644 --- a/NEWS +++ b/NEWS @@ -1,55 +1,83 @@ -libgee 0.6.6.1 -============== +libgee 0.9.92 +============= + * Fix memory leak in TreeSet and TreeMap - * Rebuild package with fixed Vala compiler +libgee 0.9.91 +============= + * ConcurrentSet implements SortedSet + * Fix HashMultiMap, TreeMultiSet constructor + * Add add/contains/remove_all working on array + * Allow creation of ArrayList from array + * Add read_only_view to Gee.MultiSet and Gee.MultiMap -libgee 0.6.6 +libgee 0.9.0 ============ + * ConcurrentSet preliminary implementation + * Bugfixes from 0.8.2 and 0.8.3 + * Fix various Vala warnings + * First part of test refactoring - * Fix Iterator.remove in PriorityQueue - -libgee 0.6.5 +libgee 0.8.1 ============ + * Allow slice in ReadOnlyList + * Fix Iterator.remove in PriorityQueue + * Add foreach specializations + * Use foreach function instead of iterators - * Prevent hashtables from resizing during iteration - -libgee 0.6.4 -============ - - * Fix compilation with vala master - * Fix creation of GObject introspection files - -libgee 0.6.3 +libgee 0.8.0 ============ + * Fix Traversable.chop (bug #684348) + * Remove unnecessary method + * Update README + * Move everything to GenericAccessor - * Fix buffer underflow. +libgee 0.7.90 +============= + * Don't notify when constructor property is set + * Use views instead of copies in MultiMap as in rest of libgee + * Allow early termination in Traversable.foreach -libgee 0.6.2.1 +libgee 0.7.4.1 ============== + * Fix missing property read_only in testmap Entry - * Add check-news to AM_INIT_AUTOMAKE - -libgee 0.6.2 +libgee 0.7.4 ============ + * Remove *_impl methods + * Move virtual methods to interfaces + * Future-proof the ABI by adding reserved v-table members + * Add read_only to Map.Entry - * Fix adding second element to priority queue. - * Fix problem with key used in range is freed. - -libgee 0.6.1 +libgee 0.7.3 ============ + * Update documentation + * Fix iteration order in hashtables + * Split SortedMap/SortedSet into bi-directional and uni-directional parts + * Simplify CompareDataFunc/HashDataFunc/EqualDataFunc + * Fix HazardPointers - * Fix memory leaks in LinkedList. - -libgee 0.6.0 +libgee 0.7.2 ============ + * Require *_type property for all collections + * Add ArrayQueue + * Few bug fixes - * Fix compiler warning. - -libgee 0.5.3 +libgee 0.7.1 ============ + * Implement hazard pointers and concurrent linked lists + * Respect VALAFLAGS when building tests + * Fix a few compiling warnings - * Fix memory leaks in TimSort and LinkedList. - * Bug fixes in TreeMap and TreeSet. +libgee 0.7.0 +============ + * Build system using the automake 1.11 vala support + * Move to delegates with targets and move them to Gee namespace + * Gee.Hashable interface + * Improve Iterator allowing to, among others, query about state of iterator + * Allow checking if Iterator or Collection is read-only + * Introducing highier-level function via Traversable interface + * Introduce support for lazy values + * Allow to install in parallel with 0.6 libgee 0.5.2 ============ diff --git a/README b/README index 9236473..802318c 100644 --- a/README +++ b/README @@ -1,20 +1,38 @@ -libgee is a collection library providing GObject-based interfaces and +Libgee is a collection library providing GObject-based interfaces and classes for commonly used data structures. -libgee provides the following interfaces: +Libgee provides the following interfaces: - * Iterable - * Collection - * List - * Set - * Iterator - * Map + * Traversable + o Iterable + + Collection + # List + * BidirList + # Set + * SortedSet + o BidirSortedSet + # MultiSet + # Queue + * Deque + + Map + # SortedMap + * BidirSortedMap + o Iterator + + BidirIterator + # BidirListIterator + + ListIterator + # BidirListIterator + * MultiMap -The ArrayList, HashSet, and HashMap classes provide a reasonable sample -implementation of the List, Set, and Map interfaces. ReadOnlyCollection, -ReadOnlyList, ReadOnlySet, and ReadOnlyMap are read-only wrapper classes -that prevent modification of the underlying collection. +The ArrayList, ArrauQueue, ConcurrentLinkedList, ConcurrentSet, HashSet, +HashMap, HashMultiSet, HashMultiMap, LinkedList, PriorityQueue, TreeSet, +TreeMap, TreeMultiSet, and TreeMultiMap classes provide a reasonable sample +implementation of those interfaces. In addition, a set of abstract +classes are provided to ease the implementation of new collections. -libgee is written in Vala and can be used like any GObject-based C library. -It's planned to provide bindings for further languages. +Around that, the API provide means to retrieve read-only views, +efficient sort algorithms, simple, bi-directional or index-based mutable +iterators depending on the collection type. +Libgee is written in Vala and can be used like any GObject-based C +library. It's planned to provide bindings for further languages. diff --git a/aclocal.m4 b/aclocal.m4 index c0c1567..49bedd6 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1318,6 +1318,36 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +# Autoconf support for the Vala compiler + +# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# Check whether the Vala compiler exists in `PATH'. If it is found, the +# variable VALAC is set. Optionally a minimum release number of the +# compiler can be requested. +# +# AM_PROG_VALAC([MINIMUM-VERSION]) +# -------------------------------- +AC_DEFUN([AM_PROG_VALAC], +[AC_PATH_PROG([VALAC], [valac], []) + AS_IF([test -z "$VALAC"], + [AC_MSG_WARN([No Vala compiler found. You will not be able to compile .vala source files.])], + [AS_IF([test -n "$1"], + [AC_MSG_CHECKING([$VALAC is at least version $1]) + am__vala_version=`$VALAC --version | sed 's/Vala *//'` + AS_VERSION_COMPARE([$1], ["$am__vala_version"], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Vala $1 not found.])])])]) +]) + m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/benchmark/Makefile.am b/benchmark/Makefile.am index 6043188..22513f7 100644 --- a/benchmark/Makefile.am +++ b/benchmark/Makefile.am @@ -1,37 +1,28 @@ include $(top_srcdir)/Makefile.decl -NULL = - -AM_CPPFLAGS = \ - -I$(top_srcdir)/gee \ - $(GLIB_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - -lm - $(NULL) - noinst_PROGRAMS = benchmarks -progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la - -BUILT_SOURCES = benchmarks.vala.stamp - -benchmarks_VALASOURCES = \ +benchmarks_SOURCES = \ benchmark.vala \ benchmarksorts.vala \ - mergesort.vala \ $(NULL) -benchmarks_SOURCES = benchmarks.vala.stamp $(benchmarks_VALASOURCES:.vala=.c) -benchmarks.vala.stamp: $(benchmarks_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-internals-1.0 $^ - touch $@ -benchmarks_LDADD = $(progs_ldadd) -EXTRA_DIST += $(benchmarks_VALASOURCES) +benchmarks_VALAFLAGS = \ + --basedir $(top_srcdir) \ + --vapidir $(top_srcdir)/gee \ + --pkg gee-internals-0.8 \ + $(NULL) -MAINTAINERCLEANFILES = \ - $(benchmarks_VALASOURCES:.vala=.c) \ - benchmarks.vala.stamp \ +benchmarks_CPPFLAGS = \ + -I$(top_srcdir)/gee \ + $(GLIB_CFLAGS) \ $(NULL) +benchmarks_LDADD = \ + $(GLIB_LIBS) \ + ../gee/libgee-0.8.la \ + $(NULL) + +benchmarks_LDFLAGS = \ + -lm \ + $(NULL) diff --git a/benchmark/Makefile.in b/benchmark/Makefile.in index 5749783..524e3e6 100644 --- a/benchmark/Makefile.in +++ b/benchmark/Makefile.in @@ -54,7 +54,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/Makefile.decl + $(top_srcdir)/Makefile.decl benchmark.c benchmarks_vala.stamp \ + benchmarksorts.c noinst_PROGRAMS = benchmarks$(EXEEXT) subdir = benchmark ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -70,16 +71,18 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__objects_1 = -am__objects_2 = benchmark.$(OBJEXT) benchmarksorts.$(OBJEXT) \ - mergesort.$(OBJEXT) $(am__objects_1) -am_benchmarks_OBJECTS = $(am__objects_2) +am_benchmarks_OBJECTS = benchmarks-benchmark.$(OBJEXT) \ + benchmarks-benchmarksorts.$(OBJEXT) $(am__objects_1) benchmarks_OBJECTS = $(am_benchmarks_OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) ../gee/libgee.la -benchmarks_DEPENDENCIES = $(am__DEPENDENCIES_2) +benchmarks_DEPENDENCIES = $(am__DEPENDENCIES_1) ../gee/libgee-0.8.la \ + $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +benchmarks_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(benchmarks_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -103,6 +106,13 @@ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; +VALACOMPILE = $(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS) +LTVALACOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(VALAC) $(AM_VALAFLAGS) \ + $(VALAFLAGS) +AM_V_VALAC = $(am__v_VALAC_@AM_V@) +am__v_VALAC_ = $(am__v_VALAC_@AM_DEFAULT_V@) +am__v_VALAC_0 = @echo " VALAC " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; @@ -255,34 +265,37 @@ GTESTER = gtester GTESTER_REPORT = gtester-report # initialize variables for unconditional += appending -EXTRA_DIST = $(benchmarks_VALASOURCES) +EXTRA_DIST = TEST_PROGS = + +# useful constants NULL = -AM_CPPFLAGS = \ +benchmarks_SOURCES = \ + benchmark.vala \ + benchmarksorts.vala \ + $(NULL) + +benchmarks_VALAFLAGS = \ + --basedir $(top_srcdir) \ + --vapidir $(top_srcdir)/gee \ + --pkg gee-internals-0.8 \ + $(NULL) + +benchmarks_CPPFLAGS = \ -I$(top_srcdir)/gee \ $(GLIB_CFLAGS) \ $(NULL) -AM_LDFLAGS = \ - -lm - -progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la -BUILT_SOURCES = benchmarks.vala.stamp -benchmarks_VALASOURCES = \ - benchmark.vala \ - benchmarksorts.vala \ - mergesort.vala \ +benchmarks_LDADD = \ + $(GLIB_LIBS) \ + ../gee/libgee-0.8.la \ $(NULL) -benchmarks_SOURCES = benchmarks.vala.stamp $(benchmarks_VALASOURCES:.vala=.c) -benchmarks_LDADD = $(progs_ldadd) -MAINTAINERCLEANFILES = \ - $(benchmarks_VALASOURCES:.vala=.c) \ - benchmarks.vala.stamp \ +benchmarks_LDFLAGS = \ + -lm \ $(NULL) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -328,7 +341,7 @@ clean-noinstPROGRAMS: rm -f $$list benchmarks$(EXEEXT): $(benchmarks_OBJECTS) $(benchmarks_DEPENDENCIES) $(EXTRA_benchmarks_DEPENDENCIES) @rm -f benchmarks$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(benchmarks_OBJECTS) $(benchmarks_LDADD) $(LIBS) + $(AM_V_CCLD)$(benchmarks_LINK) $(benchmarks_OBJECTS) $(benchmarks_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -336,9 +349,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmarksorts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mergesort.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmarks-benchmark.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmarks-benchmarksorts.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -361,6 +373,48 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +benchmarks-benchmark.o: benchmark.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT benchmarks-benchmark.o -MD -MP -MF $(DEPDIR)/benchmarks-benchmark.Tpo -c -o benchmarks-benchmark.o `test -f 'benchmark.c' || echo '$(srcdir)/'`benchmark.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/benchmarks-benchmark.Tpo $(DEPDIR)/benchmarks-benchmark.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='benchmark.c' object='benchmarks-benchmark.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o benchmarks-benchmark.o `test -f 'benchmark.c' || echo '$(srcdir)/'`benchmark.c + +benchmarks-benchmark.obj: benchmark.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT benchmarks-benchmark.obj -MD -MP -MF $(DEPDIR)/benchmarks-benchmark.Tpo -c -o benchmarks-benchmark.obj `if test -f 'benchmark.c'; then $(CYGPATH_W) 'benchmark.c'; else $(CYGPATH_W) '$(srcdir)/benchmark.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/benchmarks-benchmark.Tpo $(DEPDIR)/benchmarks-benchmark.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='benchmark.c' object='benchmarks-benchmark.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o benchmarks-benchmark.obj `if test -f 'benchmark.c'; then $(CYGPATH_W) 'benchmark.c'; else $(CYGPATH_W) '$(srcdir)/benchmark.c'; fi` + +benchmarks-benchmarksorts.o: benchmarksorts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT benchmarks-benchmarksorts.o -MD -MP -MF $(DEPDIR)/benchmarks-benchmarksorts.Tpo -c -o benchmarks-benchmarksorts.o `test -f 'benchmarksorts.c' || echo '$(srcdir)/'`benchmarksorts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/benchmarks-benchmarksorts.Tpo $(DEPDIR)/benchmarks-benchmarksorts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='benchmarksorts.c' object='benchmarks-benchmarksorts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o benchmarks-benchmarksorts.o `test -f 'benchmarksorts.c' || echo '$(srcdir)/'`benchmarksorts.c + +benchmarks-benchmarksorts.obj: benchmarksorts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT benchmarks-benchmarksorts.obj -MD -MP -MF $(DEPDIR)/benchmarks-benchmarksorts.Tpo -c -o benchmarks-benchmarksorts.obj `if test -f 'benchmarksorts.c'; then $(CYGPATH_W) 'benchmarksorts.c'; else $(CYGPATH_W) '$(srcdir)/benchmarksorts.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/benchmarks-benchmarksorts.Tpo $(DEPDIR)/benchmarks-benchmarksorts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='benchmarksorts.c' object='benchmarks-benchmarksorts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(benchmarks_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o benchmarks-benchmarksorts.obj `if test -f 'benchmarksorts.c'; then $(CYGPATH_W) 'benchmarksorts.c'; else $(CYGPATH_W) '$(srcdir)/benchmarksorts.c'; fi` +$(srcdir)/benchmark.c: $(srcdir)/benchmarks_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/benchmarks_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/benchmarks_vala.stamp; \ + fi +$(srcdir)/benchmarksorts.c: $(srcdir)/benchmarks_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/benchmarks_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/benchmarks_vala.stamp; \ + fi +$(srcdir)/benchmarks_vala.stamp: benchmark.vala benchmarksorts.vala + $(AM_V_at)rm -f $@ && echo stamp > $@-t + $(AM_V_VALAC)$(am__cd) $(srcdir) && $(VALAC) $(benchmarks_VALAFLAGS) $(VALAFLAGS) -C benchmark.vala benchmarksorts.vala + $(AM_V_at)mv -f $@-t $@ + mostlyclean-libtool: -rm -f *.lo @@ -451,12 +505,10 @@ distdir: $(DISTFILES) done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am +check: check-am all-am: Makefile $(PROGRAMS) installdirs: -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am +install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -486,8 +538,9 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -rm -f benchmark.c + -rm -f benchmarks_vala.stamp + -rm -f benchmarksorts.c clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ @@ -559,7 +612,7 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ @@ -624,10 +677,6 @@ test-report perf-report full-report: ${TEST_PROGS} .PHONY: test test-report perf-report full-report # run make test as part of make check check-local: test - $(NULL) -benchmarks.vala.stamp: $(benchmarks_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-internals-1.0 $^ - touch $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/benchmark/benchmark.c b/benchmark/benchmark.c index ea6c65e..b885f26 100644 --- a/benchmark/benchmark.c +++ b/benchmark/benchmark.c @@ -1,10 +1,11 @@ -/* benchmark.c generated by valac 0.16.1, the Vala compiler +/* benchmark.c generated by valac 0.18.0, the Vala compiler * generated from benchmark.vala, do not modify */ /* benchmark.vala * * Copyright (C) 2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,13 +27,15 @@ #include #include -#include #include #include +#include +#include #include #include -#include +#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define GEE_BENCHMARK_TYPE_FACTORY (gee_benchmark_factory_get_type ()) #define GEE_BENCHMARK_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_FACTORY, GeeBenchmarkFactory)) @@ -260,6 +263,9 @@ static gpointer gee_benchmark_array_list_factory_parent_class = NULL; static GeeBenchmarkFactoryIface* gee_benchmark_array_list_factory_gee_benchmark_factory_parent_iface = NULL; static gpointer gee_benchmark_benchmark_parent_class = NULL; +void gee_benchmark_run_benchmark_option (const gchar* long_name, gchar short_name, const gchar* description, gboolean* do_run, GOptionEntry* result); +gint gee_benchmark_main (gchar** args, int args_length1); +void gee_benchmark_benchmark_sorts (void); GType gee_benchmark_factory_get_type (void) G_GNUC_CONST; GeeCollection* gee_benchmark_factory_create (GeeBenchmarkFactory* self); GeeCollection* gee_benchmark_factory_copy (GeeBenchmarkFactory* self, GeeCollection* collection); @@ -346,6 +352,116 @@ static void _vala_gee_benchmark_benchmark_get_property (GObject * object, guint static void _vala_gee_benchmark_benchmark_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +void gee_benchmark_run_benchmark_option (const gchar* long_name, gchar short_name, const gchar* description, gboolean* do_run, GOptionEntry* result) { + const gchar* _tmp0_; + gchar _tmp1_; + const gchar* _tmp2_; + GOptionEntry _tmp3_ = {0}; + g_return_if_fail (long_name != NULL); + g_return_if_fail (description != NULL); + _tmp0_ = long_name; + _tmp1_ = short_name; + _tmp2_ = description; + memset (&_tmp3_, 0, sizeof (GOptionEntry)); + _tmp3_.long_name = _tmp0_; + _tmp3_.short_name = _tmp1_; + _tmp3_.flags = 0; + _tmp3_.arg = G_OPTION_ARG_NONE; + _tmp3_.arg_data = do_run; + _tmp3_.description = _tmp2_; + _tmp3_.arg_description = NULL; + *result = _tmp3_; + return; +} + + +gint gee_benchmark_main (gchar** args, int args_length1) { + gint result = 0; + gboolean run_sort; + GOptionEntry _tmp0_ = {0}; + GOptionEntry* _tmp1_ = NULL; + GOptionEntry* entries; + gint entries_length1; + gint _entries_size_; + GOptionContext* _tmp2_; + GOptionContext* context; + GOptionContext* _tmp3_; + GOptionEntry* _tmp4_; + gint _tmp4__length1; + gboolean _tmp9_; + GError * _inner_error_ = NULL; + run_sort = FALSE; + gee_benchmark_run_benchmark_option ("run-sort", 's', "Run sorting benchmark", &run_sort, &_tmp0_); + _tmp1_ = g_new0 (GOptionEntry, 1); + _tmp1_[0] = _tmp0_; + entries = _tmp1_; + entries_length1 = 1; + _entries_size_ = entries_length1; + _tmp2_ = g_option_context_new ("Run various benchmarks"); + context = _tmp2_; + _tmp3_ = context; + _tmp4_ = entries; + _tmp4__length1 = entries_length1; + g_option_context_add_main_entries (_tmp3_, _tmp4_, "gee-benchmark"); + { + GOptionContext* _tmp5_; + _tmp5_ = context; + g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_); + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_OPTION_ERROR) { + goto __catch0_g_option_error; + } + _g_option_context_free0 (context); + entries = (g_free (entries), NULL); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return 0; + } + } + goto __finally0; + __catch0_g_option_error: + { + GError* e = NULL; + FILE* _tmp6_; + GError* _tmp7_; + const gchar* _tmp8_; + e = _inner_error_; + _inner_error_ = NULL; + _tmp6_ = stdout; + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + fprintf (_tmp6_, "option parsing failed: %s\n", _tmp8_); + result = 2; + _g_error_free0 (e); + _g_option_context_free0 (context); + entries = (g_free (entries), NULL); + return result; + } + __finally0: + if (_inner_error_ != NULL) { + _g_option_context_free0 (context); + entries = (g_free (entries), NULL); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return 0; + } + _tmp9_ = run_sort; + if (_tmp9_) { + gee_benchmark_benchmark_sorts (); + } + result = 0; + _g_option_context_free0 (context); + entries = (g_free (entries), NULL); + return result; +} + + +int main (int argc, char ** argv) { + g_type_init (); + return gee_benchmark_main (argv, argc); +} + + GeeCollection* gee_benchmark_factory_create (GeeBenchmarkFactory* self) { g_return_val_if_fail (self != NULL, NULL); return GEE_BENCHMARK_FACTORY_GET_INTERFACE (self)->create (self); @@ -479,7 +595,7 @@ static void gee_benchmark_random_int32_real_generate_collection (GeeBenchmarkGen _tmp5_ = collection; _tmp6_ = size; _tmp7_ = g_random_int_range ((gint32) 0, (gint32) (_tmp6_ - 1)); - gee_collection_add (_tmp5_, GINT_TO_POINTER (_tmp7_)); + gee_collection_add (_tmp5_, (gpointer) ((gintptr) _tmp7_)); } } } @@ -541,7 +657,7 @@ GType gee_benchmark_random_int32_get_type (void) { static void _vala_gee_benchmark_random_int32_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkRandomInt32 * self; - self = GEE_BENCHMARK_RANDOM_INT32 (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32); switch (property_id) { case GEE_BENCHMARK_RANDOM_INT32_NAME: g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self)); @@ -595,7 +711,7 @@ static void gee_benchmark_fixed_variance_int32_real_generate_collection (GeeBenc _tmp9_ = variance; _tmp10_ = g_random_int_range ((gint32) 0, (gint32) _tmp9_); _tmp11_ = variance; - gee_collection_add (_tmp7_, GINT_TO_POINTER ((gint32) ((_tmp8_ + _tmp10_) - (_tmp11_ / 2)))); + gee_collection_add (_tmp7_, (gpointer) ((gintptr) ((gint32) ((_tmp8_ + _tmp10_) - (_tmp11_ / 2))))); } } } @@ -657,7 +773,7 @@ GType gee_benchmark_fixed_variance_int32_get_type (void) { static void _vala_gee_benchmark_fixed_variance_int32_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkFixedVarianceInt32 * self; - self = GEE_BENCHMARK_FIXED_VARIANCE_INT32 (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32); switch (property_id) { case GEE_BENCHMARK_FIXED_VARIANCE_INT32_NAME: g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self)); @@ -739,7 +855,7 @@ static void gee_benchmark_mounts_int32_real_generate_collection (GeeBenchmarkGen _tmp15_ = last; _tmp16_ = height; _tmp17_ = width; - gee_collection_add (_tmp14_, GINT_TO_POINTER ((gint32) (_tmp15_ + (_tmp16_ / _tmp17_)))); + gee_collection_add (_tmp14_, (gpointer) ((gintptr) ((gint32) (_tmp15_ + (_tmp16_ / _tmp17_))))); } } } @@ -808,7 +924,7 @@ GType gee_benchmark_mounts_int32_get_type (void) { static void _vala_gee_benchmark_mounts_int32_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkMountsInt32 * self; - self = GEE_BENCHMARK_MOUNTS_INT32 (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32); switch (property_id) { case GEE_BENCHMARK_MOUNTS_INT32_NAME: g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self)); @@ -852,7 +968,7 @@ static void gee_benchmark_reverse_sorted_int32_real_generate_collection (GeeBenc _tmp5_ = collection; _tmp6_ = size; _tmp7_ = i; - gee_collection_add (_tmp5_, GINT_TO_POINTER ((gint32) ((_tmp6_ - _tmp7_) - 1))); + gee_collection_add (_tmp5_, (gpointer) ((gintptr) ((gint32) ((_tmp6_ - _tmp7_) - 1)))); } } } @@ -914,7 +1030,7 @@ GType gee_benchmark_reverse_sorted_int32_get_type (void) { static void _vala_gee_benchmark_reverse_sorted_int32_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkReverseSortedInt32 * self; - self = GEE_BENCHMARK_REVERSE_SORTED_INT32 (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32); switch (property_id) { case GEE_BENCHMARK_REVERSE_SORTED_INT32_NAME: g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self)); @@ -956,7 +1072,7 @@ static void gee_benchmark_sorted_int32_real_generate_collection (GeeBenchmarkGen } _tmp5_ = collection; _tmp6_ = i; - gee_collection_add (_tmp5_, GINT_TO_POINTER ((gint32) _tmp6_)); + gee_collection_add (_tmp5_, (gpointer) ((gintptr) ((gint32) _tmp6_))); } } } @@ -1018,7 +1134,7 @@ GType gee_benchmark_sorted_int32_get_type (void) { static void _vala_gee_benchmark_sorted_int32_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkSortedInt32 * self; - self = GEE_BENCHMARK_SORTED_INT32 (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32); switch (property_id) { case GEE_BENCHMARK_SORTED_INT32_NAME: g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self)); @@ -1035,7 +1151,7 @@ static GeeCollection* gee_benchmark_array_list_factory_real_create (GeeBenchmark GeeCollection* result = NULL; GeeArrayList* _tmp0_; self = (GeeBenchmarkArrayListFactory*) base; - _tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, NULL); + _tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, NULL, NULL, NULL); result = (GeeCollection*) _tmp0_; return result; } @@ -1048,7 +1164,7 @@ static GeeCollection* gee_benchmark_array_list_factory_real_copy (GeeBenchmarkFa GeeArrayList* copy; self = (GeeBenchmarkArrayListFactory*) base; g_return_val_if_fail (collection != NULL, NULL); - _tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, NULL); + _tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, NULL, NULL, NULL); copy = _tmp0_; { GeeCollection* _tmp1_; @@ -1139,7 +1255,7 @@ GType gee_benchmark_array_list_factory_get_type (void) { static void _vala_gee_benchmark_array_list_factory_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkArrayListFactory * self; - self = GEE_BENCHMARK_ARRAY_LIST_FACTORY (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -1150,7 +1266,7 @@ static void _vala_gee_benchmark_array_list_factory_get_property (GObject * objec static void _vala_gee_benchmark_array_list_factory_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GeeBenchmarkArrayListFactory * self; - self = GEE_BENCHMARK_ARRAY_LIST_FACTORY (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory); switch (property_id) { case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_TYPE: self->priv->g_type = g_value_get_gtype (value); @@ -1906,7 +2022,7 @@ static void gee_benchmark_benchmark_instance_init (GeeBenchmarkBenchmark * self) static void gee_benchmark_benchmark_finalize (GObject* obj) { GeeBenchmarkBenchmark * self; - self = GEE_BENCHMARK_BENCHMARK (obj); + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark); _g_object_unref0 (self->priv->factory); self->priv->sizes = (g_free (self->priv->sizes), NULL); _g_object_unref0 (self->priv->generators); @@ -1931,7 +2047,7 @@ GType gee_benchmark_benchmark_get_type (void) { static void _vala_gee_benchmark_benchmark_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkBenchmark * self; - self = GEE_BENCHMARK_BENCHMARK (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -1942,7 +2058,7 @@ static void _vala_gee_benchmark_benchmark_get_property (GObject * object, guint static void _vala_gee_benchmark_benchmark_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GeeBenchmarkBenchmark * self; - self = GEE_BENCHMARK_BENCHMARK (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark); switch (property_id) { case GEE_BENCHMARK_BENCHMARK_G_TYPE: self->priv->g_type = g_value_get_gtype (value); diff --git a/benchmark/benchmark.vala b/benchmark/benchmark.vala index 0aae1a5..f973931 100644 --- a/benchmark/benchmark.vala +++ b/benchmark/benchmark.vala @@ -2,6 +2,7 @@ * * Copyright (C) 2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +25,36 @@ using Gee; namespace Gee.Benchmark { + OptionEntry run_benchmark_option(string long_name, char short_name, string description, ref bool do_run) { + return OptionEntry() { + long_name = long_name, + short_name = short_name, + flags = 0, + arg = OptionArg.NONE, + arg_data = &do_run, + description = description, + arg_description = null + }; + } + + int main (string[] args) { + bool run_sort = false; + OptionEntry[] entries = { + run_benchmark_option("run-sort", 's', "Run sorting benchmark", ref run_sort) + }; + var context = new OptionContext ("Run various benchmarks"); + context.add_main_entries (entries, "gee-benchmark"); + try { + context.parse (ref args); + } catch (OptionError e) { + stdout.printf ("option parsing failed: %s\n", e.message); + return 2; + } + if(run_sort) { + benchmark_sorts (); + } + return 0; + } public interface Factory : Object { diff --git a/benchmark/benchmarks.vala.stamp b/benchmark/benchmarks.vala.stamp deleted file mode 100644 index e69de29..0000000 diff --git a/benchmark/benchmarks_vala.stamp b/benchmark/benchmarks_vala.stamp new file mode 100644 index 0000000..859afb1 --- /dev/null +++ b/benchmark/benchmarks_vala.stamp @@ -0,0 +1 @@ +stamp diff --git a/benchmark/benchmarksorts.c b/benchmark/benchmarksorts.c index 97c2f5a..7147627 100644 --- a/benchmark/benchmarksorts.c +++ b/benchmark/benchmarksorts.c @@ -1,4 +1,4 @@ -/* benchmarksorts.c generated by valac 0.16.1, the Vala compiler +/* benchmarksorts.c generated by valac 0.18.0, the Vala compiler * generated from benchmarksorts.vala, do not modify */ /* benchmarksorts.vala @@ -22,6 +22,7 @@ * * Author: * Didier 'Ptitjes Villevalois + * Will */ #include @@ -29,6 +30,7 @@ #include #include #include +#include #define GEE_BENCHMARK_TYPE_ALGORITHM (gee_benchmark_algorithm_get_type ()) @@ -148,6 +150,20 @@ typedef struct _GeeBenchmarkFactoryIface GeeBenchmarkFactoryIface; typedef struct _GeeBenchmarkBenchmark GeeBenchmarkBenchmark; typedef struct _GeeBenchmarkBenchmarkClass GeeBenchmarkBenchmarkClass; +#define GEE_TYPE_MERGE_SORT (gee_merge_sort_get_type ()) +#define GEE_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSort)) +#define GEE_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_MERGE_SORT, GeeMergeSortClass)) +#define GEE_IS_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MERGE_SORT)) +#define GEE_IS_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_MERGE_SORT)) +#define GEE_MERGE_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSortClass)) + +typedef struct _GeeMergeSort GeeMergeSort; +typedef struct _GeeMergeSortClass GeeMergeSortClass; +typedef struct _GeeMergeSortPrivate GeeMergeSortPrivate; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) +#define _gee_merge_sort_unref0(var) ((var == NULL) ? NULL : (var = (gee_merge_sort_unref (var), NULL))) +typedef struct _GeeParamSpecMergeSort GeeParamSpecMergeSort; + struct _GeeBenchmarkAlgorithmIface { GTypeInterface parent_iface; void (*process_collection) (GeeBenchmarkAlgorithm* self, GeeCollection* collection); @@ -196,11 +212,45 @@ struct _GeeBenchmarkFactoryIface { GeeCollection* (*copy) (GeeBenchmarkFactory* self, GeeCollection* collection); }; +struct _GeeMergeSort { + GTypeInstance parent_instance; + volatile int ref_count; + GeeMergeSortPrivate * priv; +}; + +struct _GeeMergeSortClass { + GTypeClass parent_class; + void (*finalize) (GeeMergeSort *self); +}; + +struct _GeeMergeSortPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeList* list_collection; + gpointer* array; + gint array_length1; + gint _array_size_; + gpointer* list; + gint list_length1; + gint _list_size_; + gint index; + gint size; + GCompareDataFunc compare; + gpointer compare_target; + GDestroyNotify compare_target_destroy_notify; +}; + +struct _GeeParamSpecMergeSort { + GParamSpec parent_instance; +}; + static gpointer gee_benchmark_tim_sort_parent_class = NULL; static GeeBenchmarkAlgorithmIface* gee_benchmark_tim_sort_gee_benchmark_algorithm_parent_iface = NULL; static gpointer gee_benchmark_merge_sort_parent_class = NULL; static GeeBenchmarkAlgorithmIface* gee_benchmark_merge_sort_gee_benchmark_algorithm_parent_iface = NULL; +static gpointer gee_merge_sort_parent_class = NULL; GType gee_benchmark_algorithm_get_type (void) G_GNUC_CONST; GType gee_benchmark_tim_sort_get_type (void) G_GNUC_CONST; @@ -228,12 +278,12 @@ enum { GEE_BENCHMARK_MERGE_SORT_NAME }; static void gee_benchmark_merge_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection); -void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare); +void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); GeeBenchmarkMergeSort* gee_benchmark_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeBenchmarkMergeSort* gee_benchmark_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static void _vala_gee_benchmark_merge_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_benchmark_merge_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); -void gee_benchmark_main (gchar** args, int args_length1); +void gee_benchmark_benchmark_sorts (void); GType gee_benchmark_generator_get_type (void) G_GNUC_CONST; GeeBenchmarkRandomInt32* gee_benchmark_random_int32_new (void); GeeBenchmarkRandomInt32* gee_benchmark_random_int32_construct (GType object_type); @@ -258,6 +308,26 @@ GeeBenchmarkBenchmark* gee_benchmark_benchmark_new (GType g_type, GBoxedCopyFunc GeeBenchmarkBenchmark* gee_benchmark_benchmark_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBenchmarkFactory* factory, GeeList* algorithms, GeeList* generators, gint* sizes, int sizes_length1, gint iteration_count); GType gee_benchmark_benchmark_get_type (void) G_GNUC_CONST; void gee_benchmark_benchmark_run (GeeBenchmarkBenchmark* self); +gpointer gee_merge_sort_ref (gpointer instance); +void gee_merge_sort_unref (gpointer instance); +GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_merge_sort (GValue* value, gpointer v_object); +void gee_value_take_merge_sort (GValue* value, gpointer v_object); +gpointer gee_value_get_merge_sort (const GValue* value); +GType gee_merge_sort_get_type (void) G_GNUC_CONST; +#define GEE_MERGE_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_MERGE_SORT, GeeMergeSortPrivate)) +enum { + GEE_MERGE_SORT_DUMMY_PROPERTY +}; +void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target); +void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); +GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static void gee_merge_sort_do_sort (GeeMergeSort* self); +static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1); +static void gee_merge_sort_finalize (GeeMergeSort* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static void gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection) { @@ -266,7 +336,7 @@ static void gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorith self = (GeeBenchmarkTimSort*) base; g_return_if_fail (collection != NULL); _tmp0_ = collection; - gee_list_sort (GEE_LIST (_tmp0_), NULL); + gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList), NULL, NULL, NULL); } @@ -334,7 +404,7 @@ GType gee_benchmark_tim_sort_get_type (void) { static void _vala_gee_benchmark_tim_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkTimSort * self; - self = GEE_BENCHMARK_TIM_SORT (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSort); switch (property_id) { case GEE_BENCHMARK_TIM_SORT_NAME: g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self)); @@ -348,7 +418,7 @@ static void _vala_gee_benchmark_tim_sort_get_property (GObject * object, guint p static void _vala_gee_benchmark_tim_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GeeBenchmarkTimSort * self; - self = GEE_BENCHMARK_TIM_SORT (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSort); switch (property_id) { case GEE_BENCHMARK_TIM_SORT_G_TYPE: self->priv->g_type = g_value_get_gtype (value); @@ -368,15 +438,25 @@ static void _vala_gee_benchmark_tim_sort_set_property (GObject * object, guint p static void gee_benchmark_merge_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection) { GeeBenchmarkMergeSort * self; - GCompareFunc _tmp0_ = NULL; - GCompareFunc compare; - GeeCollection* _tmp1_; + void* _tmp0_ = NULL; + GDestroyNotify _tmp1_ = NULL; + GCompareDataFunc _tmp2_ = NULL; + GCompareDataFunc compare; + void* compare_target; + GDestroyNotify compare_target_destroy_notify; + GeeCollection* _tmp3_; self = (GeeBenchmarkMergeSort*) base; g_return_if_fail (collection != NULL); - _tmp0_ = gee_functions_get_compare_func_for (self->priv->g_type); - compare = _tmp0_; - _tmp1_ = collection; - gee_merge_sort_sort (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, GEE_LIST (_tmp1_), compare); + _tmp2_ = gee_functions_get_compare_func_for (self->priv->g_type, &_tmp0_, &_tmp1_); + compare = _tmp2_; + compare_target = _tmp0_; + compare_target_destroy_notify = _tmp1_; + _tmp3_ = collection; + gee_merge_sort_sort (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_LIST, GeeList), compare, compare_target); + (compare_target_destroy_notify == NULL) ? NULL : (compare_target_destroy_notify (compare_target), NULL); + compare = NULL; + compare_target = NULL; + compare_target_destroy_notify = NULL; } @@ -444,7 +524,7 @@ GType gee_benchmark_merge_sort_get_type (void) { static void _vala_gee_benchmark_merge_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GeeBenchmarkMergeSort * self; - self = GEE_BENCHMARK_MERGE_SORT (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSort); switch (property_id) { case GEE_BENCHMARK_MERGE_SORT_NAME: g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self)); @@ -458,7 +538,7 @@ static void _vala_gee_benchmark_merge_sort_get_property (GObject * object, guint static void _vala_gee_benchmark_merge_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GeeBenchmarkMergeSort * self; - self = GEE_BENCHMARK_MERGE_SORT (object); + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSort); switch (property_id) { case GEE_BENCHMARK_MERGE_SORT_G_TYPE: self->priv->g_type = g_value_get_gtype (value); @@ -476,7 +556,7 @@ static void _vala_gee_benchmark_merge_sort_set_property (GObject * object, guint } -void gee_benchmark_main (gchar** args, int args_length1) { +void gee_benchmark_benchmark_sorts (void) { GeeArrayList* _tmp0_; GeeArrayList* algorithms; GeeBenchmarkTimSort* _tmp1_; @@ -503,7 +583,7 @@ void gee_benchmark_main (gchar** args, int args_length1) { GeeBenchmarkBenchmark* _tmp20_; GeeBenchmarkBenchmark* _tmp21_; GeeBenchmarkBenchmark* benchmark; - _tmp0_ = gee_array_list_new (GEE_BENCHMARK_TYPE_ALGORITHM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL); + _tmp0_ = gee_array_list_new (GEE_BENCHMARK_TYPE_ALGORITHM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); algorithms = _tmp0_; _tmp1_ = gee_benchmark_tim_sort_new (G_TYPE_INT, NULL, NULL); _tmp2_ = _tmp1_; @@ -513,7 +593,7 @@ void gee_benchmark_main (gchar** args, int args_length1) { _tmp4_ = _tmp3_; gee_abstract_collection_add ((GeeAbstractCollection*) algorithms, (GeeBenchmarkAlgorithm*) _tmp4_); _g_object_unref0 (_tmp4_); - _tmp5_ = gee_array_list_new (GEE_BENCHMARK_TYPE_GENERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL); + _tmp5_ = gee_array_list_new (GEE_BENCHMARK_TYPE_GENERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); generators = _tmp5_; _tmp6_ = gee_benchmark_random_int32_new (); _tmp7_ = _tmp6_; @@ -558,10 +638,630 @@ void gee_benchmark_main (gchar** args, int args_length1) { } -int main (int argc, char ** argv) { - g_type_init (); - gee_benchmark_main (argv, argc); - return 0; +void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) { + GeeList* _tmp0_; + g_return_if_fail (list != NULL); + _tmp0_ = list; + if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST)) { + GeeList* _tmp1_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + _tmp1_ = list; + _tmp2_ = compare; + _tmp2__target = compare_target; + gee_merge_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ARRAY_LIST, GeeArrayList), _tmp2_, _tmp2__target); + } else { + GeeList* _tmp3_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + _tmp3_ = list; + _tmp4_ = compare; + _tmp4__target = compare_target; + gee_merge_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_, _tmp4__target); + } +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) { + GeeMergeSort* _tmp0_; + GeeMergeSort* helper; + GeeMergeSort* _tmp1_; + GeeList* _tmp2_; + GeeList* _tmp3_; + GeeMergeSort* _tmp4_; + GeeList* _tmp5_; + gint _tmp6_ = 0; + gpointer* _tmp7_ = NULL; + GeeMergeSort* _tmp8_; + GeeMergeSort* _tmp9_; + gpointer* _tmp10_; + gint _tmp10__length1; + GeeMergeSort* _tmp11_; + GeeMergeSort* _tmp12_; + GeeList* _tmp13_; + gint _tmp14_; + gint _tmp15_; + GeeMergeSort* _tmp16_; + GCompareDataFunc _tmp17_; + void* _tmp17__target; + GeeMergeSort* _tmp18_; + GeeList* _tmp19_; + GeeMergeSort* _tmp20_; + gpointer* _tmp21_; + gint _tmp21__length1; + g_return_if_fail (list != NULL); + _tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + helper = _tmp0_; + _tmp1_ = helper; + _tmp2_ = list; + _tmp3_ = _g_object_ref0 (_tmp2_); + _g_object_unref0 (_tmp1_->priv->list_collection); + _tmp1_->priv->list_collection = _tmp3_; + _tmp4_ = helper; + _tmp5_ = list; + _tmp7_ = gee_collection_to_array ((GeeCollection*) _tmp5_, &_tmp6_); + _tmp4_->priv->array = (_vala_array_free (_tmp4_->priv->array, _tmp4_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL); + _tmp4_->priv->array = _tmp7_; + _tmp4_->priv->array_length1 = _tmp6_; + _tmp4_->priv->_array_size_ = _tmp4_->priv->array_length1; + _tmp8_ = helper; + _tmp9_ = helper; + _tmp10_ = _tmp9_->priv->array; + _tmp10__length1 = _tmp9_->priv->array_length1; + _tmp8_->priv->list = _tmp10_; + _tmp8_->priv->list_length1 = _tmp10__length1; + _tmp8_->priv->_list_size_ = _tmp8_->priv->list_length1; + _tmp11_ = helper; + _tmp11_->priv->index = 0; + _tmp12_ = helper; + _tmp13_ = list; + _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + _tmp12_->priv->size = _tmp15_; + _tmp16_ = helper; + _tmp17_ = compare; + _tmp17__target = compare_target; + (_tmp16_->priv->compare_target_destroy_notify == NULL) ? NULL : (_tmp16_->priv->compare_target_destroy_notify (_tmp16_->priv->compare_target), NULL); + _tmp16_->priv->compare = NULL; + _tmp16_->priv->compare_target = NULL; + _tmp16_->priv->compare_target_destroy_notify = NULL; + _tmp16_->priv->compare = _tmp17_; + _tmp16_->priv->compare_target = _tmp17__target; + _tmp16_->priv->compare_target_destroy_notify = NULL; + _tmp18_ = helper; + gee_merge_sort_do_sort (_tmp18_); + _tmp19_ = list; + gee_collection_clear ((GeeCollection*) _tmp19_); + _tmp20_ = helper; + _tmp21_ = _tmp20_->priv->array; + _tmp21__length1 = _tmp20_->priv->array_length1; + { + gpointer* item_collection = NULL; + gint item_collection_length1 = 0; + gint _item_collection_size_ = 0; + gint item_it = 0; + item_collection = _tmp21_; + item_collection_length1 = _tmp21__length1; + for (item_it = 0; item_it < _tmp21__length1; item_it = item_it + 1) { + gpointer _tmp22_; + gpointer item = NULL; + _tmp22_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]); + item = _tmp22_; + { + GeeList* _tmp23_; + gconstpointer _tmp24_; + _tmp23_ = list; + _tmp24_ = item; + gee_collection_add ((GeeCollection*) _tmp23_, _tmp24_); + _g_destroy_func0 (item); + } + } + } + _gee_merge_sort_unref0 (helper); +} + + +void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target) { + GeeMergeSort* _tmp0_; + GeeMergeSort* helper; + GeeArrayList* _tmp1_; + GeeList* _tmp2_; + GeeArrayList* _tmp3_; + gpointer* _tmp4_; + gint _tmp4__length1; + GeeArrayList* _tmp5_; + gint _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + g_return_if_fail (list != NULL); + _tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + helper = _tmp0_; + _tmp1_ = list; + _tmp2_ = _g_object_ref0 ((GeeList*) _tmp1_); + _g_object_unref0 (helper->priv->list_collection); + helper->priv->list_collection = _tmp2_; + _tmp3_ = list; + _tmp4_ = _tmp3_->_items; + _tmp4__length1 = _tmp3_->_items_length1; + helper->priv->list = _tmp4_; + helper->priv->list_length1 = _tmp4__length1; + helper->priv->_list_size_ = helper->priv->list_length1; + helper->priv->index = 0; + _tmp5_ = list; + _tmp6_ = _tmp5_->_size; + helper->priv->size = _tmp6_; + _tmp7_ = compare; + _tmp7__target = compare_target; + (helper->priv->compare_target_destroy_notify == NULL) ? NULL : (helper->priv->compare_target_destroy_notify (helper->priv->compare_target), NULL); + helper->priv->compare = NULL; + helper->priv->compare_target = NULL; + helper->priv->compare_target_destroy_notify = NULL; + helper->priv->compare = _tmp7_; + helper->priv->compare_target = _tmp7__target; + helper->priv->compare_target_destroy_notify = NULL; + gee_merge_sort_do_sort (helper); + _gee_merge_sort_unref0 (helper); +} + + +static void gee_merge_sort_do_sort (GeeMergeSort* self) { + gint _tmp0_; + gint _tmp1_; + gpointer* _tmp2_ = NULL; + gpointer* work_area; + gint work_area_length1; + gint _work_area_size_; + gint _tmp3_; + gint _tmp4_; + gpointer* _tmp5_; + gint _tmp5__length1; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->size; + if (_tmp0_ <= 1) { + return; + } + _tmp1_ = self->priv->size; + _tmp2_ = g_new0 (gpointer, _tmp1_); + work_area = _tmp2_; + work_area_length1 = _tmp1_; + _work_area_size_ = work_area_length1; + _tmp3_ = self->priv->index; + _tmp4_ = self->priv->size; + _tmp5_ = work_area; + _tmp5__length1 = work_area_length1; + gee_merge_sort_merge_sort_aux (self, _tmp3_, _tmp4_, _tmp5_, _tmp5__length1); + work_area = (_vala_array_free (work_area, work_area_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); +} + + +static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1) { + gint _tmp0_; + gint _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = right; + _tmp1_ = left; + if (_tmp0_ == (_tmp1_ + 1)) { + return; + } else { + gint _tmp2_; + gint _tmp3_; + gint size; + gint _tmp4_; + gint middle; + gint _tmp5_; + gint lbegin; + gint _tmp6_; + gint _tmp7_; + gint rbegin; + gint _tmp8_; + gint _tmp9_; + gint _tmp10_; + gpointer* _tmp11_; + gint _tmp11__length1; + gint _tmp12_; + gint _tmp13_; + gint _tmp14_; + gpointer* _tmp15_; + gint _tmp15__length1; + _tmp2_ = right; + _tmp3_ = left; + size = _tmp2_ - _tmp3_; + _tmp4_ = size; + middle = _tmp4_ / 2; + _tmp5_ = left; + lbegin = _tmp5_; + _tmp6_ = left; + _tmp7_ = middle; + rbegin = _tmp6_ + _tmp7_; + _tmp8_ = left; + _tmp9_ = left; + _tmp10_ = middle; + _tmp11_ = work_area; + _tmp11__length1 = work_area_length1; + gee_merge_sort_merge_sort_aux (self, _tmp8_, _tmp9_ + _tmp10_, _tmp11_, _tmp11__length1); + _tmp12_ = left; + _tmp13_ = middle; + _tmp14_ = right; + _tmp15_ = work_area; + _tmp15__length1 = work_area_length1; + gee_merge_sort_merge_sort_aux (self, _tmp12_ + _tmp13_, _tmp14_, _tmp15_, _tmp15__length1); + { + gint i; + i = 0; + { + gboolean _tmp16_; + _tmp16_ = TRUE; + while (TRUE) { + gboolean _tmp17_; + gint _tmp19_; + gint _tmp20_; + gboolean _tmp21_ = FALSE; + gint _tmp22_; + gint _tmp23_; + gint _tmp24_; + gboolean _tmp37_; + _tmp17_ = _tmp16_; + if (!_tmp17_) { + gint _tmp18_; + _tmp18_ = i; + i = _tmp18_ + 1; + } + _tmp16_ = FALSE; + _tmp19_ = i; + _tmp20_ = size; + if (!(_tmp19_ < _tmp20_)) { + break; + } + _tmp22_ = lbegin; + _tmp23_ = left; + _tmp24_ = middle; + if (_tmp22_ < (_tmp23_ + _tmp24_)) { + gboolean _tmp25_ = FALSE; + gint _tmp26_; + gint _tmp27_; + gboolean _tmp36_; + _tmp26_ = rbegin; + _tmp27_ = right; + if (_tmp26_ == _tmp27_) { + _tmp25_ = TRUE; + } else { + GCompareDataFunc _tmp28_; + void* _tmp28__target; + gpointer* _tmp29_; + gint _tmp29__length1; + gint _tmp30_; + gconstpointer _tmp31_; + gpointer* _tmp32_; + gint _tmp32__length1; + gint _tmp33_; + gconstpointer _tmp34_; + gint _tmp35_ = 0; + _tmp28_ = self->priv->compare; + _tmp28__target = self->priv->compare_target; + _tmp29_ = self->priv->list; + _tmp29__length1 = self->priv->list_length1; + _tmp30_ = lbegin; + _tmp31_ = _tmp29_[_tmp30_]; + _tmp32_ = self->priv->list; + _tmp32__length1 = self->priv->list_length1; + _tmp33_ = rbegin; + _tmp34_ = _tmp32_[_tmp33_]; + _tmp35_ = _tmp28_ (_tmp31_, _tmp34_, _tmp28__target); + _tmp25_ = _tmp35_ <= 0; + } + _tmp36_ = _tmp25_; + _tmp21_ = _tmp36_; + } else { + _tmp21_ = FALSE; + } + _tmp37_ = _tmp21_; + if (_tmp37_) { + gpointer* _tmp38_; + gint _tmp38__length1; + gint _tmp39_; + gpointer* _tmp40_; + gint _tmp40__length1; + gint _tmp41_; + gconstpointer _tmp42_; + gpointer _tmp43_; + gpointer _tmp44_; + gint _tmp45_; + _tmp38_ = work_area; + _tmp38__length1 = work_area_length1; + _tmp39_ = i; + _tmp40_ = self->priv->list; + _tmp40__length1 = self->priv->list_length1; + _tmp41_ = lbegin; + _tmp42_ = _tmp40_[_tmp41_]; + _tmp43_ = ((_tmp42_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp42_) : ((gpointer) _tmp42_); + ((_tmp38_[_tmp39_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp38_[_tmp39_] = (self->priv->g_destroy_func (_tmp38_[_tmp39_]), NULL)); + _tmp38_[_tmp39_] = _tmp43_; + _tmp44_ = _tmp38_[_tmp39_]; + _tmp45_ = lbegin; + lbegin = _tmp45_ + 1; + } else { + gpointer* _tmp46_; + gint _tmp46__length1; + gint _tmp47_; + gpointer* _tmp48_; + gint _tmp48__length1; + gint _tmp49_; + gconstpointer _tmp50_; + gpointer _tmp51_; + gpointer _tmp52_; + gint _tmp53_; + _tmp46_ = work_area; + _tmp46__length1 = work_area_length1; + _tmp47_ = i; + _tmp48_ = self->priv->list; + _tmp48__length1 = self->priv->list_length1; + _tmp49_ = rbegin; + _tmp50_ = _tmp48_[_tmp49_]; + _tmp51_ = ((_tmp50_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp50_) : ((gpointer) _tmp50_); + ((_tmp46_[_tmp47_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp46_[_tmp47_] = (self->priv->g_destroy_func (_tmp46_[_tmp47_]), NULL)); + _tmp46_[_tmp47_] = _tmp51_; + _tmp52_ = _tmp46_[_tmp47_]; + _tmp53_ = rbegin; + rbegin = _tmp53_ + 1; + } + } + } + } + { + gint _tmp54_; + gint i; + _tmp54_ = left; + i = _tmp54_; + { + gboolean _tmp55_; + _tmp55_ = TRUE; + while (TRUE) { + gboolean _tmp56_; + gint _tmp58_; + gint _tmp59_; + gpointer* _tmp60_; + gint _tmp60__length1; + gint _tmp61_; + gpointer* _tmp62_; + gint _tmp62__length1; + gint _tmp63_; + gint _tmp64_; + gconstpointer _tmp65_; + gpointer _tmp66_; + gpointer _tmp67_; + _tmp56_ = _tmp55_; + if (!_tmp56_) { + gint _tmp57_; + _tmp57_ = i; + i = _tmp57_ + 1; + } + _tmp55_ = FALSE; + _tmp58_ = i; + _tmp59_ = right; + if (!(_tmp58_ < _tmp59_)) { + break; + } + _tmp60_ = self->priv->list; + _tmp60__length1 = self->priv->list_length1; + _tmp61_ = i; + _tmp62_ = work_area; + _tmp62__length1 = work_area_length1; + _tmp63_ = i; + _tmp64_ = left; + _tmp65_ = _tmp62_[_tmp63_ - _tmp64_]; + _tmp66_ = ((_tmp65_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp65_) : ((gpointer) _tmp65_); + ((_tmp60_[_tmp61_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp60_[_tmp61_] = (self->priv->g_destroy_func (_tmp60_[_tmp61_]), NULL)); + _tmp60_[_tmp61_] = _tmp66_; + _tmp67_ = _tmp60_[_tmp61_]; + } + } + } + } +} + + +GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeMergeSort* self = NULL; + self = (GeeMergeSort*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + return gee_merge_sort_construct (GEE_TYPE_MERGE_SORT, g_type, g_dup_func, g_destroy_func); +} + + +static void gee_value_merge_sort_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void gee_value_merge_sort_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_merge_sort_unref (value->data[0].v_pointer); + } +} + + +static void gee_value_merge_sort_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_merge_sort_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer gee_value_merge_sort_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* gee_value_merge_sort_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeMergeSort* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_merge_sort_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* gee_value_merge_sort_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeMergeSort** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_merge_sort_ref (value->data[0].v_pointer); + } + return NULL; +} + + +GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeParamSpecMergeSort* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_TYPE_MERGE_SORT), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +gpointer gee_value_get_merge_sort (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT), NULL); + return value->data[0].v_pointer; +} + + +void gee_value_set_merge_sort (GValue* value, gpointer v_object) { + GeeMergeSort* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_merge_sort_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_merge_sort_unref (old); + } +} + + +void gee_value_take_merge_sort (GValue* value, gpointer v_object) { + GeeMergeSort* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_merge_sort_unref (old); + } +} + + +static void gee_merge_sort_class_init (GeeMergeSortClass * klass) { + gee_merge_sort_parent_class = g_type_class_peek_parent (klass); + GEE_MERGE_SORT_CLASS (klass)->finalize = gee_merge_sort_finalize; + g_type_class_add_private (klass, sizeof (GeeMergeSortPrivate)); +} + + +static void gee_merge_sort_instance_init (GeeMergeSort * self) { + self->priv = GEE_MERGE_SORT_GET_PRIVATE (self); + self->ref_count = 1; +} + + +static void gee_merge_sort_finalize (GeeMergeSort* obj) { + GeeMergeSort * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_MERGE_SORT, GeeMergeSort); + _g_object_unref0 (self->priv->list_collection); + self->priv->array = (_vala_array_free (self->priv->array, self->priv->array_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); + (self->priv->compare_target_destroy_notify == NULL) ? NULL : (self->priv->compare_target_destroy_notify (self->priv->compare_target), NULL); + self->priv->compare = NULL; + self->priv->compare_target = NULL; + self->priv->compare_target_destroy_notify = NULL; +} + + +GType gee_merge_sort_get_type (void) { + static volatile gsize gee_merge_sort_type_id__volatile = 0; + if (g_once_init_enter (&gee_merge_sort_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_value_merge_sort_init, gee_value_merge_sort_free_value, gee_value_merge_sort_copy_value, gee_value_merge_sort_peek_pointer, "p", gee_value_merge_sort_collect_value, "p", gee_value_merge_sort_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeMergeSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_merge_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeMergeSort), 0, (GInstanceInitFunc) gee_merge_sort_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_merge_sort_type_id; + gee_merge_sort_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeMergeSort", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_merge_sort_type_id__volatile, gee_merge_sort_type_id); + } + return gee_merge_sort_type_id__volatile; +} + + +gpointer gee_merge_sort_ref (gpointer instance) { + GeeMergeSort* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +void gee_merge_sort_unref (gpointer instance) { + GeeMergeSort* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_MERGE_SORT_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); } diff --git a/benchmark/benchmarksorts.vala b/benchmark/benchmarksorts.vala index 6e384cf..94f4f3e 100644 --- a/benchmark/benchmarksorts.vala +++ b/benchmark/benchmarksorts.vala @@ -19,6 +19,7 @@ * * Author: * Didier 'Ptitjes Villevalois + * Will */ using Gee; @@ -39,12 +40,12 @@ namespace Gee.Benchmark { public string name { get { return "MergeSort"; } } public void process_collection (Collection collection) { - CompareFunc compare = Functions.get_compare_func_for (typeof (G)); + CompareDataFunc compare = Functions.get_compare_func_for (typeof (G)); Gee.MergeSort.sort ((Gee.List) collection, compare); } } - void main (string[] args) { + public void benchmark_sorts () { var algorithms = new ArrayList> (); algorithms.add (new TimSort ()); algorithms.add (new MergeSort ()); @@ -57,7 +58,7 @@ namespace Gee.Benchmark { generators.add (new SortedInt32 ()); Benchmark benchmark = - new Benchmark (new ArrayListFactory (), + new Benchmark (new ArrayListFactory (), algorithms, generators, new int[] { 10, @@ -71,3 +72,93 @@ namespace Gee.Benchmark { benchmark.run (); } } + +internal class Gee.MergeSort { + + public static void sort (List list, CompareDataFunc compare) { + if (list is ArrayList) { + MergeSort.sort_arraylist ((ArrayList) list, compare); + } else { + MergeSort.sort_list (list, compare); + } + } + + public static void sort_list (List list, CompareDataFunc compare) { + MergeSort helper = new MergeSort (); + + helper.list_collection = list; + helper.array = list.to_array (); + helper.list = helper.array; + helper.index = 0; + helper.size = list.size; + helper.compare = compare; + + helper.do_sort (); + + // TODO Use a list iterator and use iter.set(item) + list.clear (); + foreach (G item in helper.array) { + list.add (item); + } + } + + public static void sort_arraylist (ArrayList list, CompareDataFunc compare) { + MergeSort helper = new MergeSort (); + + helper.list_collection = list; + helper.list = list._items; + helper.index = 0; + helper.size = list._size; + helper.compare = compare; + + helper.do_sort (); + } + + private List list_collection; + private G[] array; + private unowned G[] list; + private int index; + private int size; + private CompareDataFunc compare; + + private void do_sort () { + if (this.size <= 1) { + return; + } + + var work_area = new G[this.size]; + + merge_sort_aux (index, this.size, work_area); + } + + private void merge_sort_aux (int left, int right, G[] work_area) { + if (right == left + 1) { + return; + } else { + int size = right - left; + int middle = size / 2; + int lbegin = left; + int rbegin = left + middle; + + merge_sort_aux (left, left + middle, work_area); + merge_sort_aux (left + middle, right, work_area); + + for (int i = 0; i < size; i++) { + if (lbegin < left + middle && (rbegin == right || + compare (list[lbegin], list[rbegin]) <= 0)) { + + work_area[i] = list[lbegin]; + lbegin++; + } else { + work_area[i] = list[rbegin]; + rbegin++; + } + } + + for (int i = left; i < right; i++) { + list[i] = work_area[i - left]; + } + } + } +} + diff --git a/benchmark/mergesort.c b/benchmark/mergesort.c deleted file mode 100644 index 1a2a841..0000000 --- a/benchmark/mergesort.c +++ /dev/null @@ -1,705 +0,0 @@ -/* mergesort.c generated by valac 0.16.1, the Vala compiler - * generated from mergesort.vala, do not modify */ - -/* mergesort.vala - * - * Copyright (C) 2009 Didier Villevalois - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Will - */ - -#include -#include -#include -#include - - -#define GEE_TYPE_MERGE_SORT (gee_merge_sort_get_type ()) -#define GEE_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSort)) -#define GEE_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_MERGE_SORT, GeeMergeSortClass)) -#define GEE_IS_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MERGE_SORT)) -#define GEE_IS_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_MERGE_SORT)) -#define GEE_MERGE_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSortClass)) - -typedef struct _GeeMergeSort GeeMergeSort; -typedef struct _GeeMergeSortClass GeeMergeSortClass; -typedef struct _GeeMergeSortPrivate GeeMergeSortPrivate; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) -#define _gee_merge_sort_unref0(var) ((var == NULL) ? NULL : (var = (gee_merge_sort_unref (var), NULL))) -typedef struct _GeeParamSpecMergeSort GeeParamSpecMergeSort; - -struct _GeeMergeSort { - GTypeInstance parent_instance; - volatile int ref_count; - GeeMergeSortPrivate * priv; -}; - -struct _GeeMergeSortClass { - GTypeClass parent_class; - void (*finalize) (GeeMergeSort *self); -}; - -struct _GeeMergeSortPrivate { - GType g_type; - GBoxedCopyFunc g_dup_func; - GDestroyNotify g_destroy_func; - GeeList* list_collection; - gpointer* array; - gint array_length1; - gint _array_size_; - gpointer* list; - gint list_length1; - gint _list_size_; - gint index; - gint size; - GCompareFunc compare; -}; - -struct _GeeParamSpecMergeSort { - GParamSpec parent_instance; -}; - - -static gpointer gee_merge_sort_parent_class = NULL; - -gpointer gee_merge_sort_ref (gpointer instance); -void gee_merge_sort_unref (gpointer instance); -GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); -void gee_value_set_merge_sort (GValue* value, gpointer v_object); -void gee_value_take_merge_sort (GValue* value, gpointer v_object); -gpointer gee_value_get_merge_sort (const GValue* value); -GType gee_merge_sort_get_type (void) G_GNUC_CONST; -#define GEE_MERGE_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_MERGE_SORT, GeeMergeSortPrivate)) -enum { - GEE_MERGE_SORT_DUMMY_PROPERTY -}; -void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare); -void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareFunc compare); -void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare); -GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -static void gee_merge_sort_do_sort (GeeMergeSort* self); -static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1); -static void gee_merge_sort_finalize (GeeMergeSort* obj); -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); - - -void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare) { - GeeList* _tmp0_; - g_return_if_fail (list != NULL); - _tmp0_ = list; - if (GEE_IS_ARRAY_LIST (_tmp0_)) { - GeeList* _tmp1_; - GCompareFunc _tmp2_; - _tmp1_ = list; - _tmp2_ = compare; - gee_merge_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, GEE_ARRAY_LIST (_tmp1_), _tmp2_); - } else { - GeeList* _tmp3_; - GCompareFunc _tmp4_; - _tmp3_ = list; - _tmp4_ = compare; - gee_merge_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_); - } -} - - -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare) { - GeeMergeSort* _tmp0_; - GeeMergeSort* helper; - GeeMergeSort* _tmp1_; - GeeList* _tmp2_; - GeeList* _tmp3_; - GeeMergeSort* _tmp4_; - GeeList* _tmp5_; - gint _tmp6_ = 0; - gpointer* _tmp7_ = NULL; - GeeMergeSort* _tmp8_; - GeeMergeSort* _tmp9_; - gpointer* _tmp10_; - gint _tmp10__length1; - GeeMergeSort* _tmp11_; - GeeMergeSort* _tmp12_; - GeeList* _tmp13_; - gint _tmp14_; - gint _tmp15_; - GeeMergeSort* _tmp16_; - GCompareFunc _tmp17_; - GeeMergeSort* _tmp18_; - GeeList* _tmp19_; - GeeMergeSort* _tmp20_; - gpointer* _tmp21_; - gint _tmp21__length1; - g_return_if_fail (list != NULL); - _tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); - helper = _tmp0_; - _tmp1_ = helper; - _tmp2_ = list; - _tmp3_ = _g_object_ref0 (_tmp2_); - _g_object_unref0 (_tmp1_->priv->list_collection); - _tmp1_->priv->list_collection = _tmp3_; - _tmp4_ = helper; - _tmp5_ = list; - _tmp7_ = gee_collection_to_array ((GeeCollection*) _tmp5_, &_tmp6_); - _tmp4_->priv->array = (_vala_array_free (_tmp4_->priv->array, _tmp4_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL); - _tmp4_->priv->array = _tmp7_; - _tmp4_->priv->array_length1 = _tmp6_; - _tmp4_->priv->_array_size_ = _tmp4_->priv->array_length1; - _tmp8_ = helper; - _tmp9_ = helper; - _tmp10_ = _tmp9_->priv->array; - _tmp10__length1 = _tmp9_->priv->array_length1; - _tmp8_->priv->list = _tmp10_; - _tmp8_->priv->list_length1 = _tmp10__length1; - _tmp8_->priv->_list_size_ = _tmp8_->priv->list_length1; - _tmp11_ = helper; - _tmp11_->priv->index = 0; - _tmp12_ = helper; - _tmp13_ = list; - _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_); - _tmp15_ = _tmp14_; - _tmp12_->priv->size = _tmp15_; - _tmp16_ = helper; - _tmp17_ = compare; - _tmp16_->priv->compare = _tmp17_; - _tmp18_ = helper; - gee_merge_sort_do_sort (_tmp18_); - _tmp19_ = list; - gee_collection_clear ((GeeCollection*) _tmp19_); - _tmp20_ = helper; - _tmp21_ = _tmp20_->priv->array; - _tmp21__length1 = _tmp20_->priv->array_length1; - { - gpointer* item_collection = NULL; - gint item_collection_length1 = 0; - gint _item_collection_size_ = 0; - gint item_it = 0; - item_collection = _tmp21_; - item_collection_length1 = _tmp21__length1; - for (item_it = 0; item_it < _tmp21__length1; item_it = item_it + 1) { - gpointer _tmp22_; - gpointer item = NULL; - _tmp22_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]); - item = _tmp22_; - { - GeeList* _tmp23_; - gconstpointer _tmp24_; - _tmp23_ = list; - _tmp24_ = item; - gee_collection_add ((GeeCollection*) _tmp23_, _tmp24_); - _g_destroy_func0 (item); - } - } - } - _gee_merge_sort_unref0 (helper); -} - - -void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareFunc compare) { - GeeMergeSort* _tmp0_; - GeeMergeSort* helper; - GeeArrayList* _tmp1_; - GeeList* _tmp2_; - GeeArrayList* _tmp3_; - gpointer* _tmp4_; - gint _tmp4__length1; - GeeArrayList* _tmp5_; - gint _tmp6_; - GCompareFunc _tmp7_; - g_return_if_fail (list != NULL); - _tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); - helper = _tmp0_; - _tmp1_ = list; - _tmp2_ = _g_object_ref0 ((GeeList*) _tmp1_); - _g_object_unref0 (helper->priv->list_collection); - helper->priv->list_collection = _tmp2_; - _tmp3_ = list; - _tmp4_ = _tmp3_->_items; - _tmp4__length1 = _tmp3_->_items_length1; - helper->priv->list = _tmp4_; - helper->priv->list_length1 = _tmp4__length1; - helper->priv->_list_size_ = helper->priv->list_length1; - helper->priv->index = 0; - _tmp5_ = list; - _tmp6_ = _tmp5_->_size; - helper->priv->size = _tmp6_; - _tmp7_ = compare; - helper->priv->compare = _tmp7_; - gee_merge_sort_do_sort (helper); - _gee_merge_sort_unref0 (helper); -} - - -static void gee_merge_sort_do_sort (GeeMergeSort* self) { - gint _tmp0_; - gint _tmp1_; - gpointer* _tmp2_ = NULL; - gpointer* work_area; - gint work_area_length1; - gint _work_area_size_; - gint _tmp3_; - gint _tmp4_; - gpointer* _tmp5_; - gint _tmp5__length1; - g_return_if_fail (self != NULL); - _tmp0_ = self->priv->size; - if (_tmp0_ <= 1) { - return; - } - _tmp1_ = self->priv->size; - _tmp2_ = g_new0 (gpointer, _tmp1_); - work_area = _tmp2_; - work_area_length1 = _tmp1_; - _work_area_size_ = work_area_length1; - _tmp3_ = self->priv->index; - _tmp4_ = self->priv->size; - _tmp5_ = work_area; - _tmp5__length1 = work_area_length1; - gee_merge_sort_merge_sort_aux (self, _tmp3_, _tmp4_, _tmp5_, _tmp5__length1); - work_area = (_vala_array_free (work_area, work_area_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); -} - - -static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1) { - gint _tmp0_; - gint _tmp1_; - g_return_if_fail (self != NULL); - _tmp0_ = right; - _tmp1_ = left; - if (_tmp0_ == (_tmp1_ + 1)) { - return; - } else { - gint _tmp2_; - gint _tmp3_; - gint size; - gint _tmp4_; - gint middle; - gint _tmp5_; - gint lbegin; - gint _tmp6_; - gint _tmp7_; - gint rbegin; - gint _tmp8_; - gint _tmp9_; - gint _tmp10_; - gpointer* _tmp11_; - gint _tmp11__length1; - gint _tmp12_; - gint _tmp13_; - gint _tmp14_; - gpointer* _tmp15_; - gint _tmp15__length1; - _tmp2_ = right; - _tmp3_ = left; - size = _tmp2_ - _tmp3_; - _tmp4_ = size; - middle = _tmp4_ / 2; - _tmp5_ = left; - lbegin = _tmp5_; - _tmp6_ = left; - _tmp7_ = middle; - rbegin = _tmp6_ + _tmp7_; - _tmp8_ = left; - _tmp9_ = left; - _tmp10_ = middle; - _tmp11_ = work_area; - _tmp11__length1 = work_area_length1; - gee_merge_sort_merge_sort_aux (self, _tmp8_, _tmp9_ + _tmp10_, _tmp11_, _tmp11__length1); - _tmp12_ = left; - _tmp13_ = middle; - _tmp14_ = right; - _tmp15_ = work_area; - _tmp15__length1 = work_area_length1; - gee_merge_sort_merge_sort_aux (self, _tmp12_ + _tmp13_, _tmp14_, _tmp15_, _tmp15__length1); - { - gint i; - i = 0; - { - gboolean _tmp16_; - _tmp16_ = TRUE; - while (TRUE) { - gboolean _tmp17_; - gint _tmp19_; - gint _tmp20_; - gboolean _tmp21_ = FALSE; - gint _tmp22_; - gint _tmp23_; - gint _tmp24_; - gboolean _tmp37_; - _tmp17_ = _tmp16_; - if (!_tmp17_) { - gint _tmp18_; - _tmp18_ = i; - i = _tmp18_ + 1; - } - _tmp16_ = FALSE; - _tmp19_ = i; - _tmp20_ = size; - if (!(_tmp19_ < _tmp20_)) { - break; - } - _tmp22_ = lbegin; - _tmp23_ = left; - _tmp24_ = middle; - if (_tmp22_ < (_tmp23_ + _tmp24_)) { - gboolean _tmp25_ = FALSE; - gint _tmp26_; - gint _tmp27_; - gboolean _tmp36_; - _tmp26_ = rbegin; - _tmp27_ = right; - if (_tmp26_ == _tmp27_) { - _tmp25_ = TRUE; - } else { - GCompareFunc _tmp28_; - gpointer* _tmp29_; - gint _tmp29__length1; - gint _tmp30_; - gconstpointer _tmp31_; - gpointer* _tmp32_; - gint _tmp32__length1; - gint _tmp33_; - gconstpointer _tmp34_; - gint _tmp35_ = 0; - _tmp28_ = self->priv->compare; - _tmp29_ = self->priv->list; - _tmp29__length1 = self->priv->list_length1; - _tmp30_ = lbegin; - _tmp31_ = _tmp29_[_tmp30_]; - _tmp32_ = self->priv->list; - _tmp32__length1 = self->priv->list_length1; - _tmp33_ = rbegin; - _tmp34_ = _tmp32_[_tmp33_]; - _tmp35_ = _tmp28_ (_tmp31_, _tmp34_); - _tmp25_ = _tmp35_ <= 0; - } - _tmp36_ = _tmp25_; - _tmp21_ = _tmp36_; - } else { - _tmp21_ = FALSE; - } - _tmp37_ = _tmp21_; - if (_tmp37_) { - gpointer* _tmp38_; - gint _tmp38__length1; - gint _tmp39_; - gpointer* _tmp40_; - gint _tmp40__length1; - gint _tmp41_; - gconstpointer _tmp42_; - gpointer _tmp43_; - gpointer _tmp44_; - gint _tmp45_; - _tmp38_ = work_area; - _tmp38__length1 = work_area_length1; - _tmp39_ = i; - _tmp40_ = self->priv->list; - _tmp40__length1 = self->priv->list_length1; - _tmp41_ = lbegin; - _tmp42_ = _tmp40_[_tmp41_]; - _tmp43_ = ((_tmp42_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp42_) : ((gpointer) _tmp42_); - ((_tmp38_[_tmp39_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp38_[_tmp39_] = (self->priv->g_destroy_func (_tmp38_[_tmp39_]), NULL)); - _tmp38_[_tmp39_] = _tmp43_; - _tmp44_ = _tmp38_[_tmp39_]; - _tmp45_ = lbegin; - lbegin = _tmp45_ + 1; - } else { - gpointer* _tmp46_; - gint _tmp46__length1; - gint _tmp47_; - gpointer* _tmp48_; - gint _tmp48__length1; - gint _tmp49_; - gconstpointer _tmp50_; - gpointer _tmp51_; - gpointer _tmp52_; - gint _tmp53_; - _tmp46_ = work_area; - _tmp46__length1 = work_area_length1; - _tmp47_ = i; - _tmp48_ = self->priv->list; - _tmp48__length1 = self->priv->list_length1; - _tmp49_ = rbegin; - _tmp50_ = _tmp48_[_tmp49_]; - _tmp51_ = ((_tmp50_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp50_) : ((gpointer) _tmp50_); - ((_tmp46_[_tmp47_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp46_[_tmp47_] = (self->priv->g_destroy_func (_tmp46_[_tmp47_]), NULL)); - _tmp46_[_tmp47_] = _tmp51_; - _tmp52_ = _tmp46_[_tmp47_]; - _tmp53_ = rbegin; - rbegin = _tmp53_ + 1; - } - } - } - } - { - gint _tmp54_; - gint i; - _tmp54_ = left; - i = _tmp54_; - { - gboolean _tmp55_; - _tmp55_ = TRUE; - while (TRUE) { - gboolean _tmp56_; - gint _tmp58_; - gint _tmp59_; - gpointer* _tmp60_; - gint _tmp60__length1; - gint _tmp61_; - gpointer* _tmp62_; - gint _tmp62__length1; - gint _tmp63_; - gint _tmp64_; - gconstpointer _tmp65_; - gpointer _tmp66_; - gpointer _tmp67_; - _tmp56_ = _tmp55_; - if (!_tmp56_) { - gint _tmp57_; - _tmp57_ = i; - i = _tmp57_ + 1; - } - _tmp55_ = FALSE; - _tmp58_ = i; - _tmp59_ = right; - if (!(_tmp58_ < _tmp59_)) { - break; - } - _tmp60_ = self->priv->list; - _tmp60__length1 = self->priv->list_length1; - _tmp61_ = i; - _tmp62_ = work_area; - _tmp62__length1 = work_area_length1; - _tmp63_ = i; - _tmp64_ = left; - _tmp65_ = _tmp62_[_tmp63_ - _tmp64_]; - _tmp66_ = ((_tmp65_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp65_) : ((gpointer) _tmp65_); - ((_tmp60_[_tmp61_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp60_[_tmp61_] = (self->priv->g_destroy_func (_tmp60_[_tmp61_]), NULL)); - _tmp60_[_tmp61_] = _tmp66_; - _tmp67_ = _tmp60_[_tmp61_]; - } - } - } - } -} - - -GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { - GeeMergeSort* self = NULL; - self = (GeeMergeSort*) g_type_create_instance (object_type); - self->priv->g_type = g_type; - self->priv->g_dup_func = g_dup_func; - self->priv->g_destroy_func = g_destroy_func; - return self; -} - - -GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { - return gee_merge_sort_construct (GEE_TYPE_MERGE_SORT, g_type, g_dup_func, g_destroy_func); -} - - -static void gee_value_merge_sort_init (GValue* value) { - value->data[0].v_pointer = NULL; -} - - -static void gee_value_merge_sort_free_value (GValue* value) { - if (value->data[0].v_pointer) { - gee_merge_sort_unref (value->data[0].v_pointer); - } -} - - -static void gee_value_merge_sort_copy_value (const GValue* src_value, GValue* dest_value) { - if (src_value->data[0].v_pointer) { - dest_value->data[0].v_pointer = gee_merge_sort_ref (src_value->data[0].v_pointer); - } else { - dest_value->data[0].v_pointer = NULL; - } -} - - -static gpointer gee_value_merge_sort_peek_pointer (const GValue* value) { - return value->data[0].v_pointer; -} - - -static gchar* gee_value_merge_sort_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { - if (collect_values[0].v_pointer) { - GeeMergeSort* object; - object = collect_values[0].v_pointer; - if (object->parent_instance.g_class == NULL) { - return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); - } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { - return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); - } - value->data[0].v_pointer = gee_merge_sort_ref (object); - } else { - value->data[0].v_pointer = NULL; - } - return NULL; -} - - -static gchar* gee_value_merge_sort_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { - GeeMergeSort** object_p; - object_p = collect_values[0].v_pointer; - if (!object_p) { - return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); - } - if (!value->data[0].v_pointer) { - *object_p = NULL; - } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { - *object_p = value->data[0].v_pointer; - } else { - *object_p = gee_merge_sort_ref (value->data[0].v_pointer); - } - return NULL; -} - - -GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { - GeeParamSpecMergeSort* spec; - g_return_val_if_fail (g_type_is_a (object_type, GEE_TYPE_MERGE_SORT), NULL); - spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); - G_PARAM_SPEC (spec)->value_type = object_type; - return G_PARAM_SPEC (spec); -} - - -gpointer gee_value_get_merge_sort (const GValue* value) { - g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT), NULL); - return value->data[0].v_pointer; -} - - -void gee_value_set_merge_sort (GValue* value, gpointer v_object) { - GeeMergeSort* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT)); - old = value->data[0].v_pointer; - if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT)); - g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); - value->data[0].v_pointer = v_object; - gee_merge_sort_ref (value->data[0].v_pointer); - } else { - value->data[0].v_pointer = NULL; - } - if (old) { - gee_merge_sort_unref (old); - } -} - - -void gee_value_take_merge_sort (GValue* value, gpointer v_object) { - GeeMergeSort* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT)); - old = value->data[0].v_pointer; - if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT)); - g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); - value->data[0].v_pointer = v_object; - } else { - value->data[0].v_pointer = NULL; - } - if (old) { - gee_merge_sort_unref (old); - } -} - - -static void gee_merge_sort_class_init (GeeMergeSortClass * klass) { - gee_merge_sort_parent_class = g_type_class_peek_parent (klass); - GEE_MERGE_SORT_CLASS (klass)->finalize = gee_merge_sort_finalize; - g_type_class_add_private (klass, sizeof (GeeMergeSortPrivate)); -} - - -static void gee_merge_sort_instance_init (GeeMergeSort * self) { - self->priv = GEE_MERGE_SORT_GET_PRIVATE (self); - self->ref_count = 1; -} - - -static void gee_merge_sort_finalize (GeeMergeSort* obj) { - GeeMergeSort * self; - self = GEE_MERGE_SORT (obj); - _g_object_unref0 (self->priv->list_collection); - self->priv->array = (_vala_array_free (self->priv->array, self->priv->array_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); -} - - -GType gee_merge_sort_get_type (void) { - static volatile gsize gee_merge_sort_type_id__volatile = 0; - if (g_once_init_enter (&gee_merge_sort_type_id__volatile)) { - static const GTypeValueTable g_define_type_value_table = { gee_value_merge_sort_init, gee_value_merge_sort_free_value, gee_value_merge_sort_copy_value, gee_value_merge_sort_peek_pointer, "p", gee_value_merge_sort_collect_value, "p", gee_value_merge_sort_lcopy_value }; - static const GTypeInfo g_define_type_info = { sizeof (GeeMergeSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_merge_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeMergeSort), 0, (GInstanceInitFunc) gee_merge_sort_instance_init, &g_define_type_value_table }; - static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; - GType gee_merge_sort_type_id; - gee_merge_sort_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeMergeSort", &g_define_type_info, &g_define_type_fundamental_info, 0); - g_once_init_leave (&gee_merge_sort_type_id__volatile, gee_merge_sort_type_id); - } - return gee_merge_sort_type_id__volatile; -} - - -gpointer gee_merge_sort_ref (gpointer instance) { - GeeMergeSort* self; - self = instance; - g_atomic_int_inc (&self->ref_count); - return instance; -} - - -void gee_merge_sort_unref (gpointer instance) { - GeeMergeSort* self; - self = instance; - if (g_atomic_int_dec_and_test (&self->ref_count)) { - GEE_MERGE_SORT_GET_CLASS (self)->finalize (self); - g_type_free_instance ((GTypeInstance *) self); - } -} - - -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { - if ((array != NULL) && (destroy_func != NULL)) { - int i; - for (i = 0; i < array_length; i = i + 1) { - if (((gpointer*) array)[i] != NULL) { - destroy_func (((gpointer*) array)[i]); - } - } - } -} - - -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { - _vala_array_destroy (array, array_length, destroy_func); - g_free (array); -} - - - diff --git a/benchmark/mergesort.vala b/benchmark/mergesort.vala deleted file mode 100644 index f20cc92..0000000 --- a/benchmark/mergesort.vala +++ /dev/null @@ -1,110 +0,0 @@ -/* mergesort.vala - * - * Copyright (C) 2009 Didier Villevalois - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Will - */ - -internal class Gee.MergeSort { - - public static void sort (List list, CompareFunc compare) { - if (list is ArrayList) { - MergeSort.sort_arraylist ((ArrayList) list, compare); - } else { - MergeSort.sort_list (list, compare); - } - } - - public static void sort_list (List list, CompareFunc compare) { - MergeSort helper = new MergeSort (); - - helper.list_collection = list; - helper.array = list.to_array (); - helper.list = helper.array; - helper.index = 0; - helper.size = list.size; - helper.compare = compare; - - helper.do_sort (); - - // TODO Use a list iterator and use iter.set(item) - list.clear (); - foreach (G item in helper.array) { - list.add (item); - } - } - - public static void sort_arraylist (ArrayList list, CompareFunc compare) { - MergeSort helper = new MergeSort (); - - helper.list_collection = list; - helper.list = list._items; - helper.index = 0; - helper.size = list._size; - helper.compare = compare; - - helper.do_sort (); - } - - private List list_collection; - private G[] array; - private unowned G[] list; - private int index; - private int size; - private CompareFunc compare; - - private void do_sort () { - if (this.size <= 1) { - return; - } - - var work_area = new G[this.size]; - - merge_sort_aux (index, this.size, work_area); - } - - private void merge_sort_aux (int left, int right, G[] work_area) { - if (right == left + 1) { - return; - } else { - int size = right - left; - int middle = size / 2; - int lbegin = left; - int rbegin = left + middle; - - merge_sort_aux (left, left + middle, work_area); - merge_sort_aux (left + middle, right, work_area); - - for (int i = 0; i < size; i++) { - if (lbegin < left + middle && (rbegin == right || - compare (list[lbegin], list[rbegin]) <= 0)) { - - work_area[i] = list[lbegin]; - lbegin++; - } else { - work_area[i] = list[rbegin]; - rbegin++; - } - } - - for (int i = left; i < right; i++) { - list[i] = work_area[i - left]; - } - } - } -} diff --git a/configure b/configure index acbebdb..7b69a83 100755 --- a/configure +++ b/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libgee 0.6.6.1. +# Generated by GNU Autoconf 2.69 for libgee 0.9.92. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -274,7 +274,8 @@ fi $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and ptitjes@free.fr + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: https://bugzilla.gnome.org/enter_bug.cgi?product=libgee $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do @@ -566,6 +567,66 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} +as_awk_strverscmp=' + # Use only awk features that work with 7th edition Unix awk (1978). + # My, what an old awk you have, Mr. Solaris! + END { + while (length(v1) && length(v2)) { + # Set d1 to be the next thing to compare from v1, and likewise for d2. + # Normally this is a single character, but if v1 and v2 contain digits, + # compare them as integers and fractions as strverscmp does. + if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { + # Split v1 and v2 into their leading digit string components d1 and d2, + # and advance v1 and v2 past the leading digit strings. + for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue + for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue + d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) + d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) + if (d1 ~ /^0/) { + if (d2 ~ /^0/) { + # Compare two fractions. + while (d1 ~ /^0/ && d2 ~ /^0/) { + d1 = substr(d1, 2); len1-- + d2 = substr(d2, 2); len2-- + } + if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { + # The two components differ in length, and the common prefix + # contains only leading zeros. Consider the longer to be less. + d1 = -len1 + d2 = -len2 + } else { + # Otherwise, compare as strings. + d1 = "x" d1 + d2 = "x" d2 + } + } else { + # A fraction is less than an integer. + exit 1 + } + } else { + if (d2 ~ /^0/) { + # An integer is greater than a fraction. + exit 2 + } else { + # Compare two integers. + d1 += 0 + d2 += 0 + } + } + } else { + # The normal case, without worrying about digits. + d1 = substr(v1, 1, 1); v1 = substr(v1, 2) + d2 = substr(v2, 1, 1); v2 = substr(v2, 2) + } + if (d1 < d2) exit 1 + if (d1 > d2) exit 2 + } + # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), + # which mishandles some comparisons of empty strings to integers. + if (length(v2)) exit 1 + if (length(v1)) exit 2 + } +' test -n "$DJDIR" || exec 7<&0 &1 @@ -590,9 +651,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libgee' PACKAGE_TARNAME='libgee' -PACKAGE_VERSION='0.6.6.1' -PACKAGE_STRING='libgee 0.6.6.1' -PACKAGE_BUGREPORT='ptitjes@free.fr' +PACKAGE_VERSION='0.9.92' +PACKAGE_STRING='libgee 0.9.92' +PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=libgee' PACKAGE_URL='' ac_unique_file="Makefile.am" @@ -1348,7 +1409,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libgee 0.6.6.1 to adapt to many kinds of systems. +\`configure' configures libgee 0.9.92 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1418,7 +1479,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libgee 0.6.6.1:";; + short | recursive ) echo "Configuration of libgee 0.9.92:";; esac cat <<\_ACEOF @@ -1470,7 +1531,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1533,7 +1594,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libgee configure 0.6.6.1 +libgee configure 0.9.92 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1811,7 +1872,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libgee $as_me 0.6.6.1, which was +It was created by libgee $as_me 0.9.92, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2630,7 +2691,7 @@ fi # Define the identity of the package. PACKAGE='libgee' - VERSION='0.6.6.1' + VERSION='0.9.92' cat >>confdefs.h <<_ACEOF @@ -11417,9 +11478,11 @@ CC="$lt_save_CC" -LIBGEE_LT_VERSION="2:0:0" +LIBGEE_LT_VERSION="4:0:2" +GLIB_REQUIRED=2.32 + # Extract the first word of "valac", so it can be a program name with args. set dummy valac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -11447,7 +11510,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_VALAC" && ac_cv_path_VALAC="valac" ;; esac fi @@ -11461,8 +11523,38 @@ $as_echo "no" >&6; } fi + if test -z "$VALAC"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No Vala compiler found. You will not be able to compile .vala source files." >&5 +$as_echo "$as_me: WARNING: No Vala compiler found. You will not be able to compile .vala source files." >&2;} +else + if test -n "0.17.5"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking $VALAC is at least version 0.17.5" >&5 +$as_echo_n "checking $VALAC is at least version 0.17.5... " >&6; } + am__vala_version=`$VALAC --version | sed 's/Vala *//'` + as_arg_v1=0.17.5 +as_arg_v2="$am__vala_version" +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +case $? in #( + 1) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ;; #( + 0) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ;; #( + 2) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Vala 0.17.5 not found." "$LINENO" 5 ;; #( + *) : + ;; +esac +fi +fi + +VALAFLAGS=--target-glib=$GLIB_REQUIRED + # Check whether --enable-doc was given. @@ -11616,8 +11708,6 @@ else fi -GLIB_REQUIRED=2.12.0 - @@ -11927,7 +12017,7 @@ fi -ac_config_files="$ac_config_files Makefile gee-1.0.pc benchmark/Makefile doc/Makefile gee/Makefile tests/Makefile" +ac_config_files="$ac_config_files Makefile gee-0.8.pc benchmark/Makefile doc/Makefile gee/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -12467,7 +12557,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libgee $as_me 0.6.6.1, which was +This file was extended by libgee $as_me 0.9.92, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12527,13 +12617,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libgee config.status 0.6.6.1 +libgee config.status 0.9.92 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -12943,7 +13033,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gee-1.0.pc") CONFIG_FILES="$CONFIG_FILES gee-1.0.pc" ;; + "gee-0.8.pc") CONFIG_FILES="$CONFIG_FILES gee-0.8.pc" ;; "benchmark/Makefile") CONFIG_FILES="$CONFIG_FILES benchmark/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "gee/Makefile") CONFIG_FILES="$CONFIG_FILES gee/Makefile" ;; diff --git a/configure.ac b/configure.ac index 7a9cbf1..3e10898 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libgee], [0.6.6.1], [ptitjes@free.fr], [libgee]) +AC_INIT([libgee], [0.9.92], [https://bugzilla.gnome.org/enter_bug.cgi?product=libgee], [libgee]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR([m4]) @@ -11,12 +11,16 @@ AM_PROG_CC_C_O AC_DISABLE_STATIC AC_PROG_LIBTOOL -LIBGEE_LT_VERSION="2:0:0" +LIBGEE_LT_VERSION="4:0:2" AC_SUBST(LIBGEE_LT_VERSION) -AC_PATH_PROG(VALAC, valac, valac) +GLIB_REQUIRED=2.32 + +AM_PROG_VALAC([0.17.5]) AC_SUBST(VALAC) +VALAFLAGS=--target-glib=$GLIB_REQUIRED + AC_SUBST(VALAFLAGS) AC_ARG_ENABLE(doc, AS_HELP_STRING([--enable-doc], [Enable documentation generation]), enable_doc=$enableval, enable_doc=no) @@ -50,8 +54,6 @@ AS_IF([test "x$enable_coverage" != xno], AC_ARG_ENABLE(benchmark, AS_HELP_STRING([--enable-benchmark], [Enable benchmark]), enable_benchmark=$enableval, enable_benchmark=no) AM_CONDITIONAL(ENABLE_BENCHMARK, test x$enable_benchmark = xyes) -GLIB_REQUIRED=2.12.0 - PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) @@ -59,7 +61,7 @@ AC_SUBST(GLIB_LIBS) GOBJECT_INTROSPECTION_CHECK([0.9.0]) AC_OUTPUT([Makefile - gee-1.0.pc + gee-0.8.pc benchmark/Makefile doc/Makefile gee/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index bce1117..8a11807 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,37 +1,35 @@ include $(top_srcdir)/Makefile.decl -NULL = - SRC_DIR = $(top_srcdir)/gee -docdir=$(datadir)/devhelp/references/gee-1.0 -innerdocdir=$(datadir)/devhelp/references/gee-1.0/gee-1.0 -imgdir=$(datadir)/devhelp/references/gee-1.0/gee-1.0/img +docdir=$(datadir)/devhelp/references/gee-0.8 +innerdocdir=$(datadir)/devhelp/references/gee-0.8/gee-0.8 +imgdir=$(datadir)/devhelp/references/gee-0.8/gee-0.8/img doc_data = \ - gee-1.0/*.css \ - gee-1.0/*.png \ + gee-0.8/*.css \ + gee-0.8/*.png \ $(NULL) doc_DATA = \ - gee-1.0/index.html \ + gee-0.8/index.html \ $(doc_data) \ $(NULL) innerdoc_DATA = \ - gee-1.0/gee-1.0/index.htm \ - gee-1.0/gee-1.0/*.html \ + gee-0.8/gee-0.8/index.htm \ + gee-0.8/gee-0.8/*.html \ $(NULL) img_DATA = \ - gee-1.0/gee-1.0/img/*.png \ + gee-0.8/gee-0.8/img/*.png \ $(NULL) -$(doc_data) $(innerdoc_DATA) $(img_DATA): gee-1.0/index.html +$(doc_data) $(innerdoc_DATA) $(img_DATA): gee-0.8/index.html -gee-1.0/index.html: - $(VALADOC) -o gee-1.0/ --wiki ./ --force -b $(top_srcdir) $(SRC_DIR)/*.vala +gee-0.8/index.html: + $(VALADOC) -o gee-0.8/ --wiki ./ --force -b $(top_srcdir) $(SRC_DIR)/*.vala EXTRA_DIST += \ index.wiki \ - $(NULL) \ No newline at end of file + $(NULL) diff --git a/doc/Makefile.in b/doc/Makefile.in index 41fafc1..8666042 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -215,7 +215,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ -docdir = $(datadir)/devhelp/references/gee-1.0 +docdir = $(datadir)/devhelp/references/gee-0.8 dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ @@ -252,27 +252,29 @@ GTESTER_REPORT = gtester-report # initialize variables for unconditional += appending EXTRA_DIST = index.wiki $(NULL) TEST_PROGS = + +# useful constants NULL = SRC_DIR = $(top_srcdir)/gee -innerdocdir = $(datadir)/devhelp/references/gee-1.0/gee-1.0 -imgdir = $(datadir)/devhelp/references/gee-1.0/gee-1.0/img +innerdocdir = $(datadir)/devhelp/references/gee-0.8/gee-0.8 +imgdir = $(datadir)/devhelp/references/gee-0.8/gee-0.8/img doc_data = \ - gee-1.0/*.css \ - gee-1.0/*.png \ + gee-0.8/*.css \ + gee-0.8/*.png \ $(NULL) doc_DATA = \ - gee-1.0/index.html \ + gee-0.8/index.html \ $(doc_data) \ $(NULL) innerdoc_DATA = \ - gee-1.0/gee-1.0/index.htm \ - gee-1.0/gee-1.0/*.html \ + gee-0.8/gee-0.8/index.htm \ + gee-0.8/gee-0.8/*.html \ $(NULL) img_DATA = \ - gee-1.0/gee-1.0/img/*.png \ + gee-0.8/gee-0.8/img/*.png \ $(NULL) all: all-am @@ -585,10 +587,10 @@ test-report perf-report full-report: ${TEST_PROGS} # run make test as part of make check check-local: test -$(doc_data) $(innerdoc_DATA) $(img_DATA): gee-1.0/index.html +$(doc_data) $(innerdoc_DATA) $(img_DATA): gee-0.8/index.html -gee-1.0/index.html: - $(VALADOC) -o gee-1.0/ --wiki ./ --force -b $(top_srcdir) $(SRC_DIR)/*.vala +gee-0.8/index.html: + $(VALADOC) -o gee-0.8/ --wiki ./ --force -b $(top_srcdir) $(SRC_DIR)/*.vala # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gee-0.8.pc.in b/gee-0.8.pc.in new file mode 100644 index 0000000..f0c2a9e --- /dev/null +++ b/gee-0.8.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@ + +Name: libgee +Description: The GObject collection library +Version: @VERSION@ +Requires: glib-2.0 gobject-2.0 +Libs: -L${libdir} -lgee-0.8 +Cflags: -I${includedir}/gee-0.8 diff --git a/gee-1.0.pc.in b/gee-1.0.pc.in deleted file mode 100644 index a5840c8..0000000 --- a/gee-1.0.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -datarootdir=@datarootdir@ -datadir=@datadir@ - -Name: libgee -Description: The GObject collection library -Version: @VERSION@ -Requires: glib-2.0 gobject-2.0 -Libs: -L${libdir} -lgee -Cflags: -I${includedir}/gee-1.0 diff --git a/gee/Gee-0.8.gir b/gee/Gee-0.8.gir new file mode 100644 index 0000000..0bd7818 --- /dev/null +++ b/gee/Gee-0.8.gir @@ -0,0 +1,8644 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gee/Gee-1.0.gir b/gee/Gee-1.0.gir deleted file mode 100644 index ddb9aa2..0000000 --- a/gee/Gee-1.0.gir +++ /dev/null @@ -1,5206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gee/Makefile.am b/gee/Makefile.am index efcc86b..f67d58a 100644 --- a/gee/Makefile.am +++ b/gee/Makefile.am @@ -1,20 +1,14 @@ include $(top_srcdir)/Makefile.decl -NULL = - -AM_CPPFLAGS = \ - $(GLIB_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -BUILT_SOURCES = gee.vala.stamp - lib_LTLIBRARIES = \ - libgee.la + libgee-0.8.la $(NULL) -libgee_la_VALASOURCES = \ +libgee_0_8_la_SOURCES = \ assemblyinfo.vala \ + abstractbidirlist.vala \ + abstractbidirsortedset.vala \ + abstractbidirsortedmap.vala \ abstractcollection.vala \ abstractlist.vala \ abstractmap.vala \ @@ -22,18 +16,31 @@ libgee_la_VALASOURCES = \ abstractmultiset.vala \ abstractqueue.vala \ abstractset.vala \ + abstractsortedmap.vala \ + abstractsortedset.vala \ arraylist.vala \ + arrayqueue.vala \ bidiriterator.vala \ + bidirlist.vala \ + bidirlistiterator.vala \ + bidirmapiterator.vala \ + bidirsortedset.vala \ + bidirsortedmap.vala \ collection.vala \ comparable.vala \ + concurrentlist.vala \ + concurrentset.vala \ deque.vala \ functions.vala \ + hashable.vala \ hashmap.vala \ hashmultimap.vala \ hashmultiset.vala \ hashset.vala \ + hazardpointer.vala \ iterable.vala \ iterator.vala \ + lazy.vala \ linkedlist.vala \ list.vala \ listiterator.vala \ @@ -43,85 +50,93 @@ libgee_la_VALASOURCES = \ multiset.vala \ priorityqueue.vala \ queue.vala \ + readonlybidirlist.vala \ + readonlybidirsortedset.vala \ + readonlybidirsortedmap.vala \ readonlycollection.vala \ readonlylist.vala \ readonlymap.vala \ + readonlymultimap.vala \ + readonlymultiset.vala \ readonlyset.vala \ + readonlysortedmap.vala \ + readonlysortedset.vala \ set.vala \ + sortedmap.vala \ sortedset.vala \ timsort.vala \ + traversable.vala \ treemap.vala \ treemultimap.vala \ treemultiset.vala \ treeset.vala \ + unfolditerator.vala \ $(NULL) -libgee_la_SOURCES = \ - gee.vala.stamp \ - $(libgee_la_VALASOURCES:.vala=.c) \ - $(NULL) - -geeincludedir = $(includedir)/gee-1.0 - -geeinclude_HEADERS = \ - gee.h \ - $(NULL) - -AM_VALAFLAGS = \ - -H gee.h --vapi gee-1.0.vapi \ +libgee_0_8_la_VALAFLAGS = \ + -H gee.h --vapi gee-0.8.vapi \ -h gee-internals.h \ - --internal-vapi gee-internals-1.0.vapi \ - --library gee-1.0 --gir Gee-1.0.gir \ + --internal-vapi gee-internals-0.8.vapi \ + --library gee-0.8 --gir Gee-0.8.gir \ $(COVERAGE_VALAFLAGS) \ $(VALAFLAGS) \ $(NULL) -Gee-1.0.gir gee-internals-1.0.vapi gee-1.0.vapi gee.vala.stamp: $(libgee_la_VALASOURCES) - $(VALAC) -C $(AM_VALAFLAGS) $^ - touch $@ +libgee_0_8_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) -libgee_la_LIBADD = \ +libgee_0_8_la_LIBADD = \ $(GLIB_LIBS) \ $(COVERAGE_LIBS) \ $(NULL) -libgee_la_LDFLAGS = -version-info $(LIBGEE_LT_VERSION) -no-undefined +libgee_0_8_la_LDFLAGS = \ + -version-info $(LIBGEE_LT_VERSION) \ + -no-undefined \ + $(NULL) + +geeincludedir = $(includedir)/gee-0.8 + +geeinclude_HEADERS = \ + gee.h \ + $(NULL) vapidir = $(datadir)/vala/vapi dist_vapi_DATA = \ - gee-1.0.vapi \ + gee-0.8.vapi \ $(NULL) if HAVE_INTROSPECTION girdir = @INTROSPECTION_GIRDIR@ gir_DATA = \ - Gee-1.0.gir \ + Gee-0.8.gir \ $(NULL) typelibdir = @INTROSPECTION_TYPELIBDIR@ typelib_DATA = \ - Gee-1.0.typelib \ + Gee-0.8.typelib \ $(NULL) -Gee-1.0.typelib: Gee-1.0.gir - @INTROSPECTION_COMPILER@ -o $@ $^ +# Extract dlname from libfolks.la; see bug #658002. +# This is what g-ir-scanner does. +libgee_dlname = \ + `$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" libgee-0.8.la` +INTROSPECTION_COMPILER_ARGS= \ + -l $(libgee_dlname) +Gee-0.8.typelib: Gee-0.8.gir + @INTROSPECTION_COMPILER@ $(INTROSPECTION_COMPILER_ARGS) -o $@ $^ endif -EXTRA_DIST += $(libgee_la_VALASOURCES) gee-1.0.vapi Gee-1.0.gir gee.vala.stamp - -MAINTAINERCLEANFILES = \ - $(libgee_la_VALASOURCES:.vala=.c) \ - gee.vala.stamp \ - gee-internals-1.0.vapi \ - gee-1.0.vapi \ - Gee-1.0.gir \ - gee.h \ - gee-internals.h \ - $(NULL) +Gee-0.8.gir gee-internals-0.8.vapi gee-0.8.vapi: libgee-0.8.la CLEANFILES = \ - Gee-1.0.typelib \ + gee-0.8.vapi \ + gee-internals-0.8.vapi \ + Gee-0.8.typelib \ + Gee-0.8.gir \ $(NULL) diff --git a/gee/Makefile.in b/gee/Makefile.in index 710f841..a3b45ba 100644 --- a/gee/Makefile.in +++ b/gee/Makefile.in @@ -57,7 +57,26 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_vapi_DATA) $(geeinclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/Makefile.decl + $(top_srcdir)/Makefile.decl Gee-0.8.gir abstractbidirlist.c \ + abstractbidirsortedmap.c abstractbidirsortedset.c \ + abstractcollection.c abstractlist.c abstractmap.c \ + abstractmultimap.c abstractmultiset.c abstractqueue.c \ + abstractset.c abstractsortedmap.c abstractsortedset.c \ + arraylist.c arrayqueue.c assemblyinfo.c bidiriterator.c \ + bidirlist.c bidirlistiterator.c bidirmapiterator.c \ + bidirsortedmap.c bidirsortedset.c collection.c comparable.c \ + concurrentlist.c concurrentset.c deque.c functions.c \ + gee-0.8.vapi gee-internals-0.8.vapi gee-internals.h gee.h \ + hashable.c hashmap.c hashmultimap.c hashmultiset.c hashset.c \ + hazardpointer.c iterable.c iterator.c lazy.c \ + libgee_0_8_la_vala.stamp linkedlist.c list.c listiterator.c \ + map.c mapiterator.c multimap.c multiset.c priorityqueue.c \ + queue.c readonlybidirlist.c readonlybidirsortedmap.c \ + readonlybidirsortedset.c readonlycollection.c readonlylist.c \ + readonlymap.c readonlymultimap.c readonlymultiset.c \ + readonlyset.c readonlysortedmap.c readonlysortedset.c set.c \ + sortedmap.c sortedset.c timsort.c traversable.c treemap.c \ + treemultimap.c treemultiset.c treeset.c unfolditerator.c subdir = gee ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ @@ -102,27 +121,57 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(vapidir)" \ "$(DESTDIR)$(geeincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = -libgee_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +libgee_0_8_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = -am__objects_2 = assemblyinfo.lo abstractcollection.lo abstractlist.lo \ - abstractmap.lo abstractmultimap.lo abstractmultiset.lo \ - abstractqueue.lo abstractset.lo arraylist.lo bidiriterator.lo \ - collection.lo comparable.lo deque.lo functions.lo hashmap.lo \ - hashmultimap.lo hashmultiset.lo hashset.lo iterable.lo \ - iterator.lo linkedlist.lo list.lo listiterator.lo map.lo \ - mapiterator.lo multimap.lo multiset.lo priorityqueue.lo \ - queue.lo readonlycollection.lo readonlylist.lo readonlymap.lo \ - readonlyset.lo set.lo sortedset.lo timsort.lo treemap.lo \ - treemultimap.lo treemultiset.lo treeset.lo $(am__objects_1) -am_libgee_la_OBJECTS = $(am__objects_2) $(am__objects_1) -libgee_la_OBJECTS = $(am_libgee_la_OBJECTS) +am_libgee_0_8_la_OBJECTS = libgee_0_8_la-assemblyinfo.lo \ + libgee_0_8_la-abstractbidirlist.lo \ + libgee_0_8_la-abstractbidirsortedset.lo \ + libgee_0_8_la-abstractbidirsortedmap.lo \ + libgee_0_8_la-abstractcollection.lo \ + libgee_0_8_la-abstractlist.lo libgee_0_8_la-abstractmap.lo \ + libgee_0_8_la-abstractmultimap.lo \ + libgee_0_8_la-abstractmultiset.lo \ + libgee_0_8_la-abstractqueue.lo libgee_0_8_la-abstractset.lo \ + libgee_0_8_la-abstractsortedmap.lo \ + libgee_0_8_la-abstractsortedset.lo libgee_0_8_la-arraylist.lo \ + libgee_0_8_la-arrayqueue.lo libgee_0_8_la-bidiriterator.lo \ + libgee_0_8_la-bidirlist.lo libgee_0_8_la-bidirlistiterator.lo \ + libgee_0_8_la-bidirmapiterator.lo \ + libgee_0_8_la-bidirsortedset.lo \ + libgee_0_8_la-bidirsortedmap.lo libgee_0_8_la-collection.lo \ + libgee_0_8_la-comparable.lo libgee_0_8_la-concurrentlist.lo \ + libgee_0_8_la-concurrentset.lo libgee_0_8_la-deque.lo \ + libgee_0_8_la-functions.lo libgee_0_8_la-hashable.lo \ + libgee_0_8_la-hashmap.lo libgee_0_8_la-hashmultimap.lo \ + libgee_0_8_la-hashmultiset.lo libgee_0_8_la-hashset.lo \ + libgee_0_8_la-hazardpointer.lo libgee_0_8_la-iterable.lo \ + libgee_0_8_la-iterator.lo libgee_0_8_la-lazy.lo \ + libgee_0_8_la-linkedlist.lo libgee_0_8_la-list.lo \ + libgee_0_8_la-listiterator.lo libgee_0_8_la-map.lo \ + libgee_0_8_la-mapiterator.lo libgee_0_8_la-multimap.lo \ + libgee_0_8_la-multiset.lo libgee_0_8_la-priorityqueue.lo \ + libgee_0_8_la-queue.lo libgee_0_8_la-readonlybidirlist.lo \ + libgee_0_8_la-readonlybidirsortedset.lo \ + libgee_0_8_la-readonlybidirsortedmap.lo \ + libgee_0_8_la-readonlycollection.lo \ + libgee_0_8_la-readonlylist.lo libgee_0_8_la-readonlymap.lo \ + libgee_0_8_la-readonlymultimap.lo \ + libgee_0_8_la-readonlymultiset.lo libgee_0_8_la-readonlyset.lo \ + libgee_0_8_la-readonlysortedmap.lo \ + libgee_0_8_la-readonlysortedset.lo libgee_0_8_la-set.lo \ + libgee_0_8_la-sortedmap.lo libgee_0_8_la-sortedset.lo \ + libgee_0_8_la-timsort.lo libgee_0_8_la-traversable.lo \ + libgee_0_8_la-treemap.lo libgee_0_8_la-treemultimap.lo \ + libgee_0_8_la-treemultiset.lo libgee_0_8_la-treeset.lo \ + libgee_0_8_la-unfolditerator.lo $(am__objects_1) +libgee_0_8_la_OBJECTS = $(am_libgee_0_8_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent -libgee_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ +libgee_0_8_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libgee_la_LDFLAGS) $(LDFLAGS) -o $@ + $(libgee_0_8_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -146,11 +195,18 @@ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; +VALACOMPILE = $(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS) +LTVALACOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(VALAC) $(AM_VALAFLAGS) \ + $(VALAFLAGS) +AM_V_VALAC = $(am__v_VALAC_@AM_V@) +am__v_VALAC_ = $(am__v_VALAC_@AM_DEFAULT_V@) +am__v_VALAC_0 = @echo " VALAC " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libgee_la_SOURCES) -DIST_SOURCES = $(libgee_la_SOURCES) +SOURCES = $(libgee_0_8_la_SOURCES) +DIST_SOURCES = $(libgee_0_8_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -300,21 +356,19 @@ GTESTER = gtester GTESTER_REPORT = gtester-report # initialize variables for unconditional += appending -EXTRA_DIST = $(libgee_la_VALASOURCES) gee-1.0.vapi Gee-1.0.gir \ - gee.vala.stamp +EXTRA_DIST = TEST_PROGS = -NULL = -AM_CPPFLAGS = \ - $(GLIB_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) -BUILT_SOURCES = gee.vala.stamp +# useful constants +NULL = lib_LTLIBRARIES = \ - libgee.la + libgee-0.8.la -libgee_la_VALASOURCES = \ +libgee_0_8_la_SOURCES = \ assemblyinfo.vala \ + abstractbidirlist.vala \ + abstractbidirsortedset.vala \ + abstractbidirsortedmap.vala \ abstractcollection.vala \ abstractlist.vala \ abstractmap.vala \ @@ -322,18 +376,31 @@ libgee_la_VALASOURCES = \ abstractmultiset.vala \ abstractqueue.vala \ abstractset.vala \ + abstractsortedmap.vala \ + abstractsortedset.vala \ arraylist.vala \ + arrayqueue.vala \ bidiriterator.vala \ + bidirlist.vala \ + bidirlistiterator.vala \ + bidirmapiterator.vala \ + bidirsortedset.vala \ + bidirsortedmap.vala \ collection.vala \ comparable.vala \ + concurrentlist.vala \ + concurrentset.vala \ deque.vala \ functions.vala \ + hashable.vala \ hashmap.vala \ hashmultimap.vala \ hashmultiset.vala \ hashset.vala \ + hazardpointer.vala \ iterable.vala \ iterator.vala \ + lazy.vala \ linkedlist.vala \ list.vala \ listiterator.vala \ @@ -343,75 +410,90 @@ libgee_la_VALASOURCES = \ multiset.vala \ priorityqueue.vala \ queue.vala \ + readonlybidirlist.vala \ + readonlybidirsortedset.vala \ + readonlybidirsortedmap.vala \ readonlycollection.vala \ readonlylist.vala \ readonlymap.vala \ + readonlymultimap.vala \ + readonlymultiset.vala \ readonlyset.vala \ + readonlysortedmap.vala \ + readonlysortedset.vala \ set.vala \ + sortedmap.vala \ sortedset.vala \ timsort.vala \ + traversable.vala \ treemap.vala \ treemultimap.vala \ treemultiset.vala \ treeset.vala \ + unfolditerator.vala \ $(NULL) -libgee_la_SOURCES = \ - gee.vala.stamp \ - $(libgee_la_VALASOURCES:.vala=.c) \ - $(NULL) - -geeincludedir = $(includedir)/gee-1.0 -geeinclude_HEADERS = \ - gee.h \ - $(NULL) - -AM_VALAFLAGS = \ - -H gee.h --vapi gee-1.0.vapi \ +libgee_0_8_la_VALAFLAGS = \ + -H gee.h --vapi gee-0.8.vapi \ -h gee-internals.h \ - --internal-vapi gee-internals-1.0.vapi \ - --library gee-1.0 --gir Gee-1.0.gir \ + --internal-vapi gee-internals-0.8.vapi \ + --library gee-0.8 --gir Gee-0.8.gir \ $(COVERAGE_VALAFLAGS) \ $(VALAFLAGS) \ $(NULL) -libgee_la_LIBADD = \ +libgee_0_8_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +libgee_0_8_la_LIBADD = \ $(GLIB_LIBS) \ $(COVERAGE_LIBS) \ $(NULL) -libgee_la_LDFLAGS = -version-info $(LIBGEE_LT_VERSION) -no-undefined +libgee_0_8_la_LDFLAGS = \ + -version-info $(LIBGEE_LT_VERSION) \ + -no-undefined \ + $(NULL) + +geeincludedir = $(includedir)/gee-0.8 +geeinclude_HEADERS = \ + gee.h \ + $(NULL) + vapidir = $(datadir)/vala/vapi dist_vapi_DATA = \ - gee-1.0.vapi \ + gee-0.8.vapi \ $(NULL) @HAVE_INTROSPECTION_TRUE@girdir = @INTROSPECTION_GIRDIR@ @HAVE_INTROSPECTION_TRUE@gir_DATA = \ -@HAVE_INTROSPECTION_TRUE@ Gee-1.0.gir \ +@HAVE_INTROSPECTION_TRUE@ Gee-0.8.gir \ @HAVE_INTROSPECTION_TRUE@ $(NULL) @HAVE_INTROSPECTION_TRUE@typelibdir = @INTROSPECTION_TYPELIBDIR@ @HAVE_INTROSPECTION_TRUE@typelib_DATA = \ -@HAVE_INTROSPECTION_TRUE@ Gee-1.0.typelib \ +@HAVE_INTROSPECTION_TRUE@ Gee-0.8.typelib \ @HAVE_INTROSPECTION_TRUE@ $(NULL) -MAINTAINERCLEANFILES = \ - $(libgee_la_VALASOURCES:.vala=.c) \ - gee.vala.stamp \ - gee-internals-1.0.vapi \ - gee-1.0.vapi \ - Gee-1.0.gir \ - gee.h \ - gee-internals.h \ - $(NULL) + +# Extract dlname from libfolks.la; see bug #658002. +# This is what g-ir-scanner does. +@HAVE_INTROSPECTION_TRUE@libgee_dlname = \ +@HAVE_INTROSPECTION_TRUE@ `$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" libgee-0.8.la` + +@HAVE_INTROSPECTION_TRUE@INTROSPECTION_COMPILER_ARGS = \ +@HAVE_INTROSPECTION_TRUE@ -l $(libgee_dlname) CLEANFILES = \ - Gee-1.0.typelib \ + gee-0.8.vapi \ + gee-internals-0.8.vapi \ + Gee-0.8.typelib \ + Gee-0.8.gir \ $(NULL) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -478,8 +560,8 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libgee.la: $(libgee_la_OBJECTS) $(libgee_la_DEPENDENCIES) $(EXTRA_libgee_la_DEPENDENCIES) - $(AM_V_CCLD)$(libgee_la_LINK) -rpath $(libdir) $(libgee_la_OBJECTS) $(libgee_la_LIBADD) $(LIBS) +libgee-0.8.la: $(libgee_0_8_la_OBJECTS) $(libgee_0_8_la_DEPENDENCIES) $(EXTRA_libgee_0_8_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgee_0_8_la_LINK) -rpath $(libdir) $(libgee_0_8_la_OBJECTS) $(libgee_0_8_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -487,46 +569,72 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractcollection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractlist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractmultimap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractmultiset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractqueue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abstractset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arraylist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assemblyinfo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bidiriterator.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comparable.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deque.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashmultimap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashmultiset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iterable.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iterator.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkedlist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listiterator.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapiterator.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multimap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/priorityqueue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readonlycollection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readonlylist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readonlymap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readonlyset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sortedset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timsort.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treemap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treemultimap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treemultiset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treeset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractbidirlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractbidirsortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractbidirsortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractcollection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractmultimap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractmultiset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractqueue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractsortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-abstractsortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-arraylist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-arrayqueue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-assemblyinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidiriterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidirlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidirlistiterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidirmapiterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidirsortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-bidirsortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-collection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-comparable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-concurrentlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-concurrentset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-deque.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-functions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hashable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hashmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hashmultimap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hashmultiset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hashset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-hazardpointer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-iterable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-iterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-lazy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-linkedlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-listiterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-mapiterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-multimap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-multiset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-priorityqueue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlybidirlist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlybidirsortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlybidirsortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlycollection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlylist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlymap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlymultimap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlymultiset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlyset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlysortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-readonlysortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-set.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-sortedmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-sortedset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-timsort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-traversable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-treemap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-treemultimap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-treemultiset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-treeset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgee_0_8_la-unfolditerator.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -549,6 +657,827 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +libgee_0_8_la-assemblyinfo.lo: assemblyinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-assemblyinfo.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-assemblyinfo.Tpo -c -o libgee_0_8_la-assemblyinfo.lo `test -f 'assemblyinfo.c' || echo '$(srcdir)/'`assemblyinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-assemblyinfo.Tpo $(DEPDIR)/libgee_0_8_la-assemblyinfo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='assemblyinfo.c' object='libgee_0_8_la-assemblyinfo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-assemblyinfo.lo `test -f 'assemblyinfo.c' || echo '$(srcdir)/'`assemblyinfo.c + +libgee_0_8_la-abstractbidirlist.lo: abstractbidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractbidirlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractbidirlist.Tpo -c -o libgee_0_8_la-abstractbidirlist.lo `test -f 'abstractbidirlist.c' || echo '$(srcdir)/'`abstractbidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractbidirlist.Tpo $(DEPDIR)/libgee_0_8_la-abstractbidirlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractbidirlist.c' object='libgee_0_8_la-abstractbidirlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractbidirlist.lo `test -f 'abstractbidirlist.c' || echo '$(srcdir)/'`abstractbidirlist.c + +libgee_0_8_la-abstractbidirsortedset.lo: abstractbidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractbidirsortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractbidirsortedset.Tpo -c -o libgee_0_8_la-abstractbidirsortedset.lo `test -f 'abstractbidirsortedset.c' || echo '$(srcdir)/'`abstractbidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractbidirsortedset.Tpo $(DEPDIR)/libgee_0_8_la-abstractbidirsortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractbidirsortedset.c' object='libgee_0_8_la-abstractbidirsortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractbidirsortedset.lo `test -f 'abstractbidirsortedset.c' || echo '$(srcdir)/'`abstractbidirsortedset.c + +libgee_0_8_la-abstractbidirsortedmap.lo: abstractbidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractbidirsortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractbidirsortedmap.Tpo -c -o libgee_0_8_la-abstractbidirsortedmap.lo `test -f 'abstractbidirsortedmap.c' || echo '$(srcdir)/'`abstractbidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractbidirsortedmap.Tpo $(DEPDIR)/libgee_0_8_la-abstractbidirsortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractbidirsortedmap.c' object='libgee_0_8_la-abstractbidirsortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractbidirsortedmap.lo `test -f 'abstractbidirsortedmap.c' || echo '$(srcdir)/'`abstractbidirsortedmap.c + +libgee_0_8_la-abstractcollection.lo: abstractcollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractcollection.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractcollection.Tpo -c -o libgee_0_8_la-abstractcollection.lo `test -f 'abstractcollection.c' || echo '$(srcdir)/'`abstractcollection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractcollection.Tpo $(DEPDIR)/libgee_0_8_la-abstractcollection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractcollection.c' object='libgee_0_8_la-abstractcollection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractcollection.lo `test -f 'abstractcollection.c' || echo '$(srcdir)/'`abstractcollection.c + +libgee_0_8_la-abstractlist.lo: abstractlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractlist.Tpo -c -o libgee_0_8_la-abstractlist.lo `test -f 'abstractlist.c' || echo '$(srcdir)/'`abstractlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractlist.Tpo $(DEPDIR)/libgee_0_8_la-abstractlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractlist.c' object='libgee_0_8_la-abstractlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractlist.lo `test -f 'abstractlist.c' || echo '$(srcdir)/'`abstractlist.c + +libgee_0_8_la-abstractmap.lo: abstractmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractmap.Tpo -c -o libgee_0_8_la-abstractmap.lo `test -f 'abstractmap.c' || echo '$(srcdir)/'`abstractmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractmap.Tpo $(DEPDIR)/libgee_0_8_la-abstractmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractmap.c' object='libgee_0_8_la-abstractmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractmap.lo `test -f 'abstractmap.c' || echo '$(srcdir)/'`abstractmap.c + +libgee_0_8_la-abstractmultimap.lo: abstractmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractmultimap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractmultimap.Tpo -c -o libgee_0_8_la-abstractmultimap.lo `test -f 'abstractmultimap.c' || echo '$(srcdir)/'`abstractmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractmultimap.Tpo $(DEPDIR)/libgee_0_8_la-abstractmultimap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractmultimap.c' object='libgee_0_8_la-abstractmultimap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractmultimap.lo `test -f 'abstractmultimap.c' || echo '$(srcdir)/'`abstractmultimap.c + +libgee_0_8_la-abstractmultiset.lo: abstractmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractmultiset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractmultiset.Tpo -c -o libgee_0_8_la-abstractmultiset.lo `test -f 'abstractmultiset.c' || echo '$(srcdir)/'`abstractmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractmultiset.Tpo $(DEPDIR)/libgee_0_8_la-abstractmultiset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractmultiset.c' object='libgee_0_8_la-abstractmultiset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractmultiset.lo `test -f 'abstractmultiset.c' || echo '$(srcdir)/'`abstractmultiset.c + +libgee_0_8_la-abstractqueue.lo: abstractqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractqueue.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractqueue.Tpo -c -o libgee_0_8_la-abstractqueue.lo `test -f 'abstractqueue.c' || echo '$(srcdir)/'`abstractqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractqueue.Tpo $(DEPDIR)/libgee_0_8_la-abstractqueue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractqueue.c' object='libgee_0_8_la-abstractqueue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractqueue.lo `test -f 'abstractqueue.c' || echo '$(srcdir)/'`abstractqueue.c + +libgee_0_8_la-abstractset.lo: abstractset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractset.Tpo -c -o libgee_0_8_la-abstractset.lo `test -f 'abstractset.c' || echo '$(srcdir)/'`abstractset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractset.Tpo $(DEPDIR)/libgee_0_8_la-abstractset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractset.c' object='libgee_0_8_la-abstractset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractset.lo `test -f 'abstractset.c' || echo '$(srcdir)/'`abstractset.c + +libgee_0_8_la-abstractsortedmap.lo: abstractsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractsortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractsortedmap.Tpo -c -o libgee_0_8_la-abstractsortedmap.lo `test -f 'abstractsortedmap.c' || echo '$(srcdir)/'`abstractsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractsortedmap.Tpo $(DEPDIR)/libgee_0_8_la-abstractsortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractsortedmap.c' object='libgee_0_8_la-abstractsortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractsortedmap.lo `test -f 'abstractsortedmap.c' || echo '$(srcdir)/'`abstractsortedmap.c + +libgee_0_8_la-abstractsortedset.lo: abstractsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-abstractsortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-abstractsortedset.Tpo -c -o libgee_0_8_la-abstractsortedset.lo `test -f 'abstractsortedset.c' || echo '$(srcdir)/'`abstractsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-abstractsortedset.Tpo $(DEPDIR)/libgee_0_8_la-abstractsortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='abstractsortedset.c' object='libgee_0_8_la-abstractsortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-abstractsortedset.lo `test -f 'abstractsortedset.c' || echo '$(srcdir)/'`abstractsortedset.c + +libgee_0_8_la-arraylist.lo: arraylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-arraylist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-arraylist.Tpo -c -o libgee_0_8_la-arraylist.lo `test -f 'arraylist.c' || echo '$(srcdir)/'`arraylist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-arraylist.Tpo $(DEPDIR)/libgee_0_8_la-arraylist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arraylist.c' object='libgee_0_8_la-arraylist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-arraylist.lo `test -f 'arraylist.c' || echo '$(srcdir)/'`arraylist.c + +libgee_0_8_la-arrayqueue.lo: arrayqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-arrayqueue.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-arrayqueue.Tpo -c -o libgee_0_8_la-arrayqueue.lo `test -f 'arrayqueue.c' || echo '$(srcdir)/'`arrayqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-arrayqueue.Tpo $(DEPDIR)/libgee_0_8_la-arrayqueue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arrayqueue.c' object='libgee_0_8_la-arrayqueue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-arrayqueue.lo `test -f 'arrayqueue.c' || echo '$(srcdir)/'`arrayqueue.c + +libgee_0_8_la-bidiriterator.lo: bidiriterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidiriterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidiriterator.Tpo -c -o libgee_0_8_la-bidiriterator.lo `test -f 'bidiriterator.c' || echo '$(srcdir)/'`bidiriterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidiriterator.Tpo $(DEPDIR)/libgee_0_8_la-bidiriterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidiriterator.c' object='libgee_0_8_la-bidiriterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidiriterator.lo `test -f 'bidiriterator.c' || echo '$(srcdir)/'`bidiriterator.c + +libgee_0_8_la-bidirlist.lo: bidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidirlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidirlist.Tpo -c -o libgee_0_8_la-bidirlist.lo `test -f 'bidirlist.c' || echo '$(srcdir)/'`bidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidirlist.Tpo $(DEPDIR)/libgee_0_8_la-bidirlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidirlist.c' object='libgee_0_8_la-bidirlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidirlist.lo `test -f 'bidirlist.c' || echo '$(srcdir)/'`bidirlist.c + +libgee_0_8_la-bidirlistiterator.lo: bidirlistiterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidirlistiterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidirlistiterator.Tpo -c -o libgee_0_8_la-bidirlistiterator.lo `test -f 'bidirlistiterator.c' || echo '$(srcdir)/'`bidirlistiterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidirlistiterator.Tpo $(DEPDIR)/libgee_0_8_la-bidirlistiterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidirlistiterator.c' object='libgee_0_8_la-bidirlistiterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidirlistiterator.lo `test -f 'bidirlistiterator.c' || echo '$(srcdir)/'`bidirlistiterator.c + +libgee_0_8_la-bidirmapiterator.lo: bidirmapiterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidirmapiterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidirmapiterator.Tpo -c -o libgee_0_8_la-bidirmapiterator.lo `test -f 'bidirmapiterator.c' || echo '$(srcdir)/'`bidirmapiterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidirmapiterator.Tpo $(DEPDIR)/libgee_0_8_la-bidirmapiterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidirmapiterator.c' object='libgee_0_8_la-bidirmapiterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidirmapiterator.lo `test -f 'bidirmapiterator.c' || echo '$(srcdir)/'`bidirmapiterator.c + +libgee_0_8_la-bidirsortedset.lo: bidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidirsortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidirsortedset.Tpo -c -o libgee_0_8_la-bidirsortedset.lo `test -f 'bidirsortedset.c' || echo '$(srcdir)/'`bidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidirsortedset.Tpo $(DEPDIR)/libgee_0_8_la-bidirsortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidirsortedset.c' object='libgee_0_8_la-bidirsortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidirsortedset.lo `test -f 'bidirsortedset.c' || echo '$(srcdir)/'`bidirsortedset.c + +libgee_0_8_la-bidirsortedmap.lo: bidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-bidirsortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-bidirsortedmap.Tpo -c -o libgee_0_8_la-bidirsortedmap.lo `test -f 'bidirsortedmap.c' || echo '$(srcdir)/'`bidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-bidirsortedmap.Tpo $(DEPDIR)/libgee_0_8_la-bidirsortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bidirsortedmap.c' object='libgee_0_8_la-bidirsortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-bidirsortedmap.lo `test -f 'bidirsortedmap.c' || echo '$(srcdir)/'`bidirsortedmap.c + +libgee_0_8_la-collection.lo: collection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-collection.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-collection.Tpo -c -o libgee_0_8_la-collection.lo `test -f 'collection.c' || echo '$(srcdir)/'`collection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-collection.Tpo $(DEPDIR)/libgee_0_8_la-collection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collection.c' object='libgee_0_8_la-collection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-collection.lo `test -f 'collection.c' || echo '$(srcdir)/'`collection.c + +libgee_0_8_la-comparable.lo: comparable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-comparable.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-comparable.Tpo -c -o libgee_0_8_la-comparable.lo `test -f 'comparable.c' || echo '$(srcdir)/'`comparable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-comparable.Tpo $(DEPDIR)/libgee_0_8_la-comparable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comparable.c' object='libgee_0_8_la-comparable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-comparable.lo `test -f 'comparable.c' || echo '$(srcdir)/'`comparable.c + +libgee_0_8_la-concurrentlist.lo: concurrentlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-concurrentlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-concurrentlist.Tpo -c -o libgee_0_8_la-concurrentlist.lo `test -f 'concurrentlist.c' || echo '$(srcdir)/'`concurrentlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-concurrentlist.Tpo $(DEPDIR)/libgee_0_8_la-concurrentlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrentlist.c' object='libgee_0_8_la-concurrentlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-concurrentlist.lo `test -f 'concurrentlist.c' || echo '$(srcdir)/'`concurrentlist.c + +libgee_0_8_la-concurrentset.lo: concurrentset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-concurrentset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-concurrentset.Tpo -c -o libgee_0_8_la-concurrentset.lo `test -f 'concurrentset.c' || echo '$(srcdir)/'`concurrentset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-concurrentset.Tpo $(DEPDIR)/libgee_0_8_la-concurrentset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrentset.c' object='libgee_0_8_la-concurrentset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-concurrentset.lo `test -f 'concurrentset.c' || echo '$(srcdir)/'`concurrentset.c + +libgee_0_8_la-deque.lo: deque.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-deque.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-deque.Tpo -c -o libgee_0_8_la-deque.lo `test -f 'deque.c' || echo '$(srcdir)/'`deque.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-deque.Tpo $(DEPDIR)/libgee_0_8_la-deque.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='deque.c' object='libgee_0_8_la-deque.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-deque.lo `test -f 'deque.c' || echo '$(srcdir)/'`deque.c + +libgee_0_8_la-functions.lo: functions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-functions.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-functions.Tpo -c -o libgee_0_8_la-functions.lo `test -f 'functions.c' || echo '$(srcdir)/'`functions.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-functions.Tpo $(DEPDIR)/libgee_0_8_la-functions.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='functions.c' object='libgee_0_8_la-functions.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-functions.lo `test -f 'functions.c' || echo '$(srcdir)/'`functions.c + +libgee_0_8_la-hashable.lo: hashable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hashable.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hashable.Tpo -c -o libgee_0_8_la-hashable.lo `test -f 'hashable.c' || echo '$(srcdir)/'`hashable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hashable.Tpo $(DEPDIR)/libgee_0_8_la-hashable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashable.c' object='libgee_0_8_la-hashable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hashable.lo `test -f 'hashable.c' || echo '$(srcdir)/'`hashable.c + +libgee_0_8_la-hashmap.lo: hashmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hashmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hashmap.Tpo -c -o libgee_0_8_la-hashmap.lo `test -f 'hashmap.c' || echo '$(srcdir)/'`hashmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hashmap.Tpo $(DEPDIR)/libgee_0_8_la-hashmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashmap.c' object='libgee_0_8_la-hashmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hashmap.lo `test -f 'hashmap.c' || echo '$(srcdir)/'`hashmap.c + +libgee_0_8_la-hashmultimap.lo: hashmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hashmultimap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hashmultimap.Tpo -c -o libgee_0_8_la-hashmultimap.lo `test -f 'hashmultimap.c' || echo '$(srcdir)/'`hashmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hashmultimap.Tpo $(DEPDIR)/libgee_0_8_la-hashmultimap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashmultimap.c' object='libgee_0_8_la-hashmultimap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hashmultimap.lo `test -f 'hashmultimap.c' || echo '$(srcdir)/'`hashmultimap.c + +libgee_0_8_la-hashmultiset.lo: hashmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hashmultiset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hashmultiset.Tpo -c -o libgee_0_8_la-hashmultiset.lo `test -f 'hashmultiset.c' || echo '$(srcdir)/'`hashmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hashmultiset.Tpo $(DEPDIR)/libgee_0_8_la-hashmultiset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashmultiset.c' object='libgee_0_8_la-hashmultiset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hashmultiset.lo `test -f 'hashmultiset.c' || echo '$(srcdir)/'`hashmultiset.c + +libgee_0_8_la-hashset.lo: hashset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hashset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hashset.Tpo -c -o libgee_0_8_la-hashset.lo `test -f 'hashset.c' || echo '$(srcdir)/'`hashset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hashset.Tpo $(DEPDIR)/libgee_0_8_la-hashset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashset.c' object='libgee_0_8_la-hashset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hashset.lo `test -f 'hashset.c' || echo '$(srcdir)/'`hashset.c + +libgee_0_8_la-hazardpointer.lo: hazardpointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-hazardpointer.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-hazardpointer.Tpo -c -o libgee_0_8_la-hazardpointer.lo `test -f 'hazardpointer.c' || echo '$(srcdir)/'`hazardpointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-hazardpointer.Tpo $(DEPDIR)/libgee_0_8_la-hazardpointer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hazardpointer.c' object='libgee_0_8_la-hazardpointer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-hazardpointer.lo `test -f 'hazardpointer.c' || echo '$(srcdir)/'`hazardpointer.c + +libgee_0_8_la-iterable.lo: iterable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-iterable.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-iterable.Tpo -c -o libgee_0_8_la-iterable.lo `test -f 'iterable.c' || echo '$(srcdir)/'`iterable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-iterable.Tpo $(DEPDIR)/libgee_0_8_la-iterable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iterable.c' object='libgee_0_8_la-iterable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-iterable.lo `test -f 'iterable.c' || echo '$(srcdir)/'`iterable.c + +libgee_0_8_la-iterator.lo: iterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-iterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-iterator.Tpo -c -o libgee_0_8_la-iterator.lo `test -f 'iterator.c' || echo '$(srcdir)/'`iterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-iterator.Tpo $(DEPDIR)/libgee_0_8_la-iterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iterator.c' object='libgee_0_8_la-iterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-iterator.lo `test -f 'iterator.c' || echo '$(srcdir)/'`iterator.c + +libgee_0_8_la-lazy.lo: lazy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-lazy.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-lazy.Tpo -c -o libgee_0_8_la-lazy.lo `test -f 'lazy.c' || echo '$(srcdir)/'`lazy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-lazy.Tpo $(DEPDIR)/libgee_0_8_la-lazy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lazy.c' object='libgee_0_8_la-lazy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-lazy.lo `test -f 'lazy.c' || echo '$(srcdir)/'`lazy.c + +libgee_0_8_la-linkedlist.lo: linkedlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-linkedlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-linkedlist.Tpo -c -o libgee_0_8_la-linkedlist.lo `test -f 'linkedlist.c' || echo '$(srcdir)/'`linkedlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-linkedlist.Tpo $(DEPDIR)/libgee_0_8_la-linkedlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linkedlist.c' object='libgee_0_8_la-linkedlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-linkedlist.lo `test -f 'linkedlist.c' || echo '$(srcdir)/'`linkedlist.c + +libgee_0_8_la-list.lo: list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-list.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-list.Tpo -c -o libgee_0_8_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-list.Tpo $(DEPDIR)/libgee_0_8_la-list.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list.c' object='libgee_0_8_la-list.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c + +libgee_0_8_la-listiterator.lo: listiterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-listiterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-listiterator.Tpo -c -o libgee_0_8_la-listiterator.lo `test -f 'listiterator.c' || echo '$(srcdir)/'`listiterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-listiterator.Tpo $(DEPDIR)/libgee_0_8_la-listiterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='listiterator.c' object='libgee_0_8_la-listiterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-listiterator.lo `test -f 'listiterator.c' || echo '$(srcdir)/'`listiterator.c + +libgee_0_8_la-map.lo: map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-map.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-map.Tpo -c -o libgee_0_8_la-map.lo `test -f 'map.c' || echo '$(srcdir)/'`map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-map.Tpo $(DEPDIR)/libgee_0_8_la-map.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map.c' object='libgee_0_8_la-map.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-map.lo `test -f 'map.c' || echo '$(srcdir)/'`map.c + +libgee_0_8_la-mapiterator.lo: mapiterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-mapiterator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-mapiterator.Tpo -c -o libgee_0_8_la-mapiterator.lo `test -f 'mapiterator.c' || echo '$(srcdir)/'`mapiterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-mapiterator.Tpo $(DEPDIR)/libgee_0_8_la-mapiterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mapiterator.c' object='libgee_0_8_la-mapiterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-mapiterator.lo `test -f 'mapiterator.c' || echo '$(srcdir)/'`mapiterator.c + +libgee_0_8_la-multimap.lo: multimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-multimap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-multimap.Tpo -c -o libgee_0_8_la-multimap.lo `test -f 'multimap.c' || echo '$(srcdir)/'`multimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-multimap.Tpo $(DEPDIR)/libgee_0_8_la-multimap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='multimap.c' object='libgee_0_8_la-multimap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-multimap.lo `test -f 'multimap.c' || echo '$(srcdir)/'`multimap.c + +libgee_0_8_la-multiset.lo: multiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-multiset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-multiset.Tpo -c -o libgee_0_8_la-multiset.lo `test -f 'multiset.c' || echo '$(srcdir)/'`multiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-multiset.Tpo $(DEPDIR)/libgee_0_8_la-multiset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='multiset.c' object='libgee_0_8_la-multiset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-multiset.lo `test -f 'multiset.c' || echo '$(srcdir)/'`multiset.c + +libgee_0_8_la-priorityqueue.lo: priorityqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-priorityqueue.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-priorityqueue.Tpo -c -o libgee_0_8_la-priorityqueue.lo `test -f 'priorityqueue.c' || echo '$(srcdir)/'`priorityqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-priorityqueue.Tpo $(DEPDIR)/libgee_0_8_la-priorityqueue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='priorityqueue.c' object='libgee_0_8_la-priorityqueue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-priorityqueue.lo `test -f 'priorityqueue.c' || echo '$(srcdir)/'`priorityqueue.c + +libgee_0_8_la-queue.lo: queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-queue.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-queue.Tpo -c -o libgee_0_8_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-queue.Tpo $(DEPDIR)/libgee_0_8_la-queue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='libgee_0_8_la-queue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c + +libgee_0_8_la-readonlybidirlist.lo: readonlybidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlybidirlist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlybidirlist.Tpo -c -o libgee_0_8_la-readonlybidirlist.lo `test -f 'readonlybidirlist.c' || echo '$(srcdir)/'`readonlybidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlybidirlist.Tpo $(DEPDIR)/libgee_0_8_la-readonlybidirlist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlybidirlist.c' object='libgee_0_8_la-readonlybidirlist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlybidirlist.lo `test -f 'readonlybidirlist.c' || echo '$(srcdir)/'`readonlybidirlist.c + +libgee_0_8_la-readonlybidirsortedset.lo: readonlybidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlybidirsortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlybidirsortedset.Tpo -c -o libgee_0_8_la-readonlybidirsortedset.lo `test -f 'readonlybidirsortedset.c' || echo '$(srcdir)/'`readonlybidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlybidirsortedset.Tpo $(DEPDIR)/libgee_0_8_la-readonlybidirsortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlybidirsortedset.c' object='libgee_0_8_la-readonlybidirsortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlybidirsortedset.lo `test -f 'readonlybidirsortedset.c' || echo '$(srcdir)/'`readonlybidirsortedset.c + +libgee_0_8_la-readonlybidirsortedmap.lo: readonlybidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlybidirsortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlybidirsortedmap.Tpo -c -o libgee_0_8_la-readonlybidirsortedmap.lo `test -f 'readonlybidirsortedmap.c' || echo '$(srcdir)/'`readonlybidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlybidirsortedmap.Tpo $(DEPDIR)/libgee_0_8_la-readonlybidirsortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlybidirsortedmap.c' object='libgee_0_8_la-readonlybidirsortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlybidirsortedmap.lo `test -f 'readonlybidirsortedmap.c' || echo '$(srcdir)/'`readonlybidirsortedmap.c + +libgee_0_8_la-readonlycollection.lo: readonlycollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlycollection.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlycollection.Tpo -c -o libgee_0_8_la-readonlycollection.lo `test -f 'readonlycollection.c' || echo '$(srcdir)/'`readonlycollection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlycollection.Tpo $(DEPDIR)/libgee_0_8_la-readonlycollection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlycollection.c' object='libgee_0_8_la-readonlycollection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlycollection.lo `test -f 'readonlycollection.c' || echo '$(srcdir)/'`readonlycollection.c + +libgee_0_8_la-readonlylist.lo: readonlylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlylist.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlylist.Tpo -c -o libgee_0_8_la-readonlylist.lo `test -f 'readonlylist.c' || echo '$(srcdir)/'`readonlylist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlylist.Tpo $(DEPDIR)/libgee_0_8_la-readonlylist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlylist.c' object='libgee_0_8_la-readonlylist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlylist.lo `test -f 'readonlylist.c' || echo '$(srcdir)/'`readonlylist.c + +libgee_0_8_la-readonlymap.lo: readonlymap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlymap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlymap.Tpo -c -o libgee_0_8_la-readonlymap.lo `test -f 'readonlymap.c' || echo '$(srcdir)/'`readonlymap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlymap.Tpo $(DEPDIR)/libgee_0_8_la-readonlymap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlymap.c' object='libgee_0_8_la-readonlymap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlymap.lo `test -f 'readonlymap.c' || echo '$(srcdir)/'`readonlymap.c + +libgee_0_8_la-readonlymultimap.lo: readonlymultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlymultimap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlymultimap.Tpo -c -o libgee_0_8_la-readonlymultimap.lo `test -f 'readonlymultimap.c' || echo '$(srcdir)/'`readonlymultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlymultimap.Tpo $(DEPDIR)/libgee_0_8_la-readonlymultimap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlymultimap.c' object='libgee_0_8_la-readonlymultimap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlymultimap.lo `test -f 'readonlymultimap.c' || echo '$(srcdir)/'`readonlymultimap.c + +libgee_0_8_la-readonlymultiset.lo: readonlymultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlymultiset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlymultiset.Tpo -c -o libgee_0_8_la-readonlymultiset.lo `test -f 'readonlymultiset.c' || echo '$(srcdir)/'`readonlymultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlymultiset.Tpo $(DEPDIR)/libgee_0_8_la-readonlymultiset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlymultiset.c' object='libgee_0_8_la-readonlymultiset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlymultiset.lo `test -f 'readonlymultiset.c' || echo '$(srcdir)/'`readonlymultiset.c + +libgee_0_8_la-readonlyset.lo: readonlyset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlyset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlyset.Tpo -c -o libgee_0_8_la-readonlyset.lo `test -f 'readonlyset.c' || echo '$(srcdir)/'`readonlyset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlyset.Tpo $(DEPDIR)/libgee_0_8_la-readonlyset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlyset.c' object='libgee_0_8_la-readonlyset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlyset.lo `test -f 'readonlyset.c' || echo '$(srcdir)/'`readonlyset.c + +libgee_0_8_la-readonlysortedmap.lo: readonlysortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlysortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlysortedmap.Tpo -c -o libgee_0_8_la-readonlysortedmap.lo `test -f 'readonlysortedmap.c' || echo '$(srcdir)/'`readonlysortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlysortedmap.Tpo $(DEPDIR)/libgee_0_8_la-readonlysortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlysortedmap.c' object='libgee_0_8_la-readonlysortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlysortedmap.lo `test -f 'readonlysortedmap.c' || echo '$(srcdir)/'`readonlysortedmap.c + +libgee_0_8_la-readonlysortedset.lo: readonlysortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-readonlysortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-readonlysortedset.Tpo -c -o libgee_0_8_la-readonlysortedset.lo `test -f 'readonlysortedset.c' || echo '$(srcdir)/'`readonlysortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-readonlysortedset.Tpo $(DEPDIR)/libgee_0_8_la-readonlysortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readonlysortedset.c' object='libgee_0_8_la-readonlysortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-readonlysortedset.lo `test -f 'readonlysortedset.c' || echo '$(srcdir)/'`readonlysortedset.c + +libgee_0_8_la-set.lo: set.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-set.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-set.Tpo -c -o libgee_0_8_la-set.lo `test -f 'set.c' || echo '$(srcdir)/'`set.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-set.Tpo $(DEPDIR)/libgee_0_8_la-set.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set.c' object='libgee_0_8_la-set.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-set.lo `test -f 'set.c' || echo '$(srcdir)/'`set.c + +libgee_0_8_la-sortedmap.lo: sortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-sortedmap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-sortedmap.Tpo -c -o libgee_0_8_la-sortedmap.lo `test -f 'sortedmap.c' || echo '$(srcdir)/'`sortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-sortedmap.Tpo $(DEPDIR)/libgee_0_8_la-sortedmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sortedmap.c' object='libgee_0_8_la-sortedmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-sortedmap.lo `test -f 'sortedmap.c' || echo '$(srcdir)/'`sortedmap.c + +libgee_0_8_la-sortedset.lo: sortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-sortedset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-sortedset.Tpo -c -o libgee_0_8_la-sortedset.lo `test -f 'sortedset.c' || echo '$(srcdir)/'`sortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-sortedset.Tpo $(DEPDIR)/libgee_0_8_la-sortedset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sortedset.c' object='libgee_0_8_la-sortedset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-sortedset.lo `test -f 'sortedset.c' || echo '$(srcdir)/'`sortedset.c + +libgee_0_8_la-timsort.lo: timsort.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-timsort.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-timsort.Tpo -c -o libgee_0_8_la-timsort.lo `test -f 'timsort.c' || echo '$(srcdir)/'`timsort.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-timsort.Tpo $(DEPDIR)/libgee_0_8_la-timsort.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timsort.c' object='libgee_0_8_la-timsort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-timsort.lo `test -f 'timsort.c' || echo '$(srcdir)/'`timsort.c + +libgee_0_8_la-traversable.lo: traversable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-traversable.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-traversable.Tpo -c -o libgee_0_8_la-traversable.lo `test -f 'traversable.c' || echo '$(srcdir)/'`traversable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-traversable.Tpo $(DEPDIR)/libgee_0_8_la-traversable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='traversable.c' object='libgee_0_8_la-traversable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-traversable.lo `test -f 'traversable.c' || echo '$(srcdir)/'`traversable.c + +libgee_0_8_la-treemap.lo: treemap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-treemap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-treemap.Tpo -c -o libgee_0_8_la-treemap.lo `test -f 'treemap.c' || echo '$(srcdir)/'`treemap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-treemap.Tpo $(DEPDIR)/libgee_0_8_la-treemap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='treemap.c' object='libgee_0_8_la-treemap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-treemap.lo `test -f 'treemap.c' || echo '$(srcdir)/'`treemap.c + +libgee_0_8_la-treemultimap.lo: treemultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-treemultimap.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-treemultimap.Tpo -c -o libgee_0_8_la-treemultimap.lo `test -f 'treemultimap.c' || echo '$(srcdir)/'`treemultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-treemultimap.Tpo $(DEPDIR)/libgee_0_8_la-treemultimap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='treemultimap.c' object='libgee_0_8_la-treemultimap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-treemultimap.lo `test -f 'treemultimap.c' || echo '$(srcdir)/'`treemultimap.c + +libgee_0_8_la-treemultiset.lo: treemultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-treemultiset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-treemultiset.Tpo -c -o libgee_0_8_la-treemultiset.lo `test -f 'treemultiset.c' || echo '$(srcdir)/'`treemultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-treemultiset.Tpo $(DEPDIR)/libgee_0_8_la-treemultiset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='treemultiset.c' object='libgee_0_8_la-treemultiset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-treemultiset.lo `test -f 'treemultiset.c' || echo '$(srcdir)/'`treemultiset.c + +libgee_0_8_la-treeset.lo: treeset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-treeset.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-treeset.Tpo -c -o libgee_0_8_la-treeset.lo `test -f 'treeset.c' || echo '$(srcdir)/'`treeset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-treeset.Tpo $(DEPDIR)/libgee_0_8_la-treeset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='treeset.c' object='libgee_0_8_la-treeset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-treeset.lo `test -f 'treeset.c' || echo '$(srcdir)/'`treeset.c + +libgee_0_8_la-unfolditerator.lo: unfolditerator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgee_0_8_la-unfolditerator.lo -MD -MP -MF $(DEPDIR)/libgee_0_8_la-unfolditerator.Tpo -c -o libgee_0_8_la-unfolditerator.lo `test -f 'unfolditerator.c' || echo '$(srcdir)/'`unfolditerator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgee_0_8_la-unfolditerator.Tpo $(DEPDIR)/libgee_0_8_la-unfolditerator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unfolditerator.c' object='libgee_0_8_la-unfolditerator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgee_0_8_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgee_0_8_la-unfolditerator.lo `test -f 'unfolditerator.c' || echo '$(srcdir)/'`unfolditerator.c +$(srcdir)/assemblyinfo.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractbidirlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractbidirsortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractbidirsortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractcollection.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractmultimap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractmultiset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractqueue.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractsortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/abstractsortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/arraylist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/arrayqueue.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidiriterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidirlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidirlistiterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidirmapiterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidirsortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/bidirsortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/collection.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/comparable.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/concurrentlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/concurrentset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/deque.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/functions.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hashable.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hashmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hashmultimap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hashmultiset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hashset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/hazardpointer.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/iterable.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/iterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/lazy.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/linkedlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/list.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/listiterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/map.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/mapiterator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/multimap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/multiset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/priorityqueue.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/queue.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlybidirlist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlybidirsortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlybidirsortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlycollection.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlylist.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlymap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlymultimap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlymultiset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlyset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlysortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/readonlysortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/set.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/sortedmap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/sortedset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/timsort.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/traversable.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/treemap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/treemultimap.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/treemultiset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/treeset.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/unfolditerator.c: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/gee.h: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/gee-0.8.vapi: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/gee-internals.h: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/gee-internals-0.8.vapi: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/Gee-0.8.gir: $(srcdir)/libgee_0_8_la_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/libgee_0_8_la_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/libgee_0_8_la_vala.stamp; \ + fi +$(srcdir)/libgee_0_8_la_vala.stamp: assemblyinfo.vala abstractbidirlist.vala abstractbidirsortedset.vala abstractbidirsortedmap.vala abstractcollection.vala abstractlist.vala abstractmap.vala abstractmultimap.vala abstractmultiset.vala abstractqueue.vala abstractset.vala abstractsortedmap.vala abstractsortedset.vala arraylist.vala arrayqueue.vala bidiriterator.vala bidirlist.vala bidirlistiterator.vala bidirmapiterator.vala bidirsortedset.vala bidirsortedmap.vala collection.vala comparable.vala concurrentlist.vala concurrentset.vala deque.vala functions.vala hashable.vala hashmap.vala hashmultimap.vala hashmultiset.vala hashset.vala hazardpointer.vala iterable.vala iterator.vala lazy.vala linkedlist.vala list.vala listiterator.vala map.vala mapiterator.vala multimap.vala multiset.vala priorityqueue.vala queue.vala readonlybidirlist.vala readonlybidirsortedset.vala readonlybidirsortedmap.vala readonlycollection.vala readonlylist.vala readonlymap.vala readonlymultimap.vala readonlymultiset.vala readonlyset.vala readonlysortedmap.vala readonlysortedset.vala set.vala sortedmap.vala sortedset.vala timsort.vala traversable.vala treemap.vala treemultimap.vala treemultiset.vala treeset.vala unfolditerator.vala + $(AM_V_at)rm -f $@ && echo stamp > $@-t + $(AM_V_VALAC)$(am__cd) $(srcdir) && $(VALAC) $(libgee_0_8_la_VALAFLAGS) $(VALAFLAGS) -C assemblyinfo.vala abstractbidirlist.vala abstractbidirsortedset.vala abstractbidirsortedmap.vala abstractcollection.vala abstractlist.vala abstractmap.vala abstractmultimap.vala abstractmultiset.vala abstractqueue.vala abstractset.vala abstractsortedmap.vala abstractsortedset.vala arraylist.vala arrayqueue.vala bidiriterator.vala bidirlist.vala bidirlistiterator.vala bidirmapiterator.vala bidirsortedset.vala bidirsortedmap.vala collection.vala comparable.vala concurrentlist.vala concurrentset.vala deque.vala functions.vala hashable.vala hashmap.vala hashmultimap.vala hashmultiset.vala hashset.vala hazardpointer.vala iterable.vala iterator.vala lazy.vala linkedlist.vala list.vala listiterator.vala map.vala mapiterator.vala multimap.vala multiset.vala priorityqueue.vala queue.vala readonlybidirlist.vala readonlybidirsortedset.vala readonlybidirsortedmap.vala readonlycollection.vala readonlylist.vala readonlymap.vala readonlymultimap.vala readonlymultiset.vala readonlyset.vala readonlysortedmap.vala readonlysortedset.vala set.vala sortedmap.vala sortedset.vala timsort.vala traversable.vala treemap.vala treemultimap.vala treemultiset.vala treeset.vala unfolditerator.vala + $(AM_V_at)mv -f $@-t $@ + mostlyclean-libtool: -rm -f *.lo @@ -723,15 +1652,13 @@ distdir: $(DISTFILES) done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am +check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(geeincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am +install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -762,8 +1689,78 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -rm -f Gee-0.8.gir + -rm -f abstractbidirlist.c + -rm -f abstractbidirsortedmap.c + -rm -f abstractbidirsortedset.c + -rm -f abstractcollection.c + -rm -f abstractlist.c + -rm -f abstractmap.c + -rm -f abstractmultimap.c + -rm -f abstractmultiset.c + -rm -f abstractqueue.c + -rm -f abstractset.c + -rm -f abstractsortedmap.c + -rm -f abstractsortedset.c + -rm -f arraylist.c + -rm -f arrayqueue.c + -rm -f assemblyinfo.c + -rm -f bidiriterator.c + -rm -f bidirlist.c + -rm -f bidirlistiterator.c + -rm -f bidirmapiterator.c + -rm -f bidirsortedmap.c + -rm -f bidirsortedset.c + -rm -f collection.c + -rm -f comparable.c + -rm -f concurrentlist.c + -rm -f concurrentset.c + -rm -f deque.c + -rm -f functions.c + -rm -f gee-0.8.vapi + -rm -f gee-internals-0.8.vapi + -rm -f gee-internals.h + -rm -f gee.h + -rm -f hashable.c + -rm -f hashmap.c + -rm -f hashmultimap.c + -rm -f hashmultiset.c + -rm -f hashset.c + -rm -f hazardpointer.c + -rm -f iterable.c + -rm -f iterator.c + -rm -f lazy.c + -rm -f libgee_0_8_la_vala.stamp + -rm -f linkedlist.c + -rm -f list.c + -rm -f listiterator.c + -rm -f map.c + -rm -f mapiterator.c + -rm -f multimap.c + -rm -f multiset.c + -rm -f priorityqueue.c + -rm -f queue.c + -rm -f readonlybidirlist.c + -rm -f readonlybidirsortedmap.c + -rm -f readonlybidirsortedset.c + -rm -f readonlycollection.c + -rm -f readonlylist.c + -rm -f readonlymap.c + -rm -f readonlymultimap.c + -rm -f readonlymultiset.c + -rm -f readonlyset.c + -rm -f readonlysortedmap.c + -rm -f readonlysortedset.c + -rm -f set.c + -rm -f sortedmap.c + -rm -f sortedset.c + -rm -f timsort.c + -rm -f traversable.c + -rm -f treemap.c + -rm -f treemultimap.c + -rm -f treemultiset.c + -rm -f treeset.c + -rm -f unfolditerator.c clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ @@ -838,7 +1835,7 @@ uninstall-am: uninstall-dist_vapiDATA uninstall-geeincludeHEADERS \ uninstall-girDATA uninstall-libLTLIBRARIES \ uninstall-typelibDATA -.MAKE: all check check-am install install-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libLTLIBRARIES clean-libtool ctags \ @@ -908,13 +1905,10 @@ test-report perf-report full-report: ${TEST_PROGS} # run make test as part of make check check-local: test $(NULL) +@HAVE_INTROSPECTION_TRUE@Gee-0.8.typelib: Gee-0.8.gir +@HAVE_INTROSPECTION_TRUE@ @INTROSPECTION_COMPILER@ $(INTROSPECTION_COMPILER_ARGS) -o $@ $^ -Gee-1.0.gir gee-internals-1.0.vapi gee-1.0.vapi gee.vala.stamp: $(libgee_la_VALASOURCES) - $(VALAC) -C $(AM_VALAFLAGS) $^ - touch $@ - -@HAVE_INTROSPECTION_TRUE@Gee-1.0.typelib: Gee-1.0.gir -@HAVE_INTROSPECTION_TRUE@ @INTROSPECTION_COMPILER@ -o $@ $^ +Gee-0.8.gir gee-internals-0.8.vapi gee-0.8.vapi: libgee-0.8.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gee/abstractbidirlist.c b/gee/abstractbidirlist.c new file mode 100644 index 0000000..ecd63d3 --- /dev/null +++ b/gee/abstractbidirlist.c @@ -0,0 +1,724 @@ +/* abstractbidirlist.c generated by valac 0.18.0, the Vala compiler + * generated from abstractbidirlist.vala, do not modify */ + +/* bidirlistiterator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_LIST (gee_list_get_type ()) +#define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList)) +#define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST)) +#define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface)) + +typedef struct _GeeList GeeList; +typedef struct _GeeListIface GeeListIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ()) +#define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList)) +#define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) +#define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) + +typedef struct _GeeAbstractList GeeAbstractList; +typedef struct _GeeAbstractListClass GeeAbstractListClass; +typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; + +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; + +#define GEE_TYPE_READ_ONLY_LIST (gee_read_only_list_get_type ()) +#define GEE_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyList)) +#define GEE_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) +#define GEE_IS_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_IS_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_READ_ONLY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) + +typedef struct _GeeReadOnlyList GeeReadOnlyList; +typedef struct _GeeReadOnlyListClass GeeReadOnlyListClass; + +#define GEE_TYPE_READ_ONLY_BIDIR_LIST (gee_read_only_bidir_list_get_type ()) +#define GEE_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirList)) +#define GEE_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) +#define GEE_IS_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_IS_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_READ_ONLY_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) + +typedef struct _GeeReadOnlyBidirList GeeReadOnlyBidirList; +typedef struct _GeeReadOnlyBidirListClass GeeReadOnlyBidirListClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); + GeeListIterator* (*list_iterator) (GeeList* self); + gpointer (*get) (GeeList* self, gint index); + void (*set) (GeeList* self, gint index, gconstpointer item); + gint (*index_of) (GeeList* self, gconstpointer item); + void (*insert) (GeeList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeList* self, gint index); + GeeList* (*slice) (GeeList* self, gint start, gint stop); + gpointer (*first) (GeeList* self); + gpointer (*last) (GeeList* self); + void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); + GeeList* (*get_read_only_view) (GeeList* self); +}; + +struct _GeeAbstractList { + GeeAbstractCollection parent_instance; + GeeAbstractListPrivate * priv; +}; + +struct _GeeAbstractListClass { + GeeAbstractCollectionClass parent_class; + GeeListIterator* (*list_iterator) (GeeAbstractList* self); + gpointer (*get) (GeeAbstractList* self, gint index); + void (*set) (GeeAbstractList* self, gint index, gconstpointer item); + gint (*index_of) (GeeAbstractList* self, gconstpointer item); + void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeAbstractList* self, gint index); + GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); + GeeList* (*get_read_only_view) (GeeAbstractList* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { + GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + +struct _GeeAbstractBidirListPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeBidirList* _read_only_view; +}; + + +static gpointer gee_abstract_bidir_list_parent_class = NULL; +static GeeBidirListIface* gee_abstract_bidir_list_gee_bidir_list_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_BIDIR_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListPrivate)) +enum { + GEE_ABSTRACT_BIDIR_LIST_DUMMY_PROPERTY, + GEE_ABSTRACT_BIDIR_LIST_G_TYPE, + GEE_ABSTRACT_BIDIR_LIST_G_DUP_FUNC, + GEE_ABSTRACT_BIDIR_LIST_G_DESTROY_FUNC, + GEE_ABSTRACT_BIDIR_LIST_READ_ONLY_VIEW +}; +GeeBidirListIterator* gee_abstract_bidir_list_bidir_list_iterator (GeeAbstractBidirList* self); +static GeeBidirListIterator* gee_abstract_bidir_list_real_bidir_list_iterator (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved0 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved0 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved1 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved1 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved2 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved2 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved3 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved3 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved4 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved4 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved5 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved5 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved6 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved6 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved7 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved7 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved8 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved8 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved9 (GeeAbstractBidirList* self); +static void gee_abstract_bidir_list_real_reserved9 (GeeAbstractBidirList* self); +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirList* gee_abstract_bidir_list_get_read_only_view (GeeAbstractBidirList* self); +GeeReadOnlyBidirList* gee_read_only_bidir_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GeeReadOnlyBidirList* gee_read_only_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_list_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_list_get_type (void) G_GNUC_CONST; +static void gee_abstract_bidir_list_finalize (GObject* obj); +static void _vala_gee_abstract_bidir_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_bidir_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * {@inheritDoc} + */ +static GeeBidirListIterator* gee_abstract_bidir_list_real_bidir_list_iterator (GeeAbstractBidirList* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_bidir_list_bidir_list_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeBidirListIterator* gee_abstract_bidir_list_bidir_list_iterator (GeeAbstractBidirList* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->bidir_list_iterator (self); +} + + +static void gee_abstract_bidir_list_real_reserved0 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved0 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_bidir_list_real_reserved1 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved1 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_bidir_list_real_reserved2 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved2 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_bidir_list_real_reserved3 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved3 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_bidir_list_real_reserved4 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved4 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_bidir_list_real_reserved5 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved5 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_bidir_list_real_reserved6 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved6 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_bidir_list_real_reserved7 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved7 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_bidir_list_real_reserved8 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved8 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_bidir_list_real_reserved9 (GeeAbstractBidirList* self) { +} + + +void gee_abstract_bidir_list_reserved9 (GeeAbstractBidirList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->reserved9 (self); +} + + +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeAbstractBidirList * self = NULL; + self = (GeeAbstractBidirList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeBidirList* gee_abstract_bidir_list_get_read_only_view (GeeAbstractBidirList* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_LIST_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeBidirList* gee_abstract_bidir_list_real_get_read_only_view (GeeAbstractBidirList* base) { + GeeBidirList* result; + GeeAbstractBidirList* self; + GeeBidirList* _tmp0_; + GeeBidirList* _tmp1_; + GeeBidirList* instance; + GeeBidirList* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlyBidirList* _tmp3_; + GeeBidirList* _tmp4_; + GeeBidirList* _tmp5_; + _tmp3_ = gee_read_only_bidir_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeBidirList*) self); + _g_object_unref0 (instance); + instance = (GeeBidirList*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + +static void gee_abstract_bidir_list_class_init (GeeAbstractBidirListClass * klass) { + gee_abstract_bidir_list_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractBidirListPrivate)); + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->bidir_list_iterator = gee_abstract_bidir_list_real_bidir_list_iterator; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved0 = gee_abstract_bidir_list_real_reserved0; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved1 = gee_abstract_bidir_list_real_reserved1; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved2 = gee_abstract_bidir_list_real_reserved2; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved3 = gee_abstract_bidir_list_real_reserved3; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved4 = gee_abstract_bidir_list_real_reserved4; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved5 = gee_abstract_bidir_list_real_reserved5; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved6 = gee_abstract_bidir_list_real_reserved6; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved7 = gee_abstract_bidir_list_real_reserved7; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved8 = gee_abstract_bidir_list_real_reserved8; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->reserved9 = gee_abstract_bidir_list_real_reserved9; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->get_read_only_view = gee_abstract_bidir_list_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_bidir_list_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_bidir_list_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_bidir_list_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_LIST_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_LIST_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_bidir_list_gee_bidir_list_get_g_type (GeeAbstractBidirList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_bidir_list_gee_bidir_list_get_g_dup_func (GeeAbstractBidirList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_bidir_list_gee_bidir_list_get_g_destroy_func (GeeAbstractBidirList* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_bidir_list_gee_bidir_list_interface_init (GeeBidirListIface * iface) { + gee_abstract_bidir_list_gee_bidir_list_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_list_iterator = (GeeBidirListIterator* (*)(GeeBidirList*)) gee_abstract_bidir_list_bidir_list_iterator; + iface->get_g_type = (GType(*)(GeeBidirList*)) gee_abstract_bidir_list_gee_bidir_list_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirList*)) gee_abstract_bidir_list_gee_bidir_list_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirList*)) gee_abstract_bidir_list_gee_bidir_list_get_g_destroy_func; + iface->get_read_only_view = (GeeBidirList* (*) (GeeBidirList *)) gee_abstract_bidir_list_get_read_only_view; +} + + +static void gee_abstract_bidir_list_instance_init (GeeAbstractBidirList * self) { + self->priv = GEE_ABSTRACT_BIDIR_LIST_GET_PRIVATE (self); +} + + +static void gee_abstract_bidir_list_finalize (GObject* obj) { + GeeAbstractBidirList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList); + G_OBJECT_CLASS (gee_abstract_bidir_list_parent_class)->finalize (obj); +} + + +GType gee_abstract_bidir_list_get_type (void) { + static volatile gsize gee_abstract_bidir_list_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_bidir_list_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractBidirListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_bidir_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractBidirList), 0, (GInstanceInitFunc) gee_abstract_bidir_list_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_list_info = { (GInterfaceInitFunc) gee_abstract_bidir_list_gee_bidir_list_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_bidir_list_type_id; + gee_abstract_bidir_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_LIST, "GeeAbstractBidirList", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_bidir_list_type_id, GEE_TYPE_BIDIR_LIST, &gee_bidir_list_info); + g_once_init_leave (&gee_abstract_bidir_list_type_id__volatile, gee_abstract_bidir_list_type_id); + } + return gee_abstract_bidir_list_type_id__volatile; +} + + +static void _vala_gee_abstract_bidir_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractBidirList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_LIST_READ_ONLY_VIEW: + g_value_take_object (value, gee_abstract_bidir_list_get_read_only_view (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_bidir_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractBidirList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_LIST_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_BIDIR_LIST_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_BIDIR_LIST_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/abstractbidirlist.vala b/gee/abstractbidirlist.vala new file mode 100644 index 0000000..1f50a0f --- /dev/null +++ b/gee/abstractbidirlist.vala @@ -0,0 +1,58 @@ +/* bidirlistiterator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +public abstract class Gee.AbstractBidirList : AbstractList, BidirList { + /** + * {@inheritDoc} + */ + public abstract BidirListIterator bidir_list_iterator (); + + private weak BidirList _read_only_view; + + /** + * {@inheritDoc} + */ + public virtual new BidirList read_only_view { + owned get { + BidirList instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlyBidirList (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} +} + diff --git a/gee/abstractbidirsortedmap.c b/gee/abstractbidirsortedmap.c new file mode 100644 index 0000000..de4e3ae --- /dev/null +++ b/gee/abstractbidirsortedmap.c @@ -0,0 +1,860 @@ +/* abstractbidirsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from abstractbidirsortedmap.vala, do not modify */ + +/* abstractbidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) +#define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) +#define GEE_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) +#define GEE_IS_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_IS_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_ABSTRACT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) + +typedef struct _GeeAbstractMap GeeAbstractMap; +typedef struct _GeeAbstractMapClass GeeAbstractMapClass; +typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; +typedef struct _GeeAbstractSortedMapPrivate GeeAbstractSortedMapPrivate; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; +typedef struct _GeeAbstractBidirSortedMapPrivate GeeAbstractBidirSortedMapPrivate; + +#define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ()) +#define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap)) +#define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) +#define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) + +typedef struct _GeeReadOnlyMap GeeReadOnlyMap; +typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; + +#define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ()) +#define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap)) +#define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) +#define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) + +typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap; +typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP (gee_read_only_bidir_sorted_map_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMap)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) + +typedef struct _GeeReadOnlyBidirSortedMap GeeReadOnlyBidirSortedMap; +typedef struct _GeeReadOnlyBidirSortedMapClass GeeReadOnlyBidirSortedMapClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeAbstractMap { + GObject parent_instance; + GeeAbstractMapPrivate * priv; +}; + +struct _GeeAbstractMapClass { + GObjectClass parent_class; + gboolean (*has_key) (GeeAbstractMap* self, gconstpointer key); + gboolean (*has) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeAbstractMap* self, gconstpointer key); + void (*set) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); + GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); + void (*clear) (GeeAbstractMap* self); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); + gint (*get_size) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); + GeeSet* (*get_keys) (GeeAbstractMap* self); + GeeCollection* (*get_values) (GeeAbstractMap* self); + GeeSet* (*get_entries) (GeeAbstractMap* self); + GeeMap* (*get_read_only_view) (GeeAbstractMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeAbstractSortedMap { + GeeAbstractMap parent_instance; + GeeAbstractSortedMapPrivate * priv; +}; + +struct _GeeAbstractSortedMapClass { + GeeAbstractMapClass parent_class; + GeeSortedMap* (*head_map) (GeeAbstractSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeAbstractSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); + void (*reserved0) (GeeAbstractSortedMap* self); + void (*reserved1) (GeeAbstractSortedMap* self); + void (*reserved2) (GeeAbstractSortedMap* self); + void (*reserved3) (GeeAbstractSortedMap* self); + void (*reserved4) (GeeAbstractSortedMap* self); + void (*reserved5) (GeeAbstractSortedMap* self); + void (*reserved6) (GeeAbstractSortedMap* self); + void (*reserved7) (GeeAbstractSortedMap* self); + void (*reserved8) (GeeAbstractSortedMap* self); + void (*reserved9) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_keys) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeAbstractSortedMap* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +struct _GeeAbstractBidirSortedMap { + GeeAbstractSortedMap parent_instance; + GeeAbstractBidirSortedMapPrivate * priv; +}; + +struct _GeeAbstractBidirSortedMapClass { + GeeAbstractSortedMapClass parent_class; + GeeBidirMapIterator* (*bidir_map_iterator) (GeeAbstractBidirSortedMap* self); + void (*reserved0) (GeeAbstractBidirSortedMap* self); + void (*reserved1) (GeeAbstractBidirSortedMap* self); + void (*reserved2) (GeeAbstractBidirSortedMap* self); + void (*reserved3) (GeeAbstractBidirSortedMap* self); + void (*reserved4) (GeeAbstractBidirSortedMap* self); + void (*reserved5) (GeeAbstractBidirSortedMap* self); + void (*reserved6) (GeeAbstractBidirSortedMap* self); + void (*reserved7) (GeeAbstractBidirSortedMap* self); + void (*reserved8) (GeeAbstractBidirSortedMap* self); + void (*reserved9) (GeeAbstractBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeAbstractBidirSortedMap* self); +}; + +struct _GeeAbstractBidirSortedMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeBidirSortedMap* _read_only_view; +}; + + +static gpointer gee_abstract_bidir_sorted_map_parent_class = NULL; +static GeeBidirSortedMapIface* gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapPrivate)) +enum { + GEE_ABSTRACT_BIDIR_SORTED_MAP_DUMMY_PROPERTY, + GEE_ABSTRACT_BIDIR_SORTED_MAP_K_TYPE, + GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DUP_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DESTROY_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_MAP_V_TYPE, + GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DUP_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DESTROY_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_MAP_READ_ONLY_VIEW +}; +GeeBidirMapIterator* gee_abstract_bidir_sorted_map_bidir_map_iterator (GeeAbstractBidirSortedMap* self); +static GeeBidirMapIterator* gee_abstract_bidir_sorted_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved0 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved0 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved1 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved1 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved2 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved2 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved3 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved3 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved4 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved4 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved5 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved5 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved6 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved6 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved7 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved7 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved8 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved8 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved9 (GeeAbstractBidirSortedMap* self); +static void gee_abstract_bidir_sorted_map_real_reserved9 (GeeAbstractBidirSortedMap* self); +GeeAbstractBidirSortedMap* gee_abstract_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeAbstractSortedMap* gee_abstract_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self); +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GType gee_read_only_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_map_get_type (void) G_GNUC_CONST; +static void gee_abstract_bidir_sorted_map_finalize (GObject* obj); +static void _vala_gee_abstract_bidir_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_bidir_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * {@inheritDoc} + */ +static GeeBidirMapIterator* gee_abstract_bidir_sorted_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_bidir_sorted_map_bidir_map_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeBidirMapIterator* gee_abstract_bidir_sorted_map_bidir_map_iterator (GeeAbstractBidirSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->bidir_map_iterator (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved0 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved0 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved1 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved1 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved2 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved2 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved3 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved3 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved4 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved4 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved5 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved5 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved6 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved6 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved7 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved7 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved8 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved8 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_bidir_sorted_map_real_reserved9 (GeeAbstractBidirSortedMap* self) { +} + + +void gee_abstract_bidir_sorted_map_reserved9 (GeeAbstractBidirSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->reserved9 (self); +} + + +GeeAbstractBidirSortedMap* gee_abstract_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func) { + GeeAbstractBidirSortedMap * self = NULL; + self = (GeeAbstractBidirSortedMap*) gee_abstract_sorted_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeBidirSortedMap* gee_abstract_bidir_sorted_map_real_get_read_only_view (GeeAbstractBidirSortedMap* base) { + GeeBidirSortedMap* result; + GeeAbstractBidirSortedMap* self; + GeeBidirSortedMap* _tmp0_; + GeeBidirSortedMap* _tmp1_; + GeeBidirSortedMap* instance; + GeeBidirSortedMap* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlyBidirSortedMap* _tmp3_; + GeeBidirSortedMap* _tmp4_; + GeeBidirSortedMap* _tmp5_; + _tmp3_ = gee_read_only_bidir_sorted_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, (GeeBidirSortedMap*) self); + _g_object_unref0 (instance); + instance = (GeeBidirSortedMap*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + +static void gee_abstract_bidir_sorted_map_class_init (GeeAbstractBidirSortedMapClass * klass) { + gee_abstract_bidir_sorted_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractBidirSortedMapPrivate)); + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->bidir_map_iterator = gee_abstract_bidir_sorted_map_real_bidir_map_iterator; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved0 = gee_abstract_bidir_sorted_map_real_reserved0; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved1 = gee_abstract_bidir_sorted_map_real_reserved1; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved2 = gee_abstract_bidir_sorted_map_real_reserved2; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved3 = gee_abstract_bidir_sorted_map_real_reserved3; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved4 = gee_abstract_bidir_sorted_map_real_reserved4; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved5 = gee_abstract_bidir_sorted_map_real_reserved5; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved6 = gee_abstract_bidir_sorted_map_real_reserved6; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved7 = gee_abstract_bidir_sorted_map_real_reserved7; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved8 = gee_abstract_bidir_sorted_map_real_reserved8; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->reserved9 = gee_abstract_bidir_sorted_map_real_reserved9; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->get_read_only_view = gee_abstract_bidir_sorted_map_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_bidir_sorted_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_bidir_sorted_map_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_bidir_sorted_map_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_MAP_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_SORTED_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_type (GeeAbstractBidirSortedMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_dup_func (GeeAbstractBidirSortedMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_destroy_func (GeeAbstractBidirSortedMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_type (GeeAbstractBidirSortedMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_dup_func (GeeAbstractBidirSortedMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_destroy_func (GeeAbstractBidirSortedMap* self) { + return self->priv->v_destroy_func; +} + + +static void gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_interface_init (GeeBidirSortedMapIface * iface) { + gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_map_iterator = (GeeBidirMapIterator* (*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_bidir_map_iterator; + iface->get_k_type = (GType(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeBidirSortedMap*)) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_get_v_destroy_func; + iface->get_read_only_view = (GeeBidirSortedMap* (*) (GeeBidirSortedMap *)) gee_abstract_bidir_sorted_map_get_read_only_view; +} + + +static void gee_abstract_bidir_sorted_map_instance_init (GeeAbstractBidirSortedMap * self) { + self->priv = GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_PRIVATE (self); +} + + +static void gee_abstract_bidir_sorted_map_finalize (GObject* obj) { + GeeAbstractBidirSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap); + G_OBJECT_CLASS (gee_abstract_bidir_sorted_map_parent_class)->finalize (obj); +} + + +/** + * Skeletal implementation of the {@link BidirSortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +GType gee_abstract_bidir_sorted_map_get_type (void) { + static volatile gsize gee_abstract_bidir_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_bidir_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractBidirSortedMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_bidir_sorted_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractBidirSortedMap), 0, (GInstanceInitFunc) gee_abstract_bidir_sorted_map_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_sorted_map_info = { (GInterfaceInitFunc) gee_abstract_bidir_sorted_map_gee_bidir_sorted_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_bidir_sorted_map_type_id; + gee_abstract_bidir_sorted_map_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SORTED_MAP, "GeeAbstractBidirSortedMap", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_bidir_sorted_map_type_id, GEE_TYPE_BIDIR_SORTED_MAP, &gee_bidir_sorted_map_info); + g_once_init_leave (&gee_abstract_bidir_sorted_map_type_id__volatile, gee_abstract_bidir_sorted_map_type_id); + } + return gee_abstract_bidir_sorted_map_type_id__volatile; +} + + +static void _vala_gee_abstract_bidir_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractBidirSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_SORTED_MAP_READ_ONLY_VIEW: + g_value_take_object (value, gee_abstract_bidir_sorted_map_get_read_only_view (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_bidir_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractBidirSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_SORTED_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/abstractbidirsortedmap.vala b/gee/abstractbidirsortedmap.vala new file mode 100644 index 0000000..bab090a --- /dev/null +++ b/gee/abstractbidirsortedmap.vala @@ -0,0 +1,65 @@ +/* abstractbidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Skeletal implementation of the {@link BidirSortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +public abstract class Gee.AbstractBidirSortedMap : Gee.AbstractSortedMap, BidirSortedMap { + /** + * {@inheritDoc} + */ + public abstract BidirMapIterator bidir_map_iterator (); + + private weak BidirSortedMap _read_only_view; + + /** + * {@inheritDoc} + */ + public virtual new BidirSortedMap read_only_view { + owned get { + BidirSortedMap instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlyBidirSortedMap (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} +} + diff --git a/gee/abstractbidirsortedset.c b/gee/abstractbidirsortedset.c new file mode 100644 index 0000000..691e035 --- /dev/null +++ b/gee/abstractbidirsortedset.c @@ -0,0 +1,760 @@ +/* abstractbidirsortedset.c generated by valac 0.18.0, the Vala compiler + * generated from abstractbidirsortedset.vala, do not modify */ + +/* abstractbidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; +typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; + +#define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ()) +#define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet)) +#define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) +#define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET)) +#define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET)) +#define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) + +typedef struct _GeeReadOnlySet GeeReadOnlySet; +typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; + +#define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ()) +#define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet)) +#define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) +#define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) + +typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet; +typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET (gee_read_only_bidir_sorted_set_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSet)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) + +typedef struct _GeeReadOnlyBidirSortedSet GeeReadOnlyBidirSortedSet; +typedef struct _GeeReadOnlyBidirSortedSetClass GeeReadOnlyBidirSortedSetClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeAbstractSet { + GeeAbstractCollection parent_instance; + GeeAbstractSetPrivate * priv; +}; + +struct _GeeAbstractSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); + GeeSet* (*get_read_only_view) (GeeAbstractSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeAbstractSortedSet { + GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSet { + GeeAbstractSortedSet parent_instance; + GeeAbstractBidirSortedSetPrivate * priv; +}; + +struct _GeeAbstractBidirSortedSetClass { + GeeAbstractSortedSetClass parent_class; + GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self); + void (*reserved0) (GeeAbstractBidirSortedSet* self); + void (*reserved1) (GeeAbstractBidirSortedSet* self); + void (*reserved2) (GeeAbstractBidirSortedSet* self); + void (*reserved3) (GeeAbstractBidirSortedSet* self); + void (*reserved4) (GeeAbstractBidirSortedSet* self); + void (*reserved5) (GeeAbstractBidirSortedSet* self); + void (*reserved6) (GeeAbstractBidirSortedSet* self); + void (*reserved7) (GeeAbstractBidirSortedSet* self); + void (*reserved8) (GeeAbstractBidirSortedSet* self); + void (*reserved9) (GeeAbstractBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeBidirSortedSet* _read_only_view; +}; + + +static gpointer gee_abstract_bidir_sorted_set_parent_class = NULL; +static GeeBidirSortedSetIface* gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetPrivate)) +enum { + GEE_ABSTRACT_BIDIR_SORTED_SET_DUMMY_PROPERTY, + GEE_ABSTRACT_BIDIR_SORTED_SET_G_TYPE, + GEE_ABSTRACT_BIDIR_SORTED_SET_G_DUP_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_SET_G_DESTROY_FUNC, + GEE_ABSTRACT_BIDIR_SORTED_SET_READ_ONLY_VIEW +}; +GeeBidirIterator* gee_abstract_bidir_sorted_set_bidir_iterator (GeeAbstractBidirSortedSet* self); +static GeeBidirIterator* gee_abstract_bidir_sorted_set_real_bidir_iterator (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved0 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved0 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved1 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved1 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved2 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved2 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved3 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved3 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved4 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved4 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved5 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved5 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved6 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved6 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved7 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved7 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved8 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved8 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved9 (GeeAbstractBidirSortedSet* self); +static void gee_abstract_bidir_sorted_set_real_reserved9 (GeeAbstractBidirSortedSet* self); +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self); +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_set_get_type (void) G_GNUC_CONST; +static void gee_abstract_bidir_sorted_set_finalize (GObject* obj); +static void _vala_gee_abstract_bidir_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_bidir_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * {@inheritDoc} + */ +static GeeBidirIterator* gee_abstract_bidir_sorted_set_real_bidir_iterator (GeeAbstractBidirSortedSet* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_bidir_sorted_set_bidir_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeBidirIterator* gee_abstract_bidir_sorted_set_bidir_iterator (GeeAbstractBidirSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->bidir_iterator (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved0 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved0 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved1 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved1 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved2 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved2 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved3 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved3 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved4 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved4 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved5 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved5 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved6 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved6 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved7 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved7 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved8 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved8 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_bidir_sorted_set_real_reserved9 (GeeAbstractBidirSortedSet* self) { +} + + +void gee_abstract_bidir_sorted_set_reserved9 (GeeAbstractBidirSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->reserved9 (self); +} + + +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeAbstractBidirSortedSet * self = NULL; + self = (GeeAbstractBidirSortedSet*) gee_abstract_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeBidirSortedSet* gee_abstract_bidir_sorted_set_real_get_read_only_view (GeeAbstractBidirSortedSet* base) { + GeeBidirSortedSet* result; + GeeAbstractBidirSortedSet* self; + GeeBidirSortedSet* _tmp0_; + GeeBidirSortedSet* _tmp1_; + GeeBidirSortedSet* instance; + GeeBidirSortedSet* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlyBidirSortedSet* _tmp3_; + GeeBidirSortedSet* _tmp4_; + GeeBidirSortedSet* _tmp5_; + _tmp3_ = gee_read_only_bidir_sorted_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeBidirSortedSet*) self); + _g_object_unref0 (instance); + instance = (GeeBidirSortedSet*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + +static void gee_abstract_bidir_sorted_set_class_init (GeeAbstractBidirSortedSetClass * klass) { + gee_abstract_bidir_sorted_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractBidirSortedSetPrivate)); + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_abstract_bidir_sorted_set_real_bidir_iterator; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved0 = gee_abstract_bidir_sorted_set_real_reserved0; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved1 = gee_abstract_bidir_sorted_set_real_reserved1; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved2 = gee_abstract_bidir_sorted_set_real_reserved2; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved3 = gee_abstract_bidir_sorted_set_real_reserved3; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved4 = gee_abstract_bidir_sorted_set_real_reserved4; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved5 = gee_abstract_bidir_sorted_set_real_reserved5; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved6 = gee_abstract_bidir_sorted_set_real_reserved6; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved7 = gee_abstract_bidir_sorted_set_real_reserved7; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved8 = gee_abstract_bidir_sorted_set_real_reserved8; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->reserved9 = gee_abstract_bidir_sorted_set_real_reserved9; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->get_read_only_view = gee_abstract_bidir_sorted_set_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_bidir_sorted_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_bidir_sorted_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_bidir_sorted_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_BIDIR_SORTED_SET_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_type (GeeAbstractBidirSortedSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_dup_func (GeeAbstractBidirSortedSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_destroy_func (GeeAbstractBidirSortedSet* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_interface_init (GeeBidirSortedSetIface * iface) { + gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_iterator = (GeeBidirIterator* (*)(GeeBidirSortedSet*)) gee_abstract_bidir_sorted_set_bidir_iterator; + iface->get_g_type = (GType(*)(GeeBidirSortedSet*)) gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedSet*)) gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirSortedSet*)) gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_get_g_destroy_func; + iface->get_read_only_view = (GeeBidirSortedSet* (*) (GeeBidirSortedSet *)) gee_abstract_bidir_sorted_set_get_read_only_view; +} + + +static void gee_abstract_bidir_sorted_set_instance_init (GeeAbstractBidirSortedSet * self) { + self->priv = GEE_ABSTRACT_BIDIR_SORTED_SET_GET_PRIVATE (self); +} + + +static void gee_abstract_bidir_sorted_set_finalize (GObject* obj) { + GeeAbstractBidirSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet); + G_OBJECT_CLASS (gee_abstract_bidir_sorted_set_parent_class)->finalize (obj); +} + + +/** + * Skeletal implementation of the {@link BidirSortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +GType gee_abstract_bidir_sorted_set_get_type (void) { + static volatile gsize gee_abstract_bidir_sorted_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_bidir_sorted_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractBidirSortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_bidir_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractBidirSortedSet), 0, (GInstanceInitFunc) gee_abstract_bidir_sorted_set_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_sorted_set_info = { (GInterfaceInitFunc) gee_abstract_bidir_sorted_set_gee_bidir_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_bidir_sorted_set_type_id; + gee_abstract_bidir_sorted_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SORTED_SET, "GeeAbstractBidirSortedSet", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_bidir_sorted_set_type_id, GEE_TYPE_BIDIR_SORTED_SET, &gee_bidir_sorted_set_info); + g_once_init_leave (&gee_abstract_bidir_sorted_set_type_id__volatile, gee_abstract_bidir_sorted_set_type_id); + } + return gee_abstract_bidir_sorted_set_type_id__volatile; +} + + +static void _vala_gee_abstract_bidir_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractBidirSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_SORTED_SET_READ_ONLY_VIEW: + g_value_take_object (value, gee_abstract_bidir_sorted_set_get_read_only_view (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_bidir_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractBidirSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet); + switch (property_id) { + case GEE_ABSTRACT_BIDIR_SORTED_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_BIDIR_SORTED_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/abstractbidirsortedset.vala b/gee/abstractbidirsortedset.vala new file mode 100644 index 0000000..92ca920 --- /dev/null +++ b/gee/abstractbidirsortedset.vala @@ -0,0 +1,65 @@ +/* abstractbidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Skeletal implementation of the {@link BidirSortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +public abstract class Gee.AbstractBidirSortedSet : Gee.AbstractSortedSet, BidirSortedSet { + /** + * {@inheritDoc} + */ + public abstract BidirIterator bidir_iterator (); + + private weak BidirSortedSet _read_only_view; + + /** + * {@inheritDoc} + */ + public virtual new BidirSortedSet read_only_view { + owned get { + BidirSortedSet instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlyBidirSortedSet (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} +} + diff --git a/gee/abstractcollection.c b/gee/abstractcollection.c index a23fbb2..35ab45e 100644 --- a/gee/abstractcollection.c +++ b/gee/abstractcollection.c @@ -26,18 +26,27 @@ #include #include -#include -#include -#include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -47,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -66,7 +83,6 @@ typedef struct _GeeAbstractCollection GeeAbstractCollection; typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL))) #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) @@ -78,23 +94,55 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -106,6 +154,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -120,14 +169,20 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; @@ -140,10 +195,20 @@ struct _GeeAbstractCollectionPrivate { static gpointer gee_abstract_collection_parent_class = NULL; +static GeeTraversableIface* gee_abstract_collection_gee_traversable_parent_iface = NULL; static GeeIterableIface* gee_abstract_collection_gee_iterable_parent_iface = NULL; static GeeCollectionIface* gee_abstract_collection_gee_collection_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -154,8 +219,7 @@ enum { GEE_ABSTRACT_COLLECTION_G_DUP_FUNC, GEE_ABSTRACT_COLLECTION_G_DESTROY_FUNC, GEE_ABSTRACT_COLLECTION_SIZE, - GEE_ABSTRACT_COLLECTION_IS_EMPTY, - GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE, + GEE_ABSTRACT_COLLECTION_READ_ONLY, GEE_ABSTRACT_COLLECTION_READ_ONLY_VIEW }; gboolean gee_abstract_collection_contains (GeeAbstractCollection* self, gconstpointer item); @@ -166,50 +230,41 @@ gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpoin static gboolean gee_abstract_collection_real_remove (GeeAbstractCollection* self, gconstpointer item); void gee_abstract_collection_clear (GeeAbstractCollection* self); static void gee_abstract_collection_real_clear (GeeAbstractCollection* self); -gpointer* gee_abstract_collection_to_array (GeeAbstractCollection* self, int* result_length1); -static gpointer* gee_abstract_collection_real_to_array (GeeAbstractCollection* self, int* result_length1); -static gboolean* gee_abstract_collection_to_bool_array (GeeCollection* coll, int* result_length1); -static gchar* gee_abstract_collection_to_char_array (GeeCollection* coll, int* result_length1); -static guchar* gee_abstract_collection_to_uchar_array (GeeCollection* coll, int* result_length1); -static gint* gee_abstract_collection_to_int_array (GeeCollection* coll, int* result_length1); -static guint* gee_abstract_collection_to_uint_array (GeeCollection* coll, int* result_length1); -static gint64* gee_abstract_collection_to_int64_array (GeeCollection* coll, int* result_length1); -static guint64* gee_abstract_collection_to_uint64_array (GeeCollection* coll, int* result_length1); -static glong* gee_abstract_collection_to_long_array (GeeCollection* coll, int* result_length1); -static gulong* gee_abstract_collection_to_ulong_array (GeeCollection* coll, int* result_length1); -static gfloat** gee_abstract_collection_to_float_array (GeeCollection* coll, int* result_length1); -static gdouble** gee_abstract_collection_to_double_array (GeeCollection* coll, int* result_length1); -gint gee_collection_get_size (GeeCollection* self); GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -GeeIterator* gee_iterable_iterator (GeeIterable* self); -static gfloat* _float_dup (gfloat* self); -static gdouble* _double_dup (gdouble* self); -gboolean gee_abstract_collection_add_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_add_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_collection_get_is_empty (GeeCollection* self); -gboolean gee_abstract_collection_contains_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_contains_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_remove_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_remove_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_retain_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_retain_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self); +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); +static gboolean gee_abstract_collection_real_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +void gee_abstract_collection_reserved0 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved0 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved1 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved1 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved2 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved2 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved3 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved3 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved4 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved4 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved5 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved5 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved6 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved6 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved7 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved7 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved8 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved8 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved9 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved9 (GeeAbstractCollection* self); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); GeeCollection* gee_abstract_collection_get_read_only_view (GeeAbstractCollection* self); GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); GType gee_read_only_collection_get_type (void) G_GNUC_CONST; static void gee_abstract_collection_finalize (GObject* obj); -GType gee_iterable_get_element_type (GeeIterable* self); static void _vala_gee_abstract_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); /** @@ -275,1333 +330,141 @@ void gee_abstract_collection_clear (GeeAbstractCollection* self) { /** * {@inheritDoc} */ -static gpointer* gee_abstract_collection_real_to_array (GeeAbstractCollection* self, int* result_length1) { - gpointer* result = NULL; - GType t; - GType _tmp0_; - t = self->priv->g_type; - _tmp0_ = t; - if (_tmp0_ == G_TYPE_BOOLEAN) { - gint _tmp1_ = 0; - gboolean* _tmp2_ = NULL; - gpointer* _tmp3_; - gint _tmp3__length1; - _tmp2_ = gee_abstract_collection_to_bool_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp1_); - _tmp3_ = (gpointer*) _tmp2_; - _tmp3__length1 = (_tmp1_ * sizeof (gboolean)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp3__length1; - } - result = _tmp3_; - return result; - } else { - GType _tmp4_; - _tmp4_ = t; - if (_tmp4_ == G_TYPE_CHAR) { - gint _tmp5_ = 0; - gchar* _tmp6_ = NULL; - gpointer* _tmp7_; - gint _tmp7__length1; - _tmp6_ = gee_abstract_collection_to_char_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp5_); - _tmp7_ = (gpointer*) _tmp6_; - _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp7__length1; - } - result = _tmp7_; - return result; - } else { - GType _tmp8_; - _tmp8_ = t; - if (_tmp8_ == G_TYPE_UCHAR) { - gint _tmp9_ = 0; - guchar* _tmp10_ = NULL; - gpointer* _tmp11_; - gint _tmp11__length1; - _tmp10_ = gee_abstract_collection_to_uchar_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp9_); - _tmp11_ = (gpointer*) _tmp10_; - _tmp11__length1 = (_tmp9_ * sizeof (guchar)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp11__length1; - } - result = _tmp11_; - return result; - } else { - GType _tmp12_; - _tmp12_ = t; - if (_tmp12_ == G_TYPE_INT) { - gint _tmp13_ = 0; - gint* _tmp14_ = NULL; - gpointer* _tmp15_; - gint _tmp15__length1; - _tmp14_ = gee_abstract_collection_to_int_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_); - _tmp15_ = (gpointer*) _tmp14_; - _tmp15__length1 = (_tmp13_ * sizeof (gint)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp15__length1; - } - result = _tmp15_; - return result; - } else { - GType _tmp16_; - _tmp16_ = t; - if (_tmp16_ == G_TYPE_UINT) { - gint _tmp17_ = 0; - guint* _tmp18_ = NULL; - gpointer* _tmp19_; - gint _tmp19__length1; - _tmp18_ = gee_abstract_collection_to_uint_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp17_); - _tmp19_ = (gpointer*) _tmp18_; - _tmp19__length1 = (_tmp17_ * sizeof (guint)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp19__length1; - } - result = _tmp19_; - return result; - } else { - GType _tmp20_; - _tmp20_ = t; - if (_tmp20_ == G_TYPE_INT64) { - gint _tmp21_ = 0; - gint64* _tmp22_ = NULL; - gpointer* _tmp23_; - gint _tmp23__length1; - _tmp22_ = gee_abstract_collection_to_int64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp21_); - _tmp23_ = (gpointer*) _tmp22_; - _tmp23__length1 = (_tmp21_ * sizeof (gint64)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp23__length1; - } - result = _tmp23_; - return result; - } else { - GType _tmp24_; - _tmp24_ = t; - if (_tmp24_ == G_TYPE_UINT64) { - gint _tmp25_ = 0; - guint64* _tmp26_ = NULL; - gpointer* _tmp27_; - gint _tmp27__length1; - _tmp26_ = gee_abstract_collection_to_uint64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp25_); - _tmp27_ = (gpointer*) _tmp26_; - _tmp27__length1 = (_tmp25_ * sizeof (guint64)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp27__length1; - } - result = _tmp27_; - return result; - } else { - GType _tmp28_; - _tmp28_ = t; - if (_tmp28_ == G_TYPE_LONG) { - gint _tmp29_ = 0; - glong* _tmp30_ = NULL; - gpointer* _tmp31_; - gint _tmp31__length1; - _tmp30_ = gee_abstract_collection_to_long_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp29_); - _tmp31_ = (gpointer*) _tmp30_; - _tmp31__length1 = (_tmp29_ * sizeof (glong)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp31__length1; - } - result = _tmp31_; - return result; - } else { - GType _tmp32_; - _tmp32_ = t; - if (_tmp32_ == G_TYPE_ULONG) { - gint _tmp33_ = 0; - gulong* _tmp34_ = NULL; - gpointer* _tmp35_; - gint _tmp35__length1; - _tmp34_ = gee_abstract_collection_to_ulong_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp33_); - _tmp35_ = (gpointer*) _tmp34_; - _tmp35__length1 = (_tmp33_ * sizeof (gulong)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp35__length1; - } - result = _tmp35_; - return result; - } else { - GType _tmp36_; - _tmp36_ = t; - if (_tmp36_ == G_TYPE_FLOAT) { - gint _tmp37_ = 0; - gfloat** _tmp38_ = NULL; - gpointer* _tmp39_; - gint _tmp39__length1; - _tmp38_ = gee_abstract_collection_to_float_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp37_); - _tmp39_ = (gpointer*) _tmp38_; - _tmp39__length1 = (_tmp37_ * sizeof (gfloat*)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp39__length1; - } - result = _tmp39_; - return result; - } else { - GType _tmp40_; - _tmp40_ = t; - if (_tmp40_ == G_TYPE_DOUBLE) { - gint _tmp41_ = 0; - gdouble** _tmp42_ = NULL; - gpointer* _tmp43_; - gint _tmp43__length1; - _tmp42_ = gee_abstract_collection_to_double_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp41_); - _tmp43_ = (gpointer*) _tmp42_; - _tmp43__length1 = (_tmp41_ * sizeof (gdouble*)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp43__length1; - } - result = _tmp43_; - return result; - } else { - gint _tmp44_; - gint _tmp45_; - gpointer* _tmp46_ = NULL; - gpointer* array; - gint array_length1; - gint _array_size_; - gint index; - gpointer* _tmp57_; - gint _tmp57__length1; - _tmp44_ = gee_collection_get_size ((GeeCollection*) self); - _tmp45_ = _tmp44_; - _tmp46_ = g_new0 (gpointer, _tmp45_); - array = _tmp46_; - array_length1 = _tmp45_; - _array_size_ = array_length1; - index = 0; - { - GeeIterator* _tmp47_ = NULL; - GeeIterator* _element_it; - _tmp47_ = gee_abstract_collection_iterator (self); - _element_it = _tmp47_; - while (TRUE) { - GeeIterator* _tmp48_; - gboolean _tmp49_ = FALSE; - GeeIterator* _tmp50_; - gpointer _tmp51_ = NULL; - gpointer element; - gpointer* _tmp52_; - gint _tmp52__length1; - gint _tmp53_; - gconstpointer _tmp54_; - gpointer _tmp55_; - gpointer _tmp56_; - _tmp48_ = _element_it; - _tmp49_ = gee_iterator_next (_tmp48_); - if (!_tmp49_) { - break; - } - _tmp50_ = _element_it; - _tmp51_ = gee_iterator_get (_tmp50_); - element = _tmp51_; - _tmp52_ = array; - _tmp52__length1 = array_length1; - _tmp53_ = index; - index = _tmp53_ + 1; - _tmp54_ = element; - _tmp55_ = ((_tmp54_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp54_) : ((gpointer) _tmp54_); - ((_tmp52_[_tmp53_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp52_[_tmp53_] = (self->priv->g_destroy_func (_tmp52_[_tmp53_]), NULL)); - _tmp52_[_tmp53_] = _tmp55_; - _tmp56_ = _tmp52_[_tmp53_]; - ((element == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (element = (self->priv->g_destroy_func (element), NULL)); - } - _g_object_unref0 (_element_it); - } - _tmp57_ = array; - _tmp57__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp57__length1; - } - result = _tmp57_; - return result; - } - } - } - } - } - } - } - } - } - } - } +static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_collection_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; } -gpointer* gee_abstract_collection_to_array (GeeAbstractCollection* self, int* result_length1) { +GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self) { g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->to_array (self, result_length1); -} - - -static gboolean* gee_abstract_collection_to_bool_array (GeeCollection* coll, int* result_length1) { - gboolean* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gboolean* _tmp3_ = NULL; - gboolean* array; - gint array_length1; - gint _array_size_; - gint index; - gboolean* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gboolean, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gboolean element; - gboolean* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gboolean _tmp12_; - gboolean _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gboolean) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; -} - - -static gchar* gee_abstract_collection_to_char_array (GeeCollection* coll, int* result_length1) { - gchar* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gchar* _tmp3_ = NULL; - gchar* array; - gint array_length1; - gint _array_size_; - gint index; - gchar* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gchar, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gchar element; - gchar* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gchar _tmp12_; - gchar _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gchar) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->iterator (self); } -static guchar* gee_abstract_collection_to_uchar_array (GeeCollection* coll, int* result_length1) { - guchar* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guchar* _tmp3_ = NULL; - guchar* array; - gint array_length1; - gint _array_size_; - gint index; - guchar* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guchar, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guchar element; - guchar* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - guchar _tmp12_; - guchar _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (guchar) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; +static gboolean gee_abstract_collection_real_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target) { + gboolean result = FALSE; + GeeIterator* _tmp0_ = NULL; + GeeIterator* _tmp1_; + GeeForallFunc _tmp2_; + void* _tmp2__target; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_; + _tmp0_ = gee_abstract_collection_iterator (self); + _tmp1_ = _tmp0_; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_traversable_foreach ((GeeTraversable*) _tmp1_, _tmp2_, _tmp2__target); + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; return result; } -static gint* gee_abstract_collection_to_int_array (GeeCollection* coll, int* result_length1) { - gint* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint* _tmp3_ = NULL; - gint* array; - gint array_length1; - gint _array_size_; - gint index; - gint* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gint, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gint element; - gint* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gint _tmp12_; - gint _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gint) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->foreach (self, f, f_target); } -static guint* gee_abstract_collection_to_uint_array (GeeCollection* coll, int* result_length1) { - guint* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guint* _tmp3_ = NULL; - guint* array; - gint array_length1; - gint _array_size_; - gint index; - guint* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guint, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guint element; - guint* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - guint _tmp12_; - guint _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (guint) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +static void gee_abstract_collection_real_reserved0 (GeeAbstractCollection* self) { } -static gint64* gee_abstract_collection_to_int64_array (GeeCollection* coll, int* result_length1) { - gint64* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint64* _tmp3_ = NULL; - gint64* array; - gint array_length1; - gint _array_size_; - gint index; - gint64* _tmp16_; - gint _tmp16__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gint64, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gint64* _tmp10_; - gint64 _tmp11_; - gint64 element; - gint64* _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gint64 _tmp14_; - gint64 _tmp15_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gint64*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp12_[_tmp13_] = _tmp14_; - _tmp15_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp16_ = array; - _tmp16__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp16__length1; - } - result = _tmp16_; - return result; +void gee_abstract_collection_reserved0 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved0 (self); } -static guint64* gee_abstract_collection_to_uint64_array (GeeCollection* coll, int* result_length1) { - guint64* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guint64* _tmp3_ = NULL; - guint64* array; - gint array_length1; - gint _array_size_; - gint index; - guint64* _tmp16_; - gint _tmp16__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guint64, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guint64* _tmp10_; - guint64 _tmp11_; - guint64 element; - guint64* _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - guint64 _tmp14_; - guint64 _tmp15_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (guint64*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp12_[_tmp13_] = _tmp14_; - _tmp15_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp16_ = array; - _tmp16__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp16__length1; - } - result = _tmp16_; - return result; +static void gee_abstract_collection_real_reserved1 (GeeAbstractCollection* self) { } -static glong* gee_abstract_collection_to_long_array (GeeCollection* coll, int* result_length1) { - glong* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - glong* _tmp3_ = NULL; - glong* array; - gint array_length1; - gint _array_size_; - gint index; - glong* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (glong, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - glong element; - glong* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - glong _tmp12_; - glong _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (glong) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +void gee_abstract_collection_reserved1 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved1 (self); } -static gulong* gee_abstract_collection_to_ulong_array (GeeCollection* coll, int* result_length1) { - gulong* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gulong* _tmp3_ = NULL; - gulong* array; - gint array_length1; - gint _array_size_; - gint index; - gulong* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gulong, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gulong element; - gulong* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gulong _tmp12_; - gulong _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gulong) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +static void gee_abstract_collection_real_reserved2 (GeeAbstractCollection* self) { } -static gfloat* _float_dup (gfloat* self) { - gfloat* dup; - dup = g_new0 (gfloat, 1); - memcpy (dup, self, sizeof (gfloat)); - return dup; +void gee_abstract_collection_reserved2 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved2 (self); } -static gpointer __float_dup0 (gpointer self) { - return self ? _float_dup (self) : NULL; +static void gee_abstract_collection_real_reserved3 (GeeAbstractCollection* self) { } -static gfloat** gee_abstract_collection_to_float_array (GeeCollection* coll, int* result_length1) { - gfloat** result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gfloat** _tmp3_ = NULL; - gfloat** array; - gint array_length1; - gint _array_size_; - gint index; - gfloat** _tmp17_; - gint _tmp17__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gfloat*, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gfloat* _tmp10_; - gfloat _tmp11_; - gfloat element; - gfloat** _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gfloat _tmp14_; - gfloat* _tmp15_; - gfloat* _tmp16_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gfloat*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp15_ = __float_dup0 (&_tmp14_); - _g_free0 (_tmp12_[_tmp13_]); - _tmp12_[_tmp13_] = _tmp15_; - _tmp16_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp17_ = array; - _tmp17__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp17__length1; - } - result = _tmp17_; - return result; +void gee_abstract_collection_reserved3 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved3 (self); } -static gdouble* _double_dup (gdouble* self) { - gdouble* dup; - dup = g_new0 (gdouble, 1); - memcpy (dup, self, sizeof (gdouble)); - return dup; +static void gee_abstract_collection_real_reserved4 (GeeAbstractCollection* self) { } -static gpointer __double_dup0 (gpointer self) { - return self ? _double_dup (self) : NULL; +void gee_abstract_collection_reserved4 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved4 (self); } -static gdouble** gee_abstract_collection_to_double_array (GeeCollection* coll, int* result_length1) { - gdouble** result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gdouble** _tmp3_ = NULL; - gdouble** array; - gint array_length1; - gint _array_size_; - gint index; - gdouble** _tmp17_; - gint _tmp17__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gdouble*, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gdouble* _tmp10_; - gdouble _tmp11_; - gdouble element; - gdouble** _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gdouble _tmp14_; - gdouble* _tmp15_; - gdouble* _tmp16_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gdouble*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp15_ = __double_dup0 (&_tmp14_); - _g_free0 (_tmp12_[_tmp13_]); - _tmp12_[_tmp13_] = _tmp15_; - _tmp16_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp17_ = array; - _tmp17__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp17__length1; - } - result = _tmp17_; - return result; +static void gee_abstract_collection_real_reserved5 (GeeAbstractCollection* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_add_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - GeeCollection* _tmp0_; - gboolean _tmp1_; - gboolean _tmp2_; - gboolean changed; - g_return_val_if_fail (collection != NULL, FALSE); - _tmp0_ = collection; - _tmp1_ = gee_collection_get_is_empty (_tmp0_); - _tmp2_ = _tmp1_; - if (_tmp2_) { - result = FALSE; - return result; - } - changed = FALSE; - { - GeeCollection* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _item_it; - _tmp3_ = collection; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _item_it = _tmp4_; - while (TRUE) { - GeeIterator* _tmp5_; - gboolean _tmp6_ = FALSE; - GeeIterator* _tmp7_; - gpointer _tmp8_ = NULL; - gpointer item; - gboolean _tmp9_; - gconstpointer _tmp10_; - gboolean _tmp11_ = FALSE; - _tmp5_ = _item_it; - _tmp6_ = gee_iterator_next (_tmp5_); - if (!_tmp6_) { - break; - } - _tmp7_ = _item_it; - _tmp8_ = gee_iterator_get (_tmp7_); - item = _tmp8_; - _tmp9_ = changed; - _tmp10_ = item; - _tmp11_ = gee_abstract_collection_add (self, _tmp10_); - changed = _tmp9_ | _tmp11_; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = changed; - return result; +void gee_abstract_collection_reserved5 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved5 (self); } -gboolean gee_abstract_collection_add_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->add_all (self, collection); +static void gee_abstract_collection_real_reserved6 (GeeAbstractCollection* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_contains_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint _tmp3_; - gint _tmp4_; - g_return_val_if_fail (collection != NULL, FALSE); - _tmp0_ = collection; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = gee_collection_get_size ((GeeCollection*) self); - _tmp4_ = _tmp3_; - if (_tmp2_ > _tmp4_) { - result = FALSE; - return result; - } - { - GeeCollection* _tmp5_; - GeeIterator* _tmp6_ = NULL; - GeeIterator* _item_it; - _tmp5_ = collection; - _tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_); - _item_it = _tmp6_; - while (TRUE) { - GeeIterator* _tmp7_; - gboolean _tmp8_ = FALSE; - GeeIterator* _tmp9_; - gpointer _tmp10_ = NULL; - gpointer item; - gconstpointer _tmp11_; - gboolean _tmp12_ = FALSE; - _tmp7_ = _item_it; - _tmp8_ = gee_iterator_next (_tmp7_); - if (!_tmp8_) { - break; - } - _tmp9_ = _item_it; - _tmp10_ = gee_iterator_get (_tmp9_); - item = _tmp10_; - _tmp11_ = item; - _tmp12_ = gee_abstract_collection_contains (self, _tmp11_); - if (!_tmp12_) { - result = FALSE; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - _g_object_unref0 (_item_it); - return result; - } - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = TRUE; - return result; -} - - -gboolean gee_abstract_collection_contains_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->contains_all (self, collection); +void gee_abstract_collection_reserved6 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved6 (self); } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_remove_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - gboolean changed; - g_return_val_if_fail (collection != NULL, FALSE); - changed = FALSE; - { - GeeCollection* _tmp0_; - GeeIterator* _tmp1_ = NULL; - GeeIterator* _item_it; - _tmp0_ = collection; - _tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_); - _item_it = _tmp1_; - while (TRUE) { - GeeIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - GeeIterator* _tmp4_; - gpointer _tmp5_ = NULL; - gpointer item; - gboolean _tmp6_; - gconstpointer _tmp7_; - gboolean _tmp8_ = FALSE; - _tmp2_ = _item_it; - _tmp3_ = gee_iterator_next (_tmp2_); - if (!_tmp3_) { - break; - } - _tmp4_ = _item_it; - _tmp5_ = gee_iterator_get (_tmp4_); - item = _tmp5_; - _tmp6_ = changed; - _tmp7_ = item; - _tmp8_ = gee_abstract_collection_remove (self, _tmp7_); - changed = _tmp6_ | _tmp8_; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = changed; - return result; +static void gee_abstract_collection_real_reserved7 (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_remove_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->remove_all (self, collection); +void gee_abstract_collection_reserved7 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved7 (self); } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_retain_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - gboolean changed; - gint _tmp0_ = 0; - gpointer* _tmp1_ = NULL; - gpointer* items; - gint items_length1; - gint _items_size_; - gint _tmp2_; - gint _tmp3_; - gint size_of_items; - g_return_val_if_fail (collection != NULL, FALSE); - changed = FALSE; - _tmp1_ = gee_abstract_collection_to_array (self, &_tmp0_); - items = _tmp1_; - items_length1 = _tmp0_; - _items_size_ = items_length1; - _tmp2_ = gee_collection_get_size ((GeeCollection*) self); - _tmp3_ = _tmp2_; - size_of_items = _tmp3_; - { - gint index; - index = 0; - { - gboolean _tmp4_; - _tmp4_ = TRUE; - while (TRUE) { - gboolean _tmp5_; - gint _tmp7_; - gint _tmp8_; - GeeCollection* _tmp9_; - gpointer* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gconstpointer _tmp12_; - gboolean _tmp13_ = FALSE; - _tmp5_ = _tmp4_; - if (!_tmp5_) { - gint _tmp6_; - _tmp6_ = index; - index = _tmp6_ + 1; - } - _tmp4_ = FALSE; - _tmp7_ = index; - _tmp8_ = size_of_items; - if (!(_tmp7_ < _tmp8_)) { - break; - } - _tmp9_ = collection; - _tmp10_ = items; - _tmp10__length1 = items_length1; - _tmp11_ = index; - _tmp12_ = _tmp10_[_tmp11_]; - _tmp13_ = gee_collection_contains (_tmp9_, _tmp12_); - if (!_tmp13_) { - gboolean _tmp14_; - gpointer* _tmp15_; - gint _tmp15__length1; - gint _tmp16_; - gconstpointer _tmp17_; - gboolean _tmp18_ = FALSE; - _tmp14_ = changed; - _tmp15_ = items; - _tmp15__length1 = items_length1; - _tmp16_ = index; - _tmp17_ = _tmp15_[_tmp16_]; - _tmp18_ = gee_abstract_collection_remove (self, _tmp17_); - changed = _tmp14_ | _tmp18_; - } - } - } - } - result = changed; - items = (_vala_array_free (items, items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); - return result; +static void gee_abstract_collection_real_reserved8 (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_retain_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->retain_all (self, collection); +void gee_abstract_collection_reserved8 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved8 (self); } -/** - * {@inheritDoc} - */ -static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_collection_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return NULL; +static void gee_abstract_collection_real_reserved9 (GeeAbstractCollection* self) { } -GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->iterator (self); +void gee_abstract_collection_reserved9 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved9 (self); } @@ -1621,31 +484,9 @@ gint gee_abstract_collection_get_size (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self) { +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self) { g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->get_is_empty (self); -} - - -static gboolean gee_abstract_collection_real_get_is_empty (GeeAbstractCollection* base) { - gboolean result; - GeeAbstractCollection* self; - gint _tmp0_; - gint _tmp1_; - self = base; - _tmp0_ = gee_collection_get_size ((GeeCollection*) self); - _tmp1_ = _tmp0_; - result = _tmp1_ == 0; - return result; -} - - -static GType gee_abstract_collection_real_get_element_type (GeeIterable* base) { - GType result; - GeeAbstractCollection* self; - self = (GeeAbstractCollection*) base; - result = self->priv->g_type; - return result; + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->get_read_only (self); } @@ -1696,13 +537,18 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_abstract_collection_real_add; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_abstract_collection_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_abstract_collection_real_clear; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->to_array = gee_abstract_collection_real_to_array; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_abstract_collection_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains_all = gee_abstract_collection_real_contains_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_abstract_collection_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_abstract_collection_real_retain_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_abstract_collection_real_iterator; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_is_empty = gee_abstract_collection_real_get_is_empty; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_abstract_collection_real_foreach; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved0 = gee_abstract_collection_real_reserved0; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved1 = gee_abstract_collection_real_reserved1; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved2 = gee_abstract_collection_real_reserved2; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved3 = gee_abstract_collection_real_reserved3; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved4 = gee_abstract_collection_real_reserved4; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved5 = gee_abstract_collection_real_reserved5; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved6 = gee_abstract_collection_real_reserved6; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved7 = gee_abstract_collection_real_reserved7; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved8 = gee_abstract_collection_real_reserved8; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved9 = gee_abstract_collection_real_reserved9; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only_view = gee_abstract_collection_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_collection_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_collection_set_property; @@ -1717,11 +563,7 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_COLLECTION_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_COLLECTION_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -1729,10 +571,66 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla } +static GType gee_abstract_collection_gee_traversable_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_traversable_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_traversable_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_collection_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_collection_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_collection_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_destroy_func; +} + + +static GType gee_abstract_collection_gee_iterable_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_iterable_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_iterable_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; +} + + static void gee_abstract_collection_gee_iterable_interface_init (GeeIterableIface * iface) { gee_abstract_collection_gee_iterable_parent_iface = g_type_interface_peek_parent (iface); iface->iterator = (GeeIterator* (*)(GeeIterable*)) gee_abstract_collection_iterator; - iface->get_element_type = gee_abstract_collection_real_get_element_type; + iface->get_g_type = (GType(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_destroy_func; +} + + +static GType gee_abstract_collection_gee_collection_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_collection_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_collection_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; } @@ -1742,13 +640,11 @@ static void gee_abstract_collection_gee_collection_interface_init (GeeCollection iface->add = (gboolean (*)(GeeCollection*, gconstpointer)) gee_abstract_collection_add; iface->remove = (gboolean (*)(GeeCollection*, gconstpointer)) gee_abstract_collection_remove; iface->clear = (void (*)(GeeCollection*)) gee_abstract_collection_clear; - iface->to_array = (gpointer* (*)(GeeCollection*, int*)) gee_abstract_collection_to_array; - iface->add_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_add_all; - iface->contains_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_contains_all; - iface->remove_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_remove_all; - iface->retain_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_retain_all; + iface->get_g_type = (GType(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_destroy_func; iface->get_size = (gint (*) (GeeCollection *)) gee_abstract_collection_get_size; - iface->get_is_empty = (gboolean (*) (GeeCollection *)) gee_abstract_collection_get_is_empty; + iface->get_read_only = (gboolean (*) (GeeCollection *)) gee_abstract_collection_get_read_only; iface->get_read_only_view = (GeeCollection* (*) (GeeCollection *)) gee_abstract_collection_get_read_only_view; } @@ -1778,10 +674,12 @@ GType gee_abstract_collection_get_type (void) { static volatile gsize gee_abstract_collection_type_id__volatile = 0; if (g_once_init_enter (&gee_abstract_collection_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractCollection), 0, (GInstanceInitFunc) gee_abstract_collection_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterable_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_iterable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_collection_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_collection_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_abstract_collection_type_id; gee_abstract_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractCollection", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_ITERABLE, &gee_iterable_info); g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_COLLECTION, &gee_collection_info); g_once_init_leave (&gee_abstract_collection_type_id__volatile, gee_abstract_collection_type_id); @@ -1794,12 +692,6 @@ static void _vala_gee_abstract_collection_get_property (GObject * object, guint GeeAbstractCollection * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection); switch (property_id) { - case GEE_ABSTRACT_COLLECTION_IS_EMPTY: - g_value_set_boolean (value, gee_abstract_collection_get_is_empty (self)); - break; - case GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE: - g_value_set_gtype (value, gee_iterable_get_element_type ((GeeIterable*) self)); - break; case GEE_ABSTRACT_COLLECTION_READ_ONLY_VIEW: g_value_take_object (value, gee_abstract_collection_get_read_only_view (self)); break; @@ -1830,22 +722,4 @@ static void _vala_gee_abstract_collection_set_property (GObject * object, guint } -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { - if ((array != NULL) && (destroy_func != NULL)) { - int i; - for (i = 0; i < array_length; i = i + 1) { - if (((gpointer*) array)[i] != NULL) { - destroy_func (((gpointer*) array)[i]); - } - } - } -} - - -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { - _vala_array_destroy (array, array_length, destroy_func); - g_free (array); -} - - diff --git a/gee/abstractcollection.vala b/gee/abstractcollection.vala index 9ba4a25..f7aa9b2 100644 --- a/gee/abstractcollection.vala +++ b/gee/abstractcollection.vala @@ -30,8 +30,7 @@ * @see AbstractSet * @see AbstractMultiSet */ -public abstract class Gee.AbstractCollection : Object, Iterable, Collection { - +public abstract class Gee.AbstractCollection : Object, Traversable, Iterable, Collection { /** * {@inheritDoc} */ @@ -40,9 +39,7 @@ public abstract class Gee.AbstractCollection : Object, Iterable, Collectio /** * {@inheritDoc} */ - public virtual bool is_empty { - get { return size == 0; } - } + public abstract bool read_only { get; } /** * {@inheritDoc} @@ -67,218 +64,12 @@ public abstract class Gee.AbstractCollection : Object, Iterable, Collectio /** * {@inheritDoc} */ - public virtual G[] to_array () { - var t = typeof (G); - if (t == typeof (bool)) { - return (G[]) to_bool_array((Collection) this); - } else if (t == typeof (char)) { - return (G[]) to_char_array((Collection) this); - } else if (t == typeof (uchar)) { - return (G[]) to_uchar_array((Collection) this); - } else if (t == typeof (int)) { - return (G[]) to_int_array((Collection) this); - } else if (t == typeof (uint)) { - return (G[]) to_uint_array((Collection) this); - } else if (t == typeof (int64)) { - return (G[]) to_int64_array((Collection) this); - } else if (t == typeof (uint64)) { - return (G[]) to_uint64_array((Collection) this); - } else if (t == typeof (long)) { - return (G[]) to_long_array((Collection) this); - } else if (t == typeof (ulong)) { - return (G[]) to_ulong_array((Collection) this); - } else if (t == typeof (float)) { - return (G[]) to_float_array((Collection) this); - } else if (t == typeof (double)) { - return (G[]) to_double_array((Collection) this); - } else { - G[] array = new G[size]; - int index = 0; - foreach (G element in this) { - array[index++] = element; - } - return array; - } - } - - private static bool[] to_bool_array(Collection coll) { - bool[] array = new bool[coll.size]; - int index = 0; - foreach (bool element in coll) { - array[index++] = element; - } - return array; - } - - private static char[] to_char_array(Collection coll) { - char[] array = new char[coll.size]; - int index = 0; - foreach (char element in coll) { - array[index++] = element; - } - return array; - } - - private static uchar[] to_uchar_array(Collection coll) { - uchar[] array = new uchar[coll.size]; - int index = 0; - foreach (uchar element in coll) { - array[index++] = element; - } - return array; - } - - private static int[] to_int_array(Collection coll) { - int[] array = new int[coll.size]; - int index = 0; - foreach (int element in coll) { - array[index++] = element; - } - return array; - } - - private static uint[] to_uint_array(Collection coll) { - uint[] array = new uint[coll.size]; - int index = 0; - foreach (uint element in coll) { - array[index++] = element; - } - return array; - } - - private static int64[] to_int64_array(Collection coll) { - int64[] array = new int64[coll.size]; - int index = 0; - foreach (int64 element in coll) { - array[index++] = element; - } - return array; - } - - private static uint64[] to_uint64_array(Collection coll) { - uint64[] array = new uint64[coll.size]; - int index = 0; - foreach (uint64 element in coll) { - array[index++] = element; - } - return array; - } - - private static long[] to_long_array(Collection coll) { - long[] array = new long[coll.size]; - int index = 0; - foreach (long element in coll) { - array[index++] = element; - } - return array; - } - - private static ulong[] to_ulong_array(Collection coll) { - ulong[] array = new ulong[coll.size]; - int index = 0; - foreach (ulong element in coll) { - array[index++] = element; - } - return array; - } - -#if VALA_0_16 - private static float?[] to_float_array(Collection coll) { - float?[] array = new float?[coll.size]; -#else - private static float[] to_float_array(Collection coll) { - float[] array = new float[coll.size]; -#endif - int index = 0; - foreach (float element in coll) { - array[index++] = element; - } - return array; - } - -#if VALA_0_16 - private static double?[] to_double_array(Collection coll) { - double?[] array = new double?[coll.size]; -#else - private static double[] to_double_array(Collection coll) { - double[] array = new double[coll.size]; -#endif - int index = 0; - foreach (double element in coll) { - array[index++] = element; - } - return array; - } - - /** - * {@inheritDoc} - */ - public virtual bool add_all (Collection collection) { - if (collection.is_empty) { - return false; - } - - bool changed = false; - foreach (G item in collection) { - changed = changed | add (item); - } - return changed; - } - - /** - * {@inheritDoc} - */ - public virtual bool contains_all (Collection collection) { - if (collection.size > size) { - return false; - } - - foreach (G item in collection) { - if (!contains (item)) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - public virtual bool remove_all (Collection collection) { - bool changed = false; - foreach (G item in collection) { - changed = changed | remove (item); - } - return changed; - } + public abstract Iterator iterator (); - /** - * {@inheritDoc} - */ - public virtual bool retain_all (Collection collection) { - bool changed = false; - G[] items = to_array (); - int size_of_items = size; - for (int index = 0; index < size_of_items; index++) { - if (!collection.contains (items[index])) { - changed = changed | remove (items[index]); - } - } - return changed; + public virtual bool foreach (ForallFunc f) { + return iterator ().foreach (f); } - /** - * {@inheritDoc} - */ - public Type element_type { - get { return typeof (G); } - } - - /** - * {@inheritDoc} - */ - public abstract Iterator iterator (); - private weak Collection _read_only_view; /** @@ -295,4 +86,16 @@ public abstract class Gee.AbstractCollection : Object, Iterable, Collectio return instance; } } + + // Future-proofing + internal virtual void reserved0() {} + internal virtual void reserved1() {} + internal virtual void reserved2() {} + internal virtual void reserved3() {} + internal virtual void reserved4() {} + internal virtual void reserved5() {} + internal virtual void reserved6() {} + internal virtual void reserved7() {} + internal virtual void reserved8() {} + internal virtual void reserved9() {} } diff --git a/gee/abstractlist.c b/gee/abstractlist.c index 304082e..bdcbb26 100644 --- a/gee/abstractlist.c +++ b/gee/abstractlist.c @@ -28,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -44,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -71,14 +91,6 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -97,7 +109,6 @@ typedef struct _GeeListIteratorIface GeeListIteratorIface; typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) @@ -118,24 +129,57 @@ typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; typedef struct _GeeReadOnlyList GeeReadOnlyList; typedef struct _GeeReadOnlyListClass GeeReadOnlyListClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -147,6 +191,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -161,34 +206,35 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -199,7 +245,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -217,9 +263,16 @@ struct _GeeAbstractListClass { void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); gpointer (*remove_at) (GeeAbstractList* self, gint index); GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); - gpointer (*first) (GeeAbstractList* self); - gpointer (*last) (GeeAbstractList* self); - void (*insert_all) (GeeAbstractList* self, gint index, GeeCollection* collection); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); GeeList* (*get_read_only_view) (GeeAbstractList* self); }; @@ -234,11 +287,19 @@ struct _GeeAbstractListPrivate { static gpointer gee_abstract_list_parent_class = NULL; static GeeListIface* gee_abstract_list_gee_list_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; GType gee_abstract_list_get_type (void) G_GNUC_CONST; @@ -264,19 +325,26 @@ gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index); static gpointer gee_abstract_list_real_remove_at (GeeAbstractList* self, gint index); GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop); static GeeList* gee_abstract_list_real_slice (GeeAbstractList* self, gint start, gint stop); -gpointer gee_abstract_list_first (GeeAbstractList* self); -static gpointer gee_abstract_list_real_first (GeeAbstractList* self); -gpointer gee_abstract_list_last (GeeAbstractList* self); -static gpointer gee_abstract_list_real_last (GeeAbstractList* self); -gint gee_collection_get_size (GeeCollection* self); -void gee_abstract_list_insert_all (GeeAbstractList* self, gint index, GeeCollection* collection); -static void gee_abstract_list_real_insert_all (GeeAbstractList* self, gint index, GeeCollection* collection); -GeeIterator* gee_iterable_iterator (GeeIterable* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -static void gee_abstract_list_real_sort (GeeList* base, GCompareFunc compare); -GCompareFunc gee_functions_get_compare_func_for (GType t); -void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare); +void gee_abstract_list_reserved0 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved0 (GeeAbstractList* self); +void gee_abstract_list_reserved1 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved1 (GeeAbstractList* self); +void gee_abstract_list_reserved2 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved2 (GeeAbstractList* self); +void gee_abstract_list_reserved3 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved3 (GeeAbstractList* self); +void gee_abstract_list_reserved4 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved4 (GeeAbstractList* self); +void gee_abstract_list_reserved5 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved5 (GeeAbstractList* self); +void gee_abstract_list_reserved6 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved6 (GeeAbstractList* self); +void gee_abstract_list_reserved7 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved7 (GeeAbstractList* self); +void gee_abstract_list_reserved8 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved8 (GeeAbstractList* self); +void gee_abstract_list_reserved9 (GeeAbstractList* self); +static void gee_abstract_list_real_reserved9 (GeeAbstractList* self); GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self); @@ -394,109 +462,103 @@ GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop) } -/** - * {@inheritDoc} - */ -static gpointer gee_abstract_list_real_first (GeeAbstractList* self) { - gpointer result = NULL; - gpointer _tmp0_ = NULL; - _tmp0_ = gee_abstract_list_get (self, 0); - result = _tmp0_; - return result; +static void gee_abstract_list_real_reserved0 (GeeAbstractList* self) { } -gpointer gee_abstract_list_first (GeeAbstractList* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_LIST_GET_CLASS (self)->first (self); +void gee_abstract_list_reserved0 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved0 (self); } -/** - * {@inheritDoc} - */ -static gpointer gee_abstract_list_real_last (GeeAbstractList* self) { - gpointer result = NULL; - gint _tmp0_; - gint _tmp1_; - gpointer _tmp2_ = NULL; - _tmp0_ = gee_collection_get_size ((GeeCollection*) self); - _tmp1_ = _tmp0_; - _tmp2_ = gee_abstract_list_get (self, _tmp1_ - 1); - result = _tmp2_; - return result; +static void gee_abstract_list_real_reserved1 (GeeAbstractList* self) { } -gpointer gee_abstract_list_last (GeeAbstractList* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_LIST_GET_CLASS (self)->last (self); +void gee_abstract_list_reserved1 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved1 (self); } -/** - * {@inheritDoc} - */ -static void gee_abstract_list_real_insert_all (GeeAbstractList* self, gint index, GeeCollection* collection) { - g_return_if_fail (collection != NULL); - { - GeeCollection* _tmp0_; - GeeIterator* _tmp1_ = NULL; - GeeIterator* _item_it; - _tmp0_ = collection; - _tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_); - _item_it = _tmp1_; - while (TRUE) { - GeeIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - GeeIterator* _tmp4_; - gpointer _tmp5_ = NULL; - gpointer item; - gint _tmp6_; - gconstpointer _tmp7_; - gint _tmp8_; - _tmp2_ = _item_it; - _tmp3_ = gee_iterator_next (_tmp2_); - if (!_tmp3_) { - break; - } - _tmp4_ = _item_it; - _tmp5_ = gee_iterator_get (_tmp4_); - item = _tmp5_; - _tmp6_ = index; - _tmp7_ = item; - gee_abstract_list_insert (self, _tmp6_, _tmp7_); - _tmp8_ = index; - index = _tmp8_ + 1; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } +static void gee_abstract_list_real_reserved2 (GeeAbstractList* self) { } -void gee_abstract_list_insert_all (GeeAbstractList* self, gint index, GeeCollection* collection) { +void gee_abstract_list_reserved2 (GeeAbstractList* self) { g_return_if_fail (self != NULL); - GEE_ABSTRACT_LIST_GET_CLASS (self)->insert_all (self, index, collection); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved2 (self); } -/** - * {@inheritDoc} - */ -static void gee_abstract_list_real_sort (GeeList* base, GCompareFunc compare) { - GeeAbstractList * self; - GCompareFunc _tmp0_; - GCompareFunc _tmp2_; - self = (GeeAbstractList*) base; - _tmp0_ = compare; - if (_tmp0_ == NULL) { - GCompareFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_compare_func_for (self->priv->g_type); - compare = _tmp1_; - } - _tmp2_ = compare; - gee_tim_sort_sort (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeList*) self, _tmp2_); +static void gee_abstract_list_real_reserved3 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved3 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_list_real_reserved4 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved4 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_list_real_reserved5 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved5 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_list_real_reserved6 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved6 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_list_real_reserved7 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved7 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_list_real_reserved8 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved8 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_list_real_reserved9 (GeeAbstractList* self) { +} + + +void gee_abstract_list_reserved9 (GeeAbstractList* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_LIST_GET_CLASS (self)->reserved9 (self); } @@ -560,9 +622,16 @@ static void gee_abstract_list_class_init (GeeAbstractListClass * klass) { GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_abstract_list_real_insert; GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_abstract_list_real_remove_at; GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_abstract_list_real_slice; - GEE_ABSTRACT_LIST_CLASS (klass)->first = gee_abstract_list_real_first; - GEE_ABSTRACT_LIST_CLASS (klass)->last = gee_abstract_list_real_last; - GEE_ABSTRACT_LIST_CLASS (klass)->insert_all = gee_abstract_list_real_insert_all; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved0 = gee_abstract_list_real_reserved0; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved1 = gee_abstract_list_real_reserved1; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved2 = gee_abstract_list_real_reserved2; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved3 = gee_abstract_list_real_reserved3; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved4 = gee_abstract_list_real_reserved4; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved5 = gee_abstract_list_real_reserved5; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved6 = gee_abstract_list_real_reserved6; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved7 = gee_abstract_list_real_reserved7; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved8 = gee_abstract_list_real_reserved8; + GEE_ABSTRACT_LIST_CLASS (klass)->reserved9 = gee_abstract_list_real_reserved9; GEE_ABSTRACT_LIST_CLASS (klass)->get_read_only_view = gee_abstract_list_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_list_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_list_set_property; @@ -577,6 +646,21 @@ static void gee_abstract_list_class_init (GeeAbstractListClass * klass) { } +static GType gee_abstract_list_gee_list_get_g_type (GeeAbstractList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_list_gee_list_get_g_dup_func (GeeAbstractList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_list_gee_list_get_g_destroy_func (GeeAbstractList* self) { + return self->priv->g_destroy_func; +} + + static void gee_abstract_list_gee_list_interface_init (GeeListIface * iface) { gee_abstract_list_gee_list_parent_iface = g_type_interface_peek_parent (iface); iface->list_iterator = (GeeListIterator* (*)(GeeList*)) gee_abstract_list_list_iterator; @@ -586,10 +670,9 @@ static void gee_abstract_list_gee_list_interface_init (GeeListIface * iface) { iface->insert = (void (*)(GeeList*, gint, gconstpointer)) gee_abstract_list_insert; iface->remove_at = (gpointer (*)(GeeList*, gint)) gee_abstract_list_remove_at; iface->slice = (GeeList* (*)(GeeList*, gint, gint)) gee_abstract_list_slice; - iface->first = (gpointer (*)(GeeList*)) gee_abstract_list_first; - iface->last = (gpointer (*)(GeeList*)) gee_abstract_list_last; - iface->insert_all = (void (*)(GeeList*, gint, GeeCollection*)) gee_abstract_list_insert_all; - iface->sort = (void (*)(GeeList*, GCompareFunc)) gee_abstract_list_real_sort; + iface->get_g_type = (GType(*)(GeeList*)) gee_abstract_list_gee_list_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeList*)) gee_abstract_list_gee_list_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeList*)) gee_abstract_list_gee_list_get_g_destroy_func; iface->get_read_only_view = (GeeList* (*) (GeeList *)) gee_abstract_list_get_read_only_view; } diff --git a/gee/abstractlist.vala b/gee/abstractlist.vala index 65c82b7..03650f6 100644 --- a/gee/abstractlist.vala +++ b/gee/abstractlist.vala @@ -66,40 +66,6 @@ public abstract class Gee.AbstractList : Gee.AbstractCollection, List { */ public abstract List? slice (int start, int stop); - /** - * {@inheritDoc} - */ - public virtual G first () { - return get (0); - } - - /** - * {@inheritDoc} - */ - public virtual G last () { - return get (size - 1); - } - - /** - * {@inheritDoc} - */ - public virtual void insert_all (int index, Collection collection) { - foreach (G item in collection) { - insert(index, item); - index++; - } - } - - /** - * {@inheritDoc} - */ - public void sort (CompareFunc? compare = null) { - if (compare == null) { - compare = Functions.get_compare_func_for (typeof (G)); - } - TimSort.sort (this, compare); - } - private weak List _read_only_view; /** @@ -116,4 +82,16 @@ public abstract class Gee.AbstractList : Gee.AbstractCollection, List { return instance; } } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} } diff --git a/gee/abstractmap.c b/gee/abstractmap.c index 98b45fc..b3aae07 100644 --- a/gee/abstractmap.c +++ b/gee/abstractmap.c @@ -28,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -44,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -108,34 +128,78 @@ typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; typedef struct _GeeReadOnlyMap GeeReadOnlyMap; typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -147,38 +211,43 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMap { @@ -195,11 +264,20 @@ struct _GeeAbstractMapClass { gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); void (*clear) (GeeAbstractMap* self); - void (*set_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*unset_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*has_all) (GeeAbstractMap* self, GeeMap* map); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); gint (*get_size) (GeeAbstractMap* self); - gboolean (*get_is_empty) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); GeeSet* (*get_keys) (GeeAbstractMap* self); GeeCollection* (*get_values) (GeeAbstractMap* self); GeeSet* (*get_entries) (GeeAbstractMap* self); @@ -218,10 +296,20 @@ struct _GeeAbstractMapPrivate { static gpointer gee_abstract_map_parent_class = NULL; +static GeeTraversableIface* gee_abstract_map_gee_traversable_parent_iface = NULL; static GeeIterableIface* gee_abstract_map_gee_iterable_parent_iface = NULL; static GeeMapIface* gee_abstract_map_gee_map_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; @@ -239,18 +327,14 @@ enum { GEE_ABSTRACT_MAP_V_DUP_FUNC, GEE_ABSTRACT_MAP_V_DESTROY_FUNC, GEE_ABSTRACT_MAP_SIZE, - GEE_ABSTRACT_MAP_IS_EMPTY, + GEE_ABSTRACT_MAP_READ_ONLY, GEE_ABSTRACT_MAP_KEYS, GEE_ABSTRACT_MAP_VALUES, GEE_ABSTRACT_MAP_ENTRIES, - GEE_ABSTRACT_MAP_READ_ONLY_VIEW, - GEE_ABSTRACT_MAP_KEY_TYPE, - GEE_ABSTRACT_MAP_VALUE_TYPE, - GEE_ABSTRACT_MAP_ELEMENT_TYPE + GEE_ABSTRACT_MAP_READ_ONLY_VIEW }; gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); static gboolean gee_abstract_map_real_has_key (GeeAbstractMap* self, gconstpointer key); -static gboolean gee_abstract_map_real_contains (GeeMap* base, gconstpointer key); gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); static gboolean gee_abstract_map_real_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); gpointer gee_abstract_map_get (GeeAbstractMap* self, gconstpointer key); @@ -261,29 +345,40 @@ gboolean gee_abstract_map_unset (GeeAbstractMap* self, gconstpointer key, gpoint static gboolean gee_abstract_map_real_unset (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* gee_abstract_map_map_iterator (GeeAbstractMap* self); static GeeMapIterator* gee_abstract_map_real_map_iterator (GeeAbstractMap* self); -static gboolean gee_abstract_map_real_remove (GeeMap* base, gconstpointer key, gpointer* value); void gee_abstract_map_clear (GeeAbstractMap* self); static void gee_abstract_map_real_clear (GeeAbstractMap* self); -void gee_abstract_map_set_all (GeeAbstractMap* self, GeeMap* map); -static void gee_abstract_map_real_set_all (GeeAbstractMap* self, GeeMap* map); +static GeeIterator* gee_abstract_map_real_iterator (GeeIterable* base); GeeSet* gee_map_get_entries (GeeMap* self); GeeIterator* gee_iterable_iterator (GeeIterable* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -gconstpointer gee_map_entry_get_key (GeeMapEntry* self); -gconstpointer gee_map_entry_get_value (GeeMapEntry* self); -gboolean gee_abstract_map_unset_all (GeeAbstractMap* self, GeeMap* map); -static gboolean gee_abstract_map_real_unset_all (GeeAbstractMap* self, GeeMap* map); -GeeSet* gee_map_get_keys (GeeMap* self); -static gboolean gee_abstract_map_real_remove_all (GeeMap* base, GeeMap* map); -gboolean gee_abstract_map_has_all (GeeAbstractMap* self, GeeMap* map); -static gboolean gee_abstract_map_real_has_all (GeeAbstractMap* self, GeeMap* map); -static gboolean gee_abstract_map_real_contains_all (GeeMap* base, GeeMap* map); -static GeeIterator* gee_abstract_map_real_iterator (GeeIterable* base); +gboolean gee_abstract_map_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target); +static gboolean gee_abstract_map_real_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_abstract_map_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_abstract_map_real_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +void gee_abstract_map_reserved0 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved0 (GeeAbstractMap* self); +void gee_abstract_map_reserved1 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved1 (GeeAbstractMap* self); +void gee_abstract_map_reserved2 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved2 (GeeAbstractMap* self); +void gee_abstract_map_reserved3 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved3 (GeeAbstractMap* self); +void gee_abstract_map_reserved4 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved4 (GeeAbstractMap* self); +void gee_abstract_map_reserved5 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved5 (GeeAbstractMap* self); +void gee_abstract_map_reserved6 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved6 (GeeAbstractMap* self); +void gee_abstract_map_reserved7 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved7 (GeeAbstractMap* self); +void gee_abstract_map_reserved8 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved8 (GeeAbstractMap* self); +void gee_abstract_map_reserved9 (GeeAbstractMap* self); +static void gee_abstract_map_real_reserved9 (GeeAbstractMap* self); GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); gint gee_abstract_map_get_size (GeeAbstractMap* self); -gboolean gee_abstract_map_get_is_empty (GeeAbstractMap* self); -gint gee_map_get_size (GeeMap* self); +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); @@ -292,9 +387,6 @@ GeeReadOnlyMap* gee_read_only_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GeeReadOnlyMap* gee_read_only_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); GType gee_read_only_map_get_type (void) G_GNUC_CONST; static void gee_abstract_map_finalize (GObject* obj); -GType gee_map_get_key_type (GeeMap* self); -GType gee_map_get_value_type (GeeMap* self); -GType gee_iterable_get_element_type (GeeIterable* self); static void _vala_gee_abstract_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -314,22 +406,6 @@ gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_map_real_contains (GeeMap* base, gconstpointer key) { - GeeAbstractMap * self; - gboolean result = FALSE; - gconstpointer _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeAbstractMap*) base; - _tmp0_ = key; - _tmp1_ = gee_abstract_map_has_key (self, _tmp0_); - result = _tmp1_; - return result; -} - - /** * {@inheritDoc} */ @@ -405,43 +481,6 @@ GeeMapIterator* gee_abstract_map_map_iterator (GeeAbstractMap* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_map_real_remove (GeeMap* base, gconstpointer key, gpointer* value) { - GeeAbstractMap * self; - gpointer _vala_value = NULL; - gboolean result = FALSE; - gpointer removed_value = NULL; - gconstpointer _tmp0_; - gpointer _tmp1_ = NULL; - gboolean _tmp2_ = FALSE; - gboolean _result_; - self = (GeeAbstractMap*) base; - _tmp0_ = key; - _tmp2_ = gee_abstract_map_unset (self, _tmp0_, &_tmp1_); - ((removed_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (removed_value = (self->priv->v_destroy_func (removed_value), NULL)); - removed_value = _tmp1_; - _result_ = _tmp2_; - if ((&_vala_value) != NULL) { - gconstpointer _tmp3_; - gpointer _tmp4_; - _tmp3_ = removed_value; - _tmp4_ = ((_tmp3_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); - ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); - _vala_value = _tmp4_; - } - result = _result_; - ((removed_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (removed_value = (self->priv->v_destroy_func (removed_value), NULL)); - if (value) { - *value = _vala_value; - } else { - ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); - } - return result; -} - - /** * {@inheritDoc} */ @@ -460,249 +499,188 @@ void gee_abstract_map_clear (GeeAbstractMap* self) { /** * {@inheritDoc} */ -static void gee_abstract_map_real_set_all (GeeAbstractMap* self, GeeMap* map) { - g_return_if_fail (map != NULL); - { - GeeMap* _tmp0_; - GeeSet* _tmp1_; - GeeSet* _tmp2_; - GeeSet* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _tmp5_; - GeeIterator* _entry_it; - _tmp0_ = map; - _tmp1_ = gee_map_get_entries (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _tmp5_ = _tmp4_; - _g_object_unref0 (_tmp3_); - _entry_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - GeeMapEntry* entry; - GeeMapEntry* _tmp10_; - gconstpointer _tmp11_; - gconstpointer _tmp12_; - GeeMapEntry* _tmp13_; - gconstpointer _tmp14_; - gconstpointer _tmp15_; - _tmp6_ = _entry_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _entry_it; - _tmp9_ = gee_iterator_get (_tmp8_); - entry = (GeeMapEntry*) _tmp9_; - _tmp10_ = entry; - _tmp11_ = gee_map_entry_get_key (_tmp10_); - _tmp12_ = _tmp11_; - _tmp13_ = entry; - _tmp14_ = gee_map_entry_get_value (_tmp13_); - _tmp15_ = _tmp14_; - gee_abstract_map_set (self, _tmp12_, _tmp15_); - _g_object_unref0 (entry); - } - _g_object_unref0 (_entry_it); - } -} - - -void gee_abstract_map_set_all (GeeAbstractMap* self, GeeMap* map) { - g_return_if_fail (self != NULL); - GEE_ABSTRACT_MAP_GET_CLASS (self)->set_all (self, map); +static GeeIterator* gee_abstract_map_real_iterator (GeeIterable* base) { + GeeAbstractMap * self; + GeeIterator* result = NULL; + GeeSet* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeIterator* _tmp3_ = NULL; + GeeIterator* _tmp4_; + self = (GeeAbstractMap*) base; + _tmp0_ = gee_map_get_entries ((GeeMap*) self); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_; + _tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_); + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; } /** * {@inheritDoc} */ -static gboolean gee_abstract_map_real_unset_all (GeeAbstractMap* self, GeeMap* map) { +static gboolean gee_abstract_map_real_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target) { gboolean result = FALSE; - gboolean changed; - g_return_val_if_fail (map != NULL, FALSE); - changed = FALSE; - { - GeeMap* _tmp0_; - GeeSet* _tmp1_; - GeeSet* _tmp2_; - GeeSet* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _tmp5_; - GeeIterator* _key_it; - _tmp0_ = map; - _tmp1_ = gee_map_get_keys (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _tmp5_ = _tmp4_; - _g_object_unref0 (_tmp3_); - _key_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gpointer key; - gboolean _tmp10_; - gconstpointer _tmp11_; - gboolean _tmp12_ = FALSE; - _tmp6_ = _key_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _key_it; - _tmp9_ = gee_iterator_get (_tmp8_); - key = _tmp9_; - _tmp10_ = changed; - _tmp11_ = key; - _tmp12_ = gee_abstract_map_unset (self, _tmp11_, NULL); - changed = _tmp10_ | _tmp12_; - ((key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (key = (self->priv->k_destroy_func (key), NULL)); - } - _g_object_unref0 (_key_it); - } - result = changed; + GeeIterator* _tmp0_ = NULL; + GeeIterator* _tmp1_; + GeeForallFunc _tmp2_; + void* _tmp2__target; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_; + _tmp0_ = gee_iterable_iterator ((GeeIterable*) self); + _tmp1_ = _tmp0_; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_traversable_foreach ((GeeTraversable*) _tmp1_, _tmp2_, _tmp2__target); + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; return result; } -gboolean gee_abstract_map_unset_all (GeeAbstractMap* self, GeeMap* map) { +gboolean gee_abstract_map_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target) { g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_MAP_GET_CLASS (self)->unset_all (self, map); + return GEE_ABSTRACT_MAP_GET_CLASS (self)->foreach (self, f, f_target); } /** * {@inheritDoc} */ -static gboolean gee_abstract_map_real_remove_all (GeeMap* base, GeeMap* map) { - GeeAbstractMap * self; - gboolean result = FALSE; - GeeMap* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeAbstractMap*) base; - g_return_val_if_fail (map != NULL, FALSE); - _tmp0_ = map; - _tmp1_ = gee_abstract_map_unset_all (self, _tmp0_); - result = _tmp1_; +static GeeIterator* gee_abstract_map_real_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeIterator* result = NULL; + GeeIterator* _tmp0_ = NULL; + GeeIterator* _tmp1_; + GeeStreamFunc _tmp2_; + void* _tmp2__target; + GDestroyNotify _tmp2__target_destroy_notify; + GeeIterator* _tmp3_ = NULL; + GeeIterator* _tmp4_; + _tmp0_ = gee_iterable_iterator ((GeeIterable*) self); + _tmp1_ = _tmp0_; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp2__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp3_ = gee_traversable_stream ((GeeTraversable*) _tmp1_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify); + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; return result; } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_map_real_has_all (GeeAbstractMap* self, GeeMap* map) { - gboolean result = FALSE; - g_return_val_if_fail (map != NULL, FALSE); - { - GeeMap* _tmp0_; - GeeSet* _tmp1_; - GeeSet* _tmp2_; - GeeSet* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _tmp5_; - GeeIterator* _entry_it; - _tmp0_ = map; - _tmp1_ = gee_map_get_entries (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = _tmp2_; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _tmp5_ = _tmp4_; - _g_object_unref0 (_tmp3_); - _entry_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - GeeMapEntry* entry; - GeeMapEntry* _tmp10_; - gconstpointer _tmp11_; - gconstpointer _tmp12_; - GeeMapEntry* _tmp13_; - gconstpointer _tmp14_; - gconstpointer _tmp15_; - gboolean _tmp16_ = FALSE; - _tmp6_ = _entry_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _entry_it; - _tmp9_ = gee_iterator_get (_tmp8_); - entry = (GeeMapEntry*) _tmp9_; - _tmp10_ = entry; - _tmp11_ = gee_map_entry_get_key (_tmp10_); - _tmp12_ = _tmp11_; - _tmp13_ = entry; - _tmp14_ = gee_map_entry_get_value (_tmp13_); - _tmp15_ = _tmp14_; - _tmp16_ = gee_abstract_map_has (self, _tmp12_, _tmp15_); - if (!_tmp16_) { - result = FALSE; - _g_object_unref0 (entry); - _g_object_unref0 (_entry_it); - return result; - } - _g_object_unref0 (entry); - } - _g_object_unref0 (_entry_it); - } - result = TRUE; - return result; +GeeIterator* gee_abstract_map_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MAP_GET_CLASS (self)->stream (self, a_type, a_dup_func, a_destroy_func, f, f_target, f_target_destroy_notify); } -gboolean gee_abstract_map_has_all (GeeAbstractMap* self, GeeMap* map) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_MAP_GET_CLASS (self)->has_all (self, map); +static void gee_abstract_map_real_reserved0 (GeeAbstractMap* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_map_real_contains_all (GeeMap* base, GeeMap* map) { - GeeAbstractMap * self; - gboolean result = FALSE; - GeeMap* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeAbstractMap*) base; - g_return_val_if_fail (map != NULL, FALSE); - _tmp0_ = map; - _tmp1_ = gee_abstract_map_has_all (self, _tmp0_); - result = _tmp1_; - return result; +void gee_abstract_map_reserved0 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved0 (self); } -/** - * {@inheritDoc} - */ -static GeeIterator* gee_abstract_map_real_iterator (GeeIterable* base) { - GeeAbstractMap * self; - GeeIterator* result = NULL; - GeeSet* _tmp0_; - GeeSet* _tmp1_; - GeeSet* _tmp2_; - GeeIterator* _tmp3_ = NULL; - GeeIterator* _tmp4_; - self = (GeeAbstractMap*) base; - _tmp0_ = gee_map_get_entries ((GeeMap*) self); - _tmp1_ = _tmp0_; - _tmp2_ = _tmp1_; - _tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_); - _tmp4_ = _tmp3_; - _g_object_unref0 (_tmp2_); - result = _tmp4_; - return result; +static void gee_abstract_map_real_reserved1 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved1 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_map_real_reserved2 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved2 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_map_real_reserved3 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved3 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_map_real_reserved4 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved4 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_map_real_reserved5 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved5 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_map_real_reserved6 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved6 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_map_real_reserved7 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved7 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_map_real_reserved8 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved8 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_map_real_reserved9 (GeeAbstractMap* self) { +} + + +void gee_abstract_map_reserved9 (GeeAbstractMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MAP_GET_CLASS (self)->reserved9 (self); } @@ -725,22 +703,9 @@ gint gee_abstract_map_get_size (GeeAbstractMap* self) { } -gboolean gee_abstract_map_get_is_empty (GeeAbstractMap* self) { +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self) { g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_MAP_GET_CLASS (self)->get_is_empty (self); -} - - -static gboolean gee_abstract_map_real_get_is_empty (GeeAbstractMap* base) { - gboolean result; - GeeAbstractMap* self; - gint _tmp0_; - gint _tmp1_; - self = base; - _tmp0_ = gee_map_get_size ((GeeMap*) self); - _tmp1_ = _tmp0_; - result = _tmp1_ == 0; - return result; + return GEE_ABSTRACT_MAP_GET_CLASS (self)->get_read_only (self); } @@ -802,33 +767,6 @@ static GeeMap* gee_abstract_map_real_get_read_only_view (GeeAbstractMap* base) { } -static GType gee_abstract_map_real_get_key_type (GeeMap* base) { - GType result; - GeeAbstractMap* self; - self = (GeeAbstractMap*) base; - result = self->priv->k_type; - return result; -} - - -static GType gee_abstract_map_real_get_value_type (GeeMap* base) { - GType result; - GeeAbstractMap* self; - self = (GeeAbstractMap*) base; - result = self->priv->v_type; - return result; -} - - -static GType gee_abstract_map_real_get_element_type (GeeIterable* base) { - GType result; - GeeAbstractMap* self; - self = (GeeAbstractMap*) base; - result = GEE_MAP_TYPE_ENTRY; - return result; -} - - static void gee_abstract_map_class_init (GeeAbstractMapClass * klass) { gee_abstract_map_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeAbstractMapPrivate)); @@ -839,10 +777,18 @@ static void gee_abstract_map_class_init (GeeAbstractMapClass * klass) { GEE_ABSTRACT_MAP_CLASS (klass)->unset = gee_abstract_map_real_unset; GEE_ABSTRACT_MAP_CLASS (klass)->map_iterator = gee_abstract_map_real_map_iterator; GEE_ABSTRACT_MAP_CLASS (klass)->clear = gee_abstract_map_real_clear; - GEE_ABSTRACT_MAP_CLASS (klass)->set_all = gee_abstract_map_real_set_all; - GEE_ABSTRACT_MAP_CLASS (klass)->unset_all = gee_abstract_map_real_unset_all; - GEE_ABSTRACT_MAP_CLASS (klass)->has_all = gee_abstract_map_real_has_all; - GEE_ABSTRACT_MAP_CLASS (klass)->get_is_empty = gee_abstract_map_real_get_is_empty; + GEE_ABSTRACT_MAP_CLASS (klass)->foreach = gee_abstract_map_real_foreach; + GEE_ABSTRACT_MAP_CLASS (klass)->stream = gee_abstract_map_real_stream; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved0 = gee_abstract_map_real_reserved0; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved1 = gee_abstract_map_real_reserved1; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved2 = gee_abstract_map_real_reserved2; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved3 = gee_abstract_map_real_reserved3; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved4 = gee_abstract_map_real_reserved4; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved5 = gee_abstract_map_real_reserved5; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved6 = gee_abstract_map_real_reserved6; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved7 = gee_abstract_map_real_reserved7; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved8 = gee_abstract_map_real_reserved8; + GEE_ABSTRACT_MAP_CLASS (klass)->reserved9 = gee_abstract_map_real_reserved9; GEE_ABSTRACT_MAP_CLASS (klass)->get_read_only_view = gee_abstract_map_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_map_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_map_set_property; @@ -860,7 +806,7 @@ static void gee_abstract_map_class_init (GeeAbstractMapClass * klass) { /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -877,52 +823,109 @@ static void gee_abstract_map_class_init (GeeAbstractMapClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_KEY_TYPE, g_param_spec_gtype ("key-type", "key-type", "key-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_VALUE_TYPE, g_param_spec_gtype ("value-type", "value-type", "value-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MAP_ELEMENT_TYPE, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_map_gee_traversable_get_g_type (GeeAbstractMap* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_abstract_map_gee_traversable_get_g_dup_func (GeeAbstractMap* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_abstract_map_gee_traversable_get_g_destroy_func (GeeAbstractMap* self) { + return g_object_unref; +} + + +static void gee_abstract_map_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_map_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_map_foreach; + iface->stream = (GeeIterator* (*)(GeeTraversable*, GType, GBoxedCopyFunc, GDestroyNotify, GeeStreamFunc, void*, GDestroyNotify)) gee_abstract_map_stream; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_map_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_map_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_map_gee_traversable_get_g_destroy_func; +} + + +static GType gee_abstract_map_gee_iterable_get_g_type (GeeAbstractMap* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_abstract_map_gee_iterable_get_g_dup_func (GeeAbstractMap* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_abstract_map_gee_iterable_get_g_destroy_func (GeeAbstractMap* self) { + return g_object_unref; } static void gee_abstract_map_gee_iterable_interface_init (GeeIterableIface * iface) { gee_abstract_map_gee_iterable_parent_iface = g_type_interface_peek_parent (iface); iface->iterator = (GeeIterator* (*)(GeeIterable*)) gee_abstract_map_real_iterator; - iface->get_element_type = gee_abstract_map_real_get_element_type; + iface->get_g_type = (GType(*)(GeeIterable*)) gee_abstract_map_gee_iterable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeIterable*)) gee_abstract_map_gee_iterable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeIterable*)) gee_abstract_map_gee_iterable_get_g_destroy_func; +} + + +static GType gee_abstract_map_gee_map_get_k_type (GeeAbstractMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_map_gee_map_get_k_dup_func (GeeAbstractMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_map_gee_map_get_k_destroy_func (GeeAbstractMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_abstract_map_gee_map_get_v_type (GeeAbstractMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_abstract_map_gee_map_get_v_dup_func (GeeAbstractMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_abstract_map_gee_map_get_v_destroy_func (GeeAbstractMap* self) { + return self->priv->v_destroy_func; } static void gee_abstract_map_gee_map_interface_init (GeeMapIface * iface) { gee_abstract_map_gee_map_parent_iface = g_type_interface_peek_parent (iface); iface->has_key = (gboolean (*)(GeeMap*, gconstpointer)) gee_abstract_map_has_key; - iface->contains = (gboolean (*)(GeeMap*, gconstpointer)) gee_abstract_map_real_contains; iface->has = (gboolean (*)(GeeMap*, gconstpointer, gconstpointer)) gee_abstract_map_has; iface->get = (gpointer (*)(GeeMap*, gconstpointer)) gee_abstract_map_get; iface->set = (void (*)(GeeMap*, gconstpointer, gconstpointer)) gee_abstract_map_set; iface->unset = (gboolean (*)(GeeMap*, gconstpointer, gpointer*)) gee_abstract_map_unset; iface->map_iterator = (GeeMapIterator* (*)(GeeMap*)) gee_abstract_map_map_iterator; - iface->remove = (gboolean (*)(GeeMap*, gconstpointer, gpointer*)) gee_abstract_map_real_remove; iface->clear = (void (*)(GeeMap*)) gee_abstract_map_clear; - iface->set_all = (void (*)(GeeMap*, GeeMap*)) gee_abstract_map_set_all; - iface->unset_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_abstract_map_unset_all; - iface->remove_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_abstract_map_real_remove_all; - iface->has_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_abstract_map_has_all; - iface->contains_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_abstract_map_real_contains_all; + iface->get_k_type = (GType(*)(GeeMap*)) gee_abstract_map_gee_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMap*)) gee_abstract_map_gee_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMap*)) gee_abstract_map_gee_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMap*)) gee_abstract_map_gee_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMap*)) gee_abstract_map_gee_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMap*)) gee_abstract_map_gee_map_get_v_destroy_func; iface->get_size = (gint (*) (GeeMap *)) gee_abstract_map_get_size; - iface->get_is_empty = (gboolean (*) (GeeMap *)) gee_abstract_map_get_is_empty; + iface->get_read_only = (gboolean (*) (GeeMap *)) gee_abstract_map_get_read_only; iface->get_keys = (GeeSet* (*) (GeeMap *)) gee_abstract_map_get_keys; iface->get_values = (GeeCollection* (*) (GeeMap *)) gee_abstract_map_get_values; iface->get_entries = (GeeSet* (*) (GeeMap *)) gee_abstract_map_get_entries; iface->get_read_only_view = (GeeMap* (*) (GeeMap *)) gee_abstract_map_get_read_only_view; - iface->get_key_type = gee_abstract_map_real_get_key_type; - iface->get_value_type = gee_abstract_map_real_get_value_type; } @@ -950,10 +953,12 @@ GType gee_abstract_map_get_type (void) { static volatile gsize gee_abstract_map_type_id__volatile = 0; if (g_once_init_enter (&gee_abstract_map_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMap), 0, (GInstanceInitFunc) gee_abstract_map_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_map_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterable_info = { (GInterfaceInitFunc) gee_abstract_map_gee_iterable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_map_info = { (GInterfaceInitFunc) gee_abstract_map_gee_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_abstract_map_type_id; gee_abstract_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractMap", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_map_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_abstract_map_type_id, GEE_TYPE_ITERABLE, &gee_iterable_info); g_type_add_interface_static (gee_abstract_map_type_id, GEE_TYPE_MAP, &gee_map_info); g_once_init_leave (&gee_abstract_map_type_id__volatile, gee_abstract_map_type_id); @@ -966,21 +971,9 @@ static void _vala_gee_abstract_map_get_property (GObject * object, guint propert GeeAbstractMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap); switch (property_id) { - case GEE_ABSTRACT_MAP_IS_EMPTY: - g_value_set_boolean (value, gee_abstract_map_get_is_empty (self)); - break; case GEE_ABSTRACT_MAP_READ_ONLY_VIEW: g_value_take_object (value, gee_abstract_map_get_read_only_view (self)); break; - case GEE_ABSTRACT_MAP_KEY_TYPE: - g_value_set_gtype (value, gee_map_get_key_type ((GeeMap*) self)); - break; - case GEE_ABSTRACT_MAP_VALUE_TYPE: - g_value_set_gtype (value, gee_map_get_value_type ((GeeMap*) self)); - break; - case GEE_ABSTRACT_MAP_ELEMENT_TYPE: - g_value_set_gtype (value, gee_iterable_get_element_type ((GeeIterable*) self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/gee/abstractmap.vala b/gee/abstractmap.vala index 191a823..cd761b8 100644 --- a/gee/abstractmap.vala +++ b/gee/abstractmap.vala @@ -29,19 +29,17 @@ * @see HashMap * @see TreeMap */ -public abstract class Gee.AbstractMap : Object, Iterable>, Map { +public abstract class Gee.AbstractMap : Object, Traversable>, Iterable>, Map { /** * {@inheritDoc} */ public abstract int size { get; } - + /** * {@inheritDoc} */ - public virtual bool is_empty { - get { return size == 0; } - } + public abstract bool read_only { get; } /** * {@inheritDoc} @@ -63,13 +61,6 @@ public abstract class Gee.AbstractMap : Object, Iterable>, M */ public abstract bool has_key (K key); - /** - * {@inheritDoc} - */ - public bool contains (K key) { - return has_key (key); - } - /** * {@inheritDoc} */ @@ -95,69 +86,11 @@ public abstract class Gee.AbstractMap : Object, Iterable>, M */ public abstract MapIterator map_iterator (); - /** - * {@inheritDoc} - */ - public bool remove (K key, out V? value = null) { - V removed_value; - bool result = unset (key, out removed_value); - if (&value != null) { - value = removed_value; - } - return result; - } - /** * {@inheritDoc} */ public abstract void clear (); - /** - * {@inheritDoc} - */ - public virtual void set_all (Map map) { - foreach (Map.Entry entry in map.entries) { - set (entry.key, entry.value); - } - } - - /** - * {@inheritDoc} - */ - public virtual bool unset_all (Map map) { - bool changed = false; - foreach (K key in map.keys) { - changed = changed | unset (key); - } - return changed; - } - - /** - * {@inheritDoc} - */ - public bool remove_all (Map map) { - return unset_all (map); - } - - /** - * {@inheritDoc} - */ - public virtual bool has_all (Map map) { - foreach (Map.Entry entry in map.entries) { - if (!has (entry.key, entry.value)) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - public bool contains_all (Map map) { - return has_all (map); - } - private weak Map _read_only_view; /** @@ -178,28 +111,33 @@ public abstract class Gee.AbstractMap : Object, Iterable>, M /** * {@inheritDoc} */ - public Type key_type { - get { return typeof (K); } + public Iterator> iterator () { + return entries.iterator (); } /** * {@inheritDoc} */ - public Type value_type { - get { return typeof (V); } + public virtual bool foreach (ForallFunc> f) { + return iterator ().foreach (f); } /** * {@inheritDoc} */ - public Type element_type { - get { return typeof (Map.Entry); } + public virtual Iterator stream (owned StreamFunc, A> f) { + return iterator ().stream ((owned) f); } - /** - * {@inheritDoc} - */ - public Iterator> iterator () { - return entries.iterator (); - } + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} } diff --git a/gee/abstractmultimap.c b/gee/abstractmultimap.c index f417508..41284de 100644 --- a/gee/abstractmultimap.c +++ b/gee/abstractmultimap.c @@ -36,13 +36,25 @@ typedef struct _GeeMultiMap GeeMultiMap; typedef struct _GeeMultiMapIface GeeMultiMapIface; -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -52,6 +64,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -76,6 +96,14 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeMultiSet GeeMultiSet; typedef struct _GeeMultiSetIface GeeMultiSetIface; +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + #define GEE_TYPE_ABSTRACT_MULTI_MAP (gee_abstract_multi_map_get_type ()) #define GEE_ABSTRACT_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap)) #define GEE_ABSTRACT_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapClass)) @@ -95,14 +123,6 @@ typedef struct _GeeAbstractMultiMapPrivate GeeAbstractMultiMapPrivate; typedef struct _GeeMap GeeMap; typedef struct _GeeMapIface GeeMapIface; -#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) -#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) -#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) -#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) - -typedef struct _GeeMapIterator GeeMapIterator; -typedef struct _GeeMapIteratorIface GeeMapIteratorIface; - #define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) #define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) #define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) @@ -124,43 +144,137 @@ typedef struct _GeeMapEntryClass GeeMapEntryClass; typedef struct _GeeAbstractCollection GeeAbstractCollection; typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; -#define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ()) -#define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList)) -#define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) -#define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST)) -#define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST)) -#define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) - -typedef struct _GeeAbstractList GeeAbstractList; -typedef struct _GeeAbstractListClass GeeAbstractListClass; - -#define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) -#define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) -#define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) -#define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST)) -#define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST)) -#define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) - -typedef struct _GeeArrayList GeeArrayList; -typedef struct _GeeArrayListClass GeeArrayListClass; - +#define GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS (gee_abstract_multi_map_all_keys_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_ALL_KEYS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeys)) +#define GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeysClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_ALL_KEYS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS)) +#define GEE_ABSTRACT_MULTI_MAP_IS_ALL_KEYS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS)) +#define GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeysClass)) + +typedef struct _GeeAbstractMultiMapAllKeys GeeAbstractMultiMapAllKeys; +typedef struct _GeeAbstractMultiMapAllKeysClass GeeAbstractMultiMapAllKeysClass; + +#define GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES (gee_abstract_multi_map_values_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_VALUES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValues)) +#define GEE_ABSTRACT_MULTI_MAP_VALUES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValuesClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_VALUES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES)) +#define GEE_ABSTRACT_MULTI_MAP_IS_VALUES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES)) +#define GEE_ABSTRACT_MULTI_MAP_VALUES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValuesClass)) + +typedef struct _GeeAbstractMultiMapValues GeeAbstractMultiMapValues; +typedef struct _GeeAbstractMultiMapValuesClass GeeAbstractMultiMapValuesClass; + +#define GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR (gee_abstract_multi_map_mapping_iterator_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIterator)) +#define GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIteratorClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_MAPPING_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_IS_MAPPING_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIteratorClass)) + +typedef struct _GeeAbstractMultiMapMappingIterator GeeAbstractMultiMapMappingIterator; +typedef struct _GeeAbstractMultiMapMappingIteratorClass GeeAbstractMultiMapMappingIteratorClass; + +#define GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR (gee_abstract_multi_map_map_iterator_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIterator)) +#define GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIteratorClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_IS_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIteratorClass)) + +typedef struct _GeeAbstractMultiMapMapIterator GeeAbstractMultiMapMapIterator; +typedef struct _GeeAbstractMultiMapMapIteratorClass GeeAbstractMultiMapMapIteratorClass; + +#define GEE_TYPE_READ_ONLY_MULTI_MAP (gee_read_only_multi_map_get_type ()) +#define GEE_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap)) +#define GEE_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) +#define GEE_IS_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_IS_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_READ_ONLY_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) + +typedef struct _GeeReadOnlyMultiMap GeeReadOnlyMultiMap; +typedef struct _GeeReadOnlyMultiMapClass GeeReadOnlyMultiMapClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; +typedef struct _GeeAbstractMultiMapAllKeysPrivate GeeAbstractMultiMapAllKeysPrivate; + +#define GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR (gee_abstract_multi_map_key_iterator_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIterator)) +#define GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIteratorClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_KEY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_IS_KEY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIteratorClass)) + +typedef struct _GeeAbstractMultiMapKeyIterator GeeAbstractMultiMapKeyIterator; +typedef struct _GeeAbstractMultiMapKeyIteratorClass GeeAbstractMultiMapKeyIteratorClass; +typedef struct _GeeAbstractMultiMapValuesPrivate GeeAbstractMultiMapValuesPrivate; + +#define GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR (gee_abstract_multi_map_value_iterator_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIterator)) +#define GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIteratorClass)) +#define GEE_ABSTRACT_MULTI_MAP_IS_VALUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_IS_VALUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR)) +#define GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIteratorClass)) + +typedef struct _GeeAbstractMultiMapValueIterator GeeAbstractMultiMapValueIterator; +typedef struct _GeeAbstractMultiMapValueIteratorClass GeeAbstractMultiMapValueIteratorClass; +typedef struct _GeeAbstractMultiMapMappingIteratorPrivate GeeAbstractMultiMapMappingIteratorPrivate; +typedef struct _GeeAbstractMultiMapKeyIteratorPrivate GeeAbstractMultiMapKeyIteratorPrivate; +typedef struct _Block1Data Block1Data; +typedef struct _Block2Data Block2Data; +typedef struct _Block3Data Block3Data; +typedef struct _GeeAbstractMultiMapValueIteratorPrivate GeeAbstractMultiMapValueIteratorPrivate; +typedef struct _Block4Data Block4Data; +typedef struct _GeeAbstractMultiMapMapIteratorPrivate GeeAbstractMultiMapMapIteratorPrivate; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -172,21 +286,58 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeMultiMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); GeeSet* (*get_keys) (GeeMultiMap* self); GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); GeeCollection* (*get_values) (GeeMultiMap* self); @@ -196,44 +347,38 @@ struct _GeeMultiMapIface { gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); }; -struct _GeeMapIteratorIface { - GTypeInterface parent_iface; - gboolean (*next) (GeeMapIterator* self); - gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); - gpointer (*get_key) (GeeMapIterator* self); - gpointer (*get_value) (GeeMapIterator* self); - void (*set_value) (GeeMapIterator* self, gconstpointer value); - void (*unset) (GeeMapIterator* self); -}; - +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiMap { @@ -246,7 +391,17 @@ struct _GeeAbstractMultiMapClass { GObjectClass parent_class; GeeCollection* (*create_value_storage) (GeeAbstractMultiMap* self); GeeMultiSet* (*create_multi_key_set) (GeeAbstractMultiMap* self); - GEqualFunc (*get_value_equal_func) (GeeAbstractMultiMap* self); + GeeEqualDataFunc (*get_value_equal_func) (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); + void (*reserved0) (GeeAbstractMultiMap* self); + void (*reserved1) (GeeAbstractMultiMap* self); + void (*reserved2) (GeeAbstractMultiMap* self); + void (*reserved3) (GeeAbstractMultiMap* self); + void (*reserved4) (GeeAbstractMultiMap* self); + void (*reserved5) (GeeAbstractMultiMap* self); + void (*reserved6) (GeeAbstractMultiMap* self); + void (*reserved7) (GeeAbstractMultiMap* self); + void (*reserved8) (GeeAbstractMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeAbstractMultiMap* self); }; struct _GeeAbstractMultiMapPrivate { @@ -257,21 +412,209 @@ struct _GeeAbstractMultiMapPrivate { GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; gint _nitems; - GeeSet* _empty_value_set; + GeeMultiMap* _read_only_view; +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeAbstractMultiMapAllKeys { + GeeAbstractCollection parent_instance; + GeeAbstractMultiMapAllKeysPrivate * priv; + GeeAbstractMultiMap* _multi_map; +}; + +struct _GeeAbstractMultiMapAllKeysClass { + GeeAbstractCollectionClass parent_class; +}; + +struct _GeeAbstractMultiMapAllKeysPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _GeeAbstractMultiMapValues { + GeeAbstractCollection parent_instance; + GeeAbstractMultiMapValuesPrivate * priv; + GeeAbstractMultiMap* _multi_map; +}; + +struct _GeeAbstractMultiMapValuesClass { + GeeAbstractCollectionClass parent_class; +}; + +struct _GeeAbstractMultiMapValuesPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _GeeAbstractMultiMapMappingIterator { + GObject parent_instance; + GeeAbstractMultiMapMappingIteratorPrivate * priv; + GeeMapIterator* outer; + GeeIterator* inner; +}; + +struct _GeeAbstractMultiMapMappingIteratorClass { + GObjectClass parent_class; + gboolean (*get_read_only) (GeeAbstractMultiMapMappingIterator* self); +}; + +struct _GeeAbstractMultiMapMappingIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _GeeAbstractMultiMapKeyIterator { + GeeAbstractMultiMapMappingIterator parent_instance; + GeeAbstractMultiMapKeyIteratorPrivate * priv; +}; + +struct _GeeAbstractMultiMapKeyIteratorClass { + GeeAbstractMultiMapMappingIteratorClass parent_class; +}; + +struct _GeeAbstractMultiMapKeyIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _Block1Data { + int _ref_count_; + GeeAbstractMultiMapKeyIterator * self; + GeeForallFunc f; + gpointer f_target; +}; + +struct _Block2Data { + int _ref_count_; + Block1Data * _data1_; + gpointer key; +}; + +struct _Block3Data { + int _ref_count_; + Block1Data * _data1_; + gpointer key; +}; + +struct _GeeAbstractMultiMapValueIterator { + GeeAbstractMultiMapMappingIterator parent_instance; + GeeAbstractMultiMapValueIteratorPrivate * priv; +}; + +struct _GeeAbstractMultiMapValueIteratorClass { + GeeAbstractMultiMapMappingIteratorClass parent_class; +}; + +struct _GeeAbstractMultiMapValueIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _Block4Data { + int _ref_count_; + GeeAbstractMultiMapValueIterator * self; + GeeForallFunc f; + gpointer f_target; +}; + +struct _GeeAbstractMultiMapMapIterator { + GeeAbstractMultiMapMappingIterator parent_instance; + GeeAbstractMultiMapMapIteratorPrivate * priv; +}; + +struct _GeeAbstractMultiMapMapIteratorClass { + GeeAbstractMultiMapMappingIteratorClass parent_class; +}; + +struct _GeeAbstractMultiMapMapIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; }; static gpointer gee_abstract_multi_map_parent_class = NULL; +static gpointer gee_abstract_multi_map_all_keys_parent_class = NULL; +static GeeMultiSetIface* gee_abstract_multi_map_all_keys_gee_multi_set_parent_iface = NULL; +static gpointer gee_abstract_multi_map_values_parent_class = NULL; +static gpointer gee_abstract_multi_map_mapping_iterator_parent_class = NULL; +static gpointer gee_abstract_multi_map_key_iterator_parent_class = NULL; +static GeeTraversableIface* gee_abstract_multi_map_key_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_abstract_multi_map_key_iterator_gee_iterator_parent_iface = NULL; +static gpointer gee_abstract_multi_map_value_iterator_parent_class = NULL; +static GeeTraversableIface* gee_abstract_multi_map_value_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_abstract_multi_map_value_iterator_gee_iterator_parent_iface = NULL; +static gpointer gee_abstract_multi_map_map_iterator_parent_class = NULL; +static GeeMapIteratorIface* gee_abstract_multi_map_map_iterator_gee_map_iterator_parent_iface = NULL; static GeeMultiMapIface* gee_abstract_multi_map_gee_multi_map_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_multi_map_get_type (void) G_GNUC_CONST; GType gee_abstract_multi_map_get_type (void) G_GNUC_CONST; -GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_map_entry_get_type (void) G_GNUC_CONST; GType gee_map_get_type (void) G_GNUC_CONST; #define GEE_ABSTRACT_MULTI_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapPrivate)) @@ -283,50 +626,225 @@ enum { GEE_ABSTRACT_MULTI_MAP_V_TYPE, GEE_ABSTRACT_MULTI_MAP_V_DUP_FUNC, GEE_ABSTRACT_MULTI_MAP_V_DESTROY_FUNC, - GEE_ABSTRACT_MULTI_MAP_SIZE + GEE_ABSTRACT_MULTI_MAP_SIZE, + GEE_ABSTRACT_MULTI_MAP_READ_ONLY }; GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* storage_map); -GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self); -static GeeCollection* gee_abstract_multi_map_real_create_value_storage (GeeAbstractMultiMap* self); -GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self); -static GeeMultiSet* gee_abstract_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* self); -GEqualFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self); -static GEqualFunc gee_abstract_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* self); static GeeSet* gee_abstract_multi_map_real_get_keys (GeeMultiMap* base); GeeSet* gee_map_get_keys (GeeMap* self); static GeeMultiSet* gee_abstract_multi_map_real_get_all_keys (GeeMultiMap* base); -GeeSet* gee_map_get_entries (GeeMap* self); -GeeIterator* gee_iterable_iterator (GeeIterable* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -gconstpointer gee_map_entry_get_value (GeeMapEntry* self); -gint gee_collection_get_size (GeeCollection* self); -gboolean gee_collection_add (GeeCollection* self, gconstpointer item); -gconstpointer gee_map_entry_get_key (GeeMapEntry* self); -static GeeCollection* gee_abstract_multi_map_real_get_values (GeeMultiMap* base); -GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); +static GeeAbstractMultiMapAllKeys* gee_abstract_multi_map_all_keys_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map); +static GeeAbstractMultiMapAllKeys* gee_abstract_multi_map_all_keys_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; -GType gee_abstract_list_get_type (void) G_GNUC_CONST; -GType gee_array_list_get_type (void) G_GNUC_CONST; -gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); +static GType gee_abstract_multi_map_all_keys_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeCollection* gee_abstract_multi_map_real_get_values (GeeMultiMap* base); +static GeeAbstractMultiMapValues* gee_abstract_multi_map_values_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map); +static GeeAbstractMultiMapValues* gee_abstract_multi_map_values_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map); +static GType gee_abstract_multi_map_values_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static gboolean gee_abstract_multi_map_real_contains (GeeMultiMap* base, gconstpointer key); gboolean gee_map_has_key (GeeMap* self, gconstpointer key); static GeeCollection* gee_abstract_multi_map_real_get (GeeMultiMap* base, gconstpointer key); gpointer gee_map_get (GeeMap* self, gconstpointer key); GeeCollection* gee_collection_get_read_only_view (GeeCollection* self); +GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static void gee_abstract_multi_map_real_set (GeeMultiMap* base, gconstpointer key, gconstpointer value); +gboolean gee_collection_add (GeeCollection* self, gconstpointer item); +GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self); void gee_map_set (GeeMap* self, gconstpointer key, gconstpointer value); static gboolean gee_abstract_multi_map_real_remove (GeeMultiMap* base, gconstpointer key, gconstpointer value); gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); gboolean gee_collection_remove (GeeCollection* self, gconstpointer item); +gint gee_collection_get_size (GeeCollection* self); gboolean gee_map_unset (GeeMap* self, gconstpointer key, gpointer* value); static gboolean gee_abstract_multi_map_real_remove_all (GeeMultiMap* base, gconstpointer key); static void gee_abstract_multi_map_real_clear (GeeMultiMap* base); void gee_map_clear (GeeMap* self); -static void gee_abstract_multi_map_finalize (GObject* obj); +static GeeMapIterator* gee_abstract_multi_map_real_map_iterator (GeeMultiMap* base); +GeeMapIterator* gee_map_map_iterator (GeeMap* self); +static GeeAbstractMultiMapMapIterator* gee_abstract_multi_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GeeAbstractMultiMapMapIterator* gee_abstract_multi_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GType gee_abstract_multi_map_mapping_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GType gee_abstract_multi_map_map_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeCollection* gee_abstract_multi_map_real_create_value_storage (GeeAbstractMultiMap* self); +GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self); +static GeeMultiSet* gee_abstract_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* self); +GeeEqualDataFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); +static GeeEqualDataFunc gee_abstract_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); +void gee_abstract_multi_map_reserved0 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved0 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved1 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved1 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved2 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved2 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved3 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved3 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved4 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved4 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved5 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved5 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved6 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved6 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved7 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved7 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved8 (GeeAbstractMultiMap* self); +static void gee_abstract_multi_map_real_reserved8 (GeeAbstractMultiMap* self); +GeeMultiMap* gee_abstract_multi_map_get_read_only_view (GeeAbstractMultiMap* self); +GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GeeReadOnlyMultiMap* gee_read_only_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GType gee_read_only_multi_map_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeysPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_SIZE, + GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_READ_ONLY +}; +GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static GeeIterator* gee_abstract_multi_map_all_keys_real_iterator (GeeAbstractCollection* base); +static GeeAbstractMultiMapKeyIterator* gee_abstract_multi_map_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GeeAbstractMultiMapKeyIterator* gee_abstract_multi_map_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GType gee_abstract_multi_map_key_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_abstract_multi_map_all_keys_real_contains (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_abstract_multi_map_all_keys_real_add (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_abstract_multi_map_all_keys_real_remove (GeeAbstractCollection* base, gconstpointer item); +static void gee_abstract_multi_map_all_keys_real_clear (GeeAbstractCollection* base); +static gint gee_abstract_multi_map_all_keys_real_count (GeeMultiSet* base, gconstpointer item); gint gee_multi_map_get_size (GeeMultiMap* self); +static void gee_abstract_multi_map_all_keys_finalize (GObject* obj); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); +static void _vala_gee_abstract_multi_map_all_keys_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_all_keys_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_ABSTRACT_MULTI_MAP_VALUES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValuesPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_VALUES_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_VALUES_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_VALUES_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUES_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUES_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_VALUES_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUES_V_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUES_SIZE, + GEE_ABSTRACT_MULTI_MAP_VALUES_READ_ONLY +}; +static GeeIterator* gee_abstract_multi_map_values_real_iterator (GeeAbstractCollection* base); +static GeeAbstractMultiMapValueIterator* gee_abstract_multi_map_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GeeAbstractMultiMapValueIterator* gee_abstract_multi_map_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GType gee_abstract_multi_map_value_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_abstract_multi_map_values_real_contains (GeeAbstractCollection* base, gconstpointer value); +GeeCollection* gee_map_get_values (GeeMap* self); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gboolean gee_iterator_next (GeeIterator* self); +gpointer gee_iterator_get (GeeIterator* self); +static gboolean gee_abstract_multi_map_values_real_add (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_abstract_multi_map_values_real_remove (GeeAbstractCollection* base, gconstpointer item); +static void gee_abstract_multi_map_values_real_clear (GeeAbstractCollection* base); +static void gee_abstract_multi_map_values_finalize (GObject* obj); +static void _vala_gee_abstract_multi_map_values_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_values_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIteratorPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_READ_ONLY, + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_VALID +}; +static GeeAbstractMultiMapMappingIterator* gee_abstract_multi_map_mapping_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static GeeAbstractMultiMapMappingIterator* gee_abstract_multi_map_mapping_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer); +static gboolean gee_abstract_multi_map_mapping_iterator_next (GeeAbstractMultiMapMappingIterator* self); +gboolean gee_map_iterator_next (GeeMapIterator* self); +gpointer gee_map_iterator_get_value (GeeMapIterator* self); +static gboolean gee_abstract_multi_map_mapping_iterator_has_next (GeeAbstractMultiMapMappingIterator* self); +gboolean gee_iterator_has_next (GeeIterator* self); +gboolean gee_map_iterator_has_next (GeeMapIterator* self); +static void gee_abstract_multi_map_mapping_iterator_remove (GeeAbstractMultiMapMappingIterator* self); +static void gee_abstract_multi_map_mapping_iterator_unset (GeeAbstractMultiMapMappingIterator* self); +void gee_iterator_remove (GeeIterator* self); +gboolean gee_collection_get_is_empty (GeeCollection* self); +void gee_map_iterator_unset (GeeMapIterator* self); +static gboolean gee_abstract_multi_map_mapping_iterator_get_read_only (GeeAbstractMultiMapMappingIterator* self); +static gboolean gee_abstract_multi_map_mapping_iterator_get_valid (GeeAbstractMultiMapMappingIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); +static void gee_abstract_multi_map_mapping_iterator_finalize (GObject* obj); +static void _vala_gee_abstract_multi_map_mapping_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_mapping_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIteratorPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DESTROY_FUNC +}; +static gpointer gee_abstract_multi_map_key_iterator_real_get (GeeIterator* base); +gpointer gee_map_iterator_get_key (GeeMapIterator* self); +static gboolean gee_abstract_multi_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static Block1Data* block1_data_ref (Block1Data* _data1_); +static void block1_data_unref (void * _userdata_); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); +static Block2Data* block2_data_ref (Block2Data* _data2_); +static void block2_data_unref (void * _userdata_); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static gboolean ___lambda29_ (Block2Data* _data2_, gpointer v); +static gboolean ____lambda29__gee_forall_func (gpointer g, gpointer self); +gboolean gee_map_iterator_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); +static gboolean __lambda30_ (Block1Data* _data1_, gconstpointer key, GeeCollection* col); +static Block3Data* block3_data_ref (Block3Data* _data3_); +static void block3_data_unref (void * _userdata_); +static gboolean __lambda31_ (Block3Data* _data3_, gpointer v); +static gboolean ___lambda31__gee_forall_func (gpointer g, gpointer self); +static gboolean ___lambda30__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self); +static void _vala_gee_abstract_multi_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIteratorPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DESTROY_FUNC +}; +static gpointer gee_abstract_multi_map_value_iterator_real_get (GeeIterator* base); +static gboolean gee_abstract_multi_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static Block4Data* block4_data_ref (Block4Data* _data4_); +static void block4_data_unref (void * _userdata_); +static gboolean __lambda32_ (Block4Data* _data4_, gconstpointer key, GeeCollection* col); +static gboolean ___lambda32__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self); +static void _vala_gee_abstract_multi_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIteratorPrivate)) +enum { + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_DUMMY_PROPERTY, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_TYPE, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_TYPE, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DUP_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_MUTABLE +}; +static gpointer gee_abstract_multi_map_map_iterator_real_get_key (GeeMapIterator* base); +static gpointer gee_abstract_multi_map_map_iterator_real_get_value (GeeMapIterator* base); +static void gee_abstract_multi_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); +static void _vala_gee_abstract_multi_map_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_multi_map_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void gee_abstract_multi_map_finalize (GObject* obj); +gboolean gee_multi_map_get_read_only (GeeMultiMap* self); static void _vala_gee_abstract_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -340,7 +858,6 @@ GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType GeeAbstractMultiMap * self = NULL; GeeMap* _tmp0_; GeeMap* _tmp1_; - GeeSet* _tmp2_ = NULL; g_return_val_if_fail (storage_map != NULL, NULL); self = (GeeAbstractMultiMap*) g_object_new (object_type, NULL); self->priv->k_type = k_type; @@ -353,49 +870,10 @@ GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->_storage_map); self->_storage_map = _tmp1_; - _tmp2_ = gee_set_empty (v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); - _g_object_unref0 (self->priv->_empty_value_set); - self->priv->_empty_value_set = _tmp2_; return self; } -static GeeCollection* gee_abstract_multi_map_real_create_value_storage (GeeAbstractMultiMap* self) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_create_value_storage'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return NULL; -} - - -GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->create_value_storage (self); -} - - -static GeeMultiSet* gee_abstract_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* self) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_create_multi_key_set'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return NULL; -} - - -GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->create_multi_key_set (self); -} - - -static GEqualFunc gee_abstract_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* self) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_get_value_equal_func'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return NULL; -} - - -GEqualFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->get_value_equal_func (self); -} - - static GeeSet* gee_abstract_multi_map_real_get_keys (GeeMultiMap* base) { GeeAbstractMultiMap * self; GeeSet* result = NULL; @@ -414,88 +892,10 @@ static GeeSet* gee_abstract_multi_map_real_get_keys (GeeMultiMap* base) { static GeeMultiSet* gee_abstract_multi_map_real_get_all_keys (GeeMultiMap* base) { GeeAbstractMultiMap * self; GeeMultiSet* result = NULL; - GeeMultiSet* _tmp0_ = NULL; - GeeMultiSet* _result_; + GeeAbstractMultiMapAllKeys* _tmp0_; self = (GeeAbstractMultiMap*) base; - _tmp0_ = gee_abstract_multi_map_create_multi_key_set (self); - _result_ = _tmp0_; - { - GeeMap* _tmp1_; - GeeSet* _tmp2_; - GeeSet* _tmp3_; - GeeSet* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _tmp6_; - GeeIterator* _entry_it; - _tmp1_ = self->_storage_map; - _tmp2_ = gee_map_get_entries (_tmp1_); - _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _tmp6_ = _tmp5_; - _g_object_unref0 (_tmp4_); - _entry_it = _tmp6_; - while (TRUE) { - GeeIterator* _tmp7_; - gboolean _tmp8_ = FALSE; - GeeIterator* _tmp9_; - gpointer _tmp10_ = NULL; - GeeMapEntry* entry; - _tmp7_ = _entry_it; - _tmp8_ = gee_iterator_next (_tmp7_); - if (!_tmp8_) { - break; - } - _tmp9_ = _entry_it; - _tmp10_ = gee_iterator_get (_tmp9_); - entry = (GeeMapEntry*) _tmp10_; - { - gint i; - i = 0; - { - gboolean _tmp11_; - _tmp11_ = TRUE; - while (TRUE) { - gboolean _tmp12_; - gint _tmp14_; - GeeMapEntry* _tmp15_; - gconstpointer _tmp16_; - GeeCollection* _tmp17_; - gint _tmp18_; - gint _tmp19_; - GeeMultiSet* _tmp20_; - GeeMapEntry* _tmp21_; - gconstpointer _tmp22_; - gconstpointer _tmp23_; - _tmp12_ = _tmp11_; - if (!_tmp12_) { - gint _tmp13_; - _tmp13_ = i; - i = _tmp13_ + 1; - } - _tmp11_ = FALSE; - _tmp14_ = i; - _tmp15_ = entry; - _tmp16_ = gee_map_entry_get_value (_tmp15_); - _tmp17_ = _tmp16_; - _tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_); - _tmp19_ = _tmp18_; - if (!(_tmp14_ < _tmp19_)) { - break; - } - _tmp20_ = _result_; - _tmp21_ = entry; - _tmp22_ = gee_map_entry_get_key (_tmp21_); - _tmp23_ = _tmp22_; - gee_collection_add ((GeeCollection*) _tmp20_, _tmp23_); - } - } - } - _g_object_unref0 (entry); - } - _g_object_unref0 (_entry_it); - } - result = _result_; + _tmp0_ = gee_abstract_multi_map_all_keys_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + result = (GeeMultiSet*) _tmp0_; return result; } @@ -503,82 +903,10 @@ static GeeMultiSet* gee_abstract_multi_map_real_get_all_keys (GeeMultiMap* base) static GeeCollection* gee_abstract_multi_map_real_get_values (GeeMultiMap* base) { GeeAbstractMultiMap * self; GeeCollection* result = NULL; - GEqualFunc _tmp0_ = NULL; - GeeArrayList* _tmp1_; - GeeArrayList* _result_; + GeeAbstractMultiMapValues* _tmp0_; self = (GeeAbstractMultiMap*) base; - _tmp0_ = gee_abstract_multi_map_get_value_equal_func (self); - _tmp1_ = gee_array_list_new (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); - _result_ = _tmp1_; - { - GeeMap* _tmp2_; - GeeSet* _tmp3_; - GeeSet* _tmp4_; - GeeSet* _tmp5_; - GeeIterator* _tmp6_ = NULL; - GeeIterator* _tmp7_; - GeeIterator* _entry_it; - _tmp2_ = self->_storage_map; - _tmp3_ = gee_map_get_entries (_tmp2_); - _tmp4_ = _tmp3_; - _tmp5_ = _tmp4_; - _tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_); - _tmp7_ = _tmp6_; - _g_object_unref0 (_tmp5_); - _entry_it = _tmp7_; - while (TRUE) { - GeeIterator* _tmp8_; - gboolean _tmp9_ = FALSE; - GeeIterator* _tmp10_; - gpointer _tmp11_ = NULL; - GeeMapEntry* entry; - _tmp8_ = _entry_it; - _tmp9_ = gee_iterator_next (_tmp8_); - if (!_tmp9_) { - break; - } - _tmp10_ = _entry_it; - _tmp11_ = gee_iterator_get (_tmp10_); - entry = (GeeMapEntry*) _tmp11_; - { - GeeMapEntry* _tmp12_; - gconstpointer _tmp13_; - GeeCollection* _tmp14_; - GeeIterator* _tmp15_ = NULL; - GeeIterator* _value_it; - _tmp12_ = entry; - _tmp13_ = gee_map_entry_get_value (_tmp12_); - _tmp14_ = _tmp13_; - _tmp15_ = gee_iterable_iterator ((GeeIterable*) ((GeeCollection*) _tmp14_)); - _value_it = _tmp15_; - while (TRUE) { - GeeIterator* _tmp16_; - gboolean _tmp17_ = FALSE; - GeeIterator* _tmp18_; - gpointer _tmp19_ = NULL; - gpointer value; - GeeArrayList* _tmp20_; - gconstpointer _tmp21_; - _tmp16_ = _value_it; - _tmp17_ = gee_iterator_next (_tmp16_); - if (!_tmp17_) { - break; - } - _tmp18_ = _value_it; - _tmp19_ = gee_iterator_get (_tmp18_); - value = _tmp19_; - _tmp20_ = _result_; - _tmp21_ = value; - gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, _tmp21_); - ((value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (value = (self->priv->v_destroy_func (value), NULL)); - } - _g_object_unref0 (_value_it); - } - _g_object_unref0 (entry); - } - _g_object_unref0 (_entry_it); - } - result = (GeeCollection*) _result_; + _tmp0_ = gee_abstract_multi_map_values_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + result = (GeeCollection*) _tmp0_; return result; } @@ -603,37 +931,34 @@ static GeeCollection* gee_abstract_multi_map_real_get (GeeMultiMap* base, gconst GeeCollection* result = NULL; GeeMap* _tmp0_; gconstpointer _tmp1_; - gboolean _tmp2_ = FALSE; + gpointer _tmp2_ = NULL; + GeeCollection* col; + GeeCollection* _tmp3_ = NULL; + GeeCollection* _tmp4_; self = (GeeAbstractMultiMap*) base; _tmp0_ = self->_storage_map; _tmp1_ = key; - _tmp2_ = gee_map_has_key (_tmp0_, _tmp1_); - if (_tmp2_) { - GeeMap* _tmp3_; - gconstpointer _tmp4_; - gpointer _tmp5_ = NULL; + _tmp2_ = gee_map_get (_tmp0_, _tmp1_); + col = (GeeCollection*) _tmp2_; + _tmp4_ = col; + if (_tmp4_ != NULL) { + GeeCollection* _tmp5_; GeeCollection* _tmp6_; GeeCollection* _tmp7_; - GeeCollection* _tmp8_; - GeeCollection* _tmp9_; - _tmp3_ = self->_storage_map; - _tmp4_ = key; - _tmp5_ = gee_map_get (_tmp3_, _tmp4_); - _tmp6_ = (GeeCollection*) _tmp5_; - _tmp7_ = gee_collection_get_read_only_view (_tmp6_); - _tmp8_ = _tmp7_; - _tmp9_ = _tmp8_; - _g_object_unref0 (_tmp6_); - result = _tmp9_; - return result; + _tmp5_ = col; + _tmp6_ = gee_collection_get_read_only_view (_tmp5_); + _tmp7_ = _tmp6_; + _g_object_unref0 (_tmp3_); + _tmp3_ = _tmp7_; } else { - GeeSet* _tmp10_; - GeeCollection* _tmp11_; - _tmp10_ = self->priv->_empty_value_set; - _tmp11_ = _g_object_ref0 ((GeeCollection*) _tmp10_); - result = _tmp11_; - return result; + GeeSet* _tmp8_ = NULL; + _tmp8_ = gee_set_empty (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func); + _g_object_unref0 (_tmp3_); + _tmp3_ = (GeeCollection*) _tmp8_; } + result = _tmp3_; + _g_object_unref0 (col); + return result; } @@ -809,6 +1134,152 @@ static void gee_abstract_multi_map_real_clear (GeeMultiMap* base) { } +static GeeMapIterator* gee_abstract_multi_map_real_map_iterator (GeeMultiMap* base) { + GeeAbstractMultiMap * self; + GeeMapIterator* result = NULL; + GeeMap* _tmp0_; + GeeMapIterator* _tmp1_ = NULL; + GeeMapIterator* _tmp2_; + GeeAbstractMultiMapMapIterator* _tmp3_; + GeeMapIterator* _tmp4_; + self = (GeeAbstractMultiMap*) base; + _tmp0_ = self->_storage_map; + _tmp1_ = gee_map_map_iterator (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = gee_abstract_multi_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + _tmp4_ = (GeeMapIterator*) _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; +} + + +static GeeCollection* gee_abstract_multi_map_real_create_value_storage (GeeAbstractMultiMap* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_create_value_storage'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->create_value_storage (self); +} + + +static GeeMultiSet* gee_abstract_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_create_multi_key_set'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->create_multi_key_set (self); +} + + +static GeeEqualDataFunc gee_abstract_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_multi_map_get_value_equal_func'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeEqualDataFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->get_value_equal_func (self, result_target, result_target_destroy_notify); +} + + +static void gee_abstract_multi_map_real_reserved0 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved0 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_multi_map_real_reserved1 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved1 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_multi_map_real_reserved2 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved2 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_multi_map_real_reserved3 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved3 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_multi_map_real_reserved4 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved4 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_multi_map_real_reserved5 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved5 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_multi_map_real_reserved6 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved6 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_multi_map_real_reserved7 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved7 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_multi_map_real_reserved8 (GeeAbstractMultiMap* self) { +} + + +void gee_abstract_multi_map_reserved8 (GeeAbstractMultiMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->reserved8 (self); +} + + static gint gee_abstract_multi_map_real_get_size (GeeMultiMap* base) { gint result; GeeAbstractMultiMap* self; @@ -820,81 +1291,1773 @@ static gint gee_abstract_multi_map_real_get_size (GeeMultiMap* base) { } -static void gee_abstract_multi_map_class_init (GeeAbstractMultiMapClass * klass) { - gee_abstract_multi_map_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapPrivate)); - GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->create_value_storage = gee_abstract_multi_map_real_create_value_storage; - GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->create_multi_key_set = gee_abstract_multi_map_real_create_multi_key_set; - GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->get_value_equal_func = gee_abstract_multi_map_real_get_value_equal_func; - G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_map_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +static gboolean gee_abstract_multi_map_real_get_read_only (GeeMultiMap* base) { + gboolean result; + GeeAbstractMultiMap* self; + self = (GeeAbstractMultiMap*) base; + result = FALSE; + return result; } -static void gee_abstract_multi_map_gee_multi_map_interface_init (GeeMultiMapIface * iface) { - gee_abstract_multi_map_gee_multi_map_parent_iface = g_type_interface_peek_parent (iface); - iface->get_keys = (GeeSet* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_keys; - iface->get_all_keys = (GeeMultiSet* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_all_keys; - iface->get_values = (GeeCollection* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_values; - iface->contains = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_contains; - iface->get = (GeeCollection* (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_get; - iface->set = (void (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_abstract_multi_map_real_set; - iface->remove = (gboolean (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_abstract_multi_map_real_remove; - iface->remove_all = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_remove_all; - iface->clear = (void (*)(GeeMultiMap*)) gee_abstract_multi_map_real_clear; - iface->get_size = gee_abstract_multi_map_real_get_size; +GeeMultiMap* gee_abstract_multi_map_get_read_only_view (GeeAbstractMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MULTI_MAP_GET_CLASS (self)->get_read_only_view (self); } -static void gee_abstract_multi_map_instance_init (GeeAbstractMultiMap * self) { - self->priv = GEE_ABSTRACT_MULTI_MAP_GET_PRIVATE (self); - self->priv->_nitems = 0; +static GeeMultiMap* gee_abstract_multi_map_real_get_read_only_view (GeeAbstractMultiMap* base) { + GeeMultiMap* result; + GeeAbstractMultiMap* self; + GeeMultiMap* _tmp0_; + GeeMultiMap* _tmp1_; + GeeMultiMap* instance; + GeeMultiMap* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlyMultiMap* _tmp3_; + GeeMultiMap* _tmp4_; + GeeMultiMap* _tmp5_; + _tmp3_ = gee_read_only_multi_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, (GeeMultiMap*) self); + _g_object_unref0 (instance); + instance = (GeeMultiMap*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; } -static void gee_abstract_multi_map_finalize (GObject* obj) { - GeeAbstractMultiMap * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap); - _g_object_unref0 (self->_storage_map); - _g_object_unref0 (self->priv->_empty_value_set); - G_OBJECT_CLASS (gee_abstract_multi_map_parent_class)->finalize (obj); +static GeeAbstractMultiMapAllKeys* gee_abstract_multi_map_all_keys_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map) { + GeeAbstractMultiMapAllKeys * self = NULL; + GeeAbstractMultiMap* _tmp0_; + GeeAbstractMultiMap* _tmp1_; + g_return_val_if_fail (multi_map != NULL, NULL); + self = (GeeAbstractMultiMapAllKeys*) gee_abstract_collection_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = multi_map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_multi_map); + self->_multi_map = _tmp1_; + return self; } -/** - * Skeletal implementation of the {@link MultiMap} interface. - * - * @see HashMultiMap - * @see TreeMultiMap - */ -GType gee_abstract_multi_map_get_type (void) { - static volatile gsize gee_abstract_multi_map_type_id__volatile = 0; - if (g_once_init_enter (&gee_abstract_multi_map_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMap), 0, (GInstanceInitFunc) gee_abstract_multi_map_instance_init, NULL }; - static const GInterfaceInfo gee_multi_map_info = { (GInterfaceInitFunc) gee_abstract_multi_map_gee_multi_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - GType gee_abstract_multi_map_type_id; - gee_abstract_multi_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractMultiMap", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); - g_type_add_interface_static (gee_abstract_multi_map_type_id, GEE_TYPE_MULTI_MAP, &gee_multi_map_info); - g_once_init_leave (&gee_abstract_multi_map_type_id__volatile, gee_abstract_multi_map_type_id); +static GeeAbstractMultiMapAllKeys* gee_abstract_multi_map_all_keys_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map) { + return gee_abstract_multi_map_all_keys_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, multi_map); +} + + +static GeeIterator* gee_abstract_multi_map_all_keys_real_iterator (GeeAbstractCollection* base) { + GeeAbstractMultiMapAllKeys * self; + GeeIterator* result = NULL; + GeeAbstractMultiMap* _tmp0_; + GeeMap* _tmp1_; + GeeMapIterator* _tmp2_ = NULL; + GeeMapIterator* _tmp3_; + GeeAbstractMultiMapKeyIterator* _tmp4_; + GeeIterator* _tmp5_; + self = (GeeAbstractMultiMapAllKeys*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = _tmp0_->_storage_map; + _tmp2_ = gee_map_map_iterator (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_abstract_multi_map_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_); + _tmp5_ = (GeeIterator*) _tmp4_; + _g_object_unref0 (_tmp3_); + result = _tmp5_; + return result; +} + + +static gboolean gee_abstract_multi_map_all_keys_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeAbstractMultiMapAllKeys * self; + gboolean result = FALSE; + GeeAbstractMultiMap* _tmp0_; + GeeMap* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + self = (GeeAbstractMultiMapAllKeys*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = _tmp0_->_storage_map; + _tmp2_ = key; + _tmp3_ = gee_map_has_key (_tmp1_, _tmp2_); + result = _tmp3_; + return result; +} + + +static gboolean gee_abstract_multi_map_all_keys_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeAbstractMultiMapAllKeys * self; + gboolean result = FALSE; + self = (GeeAbstractMultiMapAllKeys*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_abstract_multi_map_all_keys_real_remove (GeeAbstractCollection* base, gconstpointer item) { + GeeAbstractMultiMapAllKeys * self; + gboolean result = FALSE; + self = (GeeAbstractMultiMapAllKeys*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_abstract_multi_map_all_keys_real_clear (GeeAbstractCollection* base) { + GeeAbstractMultiMapAllKeys * self; + self = (GeeAbstractMultiMapAllKeys*) base; + g_assert_not_reached (); +} + + +static gint gee_abstract_multi_map_all_keys_real_count (GeeMultiSet* base, gconstpointer item) { + GeeAbstractMultiMapAllKeys * self; + gint result = 0; + GeeAbstractMultiMap* _tmp0_; + GeeMap* _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_ = NULL; + GeeCollection* collection; + gint _tmp4_ = 0; + GeeCollection* _tmp5_; + gint _tmp9_; + self = (GeeAbstractMultiMapAllKeys*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = _tmp0_->_storage_map; + _tmp2_ = item; + _tmp3_ = gee_map_get (_tmp1_, _tmp2_); + collection = (GeeCollection*) _tmp3_; + _tmp5_ = collection; + if (_tmp5_ != NULL) { + GeeCollection* _tmp6_; + gint _tmp7_; + gint _tmp8_; + _tmp6_ = collection; + _tmp7_ = gee_collection_get_size (_tmp6_); + _tmp8_ = _tmp7_; + _tmp4_ = _tmp8_; + } else { + _tmp4_ = 0; } - return gee_abstract_multi_map_type_id__volatile; + _tmp9_ = _tmp4_; + result = _tmp9_; + _g_object_unref0 (collection); + return result; } -static void _vala_gee_abstract_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeAbstractMultiMap * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap); +static gint gee_abstract_multi_map_all_keys_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeAbstractMultiMapAllKeys* self; + GeeAbstractMultiMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeAbstractMultiMapAllKeys*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = gee_multi_map_get_size ((GeeMultiMap*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_abstract_multi_map_all_keys_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeAbstractMultiMapAllKeys* self; + self = (GeeAbstractMultiMapAllKeys*) base; + result = TRUE; + return result; +} + + +static void gee_abstract_multi_map_all_keys_class_init (GeeAbstractMultiMapAllKeysClass * klass) { + gee_abstract_multi_map_all_keys_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapAllKeysPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_abstract_multi_map_all_keys_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_abstract_multi_map_all_keys_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_abstract_multi_map_all_keys_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_abstract_multi_map_all_keys_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_abstract_multi_map_all_keys_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_abstract_multi_map_all_keys_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_abstract_multi_map_all_keys_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_all_keys_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_all_keys_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_map_all_keys_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_multi_map_all_keys_gee_multi_set_get_g_type (GeeAbstractMultiMapAllKeys* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_all_keys_gee_multi_set_get_g_dup_func (GeeAbstractMultiMapAllKeys* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_all_keys_gee_multi_set_get_g_destroy_func (GeeAbstractMultiMapAllKeys* self) { + return self->priv->k_destroy_func; +} + + +static void gee_abstract_multi_map_all_keys_gee_multi_set_interface_init (GeeMultiSetIface * iface) { + gee_abstract_multi_map_all_keys_gee_multi_set_parent_iface = g_type_interface_peek_parent (iface); + iface->count = (gint (*)(GeeMultiSet*, gconstpointer)) gee_abstract_multi_map_all_keys_real_count; + iface->get_g_type = (GType(*)(GeeMultiSet*)) gee_abstract_multi_map_all_keys_gee_multi_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeMultiSet*)) gee_abstract_multi_map_all_keys_gee_multi_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeMultiSet*)) gee_abstract_multi_map_all_keys_gee_multi_set_get_g_destroy_func; +} + + +static void gee_abstract_multi_map_all_keys_instance_init (GeeAbstractMultiMapAllKeys * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_GET_PRIVATE (self); +} + + +static void gee_abstract_multi_map_all_keys_finalize (GObject* obj) { + GeeAbstractMultiMapAllKeys * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeys); + _g_object_unref0 (self->_multi_map); + G_OBJECT_CLASS (gee_abstract_multi_map_all_keys_parent_class)->finalize (obj); +} + + +static GType gee_abstract_multi_map_all_keys_get_type (void) { + static volatile gsize gee_abstract_multi_map_all_keys_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_all_keys_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapAllKeysClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_all_keys_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapAllKeys), 0, (GInstanceInitFunc) gee_abstract_multi_map_all_keys_instance_init, NULL }; + static const GInterfaceInfo gee_multi_set_info = { (GInterfaceInitFunc) gee_abstract_multi_map_all_keys_gee_multi_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_multi_map_all_keys_type_id; + gee_abstract_multi_map_all_keys_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeAbstractMultiMapAllKeys", &g_define_type_info, 0); + g_type_add_interface_static (gee_abstract_multi_map_all_keys_type_id, GEE_TYPE_MULTI_SET, &gee_multi_set_info); + g_once_init_leave (&gee_abstract_multi_map_all_keys_type_id__volatile, gee_abstract_multi_map_all_keys_type_id); + } + return gee_abstract_multi_map_all_keys_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_all_keys_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapAllKeys * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeys); switch (property_id) { - case GEE_ABSTRACT_MULTI_MAP_SIZE: - g_value_set_int (value, gee_multi_map_get_size ((GeeMultiMap*) self)); + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_all_keys_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapAllKeys * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_ALL_KEYS, GeeAbstractMultiMapAllKeys); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_ALL_KEYS_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeAbstractMultiMapValues* gee_abstract_multi_map_values_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map) { + GeeAbstractMultiMapValues * self = NULL; + GeeAbstractMultiMap* _tmp0_; + GeeAbstractMultiMap* _tmp1_; + g_return_val_if_fail (multi_map != NULL, NULL); + self = (GeeAbstractMultiMapValues*) gee_abstract_collection_construct (object_type, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = multi_map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_multi_map); + self->_multi_map = _tmp1_; + return self; +} + + +static GeeAbstractMultiMapValues* gee_abstract_multi_map_values_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeAbstractMultiMap* multi_map) { + return gee_abstract_multi_map_values_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, multi_map); +} + + +static GeeIterator* gee_abstract_multi_map_values_real_iterator (GeeAbstractCollection* base) { + GeeAbstractMultiMapValues * self; + GeeIterator* result = NULL; + GeeAbstractMultiMap* _tmp0_; + GeeMap* _tmp1_; + GeeMapIterator* _tmp2_ = NULL; + GeeMapIterator* _tmp3_; + GeeAbstractMultiMapValueIterator* _tmp4_; + GeeIterator* _tmp5_; + self = (GeeAbstractMultiMapValues*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = _tmp0_->_storage_map; + _tmp2_ = gee_map_map_iterator (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_abstract_multi_map_value_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_); + _tmp5_ = (GeeIterator*) _tmp4_; + _g_object_unref0 (_tmp3_); + result = _tmp5_; + return result; +} + + +static gboolean gee_abstract_multi_map_values_real_contains (GeeAbstractCollection* base, gconstpointer value) { + GeeAbstractMultiMapValues * self; + gboolean result = FALSE; + self = (GeeAbstractMultiMapValues*) base; + { + GeeAbstractMultiMap* _tmp0_; + GeeMap* _tmp1_; + GeeCollection* _tmp2_; + GeeCollection* _tmp3_; + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _tmp6_; + GeeIterator* _col_it; + _tmp0_ = self->_multi_map; + _tmp1_ = _tmp0_->_storage_map; + _tmp2_ = gee_map_get_values (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = _tmp3_; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp4_); + _col_it = _tmp6_; + while (TRUE) { + GeeIterator* _tmp7_; + gboolean _tmp8_ = FALSE; + GeeIterator* _tmp9_; + gpointer _tmp10_ = NULL; + GeeCollection* col; + GeeCollection* _tmp11_; + gconstpointer _tmp12_; + gboolean _tmp13_ = FALSE; + _tmp7_ = _col_it; + _tmp8_ = gee_iterator_next (_tmp7_); + if (!_tmp8_) { + break; + } + _tmp9_ = _col_it; + _tmp10_ = gee_iterator_get (_tmp9_); + col = (GeeCollection*) _tmp10_; + _tmp11_ = col; + _tmp12_ = value; + _tmp13_ = gee_collection_contains (_tmp11_, _tmp12_); + if (_tmp13_) { + result = TRUE; + _g_object_unref0 (col); + _g_object_unref0 (_col_it); + return result; + } + _g_object_unref0 (col); + } + _g_object_unref0 (_col_it); + } + result = FALSE; + return result; +} + + +static gboolean gee_abstract_multi_map_values_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeAbstractMultiMapValues * self; + gboolean result = FALSE; + self = (GeeAbstractMultiMapValues*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_abstract_multi_map_values_real_remove (GeeAbstractCollection* base, gconstpointer item) { + GeeAbstractMultiMapValues * self; + gboolean result = FALSE; + self = (GeeAbstractMultiMapValues*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_abstract_multi_map_values_real_clear (GeeAbstractCollection* base) { + GeeAbstractMultiMapValues * self; + self = (GeeAbstractMultiMapValues*) base; + g_assert_not_reached (); +} + + +static gint gee_abstract_multi_map_values_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeAbstractMultiMapValues* self; + GeeAbstractMultiMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeAbstractMultiMapValues*) base; + _tmp0_ = self->_multi_map; + _tmp1_ = gee_multi_map_get_size ((GeeMultiMap*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_abstract_multi_map_values_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeAbstractMultiMapValues* self; + self = (GeeAbstractMultiMapValues*) base; + result = TRUE; + return result; +} + + +static void gee_abstract_multi_map_values_class_init (GeeAbstractMultiMapValuesClass * klass) { + gee_abstract_multi_map_values_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapValuesPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_abstract_multi_map_values_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_abstract_multi_map_values_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_abstract_multi_map_values_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_abstract_multi_map_values_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_abstract_multi_map_values_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_abstract_multi_map_values_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_abstract_multi_map_values_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_values_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_values_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_map_values_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUES_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_abstract_multi_map_values_instance_init (GeeAbstractMultiMapValues * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_VALUES_GET_PRIVATE (self); +} + + +static void gee_abstract_multi_map_values_finalize (GObject* obj) { + GeeAbstractMultiMapValues * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValues); + _g_object_unref0 (self->_multi_map); + G_OBJECT_CLASS (gee_abstract_multi_map_values_parent_class)->finalize (obj); +} + + +static GType gee_abstract_multi_map_values_get_type (void) { + static volatile gsize gee_abstract_multi_map_values_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_values_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapValuesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_values_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapValues), 0, (GInstanceInitFunc) gee_abstract_multi_map_values_instance_init, NULL }; + GType gee_abstract_multi_map_values_type_id; + gee_abstract_multi_map_values_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeAbstractMultiMapValues", &g_define_type_info, 0); + g_once_init_leave (&gee_abstract_multi_map_values_type_id__volatile, gee_abstract_multi_map_values_type_id); + } + return gee_abstract_multi_map_values_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_values_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapValues * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValues); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_VALUES_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_values_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapValues * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_VALUES, GeeAbstractMultiMapValues); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_VALUES_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUES_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeAbstractMultiMapMappingIterator* gee_abstract_multi_map_mapping_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + GeeAbstractMultiMapMappingIterator * self = NULL; + GeeMapIterator* _tmp0_; + GeeMapIterator* _tmp1_; + self = (GeeAbstractMultiMapMappingIterator*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = outer; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->outer); + self->outer = _tmp1_; + return self; +} + + +static GeeAbstractMultiMapMappingIterator* gee_abstract_multi_map_mapping_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + return gee_abstract_multi_map_mapping_iterator_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, outer); +} + + +static gboolean gee_abstract_multi_map_mapping_iterator_next (GeeAbstractMultiMapMappingIterator* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeIterator* _tmp1_; + gboolean _tmp4_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp1_ = self->inner; + if (_tmp1_ != NULL) { + GeeIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp2_ = self->inner; + _tmp3_ = gee_iterator_next (_tmp2_); + _tmp0_ = _tmp3_; + } else { + _tmp0_ = FALSE; + } + _tmp4_ = _tmp0_; + if (_tmp4_) { + result = TRUE; + return result; + } else { + GeeMapIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = self->outer; + _tmp6_ = gee_map_iterator_next (_tmp5_); + if (_tmp6_) { + GeeMapIterator* _tmp7_; + gpointer _tmp8_ = NULL; + GeeCollection* _tmp9_; + GeeIterator* _tmp10_ = NULL; + GeeIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp7_ = self->outer; + _tmp8_ = gee_map_iterator_get_value (_tmp7_); + _tmp9_ = (GeeCollection*) _tmp8_; + _tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_); + _g_object_unref0 (self->inner); + self->inner = _tmp10_; + _g_object_unref0 (_tmp9_); + _tmp11_ = self->inner; + _tmp12_ = gee_iterator_next (_tmp11_); + _vala_assert (_tmp12_, "inner.next ()"); + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } + } +} + + +static gboolean gee_abstract_multi_map_mapping_iterator_has_next (GeeAbstractMultiMapMappingIterator* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + gboolean _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp1_ = self->inner; + _tmp2_ = gee_iterator_has_next (_tmp1_); + if (_tmp2_) { + _tmp0_ = TRUE; + } else { + GeeMapIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + _tmp3_ = self->outer; + _tmp4_ = gee_map_iterator_has_next (_tmp3_); + _tmp0_ = _tmp4_; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static void gee_abstract_multi_map_mapping_iterator_remove (GeeAbstractMultiMapMappingIterator* self) { + g_return_if_fail (self != NULL); + g_assert_not_reached (); +} + + +static void gee_abstract_multi_map_mapping_iterator_unset (GeeAbstractMultiMapMappingIterator* self) { + GeeIterator* _tmp0_; + GeeMapIterator* _tmp1_; + gpointer _tmp2_ = NULL; + GeeCollection* _tmp3_; + gboolean _tmp4_; + gboolean _tmp5_; + gboolean _tmp6_; + g_return_if_fail (self != NULL); + _tmp0_ = self->inner; + gee_iterator_remove (_tmp0_); + _tmp1_ = self->outer; + _tmp2_ = gee_map_iterator_get_value (_tmp1_); + _tmp3_ = (GeeCollection*) _tmp2_; + _tmp4_ = gee_collection_get_is_empty (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + if (_tmp6_) { + GeeMapIterator* _tmp7_; + _tmp7_ = self->outer; + gee_map_iterator_unset (_tmp7_); + } +} + + +static gboolean gee_abstract_multi_map_mapping_iterator_get_read_only (GeeAbstractMultiMapMappingIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_GET_CLASS (self)->get_read_only (self); +} + + +static gboolean gee_abstract_multi_map_mapping_iterator_real_get_read_only (GeeAbstractMultiMapMappingIterator* base) { + gboolean result; + GeeAbstractMultiMapMappingIterator* self; + self = base; + result = TRUE; + return result; +} + + +static gboolean gee_abstract_multi_map_mapping_iterator_get_valid (GeeAbstractMultiMapMappingIterator* self) { + gboolean result; + gboolean _tmp0_ = FALSE; + GeeIterator* _tmp1_; + gboolean _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp1_ = self->inner; + if (_tmp1_ != NULL) { + GeeIterator* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + _tmp2_ = self->inner; + _tmp3_ = gee_iterator_get_valid (_tmp2_); + _tmp4_ = _tmp3_; + _tmp0_ = _tmp4_; + } else { + _tmp0_ = FALSE; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static void gee_abstract_multi_map_mapping_iterator_class_init (GeeAbstractMultiMapMappingIteratorClass * klass) { + gee_abstract_multi_map_mapping_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapMappingIteratorPrivate)); + GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_CLASS (klass)->get_read_only = gee_abstract_multi_map_mapping_iterator_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_mapping_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_mapping_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_map_mapping_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_abstract_multi_map_mapping_iterator_instance_init (GeeAbstractMultiMapMappingIterator * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_GET_PRIVATE (self); + self->inner = NULL; +} + + +static void gee_abstract_multi_map_mapping_iterator_finalize (GObject* obj) { + GeeAbstractMultiMapMappingIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIterator); + _g_object_unref0 (self->outer); + _g_object_unref0 (self->inner); + G_OBJECT_CLASS (gee_abstract_multi_map_mapping_iterator_parent_class)->finalize (obj); +} + + +static GType gee_abstract_multi_map_mapping_iterator_get_type (void) { + static volatile gsize gee_abstract_multi_map_mapping_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_mapping_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapMappingIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_mapping_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapMappingIterator), 0, (GInstanceInitFunc) gee_abstract_multi_map_mapping_iterator_instance_init, NULL }; + GType gee_abstract_multi_map_mapping_iterator_type_id; + gee_abstract_multi_map_mapping_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractMultiMapMappingIterator", &g_define_type_info, 0); + g_once_init_leave (&gee_abstract_multi_map_mapping_iterator_type_id__volatile, gee_abstract_multi_map_mapping_iterator_type_id); + } + return gee_abstract_multi_map_mapping_iterator_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_mapping_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapMappingIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_abstract_multi_map_mapping_iterator_get_read_only (self)); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_VALID: + g_value_set_boolean (value, gee_abstract_multi_map_mapping_iterator_get_valid (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_mapping_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapMappingIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, GeeAbstractMultiMapMappingIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAPPING_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeAbstractMultiMapKeyIterator* gee_abstract_multi_map_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + GeeAbstractMultiMapKeyIterator * self = NULL; + GeeMapIterator* _tmp0_; + _tmp0_ = outer; + self = (GeeAbstractMultiMapKeyIterator*) gee_abstract_multi_map_mapping_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeAbstractMultiMapKeyIterator* gee_abstract_multi_map_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + return gee_abstract_multi_map_key_iterator_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, outer); +} + + +static gpointer gee_abstract_multi_map_key_iterator_real_get (GeeIterator* base) { + GeeAbstractMultiMapKeyIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeMapIterator* _tmp2_; + gpointer _tmp3_ = NULL; + self = (GeeAbstractMultiMapKeyIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp3_ = gee_map_iterator_get_key (_tmp2_); + result = _tmp3_; + return result; +} + + +static Block1Data* block1_data_ref (Block1Data* _data1_) { + g_atomic_int_inc (&_data1_->_ref_count_); + return _data1_; +} + + +static void block1_data_unref (void * _userdata_) { + Block1Data* _data1_; + _data1_ = (Block1Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { + GeeAbstractMultiMapKeyIterator * self; + self = _data1_->self; + _g_object_unref0 (self); + g_slice_free (Block1Data, _data1_); + } +} + + +static Block2Data* block2_data_ref (Block2Data* _data2_) { + g_atomic_int_inc (&_data2_->_ref_count_); + return _data2_; +} + + +static void block2_data_unref (void * _userdata_) { + Block2Data* _data2_; + _data2_ = (Block2Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) { + GeeAbstractMultiMapKeyIterator * self; + self = _data2_->_data1_->self; + ((_data2_->key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_data2_->key = (self->priv->k_destroy_func (_data2_->key), NULL)); + block1_data_unref (_data2_->_data1_); + _data2_->_data1_ = NULL; + g_slice_free (Block2Data, _data2_); + } +} + + +static gboolean ___lambda29_ (Block2Data* _data2_, gpointer v) { + Block1Data* _data1_; + GeeAbstractMultiMapKeyIterator * self; + gboolean result = FALSE; + GeeForallFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gpointer _tmp2_; + gboolean _tmp3_ = FALSE; + _data1_ = _data2_->_data1_; + self = _data1_->self; + _tmp0_ = _data1_->f; + _tmp0__target = _data1_->f_target; + _tmp1_ = _data2_->key; + _tmp2_ = ((_tmp1_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); + _tmp3_ = _tmp0_ (_tmp2_, _tmp0__target); + result = _tmp3_; + ((v == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (v = (self->priv->v_destroy_func (v), NULL)); + return result; +} + + +static gboolean ____lambda29__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = ___lambda29_ (self, g); + return result; +} + + +static Block3Data* block3_data_ref (Block3Data* _data3_) { + g_atomic_int_inc (&_data3_->_ref_count_); + return _data3_; +} + + +static void block3_data_unref (void * _userdata_) { + Block3Data* _data3_; + _data3_ = (Block3Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) { + GeeAbstractMultiMapKeyIterator * self; + self = _data3_->_data1_->self; + ((_data3_->key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_data3_->key = (self->priv->k_destroy_func (_data3_->key), NULL)); + block1_data_unref (_data3_->_data1_); + _data3_->_data1_ = NULL; + g_slice_free (Block3Data, _data3_); + } +} + + +static gboolean __lambda31_ (Block3Data* _data3_, gpointer v) { + Block1Data* _data1_; + GeeAbstractMultiMapKeyIterator * self; + gboolean result = FALSE; + GeeForallFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gpointer _tmp2_; + gboolean _tmp3_ = FALSE; + _data1_ = _data3_->_data1_; + self = _data1_->self; + _tmp0_ = _data1_->f; + _tmp0__target = _data1_->f_target; + _tmp1_ = _data3_->key; + _tmp2_ = ((_tmp1_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); + _tmp3_ = _tmp0_ (_tmp2_, _tmp0__target); + result = _tmp3_; + ((v == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (v = (self->priv->v_destroy_func (v), NULL)); + return result; +} + + +static gboolean ___lambda31__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda31_ (self, g); + return result; +} + + +static gboolean __lambda30_ (Block1Data* _data1_, gconstpointer key, GeeCollection* col) { + GeeAbstractMultiMapKeyIterator * self; + gboolean result = FALSE; + Block3Data* _data3_; + gconstpointer _tmp0_; + gpointer _tmp1_; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + self = _data1_->self; + g_return_val_if_fail (col != NULL, FALSE); + _data3_ = g_slice_new0 (Block3Data); + _data3_->_ref_count_ = 1; + _data3_->_data1_ = block1_data_ref (_data1_); + _tmp0_ = key; + _tmp1_ = ((_tmp0_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + ((_data3_->key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_data3_->key = (self->priv->k_destroy_func (_data3_->key), NULL)); + _data3_->key = _tmp1_; + _tmp2_ = col; + _tmp3_ = gee_traversable_foreach ((GeeTraversable*) _tmp2_, ___lambda31__gee_forall_func, _data3_); + result = _tmp3_; + block3_data_unref (_data3_); + _data3_ = NULL; + return result; +} + + +static gboolean ___lambda30__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self) { + gboolean result; + result = __lambda30_ (self, k, v); + return result; +} + + +static gboolean gee_abstract_multi_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeAbstractMultiMapKeyIterator * self; + gboolean result = FALSE; + Block1Data* _data1_; + GeeForallFunc _tmp0_; + void* _tmp0__target; + gboolean _tmp1_ = FALSE; + GeeIterator* _tmp2_; + gboolean _tmp6_; + GeeMapIterator* _tmp12_; + gboolean _tmp13_ = FALSE; + self = (GeeAbstractMultiMapKeyIterator*) base; + _data1_ = g_slice_new0 (Block1Data); + _data1_->_ref_count_ = 1; + _data1_->self = g_object_ref (self); + _tmp0_ = f; + _tmp0__target = f_target; + _data1_->f = _tmp0_; + _data1_->f_target = _tmp0__target; + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + if (_tmp2_ != NULL) { + GeeMapIterator* _tmp3_; + gboolean _tmp4_; + gboolean _tmp5_; + _tmp3_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp4_ = gee_map_iterator_get_valid (_tmp3_); + _tmp5_ = _tmp4_; + _tmp1_ = _tmp5_; + } else { + _tmp1_ = FALSE; + } + _tmp6_ = _tmp1_; + if (_tmp6_) { + Block2Data* _data2_; + GeeMapIterator* _tmp7_; + gpointer _tmp8_ = NULL; + GeeIterator* _tmp9_; + gboolean _tmp10_ = FALSE; + GeeMapIterator* _tmp11_; + _data2_ = g_slice_new0 (Block2Data); + _data2_->_ref_count_ = 1; + _data2_->_data1_ = block1_data_ref (_data1_); + _tmp7_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp8_ = gee_map_iterator_get_key (_tmp7_); + _data2_->key = _tmp8_; + _tmp9_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + _tmp10_ = gee_traversable_foreach ((GeeTraversable*) _tmp9_, ____lambda29__gee_forall_func, _data2_); + if (!_tmp10_) { + result = FALSE; + block2_data_unref (_data2_); + _data2_ = NULL; + block1_data_unref (_data1_); + _data1_ = NULL; + return result; + } + _tmp11_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + gee_map_iterator_next (_tmp11_); + block2_data_unref (_data2_); + _data2_ = NULL; + } + _tmp12_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp13_ = gee_map_iterator_foreach (_tmp12_, ___lambda30__gee_forall_map_func, _data1_); + result = _tmp13_; + block1_data_unref (_data1_); + _data1_ = NULL; + return result; +} + + +static void gee_abstract_multi_map_key_iterator_class_init (GeeAbstractMultiMapKeyIteratorClass * klass) { + gee_abstract_multi_map_key_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapKeyIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_key_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_key_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_abstract_multi_map_key_iterator_gee_traversable_get_g_type (GeeAbstractMultiMapKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_key_iterator_gee_traversable_get_g_dup_func (GeeAbstractMultiMapKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_key_iterator_gee_traversable_get_g_destroy_func (GeeAbstractMultiMapKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_abstract_multi_map_key_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_multi_map_key_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_multi_map_key_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_multi_map_key_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_multi_map_key_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_multi_map_key_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_abstract_multi_map_key_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_abstract_multi_map_key_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_abstract_multi_map_key_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_abstract_multi_map_mapping_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_abstract_multi_map_mapping_iterator_get_read_only; +} + + +static void gee_abstract_multi_map_key_iterator_instance_init (GeeAbstractMultiMapKeyIterator * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_abstract_multi_map_key_iterator_get_type (void) { + static volatile gsize gee_abstract_multi_map_key_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_key_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapKeyIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_key_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapKeyIterator), 0, (GInstanceInitFunc) gee_abstract_multi_map_key_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_multi_map_key_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_abstract_multi_map_key_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_multi_map_key_iterator_type_id; + gee_abstract_multi_map_key_iterator_type_id = g_type_register_static (GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, "GeeAbstractMultiMapKeyIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_abstract_multi_map_key_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_abstract_multi_map_key_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_abstract_multi_map_key_iterator_type_id__volatile, gee_abstract_multi_map_key_iterator_type_id); + } + return gee_abstract_multi_map_key_iterator_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_KEY_ITERATOR, GeeAbstractMultiMapKeyIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_KEY_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeAbstractMultiMapValueIterator* gee_abstract_multi_map_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + GeeAbstractMultiMapValueIterator * self = NULL; + GeeMapIterator* _tmp0_; + _tmp0_ = outer; + self = (GeeAbstractMultiMapValueIterator*) gee_abstract_multi_map_mapping_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeAbstractMultiMapValueIterator* gee_abstract_multi_map_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + return gee_abstract_multi_map_value_iterator_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, outer); +} + + +static gpointer gee_abstract_multi_map_value_iterator_real_get (GeeIterator* base) { + GeeAbstractMultiMapValueIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeIterator* _tmp2_; + gpointer _tmp3_ = NULL; + self = (GeeAbstractMultiMapValueIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + _tmp3_ = gee_iterator_get (_tmp2_); + result = _tmp3_; + return result; +} + + +static Block4Data* block4_data_ref (Block4Data* _data4_) { + g_atomic_int_inc (&_data4_->_ref_count_); + return _data4_; +} + + +static void block4_data_unref (void * _userdata_) { + Block4Data* _data4_; + _data4_ = (Block4Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) { + GeeAbstractMultiMapValueIterator * self; + self = _data4_->self; + _g_object_unref0 (self); + g_slice_free (Block4Data, _data4_); + } +} + + +static gboolean __lambda32_ (Block4Data* _data4_, gconstpointer key, GeeCollection* col) { + GeeAbstractMultiMapValueIterator * self; + gboolean result = FALSE; + GeeCollection* _tmp0_; + GeeForallFunc _tmp1_; + void* _tmp1__target; + gboolean _tmp2_ = FALSE; + self = _data4_->self; + g_return_val_if_fail (col != NULL, FALSE); + _tmp0_ = col; + _tmp1_ = _data4_->f; + _tmp1__target = _data4_->f_target; + _tmp2_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target); + result = _tmp2_; + return result; +} + + +static gboolean ___lambda32__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self) { + gboolean result; + result = __lambda32_ (self, k, v); + return result; +} + + +static gboolean gee_abstract_multi_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeAbstractMultiMapValueIterator * self; + gboolean result = FALSE; + Block4Data* _data4_; + GeeForallFunc _tmp0_; + void* _tmp0__target; + gboolean _tmp1_ = FALSE; + GeeIterator* _tmp2_; + gboolean _tmp6_; + GeeMapIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + self = (GeeAbstractMultiMapValueIterator*) base; + _data4_ = g_slice_new0 (Block4Data); + _data4_->_ref_count_ = 1; + _data4_->self = g_object_ref (self); + _tmp0_ = f; + _tmp0__target = f_target; + _data4_->f = _tmp0_; + _data4_->f_target = _tmp0__target; + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + if (_tmp2_ != NULL) { + GeeMapIterator* _tmp3_; + gboolean _tmp4_; + gboolean _tmp5_; + _tmp3_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp4_ = gee_map_iterator_get_valid (_tmp3_); + _tmp5_ = _tmp4_; + _tmp1_ = _tmp5_; + } else { + _tmp1_ = FALSE; + } + _tmp6_ = _tmp1_; + if (_tmp6_) { + GeeIterator* _tmp7_; + GeeForallFunc _tmp8_; + void* _tmp8__target; + gboolean _tmp9_ = FALSE; + GeeMapIterator* _tmp10_; + _tmp7_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + _tmp8_ = _data4_->f; + _tmp8__target = _data4_->f_target; + _tmp9_ = gee_traversable_foreach ((GeeTraversable*) _tmp7_, _tmp8_, _tmp8__target); + if (!_tmp9_) { + result = FALSE; + block4_data_unref (_data4_); + _data4_ = NULL; + return result; + } + _tmp10_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + gee_map_iterator_next (_tmp10_); + } + _tmp11_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp12_ = gee_map_iterator_foreach (_tmp11_, ___lambda32__gee_forall_map_func, _data4_); + result = _tmp12_; + block4_data_unref (_data4_); + _data4_ = NULL; + return result; +} + + +static void gee_abstract_multi_map_value_iterator_class_init (GeeAbstractMultiMapValueIteratorClass * klass) { + gee_abstract_multi_map_value_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapValueIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_value_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_value_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_abstract_multi_map_value_iterator_gee_traversable_get_g_type (GeeAbstractMultiMapValueIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_value_iterator_gee_traversable_get_g_dup_func (GeeAbstractMultiMapValueIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_value_iterator_gee_traversable_get_g_destroy_func (GeeAbstractMultiMapValueIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_abstract_multi_map_value_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_multi_map_value_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_multi_map_value_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_multi_map_value_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_multi_map_value_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_multi_map_value_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_abstract_multi_map_value_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_abstract_multi_map_value_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_abstract_multi_map_value_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_abstract_multi_map_mapping_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_abstract_multi_map_mapping_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_abstract_multi_map_mapping_iterator_get_read_only; +} + + +static void gee_abstract_multi_map_value_iterator_instance_init (GeeAbstractMultiMapValueIterator * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_abstract_multi_map_value_iterator_get_type (void) { + static volatile gsize gee_abstract_multi_map_value_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_value_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapValueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_value_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapValueIterator), 0, (GInstanceInitFunc) gee_abstract_multi_map_value_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_multi_map_value_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_abstract_multi_map_value_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_multi_map_value_iterator_type_id; + gee_abstract_multi_map_value_iterator_type_id = g_type_register_static (GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, "GeeAbstractMultiMapValueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_abstract_multi_map_value_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_abstract_multi_map_value_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_abstract_multi_map_value_iterator_type_id__volatile, gee_abstract_multi_map_value_iterator_type_id); + } + return gee_abstract_multi_map_value_iterator_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_VALUE_ITERATOR, GeeAbstractMultiMapValueIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_VALUE_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeAbstractMultiMapMapIterator* gee_abstract_multi_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + GeeAbstractMultiMapMapIterator * self = NULL; + GeeMapIterator* _tmp0_; + _tmp0_ = outer; + self = (GeeAbstractMultiMapMapIterator*) gee_abstract_multi_map_mapping_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeAbstractMultiMapMapIterator* gee_abstract_multi_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* outer) { + return gee_abstract_multi_map_map_iterator_construct (GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, outer); +} + + +static gpointer gee_abstract_multi_map_map_iterator_real_get_key (GeeMapIterator* base) { + GeeAbstractMultiMapMapIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeMapIterator* _tmp2_; + gpointer _tmp3_ = NULL; + self = (GeeAbstractMultiMapMapIterator*) base; + _tmp0_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->outer; + _tmp3_ = gee_map_iterator_get_key (_tmp2_); + result = _tmp3_; + return result; +} + + +static gpointer gee_abstract_multi_map_map_iterator_real_get_value (GeeMapIterator* base) { + GeeAbstractMultiMapMapIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeIterator* _tmp2_; + gpointer _tmp3_ = NULL; + self = (GeeAbstractMultiMapMapIterator*) base; + _tmp0_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeAbstractMultiMapMappingIterator*) self)->inner; + _tmp3_ = gee_iterator_get (_tmp2_); + result = _tmp3_; + return result; +} + + +static void gee_abstract_multi_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value) { + GeeAbstractMultiMapMapIterator * self; + self = (GeeAbstractMultiMapMapIterator*) base; + g_assert_not_reached (); +} + + +static gboolean gee_abstract_multi_map_map_iterator_real_get_mutable (GeeMapIterator* base) { + gboolean result; + GeeAbstractMultiMapMapIterator* self; + self = (GeeAbstractMultiMapMapIterator*) base; + result = FALSE; + return result; +} + + +static void gee_abstract_multi_map_map_iterator_class_init (GeeAbstractMultiMapMapIteratorClass * klass) { + gee_abstract_multi_map_map_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapMapIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_map_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_map_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_MUTABLE, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_type (GeeAbstractMultiMapMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_dup_func (GeeAbstractMultiMapMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_destroy_func (GeeAbstractMultiMapMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_type (GeeAbstractMultiMapMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_dup_func (GeeAbstractMultiMapMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_destroy_func (GeeAbstractMultiMapMapIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_abstract_multi_map_map_iterator_gee_map_iterator_interface_init (GeeMapIteratorIface * iface) { + gee_abstract_multi_map_map_iterator_gee_map_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_key = (gpointer (*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_real_get_key; + iface->get_value = (gpointer (*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_real_get_value; + iface->set_value = (void (*)(GeeMapIterator*, gconstpointer)) gee_abstract_multi_map_map_iterator_real_set_value; + iface->get_k_type = (GType(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_abstract_multi_map_map_iterator_gee_map_iterator_get_v_destroy_func; + iface->next = (gboolean (*)(GeeMapIterator*)) gee_abstract_multi_map_mapping_iterator_next; + iface->has_next = (gboolean (*)(GeeMapIterator*)) gee_abstract_multi_map_mapping_iterator_has_next; + iface->unset = (void (*)(GeeMapIterator*)) gee_abstract_multi_map_mapping_iterator_unset; + iface->get_mutable = gee_abstract_multi_map_map_iterator_real_get_mutable; + iface->get_valid = (gboolean (*) (GeeMapIterator *)) gee_abstract_multi_map_mapping_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeMapIterator *)) gee_abstract_multi_map_mapping_iterator_get_read_only; +} + + +static void gee_abstract_multi_map_map_iterator_instance_init (GeeAbstractMultiMapMapIterator * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_abstract_multi_map_map_iterator_get_type (void) { + static volatile gsize gee_abstract_multi_map_map_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_map_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapMapIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_map_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMapMapIterator), 0, (GInstanceInitFunc) gee_abstract_multi_map_map_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_map_iterator_info = { (GInterfaceInitFunc) gee_abstract_multi_map_map_iterator_gee_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_multi_map_map_iterator_type_id; + gee_abstract_multi_map_map_iterator_type_id = g_type_register_static (GEE_ABSTRACT_MULTI_MAP_TYPE_MAPPING_ITERATOR, "GeeAbstractMultiMapMapIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_abstract_multi_map_map_iterator_type_id, GEE_TYPE_MAP_ITERATOR, &gee_map_iterator_info); + g_once_init_leave (&gee_abstract_multi_map_map_iterator_type_id__volatile, gee_abstract_multi_map_map_iterator_type_id); + } + return gee_abstract_multi_map_map_iterator_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_MUTABLE: + g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_multi_map_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMapMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_MAP_TYPE_MAP_ITERATOR, GeeAbstractMultiMapMapIterator); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_MULTI_MAP_MAP_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void gee_abstract_multi_map_class_init (GeeAbstractMultiMapClass * klass) { + gee_abstract_multi_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractMultiMapPrivate)); + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->create_value_storage = gee_abstract_multi_map_real_create_value_storage; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->create_multi_key_set = gee_abstract_multi_map_real_create_multi_key_set; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->get_value_equal_func = gee_abstract_multi_map_real_get_value_equal_func; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved0 = gee_abstract_multi_map_real_reserved0; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved1 = gee_abstract_multi_map_real_reserved1; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved2 = gee_abstract_multi_map_real_reserved2; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved3 = gee_abstract_multi_map_real_reserved3; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved4 = gee_abstract_multi_map_real_reserved4; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved5 = gee_abstract_multi_map_real_reserved5; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved6 = gee_abstract_multi_map_real_reserved6; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved7 = gee_abstract_multi_map_real_reserved7; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->reserved8 = gee_abstract_multi_map_real_reserved8; + GEE_ABSTRACT_MULTI_MAP_CLASS (klass)->get_read_only_view = gee_abstract_multi_map_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_map_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_map_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_multi_map_gee_multi_map_get_k_type (GeeAbstractMultiMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_gee_multi_map_get_k_dup_func (GeeAbstractMultiMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_gee_multi_map_get_k_destroy_func (GeeAbstractMultiMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_abstract_multi_map_gee_multi_map_get_v_type (GeeAbstractMultiMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_map_gee_multi_map_get_v_dup_func (GeeAbstractMultiMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_map_gee_multi_map_get_v_destroy_func (GeeAbstractMultiMap* self) { + return self->priv->v_destroy_func; +} + + +static void gee_abstract_multi_map_gee_multi_map_interface_init (GeeMultiMapIface * iface) { + gee_abstract_multi_map_gee_multi_map_parent_iface = g_type_interface_peek_parent (iface); + iface->get_keys = (GeeSet* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_keys; + iface->get_all_keys = (GeeMultiSet* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_all_keys; + iface->get_values = (GeeCollection* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_get_values; + iface->contains = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_contains; + iface->get = (GeeCollection* (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_get; + iface->set = (void (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_abstract_multi_map_real_set; + iface->remove = (gboolean (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_abstract_multi_map_real_remove; + iface->remove_all = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_abstract_multi_map_real_remove_all; + iface->clear = (void (*)(GeeMultiMap*)) gee_abstract_multi_map_real_clear; + iface->map_iterator = (GeeMapIterator* (*)(GeeMultiMap*)) gee_abstract_multi_map_real_map_iterator; + iface->get_k_type = (GType(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_abstract_multi_map_gee_multi_map_get_v_destroy_func; + iface->get_size = gee_abstract_multi_map_real_get_size; + iface->get_read_only = gee_abstract_multi_map_real_get_read_only; + iface->get_read_only_view = (GeeMultiMap* (*) (GeeMultiMap *)) gee_abstract_multi_map_get_read_only_view; +} + + +static void gee_abstract_multi_map_instance_init (GeeAbstractMultiMap * self) { + self->priv = GEE_ABSTRACT_MULTI_MAP_GET_PRIVATE (self); + self->priv->_nitems = 0; +} + + +static void gee_abstract_multi_map_finalize (GObject* obj) { + GeeAbstractMultiMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap); + _g_object_unref0 (self->_storage_map); + G_OBJECT_CLASS (gee_abstract_multi_map_parent_class)->finalize (obj); +} + + +/** + * Skeletal implementation of the {@link MultiMap} interface. + * + * @see HashMultiMap + * @see TreeMultiMap + */ +GType gee_abstract_multi_map_get_type (void) { + static volatile gsize gee_abstract_multi_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_multi_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiMap), 0, (GInstanceInitFunc) gee_abstract_multi_map_instance_init, NULL }; + static const GInterfaceInfo gee_multi_map_info = { (GInterfaceInitFunc) gee_abstract_multi_map_gee_multi_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_multi_map_type_id; + gee_abstract_multi_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractMultiMap", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_multi_map_type_id, GEE_TYPE_MULTI_MAP, &gee_multi_map_info); + g_once_init_leave (&gee_abstract_multi_map_type_id__volatile, gee_abstract_multi_map_type_id); + } + return gee_abstract_multi_map_type_id__volatile; +} + + +static void _vala_gee_abstract_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractMultiMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap); + switch (property_id) { + case GEE_ABSTRACT_MULTI_MAP_SIZE: + g_value_set_int (value, gee_multi_map_get_size ((GeeMultiMap*) self)); + break; + case GEE_ABSTRACT_MULTI_MAP_READ_ONLY: + g_value_set_boolean (value, gee_multi_map_get_read_only ((GeeMultiMap*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/gee/abstractmultimap.vala b/gee/abstractmultimap.vala index 5d0d230..12e84dd 100644 --- a/gee/abstractmultimap.vala +++ b/gee/abstractmultimap.vala @@ -31,44 +31,28 @@ public abstract class Gee.AbstractMultiMap : Object, MultiMap { public int size { get { return _nitems; } } + + public bool read_only { + get { return false; } + } protected Map> _storage_map; private int _nitems = 0; - private Set _empty_value_set; public AbstractMultiMap (Map> storage_map) { this._storage_map = storage_map; - this._empty_value_set = Set.empty (); } - protected abstract Collection create_value_storage (); - - protected abstract MultiSet create_multi_key_set (); - - protected abstract EqualFunc get_value_equal_func (); - public Set get_keys () { return _storage_map.keys; } public MultiSet get_all_keys () { - MultiSet result = create_multi_key_set (); - foreach (var entry in _storage_map.entries) { - for (int i = 0; i < entry.value.size; i++) { - result.add (entry.key); - } - } - return result; + return new AllKeys (this); } public Collection get_values () { - var result = new ArrayList (get_value_equal_func ()); - foreach (var entry in _storage_map.entries) { - foreach (var value in entry.value) { - result.add (value); - } - } - return result; + return new Values (this); } public bool contains (K key) { @@ -76,11 +60,8 @@ public abstract class Gee.AbstractMultiMap : Object, MultiMap { } public new Collection get (K key) { - if (_storage_map.has_key (key)) { - return _storage_map.get (key).read_only_view; - } else { - return _empty_value_set; - } + Collection? col = _storage_map.get (key); + return col != null ? col.read_only_view : Set.empty (); } public new void set (K key, V value) { @@ -126,4 +107,230 @@ public abstract class Gee.AbstractMultiMap : Object, MultiMap { _storage_map.clear (); _nitems = 0; } + + public Gee.MapIterator map_iterator () { + return new MapIterator (_storage_map.map_iterator ()); + } + + protected abstract Collection create_value_storage (); + + protected abstract MultiSet create_multi_key_set (); + + protected abstract EqualDataFunc get_value_equal_func (); + + private class AllKeys : AbstractCollection, MultiSet { + protected AbstractMultiMap _multi_map; + + public AllKeys (AbstractMultiMap multi_map) { + _multi_map = multi_map; + } + + public override Gee.Iterator iterator () { + return new KeyIterator (_multi_map._storage_map.map_iterator ()); + } + + public override int size { get { return _multi_map.size; } } + + public override bool read_only { get { return true; } } + + public override bool contains (K key) { + return _multi_map._storage_map.has_key (key); + } + + public override bool add (K key) { + assert_not_reached (); + } + + public override bool remove (K item) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public int count (K item) { + Collection? collection = _multi_map._storage_map.get (item); + return collection != null ? collection.size : 0; + } + } + + private class Values : AbstractCollection { + protected AbstractMultiMap _multi_map; + + public Values (AbstractMultiMap multi_map) { + _multi_map = multi_map; + } + + public override Gee.Iterator iterator () { + return new ValueIterator (_multi_map._storage_map.map_iterator ()); + } + + public override int size { get { return _multi_map.size; } } + + public override bool read_only { get { return true; } } + + public override bool contains (V value) { + foreach (var col in _multi_map._storage_map.values) { + if (col.contains (value)) { + return true; + } + } + return false; + } + + public override bool add (K key) { + assert_not_reached (); + } + + public override bool remove (K item) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + } + + private class MappingIterator : Object { + protected Gee.MapIterator> outer; + protected Iterator? inner = null; + + public MappingIterator (Gee.MapIterator>? outer) { + this.outer = outer; + } + + public bool next () { + if (inner != null && inner.next ()) { + return true; + } else if (outer.next ()) { + inner = outer.get_value ().iterator (); + assert (inner.next ()); + return true; + } else { + return false; + } + } + + public bool has_next () { + return inner.has_next () || outer.has_next (); + } + + public void remove () { + assert_not_reached (); + } + + public virtual bool read_only { + get { + return true; + } + } + + public void unset () { + inner.remove (); + if (outer.get_value ().is_empty) { + outer.unset (); + } + } + + public bool valid { + get { + return inner != null && inner.valid; + } + } + } + + private class KeyIterator : MappingIterator, Traversable, Iterator { + public KeyIterator (Gee.MapIterator>? outer) { + base (outer); + } + + public new K get () { + assert (valid); + return outer.get_key (); + } + + public bool foreach (ForallFunc f) { + if (inner != null && outer.valid) { + K key = outer.get_key (); + if (!inner.foreach ((v) => {return f (key);})) { + return false; + } + outer.next (); + } + return outer.foreach ((key, col) => { + return col.foreach ((v) => {return f (key);}); + }); + } + } + + private class ValueIterator : MappingIterator, Traversable, Iterator { + public ValueIterator (Gee.MapIterator>? outer) { + base (outer); + } + + public new V get () { + assert (valid); + return inner.get (); + } + + public bool foreach (ForallFunc f) { + if (inner != null && outer.valid) { + if (!inner.foreach (f)) { + return false; + } + outer.next (); + } + return outer.foreach ((key, col) => { + return col.foreach (f); + }); + } + } + + private class MapIterator : MappingIterator, Gee.MapIterator { + public MapIterator (Gee.MapIterator>? outer) { + base (outer); + } + + public K get_key () { + assert (valid); + return outer.get_key (); + } + + public V get_value () { + assert (valid); + return inner.get (); + } + + public void set_value (V value) { + assert_not_reached (); + } + + public bool mutable { get { return false; } } + } + + private weak MultiMap _read_only_view; + public virtual new MultiMap read_only_view { + owned get { + MultiMap instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlyMultiMap (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} } + diff --git a/gee/abstractmultiset.c b/gee/abstractmultiset.c index 59c29ff..5a2018d 100644 --- a/gee/abstractmultiset.c +++ b/gee/abstractmultiset.c @@ -28,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -44,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -126,26 +146,78 @@ typedef struct _GeeMapEntryClass GeeMapEntryClass; typedef struct _GeeAbstractMultiSetIterator GeeAbstractMultiSetIterator; typedef struct _GeeAbstractMultiSetIteratorClass GeeAbstractMultiSetIteratorClass; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; + +#define GEE_TYPE_READ_ONLY_MULTI_SET (gee_read_only_multi_set_get_type ()) +#define GEE_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet)) +#define GEE_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) +#define GEE_IS_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_IS_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_READ_ONLY_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) + +typedef struct _GeeReadOnlyMultiSet GeeReadOnlyMultiSet; +typedef struct _GeeReadOnlyMultiSetClass GeeReadOnlyMultiSetClass; typedef struct _GeeAbstractMultiSetIteratorPrivate GeeAbstractMultiSetIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -157,6 +229,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -171,62 +244,88 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiSet { @@ -237,6 +336,16 @@ struct _GeeAbstractMultiSet { struct _GeeAbstractMultiSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractMultiSet* self); + void (*reserved1) (GeeAbstractMultiSet* self); + void (*reserved2) (GeeAbstractMultiSet* self); + void (*reserved3) (GeeAbstractMultiSet* self); + void (*reserved4) (GeeAbstractMultiSet* self); + void (*reserved5) (GeeAbstractMultiSet* self); + void (*reserved6) (GeeAbstractMultiSet* self); + void (*reserved7) (GeeAbstractMultiSet* self); + void (*reserved8) (GeeAbstractMultiSet* self); + GeeMultiSet* (*get_read_only_view) (GeeAbstractMultiSet* self); }; struct _GeeAbstractMultiSetPrivate { @@ -244,6 +353,7 @@ struct _GeeAbstractMultiSetPrivate { GBoxedCopyFunc g_dup_func; GDestroyNotify g_destroy_func; gint _nitems; + GeeMultiSet* _read_only_view; }; struct _GeeAbstractMultiSetIterator { @@ -268,10 +378,20 @@ struct _GeeAbstractMultiSetIteratorPrivate { static gpointer gee_abstract_multi_set_parent_class = NULL; static gpointer gee_abstract_multi_set_iterator_parent_class = NULL; +static GeeTraversableIface* gee_abstract_multi_set_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_abstract_multi_set_iterator_gee_iterator_parent_iface = NULL; static GeeMultiSetIface* gee_abstract_multi_set_gee_multi_set_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -287,7 +407,8 @@ enum { GEE_ABSTRACT_MULTI_SET_G_TYPE, GEE_ABSTRACT_MULTI_SET_G_DUP_FUNC, GEE_ABSTRACT_MULTI_SET_G_DESTROY_FUNC, - GEE_ABSTRACT_MULTI_SET_SIZE + GEE_ABSTRACT_MULTI_SET_SIZE, + GEE_ABSTRACT_MULTI_SET_READ_ONLY }; GeeAbstractMultiSet* gee_abstract_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMap* storage_map); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); @@ -305,12 +426,37 @@ static gboolean gee_abstract_multi_set_real_remove (GeeAbstractCollection* base, gboolean gee_map_unset (GeeMap* self, gconstpointer key, gpointer* value); static void gee_abstract_multi_set_real_clear (GeeAbstractCollection* base); void gee_map_clear (GeeMap* self); +void gee_abstract_multi_set_reserved0 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved0 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved1 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved1 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved2 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved2 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved3 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved3 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved4 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved4 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved5 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved5 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved6 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved6 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved7 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved7 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved8 (GeeAbstractMultiSet* self); +static void gee_abstract_multi_set_real_reserved8 (GeeAbstractMultiSet* self); +GeeMultiSet* gee_abstract_multi_set_get_read_only_view (GeeAbstractMultiSet* self); +GeeReadOnlyMultiSet* gee_read_only_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeReadOnlyMultiSet* gee_read_only_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_multi_set_get_type (void) G_GNUC_CONST; #define GEE_ABSTRACT_MULTI_SET_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ABSTRACT_MULTI_SET_TYPE_ITERATOR, GeeAbstractMultiSetIteratorPrivate)) enum { GEE_ABSTRACT_MULTI_SET_ITERATOR_DUMMY_PROPERTY, GEE_ABSTRACT_MULTI_SET_ITERATOR_G_TYPE, GEE_ABSTRACT_MULTI_SET_ITERATOR_G_DUP_FUNC, - GEE_ABSTRACT_MULTI_SET_ITERATOR_G_DESTROY_FUNC + GEE_ABSTRACT_MULTI_SET_ITERATOR_G_DESTROY_FUNC, + GEE_ABSTRACT_MULTI_SET_ITERATOR_READ_ONLY, + GEE_ABSTRACT_MULTI_SET_ITERATOR_VALID }; GeeMapIterator* gee_map_map_iterator (GeeMap* self); static gboolean gee_abstract_multi_set_iterator_real_next (GeeIterator* base); @@ -318,18 +464,21 @@ gboolean gee_map_iterator_next (GeeMapIterator* self); gpointer gee_map_iterator_get_value (GeeMapIterator* self); static gboolean gee_abstract_multi_set_iterator_real_has_next (GeeIterator* base); gboolean gee_map_iterator_has_next (GeeMapIterator* self); -static gboolean gee_abstract_multi_set_iterator_real_first (GeeIterator* base); -gboolean gee_map_iterator_first (GeeMapIterator* self); static gpointer gee_abstract_multi_set_iterator_real_get (GeeIterator* base); gpointer gee_map_iterator_get_key (GeeMapIterator* self); static void gee_abstract_multi_set_iterator_real_remove (GeeIterator* base); void gee_map_iterator_set_value (GeeMapIterator* self, gconstpointer value); void gee_map_iterator_unset (GeeMapIterator* self); +static gboolean gee_abstract_multi_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); static void gee_abstract_multi_set_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); static void _vala_gee_abstract_multi_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_multi_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_abstract_multi_set_finalize (GObject* obj); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_abstract_multi_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_multi_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -519,6 +668,96 @@ static void gee_abstract_multi_set_real_clear (GeeAbstractCollection* base) { } +static void gee_abstract_multi_set_real_reserved0 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved0 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_multi_set_real_reserved1 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved1 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_multi_set_real_reserved2 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved2 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_multi_set_real_reserved3 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved3 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_multi_set_real_reserved4 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved4 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_multi_set_real_reserved5 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved5 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_multi_set_real_reserved6 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved6 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_multi_set_real_reserved7 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved7 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_multi_set_real_reserved8 (GeeAbstractMultiSet* self) { +} + + +void gee_abstract_multi_set_reserved8 (GeeAbstractMultiSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->reserved8 (self); +} + + static gint gee_abstract_multi_set_real_get_size (GeeAbstractCollection* base) { gint result; GeeAbstractMultiSet* self; @@ -530,6 +769,50 @@ static gint gee_abstract_multi_set_real_get_size (GeeAbstractCollection* base) { } +static gboolean gee_abstract_multi_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeAbstractMultiSet* self; + self = (GeeAbstractMultiSet*) base; + result = FALSE; + return result; +} + + +GeeMultiSet* gee_abstract_multi_set_get_read_only_view (GeeAbstractMultiSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_MULTI_SET_GET_CLASS (self)->get_read_only_view (self); +} + + +static GeeMultiSet* gee_abstract_multi_set_real_get_read_only_view (GeeAbstractMultiSet* base) { + GeeMultiSet* result; + GeeAbstractMultiSet* self; + GeeMultiSet* _tmp0_; + GeeMultiSet* _tmp1_; + GeeMultiSet* instance; + GeeMultiSet* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlyMultiSet* _tmp3_; + GeeMultiSet* _tmp4_; + GeeMultiSet* _tmp5_; + _tmp3_ = gee_read_only_multi_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeMultiSet*) self); + _g_object_unref0 (instance); + instance = (GeeMultiSet*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + static GeeAbstractMultiSetIterator* gee_abstract_multi_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeAbstractMultiSet* set) { GeeAbstractMultiSetIterator * self = NULL; GeeAbstractMultiSet* _tmp0_; @@ -616,35 +899,6 @@ static gboolean gee_abstract_multi_set_iterator_real_has_next (GeeIterator* base } -static gboolean gee_abstract_multi_set_iterator_real_first (GeeIterator* base) { - GeeAbstractMultiSetIterator * self; - gboolean result = FALSE; - GeeAbstractMultiSet* _tmp0_; - gint _tmp1_; - GeeMapIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - self = (GeeAbstractMultiSetIterator*) base; - _tmp0_ = self->priv->_set; - _tmp1_ = _tmp0_->priv->_nitems; - if (_tmp1_ == 0) { - result = FALSE; - return result; - } - self->priv->_pending = 0; - _tmp2_ = self->priv->_iter; - _tmp3_ = gee_map_iterator_first (_tmp2_); - if (_tmp3_) { - GeeMapIterator* _tmp4_; - gpointer _tmp5_ = NULL; - _tmp4_ = self->priv->_iter; - _tmp5_ = gee_map_iterator_get_value (_tmp4_); - self->priv->_pending = ((gint) ((gintptr) _tmp5_)) - 1; - } - result = TRUE; - return result; -} - - static gpointer gee_abstract_multi_set_iterator_real_get (GeeIterator* base) { GeeAbstractMultiSetIterator * self; gpointer result = NULL; @@ -693,6 +947,173 @@ static void gee_abstract_multi_set_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_abstract_multi_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeAbstractMultiSetIterator * self; + gboolean result = FALSE; + GeeMapIterator* _tmp0_; + gboolean _tmp1_; + gboolean _tmp2_; + self = (GeeAbstractMultiSetIterator*) base; + _tmp0_ = self->priv->_iter; + _tmp1_ = gee_map_iterator_get_valid (_tmp0_); + _tmp2_ = _tmp1_; + if (_tmp2_) { + gboolean _tmp3_; + _tmp3_ = self->priv->_removed; + if (!_tmp3_) { + GeeForallFunc _tmp4_; + void* _tmp4__target; + GeeMapIterator* _tmp5_; + gpointer _tmp6_ = NULL; + gboolean _tmp7_ = FALSE; + _tmp4_ = f; + _tmp4__target = f_target; + _tmp5_ = self->priv->_iter; + _tmp6_ = gee_map_iterator_get_key (_tmp5_); + _tmp7_ = _tmp4_ (_tmp6_, _tmp4__target); + if (!_tmp7_) { + result = FALSE; + return result; + } + } + { + gint _tmp8_; + gint i; + _tmp8_ = self->priv->_pending; + i = _tmp8_ - 1; + { + gboolean _tmp9_; + _tmp9_ = TRUE; + while (TRUE) { + gboolean _tmp10_; + gint _tmp12_; + GeeForallFunc _tmp13_; + void* _tmp13__target; + GeeMapIterator* _tmp14_; + gpointer _tmp15_ = NULL; + gboolean _tmp16_ = FALSE; + _tmp10_ = _tmp9_; + if (!_tmp10_) { + gint _tmp11_; + _tmp11_ = i; + i = _tmp11_ - 1; + } + _tmp9_ = FALSE; + _tmp12_ = i; + if (!(_tmp12_ >= 0)) { + break; + } + _tmp13_ = f; + _tmp13__target = f_target; + _tmp14_ = self->priv->_iter; + _tmp15_ = gee_map_iterator_get_key (_tmp14_); + _tmp16_ = _tmp13_ (_tmp15_, _tmp13__target); + if (!_tmp16_) { + gint _tmp17_; + _tmp17_ = i; + self->priv->_pending = _tmp17_; + result = FALSE; + return result; + } + } + } + } + } + while (TRUE) { + GeeMapIterator* _tmp18_; + gboolean _tmp19_ = FALSE; + _tmp18_ = self->priv->_iter; + _tmp19_ = gee_map_iterator_next (_tmp18_); + if (!_tmp19_) { + break; + } + { + GeeMapIterator* _tmp20_; + gpointer _tmp21_ = NULL; + gint i; + _tmp20_ = self->priv->_iter; + _tmp21_ = gee_map_iterator_get_value (_tmp20_); + i = ((gint) ((gintptr) _tmp21_)) - 1; + { + gboolean _tmp22_; + _tmp22_ = TRUE; + while (TRUE) { + gboolean _tmp23_; + gint _tmp25_; + GeeForallFunc _tmp26_; + void* _tmp26__target; + GeeMapIterator* _tmp27_; + gpointer _tmp28_ = NULL; + gboolean _tmp29_ = FALSE; + _tmp23_ = _tmp22_; + if (!_tmp23_) { + gint _tmp24_; + _tmp24_ = i; + i = _tmp24_ - 1; + } + _tmp22_ = FALSE; + _tmp25_ = i; + if (!(_tmp25_ >= 0)) { + break; + } + _tmp26_ = f; + _tmp26__target = f_target; + _tmp27_ = self->priv->_iter; + _tmp28_ = gee_map_iterator_get_key (_tmp27_); + _tmp29_ = _tmp26_ (_tmp28_, _tmp26__target); + if (!_tmp29_) { + gint _tmp30_; + self->priv->_removed = FALSE; + _tmp30_ = i; + self->priv->_pending = _tmp30_; + result = FALSE; + return result; + } + } + } + } + } + self->priv->_removed = FALSE; + self->priv->_pending = 0; + result = TRUE; + return result; +} + + +static gboolean gee_abstract_multi_set_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeAbstractMultiSetIterator* self; + self = (GeeAbstractMultiSetIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_abstract_multi_set_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeAbstractMultiSetIterator* self; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_; + gboolean _tmp5_; + self = (GeeAbstractMultiSetIterator*) base; + _tmp1_ = self->priv->_removed; + if (!_tmp1_) { + GeeMapIterator* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + _tmp2_ = self->priv->_iter; + _tmp3_ = gee_map_iterator_get_valid (_tmp2_); + _tmp4_ = _tmp3_; + _tmp0_ = _tmp4_; + } else { + _tmp0_ = FALSE; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + static void gee_abstract_multi_set_iterator_class_init (GeeAbstractMultiSetIteratorClass * klass) { gee_abstract_multi_set_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeAbstractMultiSetIteratorPrivate)); @@ -702,6 +1123,32 @@ static void gee_abstract_multi_set_iterator_class_init (GeeAbstractMultiSetItera g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_multi_set_iterator_gee_traversable_get_g_type (GeeAbstractMultiSetIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_set_iterator_gee_traversable_get_g_dup_func (GeeAbstractMultiSetIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_set_iterator_gee_traversable_get_g_destroy_func (GeeAbstractMultiSetIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_multi_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_multi_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_multi_set_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_multi_set_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_multi_set_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_multi_set_iterator_gee_traversable_get_g_destroy_func; } @@ -709,9 +1156,10 @@ static void gee_abstract_multi_set_iterator_gee_iterator_interface_init (GeeIter gee_abstract_multi_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_set_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_abstract_multi_set_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_abstract_multi_set_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_abstract_multi_set_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_abstract_multi_set_iterator_real_remove; + iface->get_read_only = gee_abstract_multi_set_iterator_real_get_read_only; + iface->get_valid = gee_abstract_multi_set_iterator_real_get_valid; } @@ -735,9 +1183,11 @@ static GType gee_abstract_multi_set_iterator_get_type (void) { static volatile gsize gee_abstract_multi_set_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_abstract_multi_set_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractMultiSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_multi_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractMultiSetIterator), 0, (GInstanceInitFunc) gee_abstract_multi_set_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_multi_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_abstract_multi_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_abstract_multi_set_iterator_type_id; gee_abstract_multi_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractMultiSetIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_abstract_multi_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_abstract_multi_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_abstract_multi_set_iterator_type_id__volatile, gee_abstract_multi_set_iterator_type_id); } @@ -749,6 +1199,12 @@ static void _vala_gee_abstract_multi_set_iterator_get_property (GObject * object GeeAbstractMultiSetIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ABSTRACT_MULTI_SET_TYPE_ITERATOR, GeeAbstractMultiSetIterator); switch (property_id) { + case GEE_ABSTRACT_MULTI_SET_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_ABSTRACT_MULTI_SET_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -784,7 +1240,18 @@ static void gee_abstract_multi_set_class_init (GeeAbstractMultiSetClass * klass) GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_abstract_multi_set_real_add; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_abstract_multi_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_abstract_multi_set_real_clear; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved0 = gee_abstract_multi_set_real_reserved0; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved1 = gee_abstract_multi_set_real_reserved1; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved2 = gee_abstract_multi_set_real_reserved2; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved3 = gee_abstract_multi_set_real_reserved3; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved4 = gee_abstract_multi_set_real_reserved4; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved5 = gee_abstract_multi_set_real_reserved5; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved6 = gee_abstract_multi_set_real_reserved6; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved7 = gee_abstract_multi_set_real_reserved7; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->reserved8 = gee_abstract_multi_set_real_reserved8; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_abstract_multi_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_abstract_multi_set_real_get_read_only; + GEE_ABSTRACT_MULTI_SET_CLASS (klass)->get_read_only_view = gee_abstract_multi_set_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_multi_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_multi_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_abstract_multi_set_finalize; @@ -792,12 +1259,32 @@ static void gee_abstract_multi_set_class_init (GeeAbstractMultiSetClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_MULTI_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_multi_set_gee_multi_set_get_g_type (GeeAbstractMultiSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_multi_set_gee_multi_set_get_g_dup_func (GeeAbstractMultiSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_multi_set_gee_multi_set_get_g_destroy_func (GeeAbstractMultiSet* self) { + return self->priv->g_destroy_func; } static void gee_abstract_multi_set_gee_multi_set_interface_init (GeeMultiSetIface * iface) { gee_abstract_multi_set_gee_multi_set_parent_iface = g_type_interface_peek_parent (iface); iface->count = (gint (*)(GeeMultiSet*, gconstpointer)) gee_abstract_multi_set_real_count; + iface->get_g_type = (GType(*)(GeeMultiSet*)) gee_abstract_multi_set_gee_multi_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeMultiSet*)) gee_abstract_multi_set_gee_multi_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeMultiSet*)) gee_abstract_multi_set_gee_multi_set_get_g_destroy_func; + iface->get_read_only_view = (GeeMultiSet* (*) (GeeMultiSet *)) gee_abstract_multi_set_get_read_only_view; } @@ -842,6 +1329,9 @@ static void _vala_gee_abstract_multi_set_get_property (GObject * object, guint p case GEE_ABSTRACT_MULTI_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_ABSTRACT_MULTI_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/gee/abstractmultiset.vala b/gee/abstractmultiset.vala index 6d2a5e5..3104c55 100644 --- a/gee/abstractmultiset.vala +++ b/gee/abstractmultiset.vala @@ -32,6 +32,10 @@ public abstract class Gee.AbstractMultiSet : AbstractCollection, MultiSet< get { return _nitems; } } + public override bool read_only { + get { return false; } + } + protected Map _storage_map; private int _nitems = 0; @@ -88,7 +92,31 @@ public abstract class Gee.AbstractMultiSet : AbstractCollection, MultiSet< _nitems = 0; } - private class Iterator : Object, Gee.Iterator { + private weak MultiSet _read_only_view; + public virtual new MultiSet read_only_view { + owned get { + MultiSet instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlyMultiSet (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + + private class Iterator : Object, Traversable, Gee.Iterator { private AbstractMultiSet _set; private MapIterator _iter; @@ -118,17 +146,6 @@ public abstract class Gee.AbstractMultiSet : AbstractCollection, MultiSet< return _pending > 0 || _iter.has_next (); } - public bool first () { - if (_set._nitems == 0) { - return false; - } - _pending = 0; - if (_iter.first ()) { - _pending = _iter.get_value () - 1; - } - return true; - } - public new G get () { assert (! _removed); return _iter.get_key (); @@ -143,5 +160,45 @@ public abstract class Gee.AbstractMultiSet : AbstractCollection, MultiSet< _set._nitems--; _removed = true; } + + public bool read_only { + get { + return false; + } + } + + public bool valid { + get { + return ! _removed && _iter.valid; + } + } + + public bool foreach (ForallFunc f) { + if (_iter.valid) { + if (!_removed) { + if (!f(_iter.get_key())) { + return false; + } + } + for(int i = _pending - 1; i >= 0; --i) { + if (!f(_iter.get_key())) { + _pending = i; + return false; + } + } + } + while(_iter.next()) { + for(int i = _iter.get_value() - 1; i >= 0; --i) { + if (!f(_iter.get_key())) { + _removed = false; + _pending = i; + return false; + } + } + } + _removed = false; + _pending = 0; + return true; + } } } diff --git a/gee/abstractqueue.c b/gee/abstractqueue.c index b43bec5..0b4da64 100644 --- a/gee/abstractqueue.c +++ b/gee/abstractqueue.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -81,23 +101,55 @@ typedef struct _GeeAbstractQueue GeeAbstractQueue; typedef struct _GeeAbstractQueueClass GeeAbstractQueueClass; typedef struct _GeeAbstractQueuePrivate GeeAbstractQueuePrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -109,6 +161,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -123,19 +176,28 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -152,10 +214,18 @@ struct _GeeAbstractQueue { struct _GeeAbstractQueueClass { GeeAbstractCollectionClass parent_class; - gboolean (*offer) (GeeAbstractQueue* self, gconstpointer element); gpointer (*peek) (GeeAbstractQueue* self); gpointer (*poll) (GeeAbstractQueue* self); - gint (*drain) (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); + void (*reserved0) (GeeAbstractQueue* self); + void (*reserved1) (GeeAbstractQueue* self); + void (*reserved2) (GeeAbstractQueue* self); + void (*reserved3) (GeeAbstractQueue* self); + void (*reserved4) (GeeAbstractQueue* self); + void (*reserved5) (GeeAbstractQueue* self); + void (*reserved6) (GeeAbstractQueue* self); + void (*reserved7) (GeeAbstractQueue* self); + void (*reserved8) (GeeAbstractQueue* self); + void (*reserved9) (GeeAbstractQueue* self); gint (*get_capacity) (GeeAbstractQueue* self); gint (*get_remaining_capacity) (GeeAbstractQueue* self); gboolean (*get_is_full) (GeeAbstractQueue* self); @@ -171,7 +241,16 @@ struct _GeeAbstractQueuePrivate { static gpointer gee_abstract_queue_parent_class = NULL; static GeeQueueIface* gee_abstract_queue_gee_queue_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -187,14 +266,30 @@ enum { GEE_ABSTRACT_QUEUE_REMAINING_CAPACITY, GEE_ABSTRACT_QUEUE_IS_FULL }; -gboolean gee_abstract_queue_offer (GeeAbstractQueue* self, gconstpointer element); -static gboolean gee_abstract_queue_real_offer (GeeAbstractQueue* self, gconstpointer element); gpointer gee_abstract_queue_peek (GeeAbstractQueue* self); static gpointer gee_abstract_queue_real_peek (GeeAbstractQueue* self); gpointer gee_abstract_queue_poll (GeeAbstractQueue* self); static gpointer gee_abstract_queue_real_poll (GeeAbstractQueue* self); -gint gee_abstract_queue_drain (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); -static gint gee_abstract_queue_real_drain (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); +void gee_abstract_queue_reserved0 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved0 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved1 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved1 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved2 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved2 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved3 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved3 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved4 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved4 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved5 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved5 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved6 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved6 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved7 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved7 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved8 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved8 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved9 (GeeAbstractQueue* self); +static void gee_abstract_queue_real_reserved9 (GeeAbstractQueue* self); GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self); @@ -204,21 +299,6 @@ static void _vala_gee_abstract_queue_get_property (GObject * object, guint prope static void _vala_gee_abstract_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_queue_real_offer (GeeAbstractQueue* self, gconstpointer element) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_queue_offer'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return FALSE; -} - - -gboolean gee_abstract_queue_offer (GeeAbstractQueue* self, gconstpointer element) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_QUEUE_GET_CLASS (self)->offer (self, element); -} - - /** * {@inheritDoc} */ @@ -249,18 +329,103 @@ gpointer gee_abstract_queue_poll (GeeAbstractQueue* self) { } -/** - * {@inheritDoc} - */ -static gint gee_abstract_queue_real_drain (GeeAbstractQueue* self, GeeCollection* recipient, gint amount) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_queue_drain'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return 0; +static void gee_abstract_queue_real_reserved0 (GeeAbstractQueue* self) { } -gint gee_abstract_queue_drain (GeeAbstractQueue* self, GeeCollection* recipient, gint amount) { - g_return_val_if_fail (self != NULL, 0); - return GEE_ABSTRACT_QUEUE_GET_CLASS (self)->drain (self, recipient, amount); +void gee_abstract_queue_reserved0 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_queue_real_reserved1 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved1 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_queue_real_reserved2 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved2 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_queue_real_reserved3 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved3 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_queue_real_reserved4 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved4 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_queue_real_reserved5 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved5 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_queue_real_reserved6 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved6 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_queue_real_reserved7 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved7 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_queue_real_reserved8 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved8 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_queue_real_reserved9 (GeeAbstractQueue* self) { +} + + +void gee_abstract_queue_reserved9 (GeeAbstractQueue* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_QUEUE_GET_CLASS (self)->reserved9 (self); } @@ -295,10 +460,18 @@ gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self) { static void gee_abstract_queue_class_init (GeeAbstractQueueClass * klass) { gee_abstract_queue_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeAbstractQueuePrivate)); - GEE_ABSTRACT_QUEUE_CLASS (klass)->offer = gee_abstract_queue_real_offer; GEE_ABSTRACT_QUEUE_CLASS (klass)->peek = gee_abstract_queue_real_peek; GEE_ABSTRACT_QUEUE_CLASS (klass)->poll = gee_abstract_queue_real_poll; - GEE_ABSTRACT_QUEUE_CLASS (klass)->drain = gee_abstract_queue_real_drain; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved0 = gee_abstract_queue_real_reserved0; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved1 = gee_abstract_queue_real_reserved1; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved2 = gee_abstract_queue_real_reserved2; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved3 = gee_abstract_queue_real_reserved3; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved4 = gee_abstract_queue_real_reserved4; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved5 = gee_abstract_queue_real_reserved5; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved6 = gee_abstract_queue_real_reserved6; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved7 = gee_abstract_queue_real_reserved7; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved8 = gee_abstract_queue_real_reserved8; + GEE_ABSTRACT_QUEUE_CLASS (klass)->reserved9 = gee_abstract_queue_real_reserved9; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_queue_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_queue_set_property; g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_QUEUE_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); @@ -319,12 +492,28 @@ static void gee_abstract_queue_class_init (GeeAbstractQueueClass * klass) { } +static GType gee_abstract_queue_gee_queue_get_g_type (GeeAbstractQueue* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_queue_gee_queue_get_g_dup_func (GeeAbstractQueue* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_queue_gee_queue_get_g_destroy_func (GeeAbstractQueue* self) { + return self->priv->g_destroy_func; +} + + static void gee_abstract_queue_gee_queue_interface_init (GeeQueueIface * iface) { gee_abstract_queue_gee_queue_parent_iface = g_type_interface_peek_parent (iface); - iface->offer = (gboolean (*)(GeeQueue*, gconstpointer)) gee_abstract_queue_offer; iface->peek = (gpointer (*)(GeeQueue*)) gee_abstract_queue_peek; iface->poll = (gpointer (*)(GeeQueue*)) gee_abstract_queue_poll; - iface->drain = (gint (*)(GeeQueue*, GeeCollection*, gint)) gee_abstract_queue_drain; + iface->get_g_type = (GType(*)(GeeQueue*)) gee_abstract_queue_gee_queue_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeQueue*)) gee_abstract_queue_gee_queue_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeQueue*)) gee_abstract_queue_gee_queue_get_g_destroy_func; iface->get_capacity = (gint (*) (GeeQueue *)) gee_abstract_queue_get_capacity; iface->get_remaining_capacity = (gint (*) (GeeQueue *)) gee_abstract_queue_get_remaining_capacity; iface->get_is_full = (gboolean (*) (GeeQueue *)) gee_abstract_queue_get_is_full; diff --git a/gee/abstractqueue.vala b/gee/abstractqueue.vala index ce3fc3d..87a0f3c 100644 --- a/gee/abstractqueue.vala +++ b/gee/abstractqueue.vala @@ -43,11 +43,6 @@ public abstract class Gee.AbstractQueue : Gee.AbstractCollection, Queue */ public abstract bool is_full { get; } - /** - * {@inheritDoc} - */ - public abstract bool offer (G element); - /** * {@inheritDoc} */ @@ -58,8 +53,15 @@ public abstract class Gee.AbstractQueue : Gee.AbstractCollection, Queue */ public abstract G? poll (); - /** - * {@inheritDoc} - */ - public abstract int drain (Collection recipient, int amount = -1); + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} } diff --git a/gee/abstractset.c b/gee/abstractset.c index 5e75f24..f6cb9cd 100644 --- a/gee/abstractset.c +++ b/gee/abstractset.c @@ -28,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -44,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -103,23 +123,55 @@ typedef struct _GeeReadOnlySet GeeReadOnlySet; typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -131,6 +183,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -145,19 +198,28 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; @@ -168,6 +230,16 @@ struct _GeeAbstractSet { struct _GeeAbstractSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); GeeSet* (*get_read_only_view) (GeeAbstractSet* self); }; @@ -182,7 +254,16 @@ struct _GeeAbstractSetPrivate { static gpointer gee_abstract_set_parent_class = NULL; static GeeSetIface* gee_abstract_set_gee_set_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -196,6 +277,26 @@ enum { GEE_ABSTRACT_SET_G_DESTROY_FUNC, GEE_ABSTRACT_SET_READ_ONLY_VIEW }; +void gee_abstract_set_reserved0 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved0 (GeeAbstractSet* self); +void gee_abstract_set_reserved1 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved1 (GeeAbstractSet* self); +void gee_abstract_set_reserved2 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved2 (GeeAbstractSet* self); +void gee_abstract_set_reserved3 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved3 (GeeAbstractSet* self); +void gee_abstract_set_reserved4 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved4 (GeeAbstractSet* self); +void gee_abstract_set_reserved5 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved5 (GeeAbstractSet* self); +void gee_abstract_set_reserved6 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved6 (GeeAbstractSet* self); +void gee_abstract_set_reserved7 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved7 (GeeAbstractSet* self); +void gee_abstract_set_reserved8 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved8 (GeeAbstractSet* self); +void gee_abstract_set_reserved9 (GeeAbstractSet* self); +static void gee_abstract_set_real_reserved9 (GeeAbstractSet* self); GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self); @@ -208,6 +309,106 @@ static void _vala_gee_abstract_set_get_property (GObject * object, guint propert static void _vala_gee_abstract_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void gee_abstract_set_real_reserved0 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved0 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_set_real_reserved1 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved1 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_set_real_reserved2 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved2 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_set_real_reserved3 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved3 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_set_real_reserved4 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved4 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_set_real_reserved5 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved5 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_set_real_reserved6 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved6 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_set_real_reserved7 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved7 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_set_real_reserved8 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved8 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_set_real_reserved9 (GeeAbstractSet* self) { +} + + +void gee_abstract_set_reserved9 (GeeAbstractSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SET_GET_CLASS (self)->reserved9 (self); +} + + GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { GeeAbstractSet * self = NULL; self = (GeeAbstractSet*) gee_abstract_collection_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); @@ -261,6 +462,16 @@ static GeeSet* gee_abstract_set_real_get_read_only_view (GeeAbstractSet* base) { static void gee_abstract_set_class_init (GeeAbstractSetClass * klass) { gee_abstract_set_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeAbstractSetPrivate)); + GEE_ABSTRACT_SET_CLASS (klass)->reserved0 = gee_abstract_set_real_reserved0; + GEE_ABSTRACT_SET_CLASS (klass)->reserved1 = gee_abstract_set_real_reserved1; + GEE_ABSTRACT_SET_CLASS (klass)->reserved2 = gee_abstract_set_real_reserved2; + GEE_ABSTRACT_SET_CLASS (klass)->reserved3 = gee_abstract_set_real_reserved3; + GEE_ABSTRACT_SET_CLASS (klass)->reserved4 = gee_abstract_set_real_reserved4; + GEE_ABSTRACT_SET_CLASS (klass)->reserved5 = gee_abstract_set_real_reserved5; + GEE_ABSTRACT_SET_CLASS (klass)->reserved6 = gee_abstract_set_real_reserved6; + GEE_ABSTRACT_SET_CLASS (klass)->reserved7 = gee_abstract_set_real_reserved7; + GEE_ABSTRACT_SET_CLASS (klass)->reserved8 = gee_abstract_set_real_reserved8; + GEE_ABSTRACT_SET_CLASS (klass)->reserved9 = gee_abstract_set_real_reserved9; GEE_ABSTRACT_SET_CLASS (klass)->get_read_only_view = gee_abstract_set_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_set_set_property; @@ -275,8 +486,26 @@ static void gee_abstract_set_class_init (GeeAbstractSetClass * klass) { } +static GType gee_abstract_set_gee_set_get_g_type (GeeAbstractSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_set_gee_set_get_g_dup_func (GeeAbstractSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_set_gee_set_get_g_destroy_func (GeeAbstractSet* self) { + return self->priv->g_destroy_func; +} + + static void gee_abstract_set_gee_set_interface_init (GeeSetIface * iface) { gee_abstract_set_gee_set_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeSet*)) gee_abstract_set_gee_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeSet*)) gee_abstract_set_gee_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeSet*)) gee_abstract_set_gee_set_get_g_destroy_func; iface->get_read_only_view = (GeeSet* (*) (GeeSet *)) gee_abstract_set_get_read_only_view; } diff --git a/gee/abstractset.vala b/gee/abstractset.vala index 783d978..972b4d1 100644 --- a/gee/abstractset.vala +++ b/gee/abstractset.vala @@ -47,4 +47,16 @@ public abstract class Gee.AbstractSet : Gee.AbstractCollection, Set { return instance; } } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} } diff --git a/gee/abstractsortedmap.c b/gee/abstractsortedmap.c new file mode 100644 index 0000000..09e7bb9 --- /dev/null +++ b/gee/abstractsortedmap.c @@ -0,0 +1,786 @@ +/* abstractsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from abstractsortedmap.vala, do not modify */ + +/* readonlysortedmap.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) +#define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) +#define GEE_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) +#define GEE_IS_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_IS_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_ABSTRACT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) + +typedef struct _GeeAbstractMap GeeAbstractMap; +typedef struct _GeeAbstractMapClass GeeAbstractMapClass; +typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; +typedef struct _GeeAbstractSortedMapPrivate GeeAbstractSortedMapPrivate; + +#define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ()) +#define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap)) +#define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) +#define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) + +typedef struct _GeeReadOnlyMap GeeReadOnlyMap; +typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; + +#define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ()) +#define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap)) +#define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) +#define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) + +typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap; +typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeAbstractMap { + GObject parent_instance; + GeeAbstractMapPrivate * priv; +}; + +struct _GeeAbstractMapClass { + GObjectClass parent_class; + gboolean (*has_key) (GeeAbstractMap* self, gconstpointer key); + gboolean (*has) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeAbstractMap* self, gconstpointer key); + void (*set) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); + GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); + void (*clear) (GeeAbstractMap* self); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); + gint (*get_size) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); + GeeSet* (*get_keys) (GeeAbstractMap* self); + GeeCollection* (*get_values) (GeeAbstractMap* self); + GeeSet* (*get_entries) (GeeAbstractMap* self); + GeeMap* (*get_read_only_view) (GeeAbstractMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeAbstractSortedMap { + GeeAbstractMap parent_instance; + GeeAbstractSortedMapPrivate * priv; +}; + +struct _GeeAbstractSortedMapClass { + GeeAbstractMapClass parent_class; + GeeSortedMap* (*head_map) (GeeAbstractSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeAbstractSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); + void (*reserved0) (GeeAbstractSortedMap* self); + void (*reserved1) (GeeAbstractSortedMap* self); + void (*reserved2) (GeeAbstractSortedMap* self); + void (*reserved3) (GeeAbstractSortedMap* self); + void (*reserved4) (GeeAbstractSortedMap* self); + void (*reserved5) (GeeAbstractSortedMap* self); + void (*reserved6) (GeeAbstractSortedMap* self); + void (*reserved7) (GeeAbstractSortedMap* self); + void (*reserved8) (GeeAbstractSortedMap* self); + void (*reserved9) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_keys) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeAbstractSortedMap* self); +}; + +struct _GeeAbstractSortedMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeSortedMap* _read_only_view; +}; + + +static gpointer gee_abstract_sorted_map_parent_class = NULL; +static GeeSortedMapIface* gee_abstract_sorted_map_gee_sorted_map_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_SORTED_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapPrivate)) +enum { + GEE_ABSTRACT_SORTED_MAP_DUMMY_PROPERTY, + GEE_ABSTRACT_SORTED_MAP_K_TYPE, + GEE_ABSTRACT_SORTED_MAP_K_DUP_FUNC, + GEE_ABSTRACT_SORTED_MAP_K_DESTROY_FUNC, + GEE_ABSTRACT_SORTED_MAP_V_TYPE, + GEE_ABSTRACT_SORTED_MAP_V_DUP_FUNC, + GEE_ABSTRACT_SORTED_MAP_V_DESTROY_FUNC, + GEE_ABSTRACT_SORTED_MAP_ASCENDING_KEYS, + GEE_ABSTRACT_SORTED_MAP_ASCENDING_ENTRIES, + GEE_ABSTRACT_SORTED_MAP_READ_ONLY_VIEW +}; +GeeSortedMap* gee_abstract_sorted_map_head_map (GeeAbstractSortedMap* self, gconstpointer before); +static GeeSortedMap* gee_abstract_sorted_map_real_head_map (GeeAbstractSortedMap* self, gconstpointer before); +GeeSortedMap* gee_abstract_sorted_map_tail_map (GeeAbstractSortedMap* self, gconstpointer after); +static GeeSortedMap* gee_abstract_sorted_map_real_tail_map (GeeAbstractSortedMap* self, gconstpointer after); +GeeSortedMap* gee_abstract_sorted_map_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); +static GeeSortedMap* gee_abstract_sorted_map_real_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); +void gee_abstract_sorted_map_reserved0 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved0 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved1 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved1 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved2 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved2 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved3 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved3 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved4 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved4 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved5 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved5 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved6 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved6 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved7 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved7 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved8 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved8 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved9 (GeeAbstractSortedMap* self); +static void gee_abstract_sorted_map_real_reserved9 (GeeAbstractSortedMap* self); +GeeAbstractSortedMap* gee_abstract_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_keys (GeeAbstractSortedMap* self); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_entries (GeeAbstractSortedMap* self); +GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GType gee_read_only_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST; +static void gee_abstract_sorted_map_finalize (GObject* obj); +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self); +static void _vala_gee_abstract_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_abstract_sorted_map_real_head_map (GeeAbstractSortedMap* self, gconstpointer before) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_map_head_map'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedMap* gee_abstract_sorted_map_head_map (GeeAbstractSortedMap* self, gconstpointer before) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->head_map (self, before); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_abstract_sorted_map_real_tail_map (GeeAbstractSortedMap* self, gconstpointer after) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_map_tail_map'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedMap* gee_abstract_sorted_map_tail_map (GeeAbstractSortedMap* self, gconstpointer after) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->tail_map (self, after); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_abstract_sorted_map_real_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_map_sub_map'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedMap* gee_abstract_sorted_map_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->sub_map (self, before, after); +} + + +static void gee_abstract_sorted_map_real_reserved0 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved0 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_sorted_map_real_reserved1 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved1 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_sorted_map_real_reserved2 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved2 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_sorted_map_real_reserved3 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved3 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_sorted_map_real_reserved4 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved4 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_sorted_map_real_reserved5 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved5 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_sorted_map_real_reserved6 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved6 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_sorted_map_real_reserved7 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved7 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_sorted_map_real_reserved8 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved8 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_sorted_map_real_reserved9 (GeeAbstractSortedMap* self) { +} + + +void gee_abstract_sorted_map_reserved9 (GeeAbstractSortedMap* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->reserved9 (self); +} + + +GeeAbstractSortedMap* gee_abstract_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func) { + GeeAbstractSortedMap * self = NULL; + self = (GeeAbstractSortedMap*) gee_abstract_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +GeeSortedSet* gee_abstract_sorted_map_get_ascending_keys (GeeAbstractSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->get_ascending_keys (self); +} + + +GeeSortedSet* gee_abstract_sorted_map_get_ascending_entries (GeeAbstractSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_MAP_GET_CLASS (self)->get_ascending_entries (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeSortedMap* gee_abstract_sorted_map_real_get_read_only_view (GeeSortedMap* base) { + GeeSortedMap* result; + GeeAbstractSortedMap* self; + GeeSortedMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* instance; + GeeSortedMap* _tmp2_; + self = (GeeAbstractSortedMap*) base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlySortedMap* _tmp3_; + GeeSortedMap* _tmp4_; + GeeSortedMap* _tmp5_; + _tmp3_ = gee_read_only_sorted_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, (GeeMap*) self); + _g_object_unref0 (instance); + instance = (GeeSortedMap*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + +static void gee_abstract_sorted_map_class_init (GeeAbstractSortedMapClass * klass) { + gee_abstract_sorted_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractSortedMapPrivate)); + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->head_map = gee_abstract_sorted_map_real_head_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->tail_map = gee_abstract_sorted_map_real_tail_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->sub_map = gee_abstract_sorted_map_real_sub_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved0 = gee_abstract_sorted_map_real_reserved0; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved1 = gee_abstract_sorted_map_real_reserved1; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved2 = gee_abstract_sorted_map_real_reserved2; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved3 = gee_abstract_sorted_map_real_reserved3; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved4 = gee_abstract_sorted_map_real_reserved4; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved5 = gee_abstract_sorted_map_real_reserved5; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved6 = gee_abstract_sorted_map_real_reserved6; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved7 = gee_abstract_sorted_map_real_reserved7; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved8 = gee_abstract_sorted_map_real_reserved8; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->reserved9 = gee_abstract_sorted_map_real_reserved9; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_sorted_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_sorted_map_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_sorted_map_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_ASCENDING_KEYS, g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_ASCENDING_ENTRIES, g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * The read-only view this map. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_MAP_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_abstract_sorted_map_gee_sorted_map_interface_init (GeeSortedMapIface * iface) { + gee_abstract_sorted_map_gee_sorted_map_parent_iface = g_type_interface_peek_parent (iface); + iface->head_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer)) gee_abstract_sorted_map_head_map; + iface->tail_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer)) gee_abstract_sorted_map_tail_map; + iface->sub_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer, gconstpointer)) gee_abstract_sorted_map_sub_map; + iface->get_ascending_keys = (GeeSortedSet* (*) (GeeSortedMap *)) gee_abstract_sorted_map_get_ascending_keys; + iface->get_ascending_entries = (GeeSortedSet* (*) (GeeSortedMap *)) gee_abstract_sorted_map_get_ascending_entries; + iface->get_read_only_view = gee_abstract_sorted_map_real_get_read_only_view; +} + + +static void gee_abstract_sorted_map_instance_init (GeeAbstractSortedMap * self) { + self->priv = GEE_ABSTRACT_SORTED_MAP_GET_PRIVATE (self); +} + + +static void gee_abstract_sorted_map_finalize (GObject* obj) { + GeeAbstractSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap); + G_OBJECT_CLASS (gee_abstract_sorted_map_parent_class)->finalize (obj); +} + + +GType gee_abstract_sorted_map_get_type (void) { + static volatile gsize gee_abstract_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractSortedMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_sorted_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractSortedMap), 0, (GInstanceInitFunc) gee_abstract_sorted_map_instance_init, NULL }; + static const GInterfaceInfo gee_sorted_map_info = { (GInterfaceInitFunc) gee_abstract_sorted_map_gee_sorted_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_sorted_map_type_id; + gee_abstract_sorted_map_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_MAP, "GeeAbstractSortedMap", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_sorted_map_type_id, GEE_TYPE_SORTED_MAP, &gee_sorted_map_info); + g_once_init_leave (&gee_abstract_sorted_map_type_id__volatile, gee_abstract_sorted_map_type_id); + } + return gee_abstract_sorted_map_type_id__volatile; +} + + +static void _vala_gee_abstract_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap); + switch (property_id) { + case GEE_ABSTRACT_SORTED_MAP_READ_ONLY_VIEW: + g_value_take_object (value, gee_sorted_map_get_read_only_view ((GeeSortedMap*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap); + switch (property_id) { + case GEE_ABSTRACT_SORTED_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_SORTED_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_SORTED_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_SORTED_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_SORTED_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_SORTED_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/abstractsortedmap.vala b/gee/abstractsortedmap.vala new file mode 100644 index 0000000..90ec215 --- /dev/null +++ b/gee/abstractsortedmap.vala @@ -0,0 +1,77 @@ +/* readonlysortedmap.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +public abstract class Gee.AbstractSortedMap : AbstractMap, SortedMap { + /** + * {@inheritDoc} + */ + public abstract SortedMap head_map (K before); + + /** + * {@inheritDoc} + */ + public abstract SortedMap tail_map (K after); + + /** + * {@inheritDoc} + */ + public abstract SortedMap sub_map (K before, K after); + + /** + * {@inheritDoc} + */ + public abstract SortedSet ascending_keys { owned get; } + + /** + * {@inheritDoc} + */ + public abstract SortedSet> ascending_entries { owned get; } + + private weak SortedMap _read_only_view; + /** + * The read-only view this map. + */ + public new SortedMap read_only_view { + owned get { + SortedMap instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlySortedMap (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} +} + diff --git a/gee/abstractsortedset.c b/gee/abstractsortedset.c new file mode 100644 index 0000000..2e0ac59 --- /dev/null +++ b/gee/abstractsortedset.c @@ -0,0 +1,849 @@ +/* abstractsortedset.c generated by valac 0.18.0, the Vala compiler + * generated from abstractsortedset.vala, do not modify */ + +/* abstractsortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; + +#define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ()) +#define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet)) +#define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) +#define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET)) +#define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET)) +#define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) + +typedef struct _GeeReadOnlySet GeeReadOnlySet; +typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; + +#define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ()) +#define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet)) +#define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) +#define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) + +typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet; +typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeAbstractSet { + GeeAbstractCollection parent_instance; + GeeAbstractSetPrivate * priv; +}; + +struct _GeeAbstractSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); + GeeSet* (*get_read_only_view) (GeeAbstractSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeAbstractSortedSet { + GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeAbstractSortedSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeSortedSet* _read_only_view; +}; + + +static gpointer gee_abstract_sorted_set_parent_class = NULL; +static GeeSortedSetIface* gee_abstract_sorted_set_gee_sorted_set_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +#define GEE_ABSTRACT_SORTED_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetPrivate)) +enum { + GEE_ABSTRACT_SORTED_SET_DUMMY_PROPERTY, + GEE_ABSTRACT_SORTED_SET_G_TYPE, + GEE_ABSTRACT_SORTED_SET_G_DUP_FUNC, + GEE_ABSTRACT_SORTED_SET_G_DESTROY_FUNC, + GEE_ABSTRACT_SORTED_SET_READ_ONLY_VIEW +}; +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +static gpointer gee_abstract_sorted_set_real_first (GeeAbstractSortedSet* self); +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +static gpointer gee_abstract_sorted_set_real_last (GeeAbstractSortedSet* self); +GeeIterator* gee_abstract_sorted_set_iterator_at (GeeAbstractSortedSet* self, gconstpointer element); +static GeeIterator* gee_abstract_sorted_set_real_iterator_at (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_abstract_sorted_set_real_lower (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_abstract_sorted_set_real_higher (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_abstract_sorted_set_real_floor (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_abstract_sorted_set_real_ceil (GeeAbstractSortedSet* self, gconstpointer element); +GeeSortedSet* gee_abstract_sorted_set_head_set (GeeAbstractSortedSet* self, gconstpointer before); +static GeeSortedSet* gee_abstract_sorted_set_real_head_set (GeeAbstractSortedSet* self, gconstpointer before); +GeeSortedSet* gee_abstract_sorted_set_tail_set (GeeAbstractSortedSet* self, gconstpointer after); +static GeeSortedSet* gee_abstract_sorted_set_real_tail_set (GeeAbstractSortedSet* self, gconstpointer after); +GeeSortedSet* gee_abstract_sorted_set_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); +static GeeSortedSet* gee_abstract_sorted_set_real_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); +void gee_abstract_sorted_set_reserved0 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved0 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved1 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved1 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved2 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved2 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved3 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved3 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved4 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved4 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved5 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved5 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved6 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved6 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved7 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved7 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved8 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved8 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved9 (GeeAbstractSortedSet* self); +static void gee_abstract_sorted_set_real_reserved9 (GeeAbstractSortedSet* self); +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSortedSet* gee_abstract_sorted_set_get_read_only_view (GeeAbstractSortedSet* self); +GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST; +static void gee_abstract_sorted_set_finalize (GObject* obj); +static void _vala_gee_abstract_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_abstract_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_first (GeeAbstractSortedSet* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_first'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->first (self); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_last (GeeAbstractSortedSet* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_last'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->last (self); +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_abstract_sorted_set_real_iterator_at (GeeAbstractSortedSet* self, gconstpointer element) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_iterator_at'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeIterator* gee_abstract_sorted_set_iterator_at (GeeAbstractSortedSet* self, gconstpointer element) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->iterator_at (self, element); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_lower (GeeAbstractSortedSet* self, gconstpointer element) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_lower'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->lower (self, element); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_higher (GeeAbstractSortedSet* self, gconstpointer element) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_higher'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->higher (self, element); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_floor (GeeAbstractSortedSet* self, gconstpointer element) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_floor'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->floor (self, element); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_abstract_sorted_set_real_ceil (GeeAbstractSortedSet* self, gconstpointer element) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_ceil'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->ceil (self, element); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_abstract_sorted_set_real_head_set (GeeAbstractSortedSet* self, gconstpointer before) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_head_set'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedSet* gee_abstract_sorted_set_head_set (GeeAbstractSortedSet* self, gconstpointer before) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->head_set (self, before); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_abstract_sorted_set_real_tail_set (GeeAbstractSortedSet* self, gconstpointer after) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_tail_set'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedSet* gee_abstract_sorted_set_tail_set (GeeAbstractSortedSet* self, gconstpointer after) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->tail_set (self, after); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_abstract_sorted_set_real_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_sorted_set_sub_set'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; +} + + +GeeSortedSet* gee_abstract_sorted_set_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->sub_set (self, from, to); +} + + +static void gee_abstract_sorted_set_real_reserved0 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved0 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved0 (self); +} + + +static void gee_abstract_sorted_set_real_reserved1 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved1 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved1 (self); +} + + +static void gee_abstract_sorted_set_real_reserved2 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved2 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved2 (self); +} + + +static void gee_abstract_sorted_set_real_reserved3 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved3 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved3 (self); +} + + +static void gee_abstract_sorted_set_real_reserved4 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved4 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved4 (self); +} + + +static void gee_abstract_sorted_set_real_reserved5 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved5 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved5 (self); +} + + +static void gee_abstract_sorted_set_real_reserved6 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved6 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved6 (self); +} + + +static void gee_abstract_sorted_set_real_reserved7 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved7 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved7 (self); +} + + +static void gee_abstract_sorted_set_real_reserved8 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved8 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved8 (self); +} + + +static void gee_abstract_sorted_set_real_reserved9 (GeeAbstractSortedSet* self) { +} + + +void gee_abstract_sorted_set_reserved9 (GeeAbstractSortedSet* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->reserved9 (self); +} + + +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeAbstractSortedSet * self = NULL; + self = (GeeAbstractSortedSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeSortedSet* gee_abstract_sorted_set_get_read_only_view (GeeAbstractSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_ABSTRACT_SORTED_SET_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeSortedSet* gee_abstract_sorted_set_real_get_read_only_view (GeeAbstractSortedSet* base) { + GeeSortedSet* result; + GeeAbstractSortedSet* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* instance; + GeeSortedSet* _tmp2_; + self = base; + _tmp0_ = self->priv->_read_only_view; + _tmp1_ = _g_object_ref0 (_tmp0_); + instance = _tmp1_; + _tmp2_ = self->priv->_read_only_view; + if (_tmp2_ == NULL) { + GeeReadOnlySortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + _tmp3_ = gee_read_only_sorted_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeSortedSet*) self); + _g_object_unref0 (instance); + instance = (GeeSortedSet*) _tmp3_; + _tmp4_ = instance; + self->priv->_read_only_view = _tmp4_; + _tmp5_ = instance; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_read_only_view)); + } + result = instance; + return result; +} + + +static void gee_abstract_sorted_set_class_init (GeeAbstractSortedSetClass * klass) { + gee_abstract_sorted_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeAbstractSortedSetPrivate)); + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_abstract_sorted_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_abstract_sorted_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_abstract_sorted_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_abstract_sorted_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_abstract_sorted_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_abstract_sorted_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_abstract_sorted_set_real_ceil; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_abstract_sorted_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_abstract_sorted_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_abstract_sorted_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved0 = gee_abstract_sorted_set_real_reserved0; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved1 = gee_abstract_sorted_set_real_reserved1; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved2 = gee_abstract_sorted_set_real_reserved2; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved3 = gee_abstract_sorted_set_real_reserved3; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved4 = gee_abstract_sorted_set_real_reserved4; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved5 = gee_abstract_sorted_set_real_reserved5; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved6 = gee_abstract_sorted_set_real_reserved6; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved7 = gee_abstract_sorted_set_real_reserved7; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved8 = gee_abstract_sorted_set_real_reserved8; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->reserved9 = gee_abstract_sorted_set_real_reserved9; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->get_read_only_view = gee_abstract_sorted_set_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_sorted_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_sorted_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_abstract_sorted_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_SORTED_SET_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_abstract_sorted_set_gee_sorted_set_get_g_type (GeeAbstractSortedSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_sorted_set_gee_sorted_set_get_g_dup_func (GeeAbstractSortedSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_sorted_set_gee_sorted_set_get_g_destroy_func (GeeAbstractSortedSet* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_sorted_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface) { + gee_abstract_sorted_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gpointer (*)(GeeSortedSet*)) gee_abstract_sorted_set_first; + iface->last = (gpointer (*)(GeeSortedSet*)) gee_abstract_sorted_set_last; + iface->iterator_at = (GeeIterator* (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_iterator_at; + iface->lower = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_lower; + iface->higher = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_higher; + iface->floor = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_floor; + iface->ceil = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_ceil; + iface->head_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_head_set; + iface->tail_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_abstract_sorted_set_tail_set; + iface->sub_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer, gconstpointer)) gee_abstract_sorted_set_sub_set; + iface->get_g_type = (GType(*)(GeeSortedSet*)) gee_abstract_sorted_set_gee_sorted_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeSortedSet*)) gee_abstract_sorted_set_gee_sorted_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeSortedSet*)) gee_abstract_sorted_set_gee_sorted_set_get_g_destroy_func; + iface->get_read_only_view = (GeeSortedSet* (*) (GeeSortedSet *)) gee_abstract_sorted_set_get_read_only_view; +} + + +static void gee_abstract_sorted_set_instance_init (GeeAbstractSortedSet * self) { + self->priv = GEE_ABSTRACT_SORTED_SET_GET_PRIVATE (self); +} + + +static void gee_abstract_sorted_set_finalize (GObject* obj) { + GeeAbstractSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet); + G_OBJECT_CLASS (gee_abstract_sorted_set_parent_class)->finalize (obj); +} + + +/** + * Skeletal implementation of the {@link SortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +GType gee_abstract_sorted_set_get_type (void) { + static volatile gsize gee_abstract_sorted_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_abstract_sorted_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractSortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractSortedSet), 0, (GInstanceInitFunc) gee_abstract_sorted_set_instance_init, NULL }; + static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_abstract_sorted_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_abstract_sorted_set_type_id; + gee_abstract_sorted_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeAbstractSortedSet", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_sorted_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info); + g_once_init_leave (&gee_abstract_sorted_set_type_id__volatile, gee_abstract_sorted_set_type_id); + } + return gee_abstract_sorted_set_type_id__volatile; +} + + +static void _vala_gee_abstract_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeAbstractSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet); + switch (property_id) { + case GEE_ABSTRACT_SORTED_SET_READ_ONLY_VIEW: + g_value_take_object (value, gee_abstract_sorted_set_get_read_only_view (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_abstract_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeAbstractSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet); + switch (property_id) { + case GEE_ABSTRACT_SORTED_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_ABSTRACT_SORTED_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_ABSTRACT_SORTED_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/abstractsortedset.vala b/gee/abstractsortedset.vala new file mode 100644 index 0000000..50daca2 --- /dev/null +++ b/gee/abstractsortedset.vala @@ -0,0 +1,110 @@ +/* abstractsortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Skeletal implementation of the {@link SortedSet} interface. + * + * Contains common code shared by all set implementations. + * + * @see TreeSet + */ +public abstract class Gee.AbstractSortedSet : Gee.AbstractSet, SortedSet { + /** + * {@inheritDoc} + */ + public abstract G first (); + + /** + * {@inheritDoc} + */ + public abstract G last (); + + /** + * {@inheritDoc} + */ + public abstract Iterator? iterator_at (G element); + + /** + * {@inheritDoc} + */ + public abstract G? lower (G element); + + /** + * {@inheritDoc} + */ + public abstract G? higher (G element); + + /** + * {@inheritDoc} + */ + public abstract G? floor (G element); + + /** + * {@inheritDoc} + */ + public abstract G? ceil (G element); + + /** + * {@inheritDoc} + */ + public abstract SortedSet head_set (G before); + + /** + * {@inheritDoc} + */ + public abstract SortedSet tail_set (G after); + + /** + * {@inheritDoc} + */ + public abstract SortedSet sub_set (G from, G to); + + private weak SortedSet _read_only_view; + + /** + * {@inheritDoc} + */ + public virtual new SortedSet read_only_view { + owned get { + SortedSet instance = _read_only_view; + if (_read_only_view == null) { + instance = new ReadOnlySortedSet (this); + _read_only_view = instance; + instance.add_weak_pointer ((void**) (&_read_only_view)); + } + return instance; + } + } + + // Future-proofing + internal new virtual void reserved0() {} + internal new virtual void reserved1() {} + internal new virtual void reserved2() {} + internal new virtual void reserved3() {} + internal new virtual void reserved4() {} + internal new virtual void reserved5() {} + internal new virtual void reserved6() {} + internal new virtual void reserved7() {} + internal new virtual void reserved8() {} + internal new virtual void reserved9() {} +} + diff --git a/gee/arraylist.c b/gee/arraylist.c index 6b5e6c6..e2732c9 100644 --- a/gee/arraylist.c +++ b/gee/arraylist.c @@ -32,13 +32,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -48,6 +60,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -75,14 +95,6 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -102,6 +114,41 @@ typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; + #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) @@ -126,23 +173,55 @@ typedef struct _GeeArrayListIteratorClass GeeArrayListIteratorClass; typedef struct _GeeArrayListIteratorPrivate GeeArrayListIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -154,6 +233,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -168,34 +248,35 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -206,7 +287,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -224,14 +305,70 @@ struct _GeeAbstractListClass { void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); gpointer (*remove_at) (GeeAbstractList* self, gint index); GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); - gpointer (*first) (GeeAbstractList* self); - gpointer (*last) (GeeAbstractList* self); - void (*insert_all) (GeeAbstractList* self, gint index, GeeCollection* collection); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); GeeList* (*get_read_only_view) (GeeAbstractList* self); }; -struct _GeeArrayList { +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + +struct _GeeArrayList { + GeeAbstractBidirList parent_instance; GeeArrayListPrivate * priv; gpointer* _items; gint _items_length1; @@ -240,14 +377,17 @@ struct _GeeArrayList { }; struct _GeeArrayListClass { - GeeAbstractListClass parent_class; + GeeAbstractBidirListClass parent_class; }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeArrayListPrivate { GType g_type; GBoxedCopyFunc g_dup_func; GDestroyNotify g_destroy_func; - GEqualFunc _equal_func; + GeeEqualDataFunc _equal_func; + gpointer _equal_func_target; + GDestroyNotify _equal_func_target_destroy_notify; gint _stamp; }; @@ -273,18 +413,32 @@ struct _GeeArrayListIteratorPrivate { static gpointer gee_array_list_parent_class = NULL; static gpointer gee_array_list_iterator_parent_class = NULL; +static GeeTraversableIface* gee_array_list_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_array_list_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_array_list_iterator_gee_bidir_iterator_parent_iface = NULL; static GeeListIteratorIface* gee_array_list_iterator_gee_list_iterator_parent_iface = NULL; - +static GeeBidirListIteratorIface* gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; GType gee_array_list_get_type (void) G_GNUC_CONST; #define GEE_ARRAY_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ARRAY_LIST, GeeArrayListPrivate)) enum { @@ -293,22 +447,27 @@ enum { GEE_ARRAY_LIST_G_DUP_FUNC, GEE_ARRAY_LIST_G_DESTROY_FUNC, GEE_ARRAY_LIST_SIZE, - GEE_ARRAY_LIST_EQUAL_FUNC + GEE_ARRAY_LIST_READ_ONLY }; -GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_array_list_set_equal_func (GeeArrayList* self, GEqualFunc value); +GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target); +GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func); +static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target); static GeeIterator* gee_array_list_real_iterator (GeeAbstractCollection* base); static GeeArrayListIterator* gee_array_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list); static GeeArrayListIterator* gee_array_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list); static GType gee_array_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base); +static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base); static gboolean gee_array_list_real_contains (GeeAbstractCollection* base, gconstpointer item); gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item); static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer item); -GEqualFunc gee_array_list_get_equal_func (GeeArrayList* self); +GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target); static gpointer gee_array_list_real_get (GeeAbstractList* base, gint index); static void gee_array_list_real_set (GeeAbstractList* base, gint index, gconstpointer item); static gboolean gee_array_list_real_add (GeeAbstractCollection* base, gconstpointer item); @@ -322,25 +481,25 @@ static void gee_array_list_real_clear (GeeAbstractCollection* base); static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gint stop); gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); -static gboolean gee_array_list_real_add_all (GeeAbstractCollection* base, GeeCollection* collection); +gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection); gboolean gee_collection_get_is_empty (GeeCollection* self); gint gee_collection_get_size (GeeCollection* self); -GeeIterator* gee_iterable_iterator (GeeIterable* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -void gee_array_list_sort_with_data (GeeArrayList* self, GCompareDataFunc compare, void* compare_target); -void gee_tim_sort_sort_with_data (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare_data, void* compare_data_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static gboolean __lambda28_ (GeeArrayList* self, gpointer item); +static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self); static void gee_array_list_set_capacity (GeeArrayList* self, gint value); #define GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorPrivate)) enum { GEE_ARRAY_LIST_ITERATOR_DUMMY_PROPERTY, GEE_ARRAY_LIST_ITERATOR_G_TYPE, GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC, - GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC + GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC, + GEE_ARRAY_LIST_ITERATOR_READ_ONLY, + GEE_ARRAY_LIST_ITERATOR_VALID }; static gboolean gee_array_list_iterator_real_next (GeeIterator* base); static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base); -static gboolean gee_array_list_iterator_real_first (GeeIterator* base); +static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); static gpointer gee_array_list_iterator_real_get (GeeIterator* base); static void gee_array_list_iterator_real_remove (GeeIterator* base); @@ -348,14 +507,18 @@ static gboolean gee_array_list_iterator_real_previous (GeeBidirIterator* base); static gboolean gee_array_list_iterator_real_has_previous (GeeBidirIterator* base); static gboolean gee_array_list_iterator_real_last (GeeBidirIterator* base); static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpointer item); -static void gee_array_list_iterator_real_insert (GeeListIterator* base, gconstpointer item); +static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item); void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item); static void gee_array_list_iterator_real_add (GeeListIterator* base, gconstpointer item); static gint gee_array_list_iterator_real_index (GeeListIterator* base); +static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_array_list_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); static void _vala_gee_array_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_array_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_array_list_finalize (GObject* obj); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_array_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_array_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); @@ -371,28 +534,189 @@ static void _vala_array_move (gpointer array, gsize element_size, gint src, gint * * @param equal_func an optional element equality testing function */ -GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func) { +GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + GeeArrayList * self = NULL; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + gpointer* _tmp5_ = NULL; + self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = equal_func; + _tmp0__target = equal_func_target; + if (_tmp0_ == NULL) { + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp3_; + equal_func_target = _tmp1_; + equal_func_target_destroy_notify = _tmp2_; + } + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target); + _tmp5_ = g_new0 (gpointer, 4); + self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL); + self->_items = _tmp5_; + self->_items_length1 = 4; + self->__items_size_ = self->_items_length1; + self->_size = 0; + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + return self; +} + + +GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_array_list_construct (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify); +} + + +/** + * Constructs a new array list based on provided array. + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param items initial items to be put into array + * @param equal_func an optional element equality testing function + */ +static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func) { + gpointer* result; + int i; + result = g_new0 (gpointer, length); + for (i = 0; i < length; i++) { + gpointer _tmp0_; + _tmp0_ = ((self[i] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) self[i]) : ((gpointer) self[i]); + result[i] = _tmp0_; + } + return result; +} + + +GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { GeeArrayList * self = NULL; - GEqualFunc _tmp0_; - GEqualFunc _tmp2_; - self = (GeeArrayList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + gpointer* _tmp5_; + gint _tmp5__length1; + gpointer* _tmp6_; + gint _tmp6__length1; + gpointer* _tmp7_; + gint _tmp7__length1; + self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _tmp0_ = equal_func; + _tmp0__target = equal_func_target; if (_tmp0_ == NULL) { - GEqualFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_equal_func_for (g_type); - equal_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp3_; + equal_func_target = _tmp1_; + equal_func_target_destroy_notify = _tmp2_; } - _tmp2_ = equal_func; - gee_array_list_set_equal_func (self, _tmp2_); + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target); + _tmp5_ = items; + _tmp5__length1 = items_length1; + _tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1, g_dup_func) : ((gpointer) _tmp5_); + _tmp6__length1 = _tmp5__length1; + self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL); + self->_items = _tmp6_; + self->_items_length1 = _tmp6__length1; + self->__items_size_ = self->_items_length1; + _tmp7_ = items; + _tmp7__length1 = items_length1; + self->_size = _tmp7__length1; + items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_destroy_func), NULL); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; return self; } -GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func) { - return gee_array_list_construct (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, equal_func); +GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_array_list_construct_wrap (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, items, items_length1, equal_func, equal_func_target, equal_func_target_destroy_notify); +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) { + GeeArrayList * self; + gboolean result = FALSE; + self = (GeeArrayList*) base; + { + gint i; + i = 0; + { + gboolean _tmp0_; + _tmp0_ = TRUE; + while (TRUE) { + gboolean _tmp1_; + gint _tmp3_; + gint _tmp4_; + GeeForallFunc _tmp5_; + void* _tmp5__target; + gpointer* _tmp6_; + gint _tmp6__length1; + gint _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; + } + _tmp0_ = FALSE; + _tmp3_ = i; + _tmp4_ = self->_size; + if (!(_tmp3_ < _tmp4_)) { + break; + } + _tmp5_ = f; + _tmp5__target = f_target; + _tmp6_ = self->_items; + _tmp6__length1 = self->_items_length1; + _tmp7_ = i; + _tmp8_ = _tmp6_[_tmp7_]; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + _tmp10_ = _tmp5_ (_tmp9_, _tmp5__target); + if (!_tmp10_) { + result = FALSE; + return result; + } + } + } + } + result = TRUE; + return result; } @@ -424,6 +748,20 @@ static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base } +/** + * {@inheritDoc} + */ +static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base) { + GeeArrayList * self; + GeeBidirListIterator* result = NULL; + GeeArrayListIterator* _tmp0_; + self = (GeeArrayList*) base; + _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self); + result = (GeeBidirListIterator*) _tmp0_; + return result; +} + + /** * {@inheritDoc} */ @@ -457,8 +795,10 @@ static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer i gboolean _tmp1_; gint _tmp3_; gint _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; gpointer* _tmp7_; gint _tmp7__length1; gint _tmp8_; @@ -477,14 +817,15 @@ static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer i if (!(_tmp3_ < _tmp4_)) { break; } - _tmp5_ = gee_array_list_get_equal_func (self); + _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target); _tmp6_ = _tmp5_; + _tmp6__target = _tmp5__target; _tmp7_ = self->_items; _tmp7__length1 = self->_items_length1; _tmp8_ = index; _tmp9_ = _tmp7_[_tmp8_]; _tmp10_ = item; - _tmp11_ = _tmp6_ (_tmp9_, _tmp10_); + _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target); if (_tmp11_) { result = index; return result; @@ -660,8 +1001,10 @@ static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstp gboolean _tmp1_; gint _tmp3_; gint _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; gpointer* _tmp7_; gint _tmp7__length1; gint _tmp8_; @@ -680,14 +1023,15 @@ static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstp if (!(_tmp3_ < _tmp4_)) { break; } - _tmp5_ = gee_array_list_get_equal_func (self); + _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target); _tmp6_ = _tmp5_; + _tmp6__target = _tmp5__target; _tmp7_ = self->_items; _tmp7__length1 = self->_items_length1; _tmp8_ = index; _tmp9_ = _tmp7_[_tmp8_]; _tmp10_ = item; - _tmp11_ = _tmp6_ (_tmp9_, _tmp10_); + _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target); if (_tmp11_) { gint _tmp12_; gpointer _tmp13_ = NULL; @@ -814,8 +1158,10 @@ static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gi gint _tmp2_; gint _tmp3_; gint _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; GeeArrayList* _tmp7_; GeeArrayList* slice; self = (GeeArrayList*) base; @@ -827,9 +1173,10 @@ static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gi _tmp3_ = stop; _tmp4_ = self->_size; g_return_val_if_fail (_tmp3_ <= _tmp4_, NULL); - _tmp5_ = gee_array_list_get_equal_func (self); + _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target); _tmp6_ = _tmp5_; - _tmp7_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_); + _tmp6__target = _tmp5__target; + _tmp7_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, _tmp6__target, NULL); slice = _tmp7_; { gint _tmp8_; @@ -876,8 +1223,37 @@ static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gi /** * {@inheritDoc} */ -static gboolean gee_array_list_real_add_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeArrayList * self; +static gboolean __lambda28_ (GeeArrayList* self, gpointer item) { + gboolean result = FALSE; + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_; + gpointer _tmp4_; + _tmp0_ = self->_items; + _tmp0__length1 = self->_items_length1; + _tmp1_ = self->_size; + self->_size = _tmp1_ + 1; + _tmp2_ = item; + _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + ((_tmp0_[_tmp1_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp0_[_tmp1_] = (self->priv->g_destroy_func (_tmp0_[_tmp1_]), NULL)); + _tmp0_[_tmp1_] = _tmp3_; + _tmp4_ = _tmp0_[_tmp1_]; + result = TRUE; + ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); + return result; +} + + +static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda28_ (self, g); + return result; +} + + +gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection) { gboolean result = FALSE; GeeCollection* _tmp0_; gboolean _tmp1_; @@ -885,8 +1261,9 @@ static gboolean gee_array_list_real_add_all (GeeAbstractCollection* base, GeeCol GeeCollection* _tmp3_; gint _tmp4_; gint _tmp5_; - gint _tmp17_; - self = (GeeArrayList*) base; + GeeCollection* _tmp6_; + gint _tmp7_; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); _tmp0_ = collection; _tmp1_ = gee_collection_get_is_empty (_tmp0_); @@ -899,71 +1276,15 @@ static gboolean gee_array_list_real_add_all (GeeAbstractCollection* base, GeeCol _tmp4_ = gee_collection_get_size (_tmp3_); _tmp5_ = _tmp4_; gee_array_list_grow_if_needed (self, _tmp5_); - { - GeeCollection* _tmp6_; - GeeIterator* _tmp7_ = NULL; - GeeIterator* _item_it; - _tmp6_ = collection; - _tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_); - _item_it = _tmp7_; - while (TRUE) { - GeeIterator* _tmp8_; - gboolean _tmp9_ = FALSE; - GeeIterator* _tmp10_; - gpointer _tmp11_ = NULL; - gpointer item; - gpointer* _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gconstpointer _tmp14_; - gpointer _tmp15_; - gpointer _tmp16_; - _tmp8_ = _item_it; - _tmp9_ = gee_iterator_next (_tmp8_); - if (!_tmp9_) { - break; - } - _tmp10_ = _item_it; - _tmp11_ = gee_iterator_get (_tmp10_); - item = _tmp11_; - _tmp12_ = self->_items; - _tmp12__length1 = self->_items_length1; - _tmp13_ = self->_size; - self->_size = _tmp13_ + 1; - _tmp14_ = item; - _tmp15_ = ((_tmp14_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp14_) : ((gpointer) _tmp14_); - ((_tmp12_[_tmp13_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp12_[_tmp13_] = (self->priv->g_destroy_func (_tmp12_[_tmp13_]), NULL)); - _tmp12_[_tmp13_] = _tmp15_; - _tmp16_ = _tmp12_[_tmp13_]; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - _tmp17_ = self->priv->_stamp; - self->priv->_stamp = _tmp17_ + 1; + _tmp6_ = collection; + gee_traversable_foreach ((GeeTraversable*) _tmp6_, ___lambda28__gee_forall_func, self); + _tmp7_ = self->priv->_stamp; + self->priv->_stamp = _tmp7_ + 1; result = TRUE; return result; } -/** - * Sorts items by comparing with the specified compare function. - * - * @deprecated This method has only been added as hack and will be - * deprecated after the next odd minor version bump (>= 0.7.x). - * - * @param compare_func compare function to use to compare items - */ -void gee_array_list_sort_with_data (GeeArrayList* self, GCompareDataFunc compare, void* compare_target) { - GCompareDataFunc _tmp0_; - void* _tmp0__target; - g_return_if_fail (self != NULL); - _tmp0_ = compare; - _tmp0__target = compare_target; - gee_tim_sort_sort_with_data (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeList*) self, _tmp0_, _tmp0__target); -} - - static void gee_array_list_shift (GeeArrayList* self, gint start, gint delta) { gint _tmp0_; gint _tmp1_; @@ -1070,22 +1391,45 @@ static gint gee_array_list_real_get_size (GeeAbstractCollection* base) { } -GEqualFunc gee_array_list_get_equal_func (GeeArrayList* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +static gboolean gee_array_list_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeArrayList* self; + self = (GeeArrayList*) base; + result = FALSE; + return result; +} + + +GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_array_list_set_equal_func (GeeArrayList* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; self->priv->_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "equal-func"); + self->priv->_equal_func_target = _tmp0__target; + self->priv->_equal_func_target_destroy_notify = NULL; } @@ -1173,7 +1517,7 @@ static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base) { } -static gboolean gee_array_list_iterator_real_first (GeeIterator* base) { +static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base) { GeeArrayListIterator * self; gboolean result = FALSE; gint _tmp0_; @@ -1409,7 +1753,7 @@ static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpoint } -static void gee_array_list_iterator_real_insert (GeeListIterator* base, gconstpointer item) { +static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item) { GeeArrayListIterator * self; gint _tmp0_; GeeArrayList* _tmp1_; @@ -1513,6 +1857,124 @@ static gint gee_array_list_iterator_real_index (GeeListIterator* base) { } +static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeArrayListIterator * self; + gboolean result = FALSE; + gint _tmp0_; + GeeArrayList* _tmp1_; + gint _tmp2_; + gboolean _tmp3_ = FALSE; + gint _tmp4_; + gboolean _tmp6_; + GeeArrayList* _tmp19_; + gint _tmp20_; + self = (GeeArrayListIterator*) base; + _tmp0_ = self->priv->_stamp; + _tmp1_ = self->priv->_list; + _tmp2_ = _tmp1_->priv->_stamp; + _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp"); + _tmp4_ = self->priv->_index; + if (_tmp4_ < 0) { + _tmp3_ = TRUE; + } else { + gboolean _tmp5_; + _tmp5_ = self->priv->_removed; + _tmp3_ = _tmp5_; + } + _tmp6_ = _tmp3_; + if (_tmp6_) { + gint _tmp7_; + _tmp7_ = self->priv->_index; + self->priv->_index = _tmp7_ + 1; + } + while (TRUE) { + gint _tmp8_; + GeeArrayList* _tmp9_; + gint _tmp10_; + GeeForallFunc _tmp11_; + void* _tmp11__target; + GeeArrayList* _tmp12_; + gpointer* _tmp13_; + gint _tmp13__length1; + gint _tmp14_; + gconstpointer _tmp15_; + gpointer _tmp16_; + gboolean _tmp17_ = FALSE; + gint _tmp18_; + _tmp8_ = self->priv->_index; + _tmp9_ = self->priv->_list; + _tmp10_ = _tmp9_->_size; + if (!(_tmp8_ < _tmp10_)) { + break; + } + _tmp11_ = f; + _tmp11__target = f_target; + _tmp12_ = self->priv->_list; + _tmp13_ = _tmp12_->_items; + _tmp13__length1 = _tmp12_->_items_length1; + _tmp14_ = self->priv->_index; + _tmp15_ = _tmp13_[_tmp14_]; + _tmp16_ = ((_tmp15_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp15_) : ((gpointer) _tmp15_); + _tmp17_ = _tmp11_ (_tmp16_, _tmp11__target); + if (!_tmp17_) { + result = FALSE; + return result; + } + _tmp18_ = self->priv->_index; + self->priv->_index = _tmp18_ + 1; + } + _tmp19_ = self->priv->_list; + _tmp20_ = _tmp19_->_size; + self->priv->_index = _tmp20_ - 1; + result = TRUE; + return result; +} + + +static gboolean gee_array_list_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeArrayListIterator* self; + self = (GeeArrayListIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_array_list_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeArrayListIterator* self; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gint _tmp2_; + gboolean _tmp6_; + gboolean _tmp8_; + self = (GeeArrayListIterator*) base; + _tmp2_ = self->priv->_index; + if (_tmp2_ >= 0) { + gint _tmp3_; + GeeArrayList* _tmp4_; + gint _tmp5_; + _tmp3_ = self->priv->_index; + _tmp4_ = self->priv->_list; + _tmp5_ = _tmp4_->_size; + _tmp1_ = _tmp3_ < _tmp5_; + } else { + _tmp1_ = FALSE; + } + _tmp6_ = _tmp1_; + if (_tmp6_) { + gboolean _tmp7_; + _tmp7_ = self->priv->_removed; + _tmp0_ = !_tmp7_; + } else { + _tmp0_ = FALSE; + } + _tmp8_ = _tmp0_; + result = _tmp8_; + return result; +} + + static void gee_array_list_iterator_class_init (GeeArrayListIteratorClass * klass) { gee_array_list_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeArrayListIteratorPrivate)); @@ -1522,6 +1984,32 @@ static void gee_array_list_iterator_class_init (GeeArrayListIteratorClass * klas g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_array_list_iterator_gee_traversable_get_g_type (GeeArrayListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_array_list_iterator_gee_traversable_get_g_dup_func (GeeArrayListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_array_list_iterator_gee_traversable_get_g_destroy_func (GeeArrayListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_array_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_array_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_array_list_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_destroy_func; } @@ -1529,29 +2017,72 @@ static void gee_array_list_iterator_gee_iterator_interface_init (GeeIteratorIfac gee_array_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_array_list_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_array_list_iterator_real_remove; + iface->get_read_only = gee_array_list_iterator_real_get_read_only; + iface->get_valid = gee_array_list_iterator_real_get_valid; +} + + +static GType gee_array_list_iterator_gee_bidir_iterator_get_g_type (GeeArrayListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func (GeeArrayListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func (GeeArrayListIterator* self) { + return self->priv->g_destroy_func; } static void gee_array_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { gee_array_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_first; iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_previous; iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_has_previous; iface->last = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func; } static void gee_array_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) { gee_array_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_set; - iface->insert = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_insert; iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_add; iface->index = (gint (*)(GeeListIterator*)) gee_array_list_iterator_real_index; } +static GType gee_array_list_iterator_gee_bidir_list_iterator_get_g_type (GeeArrayListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func (GeeArrayListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func (GeeArrayListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_array_list_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface) { + gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->insert = (void (*)(GeeBidirListIterator*, gconstpointer)) gee_array_list_iterator_real_insert; + iface->get_g_type = (GType(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func; +} + + static void gee_array_list_iterator_instance_init (GeeArrayListIterator * self) { self->priv = GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE (self); self->priv->_index = -1; @@ -1572,14 +2103,18 @@ static GType gee_array_list_iterator_get_type (void) { static volatile gsize gee_array_list_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_array_list_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayListIterator), 0, (GInstanceInitFunc) gee_array_list_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_array_list_iterator_type_id; gee_array_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeArrayListIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info); + g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info); g_once_init_leave (&gee_array_list_iterator_type_id__volatile, gee_array_list_iterator_type_id); } return gee_array_list_iterator_type_id__volatile; @@ -1590,6 +2125,12 @@ static void _vala_gee_array_list_iterator_get_property (GObject * object, guint GeeArrayListIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator); switch (property_id) { + case GEE_ARRAY_LIST_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_ARRAY_LIST_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -1620,8 +2161,10 @@ static void _vala_gee_array_list_iterator_set_property (GObject * object, guint static void gee_array_list_class_init (GeeArrayListClass * klass) { gee_array_list_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeArrayListPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_array_list_real_foreach; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_array_list_real_iterator; GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_array_list_real_list_iterator; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->bidir_list_iterator = gee_array_list_real_bidir_list_iterator; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_array_list_real_contains; GEE_ABSTRACT_LIST_CLASS (klass)->index_of = gee_array_list_real_index_of; GEE_ABSTRACT_LIST_CLASS (klass)->get = gee_array_list_real_get; @@ -1632,8 +2175,8 @@ static void gee_array_list_class_init (GeeArrayListClass * klass) { GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_array_list_real_remove_at; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_array_list_real_clear; GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_array_list_real_slice; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_array_list_real_add_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_array_list_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_array_list_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_list_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_list_set_property; G_OBJECT_CLASS (klass)->finalize = gee_array_list_finalize; @@ -1645,19 +2188,14 @@ static void gee_array_list_class_init (GeeArrayListClass * klass) { */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * The elements' equality testing function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_EQUAL_FUNC, g_param_spec_pointer ("equal-func", "equal-func", "equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } static void gee_array_list_instance_init (GeeArrayList * self) { - gpointer* _tmp0_ = NULL; self->priv = GEE_ARRAY_LIST_GET_PRIVATE (self); - _tmp0_ = g_new0 (gpointer, 4); - self->_items = _tmp0_; - self->_items_length1 = 4; - self->__items_size_ = self->_items_length1; self->priv->_stamp = 0; } @@ -1665,6 +2203,10 @@ static void gee_array_list_instance_init (GeeArrayList * self) { static void gee_array_list_finalize (GObject* obj) { GeeArrayList * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ARRAY_LIST, GeeArrayList); + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); G_OBJECT_CLASS (gee_array_list_parent_class)->finalize (obj); } @@ -1686,7 +2228,7 @@ GType gee_array_list_get_type (void) { if (g_once_init_enter (&gee_array_list_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayList), 0, (GInstanceInitFunc) gee_array_list_instance_init, NULL }; GType gee_array_list_type_id; - gee_array_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_LIST, "GeeArrayList", &g_define_type_info, 0); + gee_array_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_LIST, "GeeArrayList", &g_define_type_info, 0); g_once_init_leave (&gee_array_list_type_id__volatile, gee_array_list_type_id); } return gee_array_list_type_id__volatile; @@ -1700,8 +2242,8 @@ static void _vala_gee_array_list_get_property (GObject * object, guint property_ case GEE_ARRAY_LIST_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; - case GEE_ARRAY_LIST_EQUAL_FUNC: - g_value_set_pointer (value, gee_array_list_get_equal_func (self)); + case GEE_ARRAY_LIST_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -1714,9 +2256,6 @@ static void _vala_gee_array_list_set_property (GObject * object, guint property_ GeeArrayList * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_LIST, GeeArrayList); switch (property_id) { - case GEE_ARRAY_LIST_EQUAL_FUNC: - gee_array_list_set_equal_func (self, g_value_get_pointer (value)); - break; case GEE_ARRAY_LIST_G_TYPE: self->priv->g_type = g_value_get_gtype (value); break; diff --git a/gee/arraylist.vala b/gee/arraylist.vala index 5c369b5..b95ecf7 100644 --- a/gee/arraylist.vala +++ b/gee/arraylist.vala @@ -37,20 +37,28 @@ using GLib; * * @see LinkedList */ -public class Gee.ArrayList : AbstractList { +public class Gee.ArrayList : AbstractBidirList { /** * {@inheritDoc} */ public override int size { get { return _size; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * The elements' equality testing function. */ - public EqualFunc equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc equal_func { private set; get; } - internal G[] _items = new G[4]; + internal G[] _items; internal int _size; // concurrent modification protection @@ -64,11 +72,43 @@ public class Gee.ArrayList : AbstractList { * * @param equal_func an optional element equality testing function */ - public ArrayList (EqualFunc? equal_func = null) { + public ArrayList (owned EqualDataFunc? equal_func = null) { if (equal_func == null) { equal_func = Functions.get_equal_func_for (typeof (G)); } this.equal_func = equal_func; + _items = new G[4]; + _size = 0; + } + + /** + * Constructs a new array list based on provided array. + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param items initial items to be put into array + * @param equal_func an optional element equality testing function + */ + public ArrayList.wrap (owned G[] items, owned EqualDataFunc? equal_func = null) { + if (equal_func == null) { + equal_func = Functions.get_equal_func_for (typeof (G)); + } + this.equal_func = equal_func; + _items = items; + _size = items.length; + } + + /** + * {@inheritDoc} + */ + public override bool foreach(ForallFunc f) { + for (int i = 0; i < _size; i++) { + if (!f (_items[i])) { + return false; + } + } + return true; } /** @@ -85,6 +125,13 @@ public class Gee.ArrayList : AbstractList { return new Iterator (this); } + /** + * {@inheritDoc} + */ + public override BidirListIterator bidir_list_iterator () { + return new Iterator (this); + } + /** * {@inheritDoc} */ @@ -210,31 +257,17 @@ public class Gee.ArrayList : AbstractList { /** * {@inheritDoc} */ - public override bool add_all (Collection collection) { + public bool add_all (Collection collection) { if (collection.is_empty) { return false; } grow_if_needed (collection.size); - foreach (G item in collection) { - _items[_size++] = item; - } + collection.foreach ((item) => {_items[_size++] = item; return true;}); _stamp++; return true; } - /** - * Sorts items by comparing with the specified compare function. - * - * @deprecated This method has only been added as hack and will be - * deprecated after the next odd minor version bump (>= 0.7.x). - * - * @param compare_func compare function to use to compare items - */ - public void sort_with_data (CompareDataFunc compare) { - TimSort.sort_with_data (this, compare); - } - private void shift (int start, int delta) { assert (start >= 0); assert (start <= _size); @@ -261,7 +294,7 @@ public class Gee.ArrayList : AbstractList { _items.resize (value); } - private class Iterator : Object, Gee.Iterator, BidirIterator, ListIterator { + private class Iterator : Object, Traversable, Gee.Iterator, BidirIterator, ListIterator, BidirListIterator { private ArrayList _list; private int _index = -1; private bool _removed = false; @@ -373,6 +406,33 @@ public class Gee.ArrayList : AbstractList { assert (_index < _list._size); return _index; } + + public bool read_only { + get { + return false; + } + } + + public bool valid { + get { + return _index >= 0 && _index < _list._size && ! _removed; + } + } + + public bool foreach (ForallFunc f) { + assert (_stamp == _list._stamp); + if (_index < 0 || _removed) { + _index++; + } + while (_index < _list._size) { + if (!f (_list._items[_index])) { + return false; + } + _index++; + } + _index = _list._size - 1; + return true; + } } } diff --git a/gee/arrayqueue.c b/gee/arrayqueue.c new file mode 100644 index 0000000..1aa0150 --- /dev/null +++ b/gee/arrayqueue.c @@ -0,0 +1,1959 @@ +/* arrayqueue.c generated by valac 0.18.0, the Vala compiler + * generated from arrayqueue.vala, do not modify */ + +/* arrayqueue.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_QUEUE (gee_queue_get_type ()) +#define GEE_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_QUEUE, GeeQueue)) +#define GEE_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_QUEUE)) +#define GEE_QUEUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_QUEUE, GeeQueueIface)) + +typedef struct _GeeQueue GeeQueue; +typedef struct _GeeQueueIface GeeQueueIface; + +#define GEE_TYPE_ABSTRACT_QUEUE (gee_abstract_queue_get_type ()) +#define GEE_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueue)) +#define GEE_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass)) +#define GEE_IS_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_QUEUE)) +#define GEE_IS_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_QUEUE)) +#define GEE_ABSTRACT_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass)) + +typedef struct _GeeAbstractQueue GeeAbstractQueue; +typedef struct _GeeAbstractQueueClass GeeAbstractQueueClass; +typedef struct _GeeAbstractQueuePrivate GeeAbstractQueuePrivate; + +#define GEE_TYPE_DEQUE (gee_deque_get_type ()) +#define GEE_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_DEQUE, GeeDeque)) +#define GEE_IS_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_DEQUE)) +#define GEE_DEQUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_DEQUE, GeeDequeIface)) + +typedef struct _GeeDeque GeeDeque; +typedef struct _GeeDequeIface GeeDequeIface; + +#define GEE_TYPE_ARRAY_QUEUE (gee_array_queue_get_type ()) +#define GEE_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue)) +#define GEE_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) +#define GEE_IS_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_IS_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_ARRAY_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) + +typedef struct _GeeArrayQueue GeeArrayQueue; +typedef struct _GeeArrayQueueClass GeeArrayQueueClass; +typedef struct _GeeArrayQueuePrivate GeeArrayQueuePrivate; + +#define GEE_ARRAY_QUEUE_TYPE_ITERATOR (gee_array_queue_iterator_get_type ()) +#define GEE_ARRAY_QUEUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIterator)) +#define GEE_ARRAY_QUEUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIteratorClass)) +#define GEE_ARRAY_QUEUE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ARRAY_QUEUE_TYPE_ITERATOR)) +#define GEE_ARRAY_QUEUE_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ARRAY_QUEUE_TYPE_ITERATOR)) +#define GEE_ARRAY_QUEUE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIteratorClass)) + +typedef struct _GeeArrayQueueIterator GeeArrayQueueIterator; +typedef struct _GeeArrayQueueIteratorClass GeeArrayQueueIteratorClass; +typedef struct _GeeArrayQueueIteratorPrivate GeeArrayQueueIteratorPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeQueueIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); + gboolean (*offer) (GeeQueue* self, gconstpointer element); + gpointer (*peek) (GeeQueue* self); + gpointer (*poll) (GeeQueue* self); + gint (*drain) (GeeQueue* self, GeeCollection* recipient, gint amount); + gint (*get_capacity) (GeeQueue* self); + gint (*get_remaining_capacity) (GeeQueue* self); + gboolean (*get_is_full) (GeeQueue* self); +}; + +struct _GeeAbstractQueue { + GeeAbstractCollection parent_instance; + GeeAbstractQueuePrivate * priv; +}; + +struct _GeeAbstractQueueClass { + GeeAbstractCollectionClass parent_class; + gpointer (*peek) (GeeAbstractQueue* self); + gpointer (*poll) (GeeAbstractQueue* self); + void (*reserved0) (GeeAbstractQueue* self); + void (*reserved1) (GeeAbstractQueue* self); + void (*reserved2) (GeeAbstractQueue* self); + void (*reserved3) (GeeAbstractQueue* self); + void (*reserved4) (GeeAbstractQueue* self); + void (*reserved5) (GeeAbstractQueue* self); + void (*reserved6) (GeeAbstractQueue* self); + void (*reserved7) (GeeAbstractQueue* self); + void (*reserved8) (GeeAbstractQueue* self); + void (*reserved9) (GeeAbstractQueue* self); + gint (*get_capacity) (GeeAbstractQueue* self); + gint (*get_remaining_capacity) (GeeAbstractQueue* self); + gboolean (*get_is_full) (GeeAbstractQueue* self); +}; + +struct _GeeDequeIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeDeque* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeDeque* self); + GDestroyNotify (*get_g_destroy_func) (GeeDeque* self); + gboolean (*offer_head) (GeeDeque* self, gconstpointer element); + gpointer (*peek_head) (GeeDeque* self); + gpointer (*poll_head) (GeeDeque* self); + gint (*drain_head) (GeeDeque* self, GeeCollection* recipient, gint amount); + gboolean (*offer_tail) (GeeDeque* self, gconstpointer element); + gpointer (*peek_tail) (GeeDeque* self); + gpointer (*poll_tail) (GeeDeque* self); + gint (*drain_tail) (GeeDeque* self, GeeCollection* recipient, gint amount); +}; + +struct _GeeArrayQueue { + GeeAbstractQueue parent_instance; + GeeArrayQueuePrivate * priv; +}; + +struct _GeeArrayQueueClass { + GeeAbstractQueueClass parent_class; +}; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeArrayQueuePrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeEqualDataFunc _equal_func; + gpointer _equal_func_target; + GDestroyNotify _equal_func_target_destroy_notify; + gpointer* _items; + gint _items_length1; + gint __items_size_; + gint _start; + gint _length; + gint _stamp; +}; + +struct _GeeArrayQueueIterator { + GObject parent_instance; + GeeArrayQueueIteratorPrivate * priv; +}; + +struct _GeeArrayQueueIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeArrayQueueIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeArrayQueue* _queue; + gint _stamp; + gint _offset; + gboolean _removed; +}; + + +static gpointer gee_array_queue_parent_class = NULL; +static gpointer gee_array_queue_iterator_parent_class = NULL; +static GeeTraversableIface* gee_array_queue_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_array_queue_iterator_gee_iterator_parent_iface = NULL; +static GeeDequeIface* gee_array_queue_gee_deque_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_queue_get_type (void) G_GNUC_CONST; +GType gee_abstract_queue_get_type (void) G_GNUC_CONST; +GType gee_deque_get_type (void) G_GNUC_CONST; +GType gee_array_queue_get_type (void) G_GNUC_CONST; +#define GEE_ARRAY_QUEUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueuePrivate)) +enum { + GEE_ARRAY_QUEUE_DUMMY_PROPERTY, + GEE_ARRAY_QUEUE_G_TYPE, + GEE_ARRAY_QUEUE_G_DUP_FUNC, + GEE_ARRAY_QUEUE_G_DESTROY_FUNC, + GEE_ARRAY_QUEUE_SIZE, + GEE_ARRAY_QUEUE_IS_EMPTY, + GEE_ARRAY_QUEUE_READ_ONLY, + GEE_ARRAY_QUEUE_CAPACITY, + GEE_ARRAY_QUEUE_REMAINING_CAPACITY, + GEE_ARRAY_QUEUE_IS_FULL +}; +GeeArrayQueue* gee_array_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayQueue* gee_array_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_array_queue_set_equal_func (GeeArrayQueue* self, GeeEqualDataFunc value, gpointer value_target); +static GeeIterator* gee_array_queue_real_iterator (GeeAbstractCollection* base); +static GeeArrayQueueIterator* gee_array_queue_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayQueue* queue); +static GeeArrayQueueIterator* gee_array_queue_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayQueue* queue); +static GType gee_array_queue_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_array_queue_real_add (GeeAbstractCollection* base, gconstpointer element); +gboolean gee_deque_offer_tail (GeeDeque* self, gconstpointer element); +static gboolean gee_array_queue_real_contains (GeeAbstractCollection* base, gconstpointer item); +static gint gee_array_queue_find_index (GeeArrayQueue* self, gconstpointer item); +static gboolean gee_array_queue_real_remove (GeeAbstractCollection* base, gconstpointer item); +static void gee_array_queue_remove_at (GeeArrayQueue* self, gint index); +static void gee_array_queue_real_clear (GeeAbstractCollection* base); +static gpointer gee_array_queue_real_peek (GeeAbstractQueue* base); +gpointer gee_deque_peek_head (GeeDeque* self); +static gpointer gee_array_queue_real_poll (GeeAbstractQueue* base); +gpointer gee_deque_poll_head (GeeDeque* self); +static gboolean gee_array_queue_real_offer_head (GeeDeque* base, gconstpointer element); +static void gee_array_queue_grow_if_needed (GeeArrayQueue* self); +static gpointer gee_array_queue_real_peek_head (GeeDeque* base); +static gpointer gee_array_queue_real_poll_head (GeeDeque* base); +static gint gee_array_queue_real_drain_head (GeeDeque* base, GeeCollection* recipient, gint amount); +gint gee_queue_drain (GeeQueue* self, GeeCollection* recipient, gint amount); +static gboolean gee_array_queue_real_offer_tail (GeeDeque* base, gconstpointer element); +static gpointer gee_array_queue_real_peek_tail (GeeDeque* base); +static gpointer gee_array_queue_real_poll_tail (GeeDeque* base); +static gint gee_array_queue_real_drain_tail (GeeDeque* base, GeeCollection* recipient, gint amount); +gpointer gee_deque_poll_tail (GeeDeque* self); +gboolean gee_collection_add (GeeCollection* self, gconstpointer item); +GeeEqualDataFunc gee_array_queue_get_equal_func (GeeArrayQueue* self, gpointer* result_target); +gboolean gee_array_queue_get_is_empty (GeeArrayQueue* self); +#define GEE_QUEUE_UNBOUNDED_CAPACITY (-1) +#define GEE_ARRAY_QUEUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIteratorPrivate)) +enum { + GEE_ARRAY_QUEUE_ITERATOR_DUMMY_PROPERTY, + GEE_ARRAY_QUEUE_ITERATOR_G_TYPE, + GEE_ARRAY_QUEUE_ITERATOR_G_DUP_FUNC, + GEE_ARRAY_QUEUE_ITERATOR_G_DESTROY_FUNC, + GEE_ARRAY_QUEUE_ITERATOR_VALID, + GEE_ARRAY_QUEUE_ITERATOR_READ_ONLY +}; +static gboolean gee_array_queue_iterator_real_next (GeeIterator* base); +gboolean gee_iterator_has_next (GeeIterator* self); +static gboolean gee_array_queue_iterator_real_has_next (GeeIterator* base); +static gpointer gee_array_queue_iterator_real_get (GeeIterator* base); +static void gee_array_queue_iterator_real_remove (GeeIterator* base); +static gboolean gee_array_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +gboolean gee_iterator_get_valid (GeeIterator* self); +static void gee_array_queue_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +static void _vala_gee_array_queue_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_array_queue_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void gee_array_queue_finalize (GObject* obj); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); +gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self); +gint gee_abstract_queue_get_remaining_capacity (GeeAbstractQueue* self); +gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self); +static void _vala_gee_array_queue_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_array_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length); + + +/** + * Constructs a new, empty array queue. + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param equal_func an optional element equality testing function + */ +GeeArrayQueue* gee_array_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + GeeArrayQueue * self = NULL; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + gpointer* _tmp5_ = NULL; + self = (GeeArrayQueue*) gee_abstract_queue_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = equal_func; + _tmp0__target = equal_func_target; + if (_tmp0_ == NULL) { + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp3_; + equal_func_target = _tmp1_; + equal_func_target_destroy_notify = _tmp2_; + } + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + gee_array_queue_set_equal_func (self, _tmp4_, _tmp4__target); + _tmp5_ = g_new0 (gpointer, 10); + self->priv->_items = (_vala_array_free (self->priv->_items, self->priv->_items_length1, (GDestroyNotify) g_destroy_func), NULL); + self->priv->_items = _tmp5_; + self->priv->_items_length1 = 10; + self->priv->__items_size_ = self->priv->_items_length1; + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + return self; +} + + +GeeArrayQueue* gee_array_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_array_queue_construct (GEE_TYPE_ARRAY_QUEUE, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify); +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_array_queue_real_iterator (GeeAbstractCollection* base) { + GeeArrayQueue * self; + GeeIterator* result = NULL; + GeeArrayQueueIterator* _tmp0_; + self = (GeeArrayQueue*) base; + _tmp0_ = gee_array_queue_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self); + result = (GeeIterator*) _tmp0_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_queue_real_add (GeeAbstractCollection* base, gconstpointer element) { + GeeArrayQueue * self; + gboolean result = FALSE; + gconstpointer _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeArrayQueue*) base; + _tmp0_ = element; + _tmp1_ = gee_deque_offer_tail ((GeeDeque*) self, _tmp0_); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_queue_real_contains (GeeAbstractCollection* base, gconstpointer item) { + GeeArrayQueue * self; + gboolean result = FALSE; + gconstpointer _tmp0_; + gint _tmp1_ = 0; + self = (GeeArrayQueue*) base; + _tmp0_ = item; + _tmp1_ = gee_array_queue_find_index (self, _tmp0_); + result = _tmp1_ != (-1); + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_queue_real_remove (GeeAbstractCollection* base, gconstpointer item) { + GeeArrayQueue * self; + gboolean result = FALSE; + gint _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + gint index; + gint _tmp3_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_stamp; + self->priv->_stamp = _tmp0_ + 1; + _tmp1_ = item; + _tmp2_ = gee_array_queue_find_index (self, _tmp1_); + index = _tmp2_; + _tmp3_ = index; + if (_tmp3_ == (-1)) { + result = FALSE; + return result; + } else { + gint _tmp4_; + _tmp4_ = index; + gee_array_queue_remove_at (self, _tmp4_); + result = TRUE; + return result; + } +} + + +/** + * {@inheritDoc} + */ +static void gee_array_queue_real_clear (GeeAbstractCollection* base) { + GeeArrayQueue * self; + gint _tmp0_; + gint _tmp11_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_stamp; + self->priv->_stamp = _tmp0_ + 1; + { + gint i; + i = 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gint _tmp4_; + gint _tmp5_; + gpointer* _tmp6_; + gint _tmp6__length1; + gint _tmp7_; + gint _tmp8_; + gpointer* _tmp9_; + gint _tmp9__length1; + gpointer _tmp10_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + gint _tmp3_; + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + _tmp5_ = self->priv->_length; + if (!(_tmp4_ < _tmp5_)) { + break; + } + _tmp6_ = self->priv->_items; + _tmp6__length1 = self->priv->_items_length1; + _tmp7_ = self->priv->_start; + _tmp8_ = i; + _tmp9_ = self->priv->_items; + _tmp9__length1 = self->priv->_items_length1; + ((_tmp6_[(_tmp7_ + _tmp8_) % _tmp9__length1] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp6_[(_tmp7_ + _tmp8_) % _tmp9__length1] = (self->priv->g_destroy_func (_tmp6_[(_tmp7_ + _tmp8_) % _tmp9__length1]), NULL)); + _tmp6_[(_tmp7_ + _tmp8_) % _tmp9__length1] = NULL; + _tmp10_ = _tmp6_[(_tmp7_ + _tmp8_) % _tmp9__length1]; + } + } + } + self->priv->_length = 0; + _tmp11_ = self->priv->_length; + self->priv->_start = _tmp11_; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_peek (GeeAbstractQueue* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gpointer _tmp0_ = NULL; + self = (GeeArrayQueue*) base; + _tmp0_ = gee_deque_peek_head ((GeeDeque*) self); + result = _tmp0_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_poll (GeeAbstractQueue* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gpointer _tmp0_ = NULL; + self = (GeeArrayQueue*) base; + _tmp0_ = gee_deque_poll_head ((GeeDeque*) self); + result = _tmp0_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_queue_real_offer_head (GeeDeque* base, gconstpointer element) { + GeeArrayQueue * self; + gboolean result = FALSE; + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + gpointer* _tmp2_; + gint _tmp2__length1; + gint _tmp3_; + gpointer* _tmp4_; + gint _tmp4__length1; + gint _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; + gpointer _tmp8_; + gint _tmp9_; + self = (GeeArrayQueue*) base; + gee_array_queue_grow_if_needed (self); + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_start; + _tmp2_ = self->priv->_items; + _tmp2__length1 = self->priv->_items_length1; + self->priv->_start = ((_tmp0__length1 + _tmp1_) - 1) % _tmp2__length1; + _tmp3_ = self->priv->_length; + self->priv->_length = _tmp3_ + 1; + _tmp4_ = self->priv->_items; + _tmp4__length1 = self->priv->_items_length1; + _tmp5_ = self->priv->_start; + _tmp6_ = element; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + ((_tmp4_[_tmp5_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp4_[_tmp5_] = (self->priv->g_destroy_func (_tmp4_[_tmp5_]), NULL)); + _tmp4_[_tmp5_] = _tmp7_; + _tmp8_ = _tmp4_[_tmp5_]; + _tmp9_ = self->priv->_stamp; + self->priv->_stamp = _tmp9_ + 1; + result = TRUE; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_peek_head (GeeDeque* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_start; + _tmp2_ = _tmp0_[_tmp1_]; + _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + result = _tmp3_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_poll_head (GeeDeque* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gint _tmp0_; + gint _tmp1_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_stamp; + self->priv->_stamp = _tmp0_ + 1; + _tmp1_ = self->priv->_length; + if (_tmp1_ == 0) { + self->priv->_start = 0; + result = NULL; + return result; + } else { + gint _tmp2_; + gpointer* _tmp3_; + gint _tmp3__length1; + gint _tmp4_; + gpointer _tmp5_; + gpointer _result_; + gint _tmp6_; + gpointer* _tmp7_; + gint _tmp7__length1; + gpointer _tmp8_; + _tmp2_ = self->priv->_length; + self->priv->_length = _tmp2_ - 1; + _tmp3_ = self->priv->_items; + _tmp3__length1 = self->priv->_items_length1; + _tmp4_ = self->priv->_start; + _tmp5_ = _tmp3_[_tmp4_]; + _tmp3_[_tmp4_] = NULL; + _result_ = _tmp5_; + _tmp6_ = self->priv->_start; + _tmp7_ = self->priv->_items; + _tmp7__length1 = self->priv->_items_length1; + self->priv->_start = (_tmp6_ + 1) % _tmp7__length1; + _tmp8_ = _result_; + _result_ = NULL; + result = _tmp8_; + ((_result_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_result_ = (self->priv->g_destroy_func (_result_), NULL)); + return result; + } +} + + +/** + * {@inheritDoc} + */ +static gint gee_array_queue_real_drain_head (GeeDeque* base, GeeCollection* recipient, gint amount) { + GeeArrayQueue * self; + gint result = 0; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_ = 0; + self = (GeeArrayQueue*) base; + g_return_val_if_fail (recipient != NULL, 0); + _tmp0_ = recipient; + _tmp1_ = amount; + _tmp2_ = gee_queue_drain ((GeeQueue*) self, _tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_array_queue_real_offer_tail (GeeDeque* base, gconstpointer element) { + GeeArrayQueue * self; + gboolean result = FALSE; + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + gint _tmp2_; + gpointer* _tmp3_; + gint _tmp3__length1; + gconstpointer _tmp4_; + gpointer _tmp5_; + gpointer _tmp6_; + gint _tmp7_; + self = (GeeArrayQueue*) base; + gee_array_queue_grow_if_needed (self); + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_start; + _tmp2_ = self->priv->_length; + self->priv->_length = _tmp2_ + 1; + _tmp3_ = self->priv->_items; + _tmp3__length1 = self->priv->_items_length1; + _tmp4_ = element; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + ((_tmp0_[(_tmp1_ + _tmp2_) % _tmp3__length1] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp0_[(_tmp1_ + _tmp2_) % _tmp3__length1] = (self->priv->g_destroy_func (_tmp0_[(_tmp1_ + _tmp2_) % _tmp3__length1]), NULL)); + _tmp0_[(_tmp1_ + _tmp2_) % _tmp3__length1] = _tmp5_; + _tmp6_ = _tmp0_[(_tmp1_ + _tmp2_) % _tmp3__length1]; + _tmp7_ = self->priv->_stamp; + self->priv->_stamp = _tmp7_ + 1; + result = TRUE; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_peek_tail (GeeDeque* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gpointer* _tmp0_; + gint _tmp0__length1; + gpointer* _tmp1_; + gint _tmp1__length1; + gint _tmp2_; + gint _tmp3_; + gpointer* _tmp4_; + gint _tmp4__length1; + gconstpointer _tmp5_; + gpointer _tmp6_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_items; + _tmp1__length1 = self->priv->_items_length1; + _tmp2_ = self->priv->_start; + _tmp3_ = self->priv->_length; + _tmp4_ = self->priv->_items; + _tmp4__length1 = self->priv->_items_length1; + _tmp5_ = _tmp0_[(((_tmp1__length1 + _tmp2_) + _tmp3_) - 1) % _tmp4__length1]; + _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + result = _tmp6_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_array_queue_real_poll_tail (GeeDeque* base) { + GeeArrayQueue * self; + gpointer result = NULL; + gint _tmp0_; + gint _tmp1_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_stamp; + self->priv->_stamp = _tmp0_ + 1; + _tmp1_ = self->priv->_length; + if (_tmp1_ == 0) { + self->priv->_start = 0; + result = NULL; + return result; + } else { + gpointer* _tmp2_; + gint _tmp2__length1; + gpointer* _tmp3_; + gint _tmp3__length1; + gint _tmp4_; + gint _tmp5_; + gint _tmp6_; + gpointer* _tmp7_; + gint _tmp7__length1; + gpointer _tmp8_; + _tmp2_ = self->priv->_items; + _tmp2__length1 = self->priv->_items_length1; + _tmp3_ = self->priv->_items; + _tmp3__length1 = self->priv->_items_length1; + _tmp4_ = self->priv->_start; + _tmp5_ = self->priv->_length; + self->priv->_length = _tmp5_ - 1; + _tmp6_ = self->priv->_length; + _tmp7_ = self->priv->_items; + _tmp7__length1 = self->priv->_items_length1; + _tmp8_ = _tmp2_[((_tmp3__length1 + _tmp4_) + _tmp6_) % _tmp7__length1]; + _tmp2_[((_tmp3__length1 + _tmp4_) + _tmp6_) % _tmp7__length1] = NULL; + result = _tmp8_; + return result; + } +} + + +/** + * {@inheritDoc} + */ +static gint gee_array_queue_real_drain_tail (GeeDeque* base, GeeCollection* recipient, gint amount) { + GeeArrayQueue * self; + gint result = 0; + gpointer item; + gint drained; + self = (GeeArrayQueue*) base; + g_return_val_if_fail (recipient != NULL, 0); + item = NULL; + drained = 0; + while (TRUE) { + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gint _tmp2_; + gboolean _tmp5_; + gboolean _tmp8_; + GeeCollection* _tmp9_; + gconstpointer _tmp10_; + gint _tmp11_; + _tmp2_ = amount; + if (_tmp2_ == (-1)) { + _tmp1_ = TRUE; + } else { + gint _tmp3_; + gint _tmp4_; + _tmp3_ = amount; + amount = _tmp3_ - 1; + _tmp4_ = amount; + _tmp1_ = _tmp4_ >= 0; + } + _tmp5_ = _tmp1_; + if (_tmp5_) { + gpointer _tmp6_ = NULL; + gconstpointer _tmp7_; + _tmp6_ = gee_deque_poll_tail ((GeeDeque*) self); + ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); + item = _tmp6_; + _tmp7_ = item; + _tmp0_ = _tmp7_ != NULL; + } else { + _tmp0_ = FALSE; + } + _tmp8_ = _tmp0_; + if (!_tmp8_) { + break; + } + _tmp9_ = recipient; + _tmp10_ = item; + gee_collection_add (_tmp9_, _tmp10_); + _tmp11_ = drained; + drained = _tmp11_ + 1; + } + result = drained; + ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); + return result; +} + + +/** + * {@inheritDoc} + */ +static void gee_array_queue_grow_if_needed (GeeArrayQueue* self) { + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_length; + if (_tmp0__length1 < (_tmp1_ + 1)) { + gpointer* _tmp2_; + gint _tmp2__length1; + gint _tmp3_ = 0; + _tmp2_ = self->priv->_items; + _tmp2__length1 = self->priv->_items_length1; + _tmp3_ = 2 * _tmp2__length1; + self->priv->_items = g_renew (gpointer, self->priv->_items, 2 * _tmp2__length1); + (_tmp3_ > self->priv->_items_length1) ? memset (self->priv->_items + self->priv->_items_length1, 0, sizeof (gpointer) * (_tmp3_ - self->priv->_items_length1)) : NULL; + self->priv->_items_length1 = _tmp3_; + self->priv->__items_size_ = _tmp3_; + { + gint i; + i = 0; + { + gboolean _tmp4_; + _tmp4_ = TRUE; + while (TRUE) { + gboolean _tmp5_; + gint _tmp7_; + gint _tmp8_; + gpointer* _tmp9_; + gint _tmp9__length1; + gint _tmp10_; + gint _tmp11_; + gpointer* _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + gpointer _tmp14_; + gpointer _tmp15_; + _tmp5_ = _tmp4_; + if (!_tmp5_) { + gint _tmp6_; + _tmp6_ = i; + i = _tmp6_ + 1; + } + _tmp4_ = FALSE; + _tmp7_ = i; + _tmp8_ = self->priv->_start; + if (!(_tmp7_ < _tmp8_)) { + break; + } + _tmp9_ = self->priv->_items; + _tmp9__length1 = self->priv->_items_length1; + _tmp10_ = self->priv->_length; + _tmp11_ = i; + _tmp12_ = self->priv->_items; + _tmp12__length1 = self->priv->_items_length1; + _tmp13_ = i; + _tmp14_ = _tmp12_[_tmp13_]; + _tmp12_[_tmp13_] = NULL; + ((_tmp9_[_tmp10_ + _tmp11_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp9_[_tmp10_ + _tmp11_] = (self->priv->g_destroy_func (_tmp9_[_tmp10_ + _tmp11_]), NULL)); + _tmp9_[_tmp10_ + _tmp11_] = _tmp14_; + _tmp15_ = _tmp9_[_tmp10_ + _tmp11_]; + } + } + } + } +} + + +static gint gee_array_queue_find_index (GeeArrayQueue* self, gconstpointer item) { + gint result = 0; + g_return_val_if_fail (self != NULL, 0); + { + gint _tmp0_; + gint i; + _tmp0_ = self->priv->_start; + i = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gint _tmp4_; + gpointer* _tmp5_; + gint _tmp5__length1; + gint _tmp6_; + gint _tmp7_; + gint _tmp8_ = 0; + GeeEqualDataFunc _tmp9_; + void* _tmp9__target; + GeeEqualDataFunc _tmp10_; + void* _tmp10__target; + gconstpointer _tmp11_; + gpointer* _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + gint _tmp3_; + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + _tmp5_ = self->priv->_items; + _tmp5__length1 = self->priv->_items_length1; + _tmp6_ = self->priv->_start; + _tmp7_ = self->priv->_length; + _tmp8_ = MIN (_tmp5__length1, _tmp6_ + _tmp7_); + if (!(_tmp4_ < _tmp8_)) { + break; + } + _tmp9_ = gee_array_queue_get_equal_func (self, &_tmp9__target); + _tmp10_ = _tmp9_; + _tmp10__target = _tmp9__target; + _tmp11_ = item; + _tmp12_ = self->priv->_items; + _tmp12__length1 = self->priv->_items_length1; + _tmp13_ = i; + _tmp14_ = _tmp12_[_tmp13_]; + _tmp15_ = _tmp10_ (_tmp11_, _tmp14_, _tmp10__target); + if (_tmp15_) { + result = i; + return result; + } + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp16_; + _tmp16_ = TRUE; + while (TRUE) { + gboolean _tmp17_; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gpointer* _tmp22_; + gint _tmp22__length1; + GeeEqualDataFunc _tmp23_; + void* _tmp23__target; + GeeEqualDataFunc _tmp24_; + void* _tmp24__target; + gconstpointer _tmp25_; + gpointer* _tmp26_; + gint _tmp26__length1; + gint _tmp27_; + gconstpointer _tmp28_; + gboolean _tmp29_ = FALSE; + _tmp17_ = _tmp16_; + if (!_tmp17_) { + gint _tmp18_; + _tmp18_ = i; + i = _tmp18_ + 1; + } + _tmp16_ = FALSE; + _tmp19_ = i; + _tmp20_ = self->priv->_start; + _tmp21_ = self->priv->_length; + _tmp22_ = self->priv->_items; + _tmp22__length1 = self->priv->_items_length1; + if (!(_tmp19_ < ((_tmp20_ + _tmp21_) - _tmp22__length1))) { + break; + } + _tmp23_ = gee_array_queue_get_equal_func (self, &_tmp23__target); + _tmp24_ = _tmp23_; + _tmp24__target = _tmp23__target; + _tmp25_ = item; + _tmp26_ = self->priv->_items; + _tmp26__length1 = self->priv->_items_length1; + _tmp27_ = i; + _tmp28_ = _tmp26_[_tmp27_]; + _tmp29_ = _tmp24_ (_tmp25_, _tmp28_, _tmp24__target); + if (_tmp29_) { + result = i; + return result; + } + } + } + } + result = -1; + return result; +} + + +static void gee_array_queue_remove_at (GeeArrayQueue* self, gint index) { + gpointer* _tmp0_; + gint _tmp0__length1; + gint _tmp1_; + gint _tmp2_; + gpointer* _tmp3_; + gint _tmp3__length1; + gint end; + gint _tmp4_; + gint _tmp5_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->_items; + _tmp0__length1 = self->priv->_items_length1; + _tmp1_ = self->priv->_start; + _tmp2_ = self->priv->_length; + _tmp3_ = self->priv->_items; + _tmp3__length1 = self->priv->_items_length1; + end = ((((_tmp0__length1 + _tmp1_) + _tmp2_) - 1) % _tmp3__length1) + 1; + _tmp4_ = index; + _tmp5_ = self->priv->_start; + if (_tmp4_ == _tmp5_) { + gpointer* _tmp6_; + gint _tmp6__length1; + gint _tmp7_; + gpointer _tmp8_; + gint _tmp9_; + _tmp6_ = self->priv->_items; + _tmp6__length1 = self->priv->_items_length1; + _tmp7_ = self->priv->_start; + self->priv->_start = _tmp7_ + 1; + ((_tmp6_[_tmp7_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp6_[_tmp7_] = (self->priv->g_destroy_func (_tmp6_[_tmp7_]), NULL)); + _tmp6_[_tmp7_] = NULL; + _tmp8_ = _tmp6_[_tmp7_]; + _tmp9_ = self->priv->_length; + self->priv->_length = _tmp9_ - 1; + return; + } else { + gboolean _tmp10_ = FALSE; + gint _tmp11_; + gint _tmp12_; + gboolean _tmp15_; + _tmp11_ = index; + _tmp12_ = self->priv->_start; + if (_tmp11_ > _tmp12_) { + gint _tmp13_; + gint _tmp14_; + _tmp13_ = end; + _tmp14_ = self->priv->_start; + _tmp10_ = _tmp13_ <= _tmp14_; + } else { + _tmp10_ = FALSE; + } + _tmp15_ = _tmp10_; + if (_tmp15_) { + gpointer* _tmp16_; + gint _tmp16__length1; + gint _tmp17_; + gpointer _tmp18_; + gint _tmp19_; + gint _tmp20_; + gpointer* _tmp21_; + gint _tmp21__length1; + gpointer* _tmp22_; + gint _tmp22__length1; + gpointer* _tmp23_; + gint _tmp23__length1; + gpointer* _tmp24_; + gint _tmp24__length1; + gpointer _tmp25_; + gpointer _tmp26_; + gint _tmp27_; + gint _tmp28_; + _tmp16_ = self->priv->_items; + _tmp16__length1 = self->priv->_items_length1; + _tmp17_ = index; + ((_tmp16_[_tmp17_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp16_[_tmp17_] = (self->priv->g_destroy_func (_tmp16_[_tmp17_]), NULL)); + _tmp16_[_tmp17_] = NULL; + _tmp18_ = _tmp16_[_tmp17_]; + _tmp19_ = index; + _tmp20_ = index; + _tmp21_ = self->priv->_items; + _tmp21__length1 = self->priv->_items_length1; + _vala_array_move (self->priv->_items, sizeof (gpointer), _tmp19_ + 1, _tmp20_, _tmp21__length1 - 1); + _tmp22_ = self->priv->_items; + _tmp22__length1 = self->priv->_items_length1; + _tmp23_ = self->priv->_items; + _tmp23__length1 = self->priv->_items_length1; + _tmp24_ = self->priv->_items; + _tmp24__length1 = self->priv->_items_length1; + _tmp25_ = _tmp24_[0]; + _tmp24_[0] = NULL; + ((_tmp22_[_tmp23__length1 - 1] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp22_[_tmp23__length1 - 1] = (self->priv->g_destroy_func (_tmp22_[_tmp23__length1 - 1]), NULL)); + _tmp22_[_tmp23__length1 - 1] = _tmp25_; + _tmp26_ = _tmp22_[_tmp23__length1 - 1]; + _tmp27_ = end; + _vala_array_move (self->priv->_items, sizeof (gpointer), 1, 0, _tmp27_ - 1); + _tmp28_ = self->priv->_length; + self->priv->_length = _tmp28_ - 1; + } else { + gpointer* _tmp29_; + gint _tmp29__length1; + gint _tmp30_; + gpointer _tmp31_; + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; + gint _tmp35_; + gint _tmp36_; + _tmp29_ = self->priv->_items; + _tmp29__length1 = self->priv->_items_length1; + _tmp30_ = index; + ((_tmp29_[_tmp30_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp29_[_tmp30_] = (self->priv->g_destroy_func (_tmp29_[_tmp30_]), NULL)); + _tmp29_[_tmp30_] = NULL; + _tmp31_ = _tmp29_[_tmp30_]; + _tmp32_ = index; + _tmp33_ = index; + _tmp34_ = end; + _tmp35_ = index; + _vala_array_move (self->priv->_items, sizeof (gpointer), _tmp32_ + 1, _tmp33_, _tmp34_ - (_tmp35_ + 1)); + _tmp36_ = self->priv->_length; + self->priv->_length = _tmp36_ - 1; + } + } +} + + +GeeEqualDataFunc gee_array_queue_get_equal_func (GeeArrayQueue* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_equal_func; + _tmp0__target = self->priv->_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; + return result; +} + + +static void gee_array_queue_set_equal_func (GeeArrayQueue* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; + self->priv->_equal_func = _tmp0_; + self->priv->_equal_func_target = _tmp0__target; + self->priv->_equal_func_target_destroy_notify = NULL; +} + + +static gint gee_array_queue_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeArrayQueue* self; + gint _tmp0_; + self = (GeeArrayQueue*) base; + _tmp0_ = self->priv->_length; + result = _tmp0_; + return result; +} + + +gboolean gee_array_queue_get_is_empty (GeeArrayQueue* self) { + gboolean result; + gint _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->_length; + result = _tmp0_ == 0; + return result; +} + + +static gboolean gee_array_queue_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeArrayQueue* self; + self = (GeeArrayQueue*) base; + result = FALSE; + return result; +} + + +static gint gee_array_queue_real_get_capacity (GeeAbstractQueue* base) { + gint result; + GeeArrayQueue* self; + self = (GeeArrayQueue*) base; + result = GEE_QUEUE_UNBOUNDED_CAPACITY; + return result; +} + + +static gint gee_array_queue_real_get_remaining_capacity (GeeAbstractQueue* base) { + gint result; + GeeArrayQueue* self; + self = (GeeArrayQueue*) base; + result = GEE_QUEUE_UNBOUNDED_CAPACITY; + return result; +} + + +static gboolean gee_array_queue_real_get_is_full (GeeAbstractQueue* base) { + gboolean result; + GeeArrayQueue* self; + self = (GeeArrayQueue*) base; + result = FALSE; + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeArrayQueueIterator* gee_array_queue_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayQueue* queue) { + GeeArrayQueueIterator * self = NULL; + GeeArrayQueue* _tmp0_; + GeeArrayQueue* _tmp1_; + GeeArrayQueue* _tmp2_; + gint _tmp3_; + g_return_val_if_fail (queue != NULL, NULL); + self = (GeeArrayQueueIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = queue; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_queue); + self->priv->_queue = _tmp1_; + _tmp2_ = self->priv->_queue; + _tmp3_ = _tmp2_->priv->_stamp; + self->priv->_stamp = _tmp3_; + return self; +} + + +static GeeArrayQueueIterator* gee_array_queue_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayQueue* queue) { + return gee_array_queue_iterator_construct (GEE_ARRAY_QUEUE_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, queue); +} + + +static gboolean gee_array_queue_iterator_real_next (GeeIterator* base) { + GeeArrayQueueIterator * self; + gboolean result = FALSE; + GeeArrayQueue* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gboolean _tmp3_ = FALSE; + self = (GeeArrayQueueIterator*) base; + _tmp0_ = self->priv->_queue; + _tmp1_ = _tmp0_->priv->_stamp; + _tmp2_ = self->priv->_stamp; + _vala_assert (_tmp1_ == _tmp2_, "_queue._stamp == _stamp"); + _tmp3_ = gee_iterator_has_next ((GeeIterator*) self); + if (_tmp3_) { + gint _tmp4_; + _tmp4_ = self->priv->_offset; + self->priv->_offset = _tmp4_ + 1; + self->priv->_removed = FALSE; + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } +} + + +static gboolean gee_array_queue_iterator_real_has_next (GeeIterator* base) { + GeeArrayQueueIterator * self; + gboolean result = FALSE; + GeeArrayQueue* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + GeeArrayQueue* _tmp4_; + gint _tmp5_; + self = (GeeArrayQueueIterator*) base; + _tmp0_ = self->priv->_queue; + _tmp1_ = _tmp0_->priv->_stamp; + _tmp2_ = self->priv->_stamp; + _vala_assert (_tmp1_ == _tmp2_, "_queue._stamp == _stamp"); + _tmp3_ = self->priv->_offset; + _tmp4_ = self->priv->_queue; + _tmp5_ = _tmp4_->priv->_length; + result = (_tmp3_ + 1) < _tmp5_; + return result; +} + + +static gpointer gee_array_queue_iterator_real_get (GeeIterator* base) { + GeeArrayQueueIterator * self; + gpointer result = NULL; + GeeArrayQueue* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + gboolean _tmp4_; + GeeArrayQueue* _tmp5_; + gpointer* _tmp6_; + gint _tmp6__length1; + GeeArrayQueue* _tmp7_; + gint _tmp8_; + gint _tmp9_; + GeeArrayQueue* _tmp10_; + gpointer* _tmp11_; + gint _tmp11__length1; + gconstpointer _tmp12_; + gpointer _tmp13_; + self = (GeeArrayQueueIterator*) base; + _tmp0_ = self->priv->_queue; + _tmp1_ = _tmp0_->priv->_stamp; + _tmp2_ = self->priv->_stamp; + _vala_assert (_tmp1_ == _tmp2_, "_queue._stamp == _stamp"); + _tmp3_ = self->priv->_offset; + _vala_assert (_tmp3_ != (-1), "_offset != -1"); + _tmp4_ = self->priv->_removed; + _vala_assert (!_tmp4_, "!_removed"); + _tmp5_ = self->priv->_queue; + _tmp6_ = _tmp5_->priv->_items; + _tmp6__length1 = _tmp5_->priv->_items_length1; + _tmp7_ = self->priv->_queue; + _tmp8_ = _tmp7_->priv->_start; + _tmp9_ = self->priv->_offset; + _tmp10_ = self->priv->_queue; + _tmp11_ = _tmp10_->priv->_items; + _tmp11__length1 = _tmp10_->priv->_items_length1; + _tmp12_ = _tmp6_[(_tmp8_ + _tmp9_) % _tmp11__length1]; + _tmp13_ = ((_tmp12_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp12_) : ((gpointer) _tmp12_); + result = _tmp13_; + return result; +} + + +static void gee_array_queue_iterator_real_remove (GeeIterator* base) { + GeeArrayQueueIterator * self; + GeeArrayQueue* _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeArrayQueue* _tmp3_; + GeeArrayQueue* _tmp4_; + gint _tmp5_; + gint _tmp6_; + GeeArrayQueue* _tmp7_; + gpointer* _tmp8_; + gint _tmp8__length1; + gint _tmp9_; + self = (GeeArrayQueueIterator*) base; + _tmp0_ = self->priv->_queue; + _tmp1_ = _tmp0_->priv->_stamp; + _tmp0_->priv->_stamp = _tmp1_ + 1; + _tmp2_ = self->priv->_stamp; + self->priv->_stamp = _tmp2_ + 1; + _vala_assert (_tmp1_ == _tmp2_, "_queue._stamp++ == _stamp++"); + _tmp3_ = self->priv->_queue; + _tmp4_ = self->priv->_queue; + _tmp5_ = _tmp4_->priv->_start; + _tmp6_ = self->priv->_offset; + _tmp7_ = self->priv->_queue; + _tmp8_ = _tmp7_->priv->_items; + _tmp8__length1 = _tmp7_->priv->_items_length1; + gee_array_queue_remove_at (_tmp3_, (_tmp5_ + _tmp6_) % _tmp8__length1); + _tmp9_ = self->priv->_offset; + self->priv->_offset = _tmp9_ - 1; + self->priv->_removed = TRUE; +} + + +static gboolean gee_array_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeArrayQueueIterator * self; + gboolean result = FALSE; + GeeArrayQueue* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + self = (GeeArrayQueueIterator*) base; + _tmp0_ = self->priv->_queue; + _tmp1_ = _tmp0_->priv->_stamp; + _tmp2_ = self->priv->_stamp; + _vala_assert (_tmp1_ == _tmp2_, "_queue._stamp == _stamp"); + _tmp3_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = self->priv->_offset; + self->priv->_offset = _tmp5_ + 1; + self->priv->_removed = FALSE; + } + { + gint _tmp6_; + gint i; + _tmp6_ = self->priv->_offset; + i = _tmp6_; + { + gboolean _tmp7_; + _tmp7_ = TRUE; + while (TRUE) { + gboolean _tmp8_; + gint _tmp10_; + GeeArrayQueue* _tmp11_; + gint _tmp12_; + GeeForallFunc _tmp13_; + void* _tmp13__target; + GeeArrayQueue* _tmp14_; + gpointer* _tmp15_; + gint _tmp15__length1; + GeeArrayQueue* _tmp16_; + gint _tmp17_; + gint _tmp18_; + GeeArrayQueue* _tmp19_; + gpointer* _tmp20_; + gint _tmp20__length1; + gconstpointer _tmp21_; + gpointer _tmp22_; + gboolean _tmp23_ = FALSE; + _tmp8_ = _tmp7_; + if (!_tmp8_) { + gint _tmp9_; + _tmp9_ = i; + i = _tmp9_ + 1; + } + _tmp7_ = FALSE; + _tmp10_ = i; + _tmp11_ = self->priv->_queue; + _tmp12_ = _tmp11_->priv->_length; + if (!(_tmp10_ < _tmp12_)) { + break; + } + _tmp13_ = f; + _tmp13__target = f_target; + _tmp14_ = self->priv->_queue; + _tmp15_ = _tmp14_->priv->_items; + _tmp15__length1 = _tmp14_->priv->_items_length1; + _tmp16_ = self->priv->_queue; + _tmp17_ = _tmp16_->priv->_start; + _tmp18_ = i; + _tmp19_ = self->priv->_queue; + _tmp20_ = _tmp19_->priv->_items; + _tmp20__length1 = _tmp19_->priv->_items_length1; + _tmp21_ = _tmp15_[(_tmp17_ + _tmp18_) % _tmp20__length1]; + _tmp22_ = ((_tmp21_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp21_) : ((gpointer) _tmp21_); + _tmp23_ = _tmp13_ (_tmp22_, _tmp13__target); + if (!_tmp23_) { + gint _tmp24_; + _tmp24_ = i; + self->priv->_offset = _tmp24_; + result = FALSE; + return result; + } + } + } + } + result = TRUE; + return result; +} + + +static gboolean gee_array_queue_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeArrayQueueIterator* self; + gboolean _tmp0_ = FALSE; + gint _tmp1_; + gboolean _tmp3_; + self = (GeeArrayQueueIterator*) base; + _tmp1_ = self->priv->_offset; + if (_tmp1_ != (-1)) { + gboolean _tmp2_; + _tmp2_ = self->priv->_removed; + _tmp0_ = !_tmp2_; + } else { + _tmp0_ = FALSE; + } + _tmp3_ = _tmp0_; + result = _tmp3_; + return result; +} + + +static gboolean gee_array_queue_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeArrayQueueIterator* self; + self = (GeeArrayQueueIterator*) base; + result = FALSE; + return result; +} + + +static void gee_array_queue_iterator_class_init (GeeArrayQueueIteratorClass * klass) { + gee_array_queue_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeArrayQueueIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_queue_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_queue_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_array_queue_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_array_queue_iterator_gee_traversable_get_g_type (GeeArrayQueueIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_array_queue_iterator_gee_traversable_get_g_dup_func (GeeArrayQueueIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_array_queue_iterator_gee_traversable_get_g_destroy_func (GeeArrayQueueIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_array_queue_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_array_queue_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_array_queue_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_array_queue_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_array_queue_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_array_queue_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_array_queue_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_array_queue_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->next = (gboolean (*)(GeeIterator*)) gee_array_queue_iterator_real_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_array_queue_iterator_real_has_next; + iface->get = (gpointer (*)(GeeIterator*)) gee_array_queue_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_array_queue_iterator_real_remove; + iface->get_valid = gee_array_queue_iterator_real_get_valid; + iface->get_read_only = gee_array_queue_iterator_real_get_read_only; +} + + +static void gee_array_queue_iterator_instance_init (GeeArrayQueueIterator * self) { + self->priv = GEE_ARRAY_QUEUE_ITERATOR_GET_PRIVATE (self); + self->priv->_offset = -1; + self->priv->_removed = FALSE; +} + + +static void gee_array_queue_iterator_finalize (GObject* obj) { + GeeArrayQueueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIterator); + _g_object_unref0 (self->priv->_queue); + G_OBJECT_CLASS (gee_array_queue_iterator_parent_class)->finalize (obj); +} + + +static GType gee_array_queue_iterator_get_type (void) { + static volatile gsize gee_array_queue_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_array_queue_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeArrayQueueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_queue_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayQueueIterator), 0, (GInstanceInitFunc) gee_array_queue_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_array_queue_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_array_queue_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_array_queue_iterator_type_id; + gee_array_queue_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeArrayQueueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_array_queue_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_array_queue_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_array_queue_iterator_type_id__volatile, gee_array_queue_iterator_type_id); + } + return gee_array_queue_iterator_type_id__volatile; +} + + +static void _vala_gee_array_queue_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeArrayQueueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIterator); + switch (property_id) { + case GEE_ARRAY_QUEUE_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_ARRAY_QUEUE_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_array_queue_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeArrayQueueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_QUEUE_TYPE_ITERATOR, GeeArrayQueueIterator); + switch (property_id) { + case GEE_ARRAY_QUEUE_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_ARRAY_QUEUE_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_ARRAY_QUEUE_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void gee_array_queue_class_init (GeeArrayQueueClass * klass) { + gee_array_queue_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeArrayQueuePrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_array_queue_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_array_queue_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_array_queue_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_array_queue_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_array_queue_real_clear; + GEE_ABSTRACT_QUEUE_CLASS (klass)->peek = gee_array_queue_real_peek; + GEE_ABSTRACT_QUEUE_CLASS (klass)->poll = gee_array_queue_real_poll; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_array_queue_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_array_queue_real_get_read_only; + GEE_ABSTRACT_QUEUE_CLASS (klass)->get_capacity = gee_array_queue_real_get_capacity; + GEE_ABSTRACT_QUEUE_CLASS (klass)->get_remaining_capacity = gee_array_queue_real_get_remaining_capacity; + GEE_ABSTRACT_QUEUE_CLASS (klass)->get_is_full = gee_array_queue_real_get_is_full; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_queue_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_queue_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_array_queue_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_CAPACITY, g_param_spec_int ("capacity", "capacity", "capacity", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_REMAINING_CAPACITY, g_param_spec_int ("remaining-capacity", "remaining-capacity", "remaining-capacity", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_QUEUE_IS_FULL, g_param_spec_boolean ("is-full", "is-full", "is-full", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_array_queue_gee_deque_get_g_type (GeeArrayQueue* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_array_queue_gee_deque_get_g_dup_func (GeeArrayQueue* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_array_queue_gee_deque_get_g_destroy_func (GeeArrayQueue* self) { + return self->priv->g_destroy_func; +} + + +static void gee_array_queue_gee_deque_interface_init (GeeDequeIface * iface) { + gee_array_queue_gee_deque_parent_iface = g_type_interface_peek_parent (iface); + iface->offer_head = (gboolean (*)(GeeDeque*, gconstpointer)) gee_array_queue_real_offer_head; + iface->peek_head = (gpointer (*)(GeeDeque*)) gee_array_queue_real_peek_head; + iface->poll_head = (gpointer (*)(GeeDeque*)) gee_array_queue_real_poll_head; + iface->drain_head = (gint (*)(GeeDeque*, GeeCollection*, gint)) gee_array_queue_real_drain_head; + iface->offer_tail = (gboolean (*)(GeeDeque*, gconstpointer)) gee_array_queue_real_offer_tail; + iface->peek_tail = (gpointer (*)(GeeDeque*)) gee_array_queue_real_peek_tail; + iface->poll_tail = (gpointer (*)(GeeDeque*)) gee_array_queue_real_poll_tail; + iface->drain_tail = (gint (*)(GeeDeque*, GeeCollection*, gint)) gee_array_queue_real_drain_tail; + iface->get_g_type = (GType(*)(GeeDeque*)) gee_array_queue_gee_deque_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeDeque*)) gee_array_queue_gee_deque_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeDeque*)) gee_array_queue_gee_deque_get_g_destroy_func; +} + + +static void gee_array_queue_instance_init (GeeArrayQueue * self) { + self->priv = GEE_ARRAY_QUEUE_GET_PRIVATE (self); + self->priv->_start = 0; + self->priv->_length = 0; + self->priv->_stamp = 0; +} + + +static void gee_array_queue_finalize (GObject* obj) { + GeeArrayQueue * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue); + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; + self->priv->_items = (_vala_array_free (self->priv->_items, self->priv->_items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); + G_OBJECT_CLASS (gee_array_queue_parent_class)->finalize (obj); +} + + +/** + * Resizable array implementation of the {@link Deque} interface. + * + * The storage array grows automatically when needed. + * + * This implementation is pretty good for lookups at the end or random. + * Because they are stored in an array this structure does not fit for deleting + * arbitrary elements. For an alternative implementation see {@link LinkedList}. + * + * @see LinkedList + */ +GType gee_array_queue_get_type (void) { + static volatile gsize gee_array_queue_type_id__volatile = 0; + if (g_once_init_enter (&gee_array_queue_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeArrayQueueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_queue_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayQueue), 0, (GInstanceInitFunc) gee_array_queue_instance_init, NULL }; + static const GInterfaceInfo gee_deque_info = { (GInterfaceInitFunc) gee_array_queue_gee_deque_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_array_queue_type_id; + gee_array_queue_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_QUEUE, "GeeArrayQueue", &g_define_type_info, 0); + g_type_add_interface_static (gee_array_queue_type_id, GEE_TYPE_DEQUE, &gee_deque_info); + g_once_init_leave (&gee_array_queue_type_id__volatile, gee_array_queue_type_id); + } + return gee_array_queue_type_id__volatile; +} + + +static void _vala_gee_array_queue_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeArrayQueue * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue); + switch (property_id) { + case GEE_ARRAY_QUEUE_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_ARRAY_QUEUE_IS_EMPTY: + g_value_set_boolean (value, gee_array_queue_get_is_empty (self)); + break; + case GEE_ARRAY_QUEUE_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + case GEE_ARRAY_QUEUE_CAPACITY: + g_value_set_int (value, gee_abstract_queue_get_capacity ((GeeAbstractQueue*) self)); + break; + case GEE_ARRAY_QUEUE_REMAINING_CAPACITY: + g_value_set_int (value, gee_abstract_queue_get_remaining_capacity ((GeeAbstractQueue*) self)); + break; + case GEE_ARRAY_QUEUE_IS_FULL: + g_value_set_boolean (value, gee_abstract_queue_get_is_full ((GeeAbstractQueue*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_array_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeArrayQueue * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue); + switch (property_id) { + case GEE_ARRAY_QUEUE_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_ARRAY_QUEUE_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_ARRAY_QUEUE_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length) { + g_memmove (((char*) array) + (dest * element_size), ((char*) array) + (src * element_size), length * element_size); + if ((src < dest) && ((src + length) > dest)) { + memset (((char*) array) + (src * element_size), 0, (dest - src) * element_size); + } else if ((src > dest) && (src < (dest + length))) { + memset (((char*) array) + ((dest + length) * element_size), 0, (src - dest) * element_size); + } else if (src != dest) { + memset (((char*) array) + (src * element_size), 0, length * element_size); + } +} + + + diff --git a/gee/arrayqueue.vala b/gee/arrayqueue.vala new file mode 100644 index 0000000..9775df2 --- /dev/null +++ b/gee/arrayqueue.vala @@ -0,0 +1,341 @@ +/* arrayqueue.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Resizable array implementation of the {@link Deque} interface. + * + * The storage array grows automatically when needed. + * + * This implementation is pretty good for lookups at the end or random. + * Because they are stored in an array this structure does not fit for deleting + * arbitrary elements. For an alternative implementation see {@link LinkedList}. + * + * @see LinkedList + */ +public class Gee.ArrayQueue : Gee.AbstractQueue, Deque { + /** + * Constructs a new, empty array queue. + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param equal_func an optional element equality testing function + */ + public ArrayQueue (owned EqualDataFunc? equal_func = null) { + if (equal_func == null) { + equal_func = Functions.get_equal_func_for (typeof (G)); + } + this.equal_func = equal_func; + this._items = new G[10]; + } + + [CCode (notify = false)] + public EqualDataFunc equal_func { private set; get; } + + /** + * {@inheritDoc} + */ + public override int size { get { return _length; } } + + public bool is_empty { get { return _length == 0; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { get { return false; } } + + /** + * {@inheritDoc} + */ + public override int capacity { get {return Queue.UNBOUNDED_CAPACITY;} } + + /** + * {@inheritDoc} + */ + public override int remaining_capacity { get {return Queue.UNBOUNDED_CAPACITY;} } + + /** + * {@inheritDoc} + */ + public override bool is_full { get { return false; } } + + /** + * {@inheritDoc} + */ + public override Gee.Iterator iterator() { + return new Iterator (this); + } + + /** + * {@inheritDoc} + */ + public override bool add (G element) { + return offer_tail (element); + } + + /** + * {@inheritDoc} + */ + public override bool contains (G item) { + return find_index(item) != -1; + } + + /** + * {@inheritDoc} + */ + public override bool remove (G item) { + _stamp++; + int index = find_index (item); + if (index == -1) { + return false; + } else { + remove_at (index); + return true; + } + } + + /** + * {@inheritDoc} + */ + public override void clear() { + _stamp++; + for (int i = 0; i < _length; i++) { + _items[(_start + i) % _items.length] = null; + } + _start = _length = 0; + } + + /** + * {@inheritDoc} + */ + public override G? peek () { + return peek_head (); + } + + /** + * {@inheritDoc} + */ + public override G? poll () { + return poll_head (); + } + + /** + * {@inheritDoc} + */ + public bool offer_head (G element) { + grow_if_needed (); + _start = (_items.length + _start - 1) % _items.length; + _length++; + _items[_start] = element; + _stamp++; + return true; + } + + /** + * {@inheritDoc} + */ + public G? peek_head () { + return _items[_start]; + } + + /** + * {@inheritDoc} + */ + public G? poll_head () { + _stamp++; + if (_length == 0) { + _start = 0; + return null; + } else { + _length--; + G result = (owned)_items[_start]; + _start = (_start + 1) % _items.length; + return (owned)result; + } + } + + /** + * {@inheritDoc} + */ + public int drain_head (Collection recipient, int amount = -1) { + return drain (recipient, amount); + } + + /** + * {@inheritDoc} + */ + public bool offer_tail (G element) { + grow_if_needed(); + _items[(_start + _length++) % _items.length] = element; + _stamp++; + return true; + } + + /** + * {@inheritDoc} + */ + public G? peek_tail () { + return _items[(_items.length + _start + _length - 1) % _items.length]; + } + + /** + * {@inheritDoc} + */ + public G? poll_tail () { + _stamp++; + if (_length == 0) { + _start = 0; + return null; + } else { + return (owned)_items[(_items.length + _start + --_length) % _items.length]; + } + } + + /** + * {@inheritDoc} + */ + public int drain_tail (Collection recipient, int amount = -1) { + G? item = null; + int drained = 0; + while((amount == -1 || --amount >= 0) && (item = poll_tail ()) != null) { + recipient.add(item); + drained++; + } + return drained; + } + + /** + * {@inheritDoc} + */ + private void grow_if_needed () { + if (_items.length < _length +1 ) { + _items.resize (2 * _items.length); +#if 0 + _items.move (0, _length, _start); +#else + // See bug #667452 + for(int i = 0; i < _start; i++) + _items[_length + i] = (owned)_items[i]; +#endif + } + } + + private int find_index (G item) { + for (int i = _start; i < int.min(_items.length, _start + _length); i++) { + if (equal_func(item, _items[i])) { + return i; + } + } + for (int i = 0; i < _start + _length - _items.length; i++) { + if (equal_func(item, _items[i])) { + return i; + } + } + return -1; + } + + private void remove_at (int index) { + int end = (_items.length + _start + _length - 1) % _items.length + 1; + if (index == _start) { + _items[_start++] = null; + _length--; + return; + } else if (index > _start && end <= _start) { + _items[index] = null; + _items.move (index + 1, index, _items.length - 1); + _items[_items.length - 1] = (owned)_items[0]; + _items.move (1, 0, end - 1); + _length--; + } else { + _items[index] = null; + _items.move (index + 1, index, end - (index + 1)); + _length--; + } + } + + private class Iterator : GLib.Object, Traversable, Gee.Iterator { + public Iterator (ArrayQueue queue) { + _queue = queue; + _stamp = _queue._stamp; + } + + public bool next () { + assert (_queue._stamp == _stamp); + if (has_next ()) { + _offset++; + _removed = false; + return true; + } else { + return false; + } + } + + public bool has_next () { + assert (_queue._stamp == _stamp); + return _offset + 1 < _queue._length; + } + + public new G get () { + assert (_queue._stamp == _stamp); + assert (_offset != -1); + assert (!_removed); + return _queue._items[(_queue._start + _offset) % _queue._items.length]; + } + + public void remove () { + assert (_queue._stamp++ == _stamp++); + _queue.remove_at((_queue._start + _offset) % _queue._items.length); + _offset--; + _removed = true; + } + + public bool valid { get {return _offset != -1 && !_removed;} } + + public bool read_only { get {return false;} } + + public bool foreach (ForallFunc f) { + assert (_queue._stamp == _stamp); + if (!valid) { + _offset++; + _removed = false; + } + for (int i = _offset; i < _queue._length; i++) { + if (!f (_queue._items[(_queue._start + i) % _queue._items.length])) { + _offset = i; + return false; + } + } + return true; + } + + private ArrayQueue _queue; + private int _stamp; + private int _offset = -1; + private bool _removed = false; + } + + private G[] _items; + private int _start = 0; + private int _length = 0; + private int _stamp = 0; +} + diff --git a/gee/assemblyinfo.vala b/gee/assemblyinfo.vala index 1fdde6d..8f3474b 100644 --- a/gee/assemblyinfo.vala +++ b/gee/assemblyinfo.vala @@ -20,6 +20,6 @@ * Maciej Piechotka */ -[CCode (gir_namespace = "Gee", gir_version = "1.0")] +[CCode (gir_namespace = "Gee", gir_version = "0.8")] namespace Gee {} diff --git a/gee/bidiriterator.c b/gee/bidiriterator.c index ae37adf..1a4b624 100644 --- a/gee/bidiriterator.c +++ b/gee/bidiriterator.c @@ -27,6 +27,26 @@ #include +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) @@ -43,28 +63,69 @@ typedef struct _GeeIteratorIface GeeIteratorIface; typedef struct _GeeBidirIterator GeeBidirIterator; typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); }; struct _GeeBidirIteratorIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); gboolean (*previous) (GeeBidirIterator* self); gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); gboolean (*last) (GeeBidirIterator* self); }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); gboolean gee_bidir_iterator_last (GeeBidirIterator* self); @@ -90,6 +151,17 @@ gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self) { } +/** + * Rewinds to the first element in the iteration. + * + * @return ``true`` if the iterator has a first element + */ +gboolean gee_bidir_iterator_first (GeeBidirIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_BIDIR_ITERATOR_GET_INTERFACE (self)->first (self); +} + + /** * Advances to the last element in the iteration. * diff --git a/gee/bidiriterator.vala b/gee/bidiriterator.vala index 03d8ce2..908dbb6 100644 --- a/gee/bidiriterator.vala +++ b/gee/bidiriterator.vala @@ -23,6 +23,7 @@ /** * A bi-directional iterator. */ +[GenericAccessors] public interface Gee.BidirIterator : Gee.Iterator { /** * Rewinds to the previous element in the iteration. @@ -38,6 +39,13 @@ public interface Gee.BidirIterator : Gee.Iterator { */ public abstract bool has_previous (); + /** + * Rewinds to the first element in the iteration. + * + * @return ``true`` if the iterator has a first element + */ + public abstract bool first (); + /** * Advances to the last element in the iteration. * diff --git a/gee/bidirlist.c b/gee/bidirlist.c new file mode 100644 index 0000000..5f61562 --- /dev/null +++ b/gee/bidirlist.c @@ -0,0 +1,297 @@ +/* bidirlist.c generated by valac 0.18.0, the Vala compiler + * generated from bidirlist.vala, do not modify */ + +/* bidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_LIST (gee_list_get_type ()) +#define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList)) +#define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST)) +#define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface)) + +typedef struct _GeeList GeeList; +typedef struct _GeeListIface GeeListIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); + GeeListIterator* (*list_iterator) (GeeList* self); + gpointer (*get) (GeeList* self, gint index); + void (*set) (GeeList* self, gint index, gconstpointer item); + gint (*index_of) (GeeList* self, gconstpointer item); + void (*insert) (GeeList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeList* self, gint index); + GeeList* (*slice) (GeeList* self, gint start, gint stop); + gpointer (*first) (GeeList* self); + gpointer (*last) (GeeList* self); + void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); + GeeList* (*get_read_only_view) (GeeList* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GeeBidirListIterator* gee_bidir_list_bidir_list_iterator (GeeBidirList* self); +GeeBidirList* gee_bidir_list_get_read_only_view (GeeBidirList* self); + + +/** + * Returns a BidirListIterator that can be used for iteration over this list. + * + * @return a BidirListIterator that can be used for iteration over this list + */ +GeeBidirListIterator* gee_bidir_list_bidir_list_iterator (GeeBidirList* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_LIST_GET_INTERFACE (self)->bidir_list_iterator (self); +} + + +GeeBidirList* gee_bidir_list_get_read_only_view (GeeBidirList* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_LIST_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static void gee_bidir_list_base_init (GeeBidirListIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + /** + * The read-only view of this list. + */ + g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + } +} + + +GType gee_bidir_list_get_type (void) { + static volatile gsize gee_bidir_list_type_id__volatile = 0; + if (g_once_init_enter (&gee_bidir_list_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeBidirListIface), (GBaseInitFunc) gee_bidir_list_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_bidir_list_type_id; + gee_bidir_list_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBidirList", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_bidir_list_type_id, GEE_TYPE_LIST); + g_once_init_leave (&gee_bidir_list_type_id__volatile, gee_bidir_list_type_id); + } + return gee_bidir_list_type_id__volatile; +} + + + diff --git a/gee/bidirlist.vala b/gee/bidirlist.vala new file mode 100644 index 0000000..4dec6b5 --- /dev/null +++ b/gee/bidirlist.vala @@ -0,0 +1,35 @@ +/* bidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +[GenericAccessors] +public interface Gee.BidirList : Gee.List { + /** + * Returns a BidirListIterator that can be used for iteration over this list. + * + * @return a BidirListIterator that can be used for iteration over this list + */ + public abstract new BidirListIterator bidir_list_iterator (); + + /** + * The read-only view of this list. + */ + public abstract new BidirList read_only_view { owned get; } +} diff --git a/gee/bidirlistiterator.c b/gee/bidirlistiterator.c new file mode 100644 index 0000000..bc6aae3 --- /dev/null +++ b/gee/bidirlistiterator.c @@ -0,0 +1,194 @@ +/* bidirlistiterator.c generated by valac 0.18.0, the Vala compiler + * generated from bidirlistiterator.vala, do not modify */ + +/* bidirlistiterator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +void gee_bidir_list_iterator_insert (GeeBidirListIterator* self, gconstpointer item); + + +/** + * Inserts the specified item before the current item in the iteration. The + * cursor is let to point to the current item. + */ +void gee_bidir_list_iterator_insert (GeeBidirListIterator* self, gconstpointer item) { + g_return_if_fail (self != NULL); + GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE (self)->insert (self, item); +} + + +static void gee_bidir_list_iterator_base_init (GeeBidirListIteratorIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + } +} + + +GType gee_bidir_list_iterator_get_type (void) { + static volatile gsize gee_bidir_list_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_bidir_list_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeBidirListIteratorIface), (GBaseInitFunc) gee_bidir_list_iterator_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_bidir_list_iterator_type_id; + gee_bidir_list_iterator_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBidirListIterator", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_bidir_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR); + g_type_interface_add_prerequisite (gee_bidir_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR); + g_once_init_leave (&gee_bidir_list_iterator_type_id__volatile, gee_bidir_list_iterator_type_id); + } + return gee_bidir_list_iterator_type_id__volatile; +} + + + diff --git a/gee/bidirlistiterator.vala b/gee/bidirlistiterator.vala new file mode 100644 index 0000000..edb858b --- /dev/null +++ b/gee/bidirlistiterator.vala @@ -0,0 +1,30 @@ +/* bidirlistiterator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +[GenericAccessors] +public interface Gee.BidirListIterator : Gee.BidirIterator, Gee.ListIterator { + /** + * Inserts the specified item before the current item in the iteration. The + * cursor is let to point to the current item. + */ + public abstract void insert (G item); +} + diff --git a/gee/bidirmapiterator.c b/gee/bidirmapiterator.c new file mode 100644 index 0000000..ff3bd27 --- /dev/null +++ b/gee/bidirmapiterator.c @@ -0,0 +1,162 @@ +/* bidirmapiterator.c generated by valac 0.18.0, the Vala compiler + * generated from bidirmapiterator.vala, do not modify */ + +/* bidiriterator.vala + * + * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + + + +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +gboolean gee_bidir_map_iterator_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_has_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_first (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_last (GeeBidirMapIterator* self); + + +/** + * Rewinds to the previous element in the iteration. + * + * @return `true` if the iterator has a previous element + */ +gboolean gee_bidir_map_iterator_previous (GeeBidirMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE (self)->previous (self); +} + + +/** + * Checks whether there is a previous element in the iteration. + * + * @return `true` if the iterator has a previous element + */ +gboolean gee_bidir_map_iterator_has_previous (GeeBidirMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE (self)->has_previous (self); +} + + +/** + * Goes back to the first element. + * + * @return `true` if the iterator has a first element + */ +gboolean gee_bidir_map_iterator_first (GeeBidirMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE (self)->first (self); +} + + +/** + * Advances to the last element in the iteration. + * + * @return `true` if the iterator has a last element + */ +gboolean gee_bidir_map_iterator_last (GeeBidirMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE (self)->last (self); +} + + +static void gee_bidir_map_iterator_base_init (GeeBidirMapIteratorIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + } +} + + +/** + * A bi-directional Map iterator. + */ +GType gee_bidir_map_iterator_get_type (void) { + static volatile gsize gee_bidir_map_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_bidir_map_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeBidirMapIteratorIface), (GBaseInitFunc) gee_bidir_map_iterator_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_bidir_map_iterator_type_id; + gee_bidir_map_iterator_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBidirMapIterator", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_bidir_map_iterator_type_id, GEE_TYPE_MAP_ITERATOR); + g_once_init_leave (&gee_bidir_map_iterator_type_id__volatile, gee_bidir_map_iterator_type_id); + } + return gee_bidir_map_iterator_type_id__volatile; +} + + + diff --git a/gee/bidirmapiterator.vala b/gee/bidirmapiterator.vala new file mode 100644 index 0000000..d5c1860 --- /dev/null +++ b/gee/bidirmapiterator.vala @@ -0,0 +1,56 @@ +/* bidiriterator.vala + * + * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * A bi-directional Map iterator. + */ +[GenericAccessors] +public interface Gee.BidirMapIterator : Gee.MapIterator { + /** + * Rewinds to the previous element in the iteration. + * + * @return `true` if the iterator has a previous element + */ + public abstract bool previous (); + + /** + * Checks whether there is a previous element in the iteration. + * + * @return `true` if the iterator has a previous element + */ + public abstract bool has_previous (); + + /** + * Goes back to the first element. + * + * @return `true` if the iterator has a first element + */ + public abstract bool first (); + + /** + * Advances to the last element in the iteration. + * + * @return `true` if the iterator has a last element + */ + public abstract bool last (); +} diff --git a/gee/bidirsortedmap.c b/gee/bidirsortedmap.c new file mode 100644 index 0000000..86d03f3 --- /dev/null +++ b/gee/bidirsortedmap.c @@ -0,0 +1,457 @@ +/* bidirsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from bidirsortedmap.vala, do not modify */ + +/* bidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) +#define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) +#define GEE_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) +#define GEE_IS_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_IS_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_ABSTRACT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) + +typedef struct _GeeAbstractMap GeeAbstractMap; +typedef struct _GeeAbstractMapClass GeeAbstractMapClass; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; + +#define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) +#define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) +#define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) +#define GEE_IS_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_MAP)) +#define GEE_IS_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_MAP)) +#define GEE_TREE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) + +typedef struct _GeeTreeMap GeeTreeMap; +typedef struct _GeeTreeMapClass GeeTreeMapClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GeeBidirMapIterator* gee_bidir_sorted_map_bidir_map_iterator (GeeBidirSortedMap* self); +GeeBidirSortedMap* gee_bidir_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_tree_map_get_type (void) G_GNUC_CONST; +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self); +GeeBidirSortedMap* gee_bidir_sorted_map_get_read_only_view (GeeBidirSortedMap* self); + + +/** + * Returns a bi-directional iterator for this map. + * + * @return a bi-directional map iterator + */ +GeeBidirMapIterator* gee_bidir_sorted_map_bidir_map_iterator (GeeBidirSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_SORTED_MAP_GET_INTERFACE (self)->bidir_map_iterator (self); +} + + +/** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ +GeeBidirSortedMap* gee_bidir_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func) { + GeeBidirSortedMap* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeBidirSortedMap* _tmp2_; + GeeBidirSortedMap* _tmp3_; + GeeBidirSortedMap* _tmp4_; + _tmp0_ = gee_tree_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL); + _tmp1_ = _tmp0_; + _tmp2_ = gee_abstract_bidir_sorted_map_get_read_only_view ((GeeAbstractBidirSortedMap*) _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + return result; +} + + +GeeBidirSortedMap* gee_bidir_sorted_map_get_read_only_view (GeeBidirSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_SORTED_MAP_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static void gee_bidir_sorted_map_base_init (GeeBidirSortedMapIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + /** + * The read-only view of this set. + */ + g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_SORTED_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + } +} + + +GType gee_bidir_sorted_map_get_type (void) { + static volatile gsize gee_bidir_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_bidir_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeBidirSortedMapIface), (GBaseInitFunc) gee_bidir_sorted_map_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_bidir_sorted_map_type_id; + gee_bidir_sorted_map_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBidirSortedMap", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_bidir_sorted_map_type_id, GEE_TYPE_SORTED_MAP); + g_once_init_leave (&gee_bidir_sorted_map_type_id__volatile, gee_bidir_sorted_map_type_id); + } + return gee_bidir_sorted_map_type_id__volatile; +} + + + diff --git a/gee/bidirsortedmap.vala b/gee/bidirsortedmap.vala new file mode 100644 index 0000000..32f842a --- /dev/null +++ b/gee/bidirsortedmap.vala @@ -0,0 +1,45 @@ +/* bidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +[GenericAccessors] +public interface Gee.BidirSortedMap : SortedMap { + /** + * Returns a bi-directional iterator for this map. + * + * @return a bi-directional map iterator + */ + public abstract BidirMapIterator bidir_map_iterator (); + + /** + * The read-only view of this set. + */ + public abstract new BidirSortedMap read_only_view { owned get; } + + /** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ + public static BidirSortedMap empty () { + return new TreeMap ().read_only_view; + } +} + diff --git a/gee/bidirsortedset.c b/gee/bidirsortedset.c new file mode 100644 index 0000000..042721a --- /dev/null +++ b/gee/bidirsortedset.c @@ -0,0 +1,364 @@ +/* bidirsortedset.c generated by valac 0.18.0, the Vala compiler + * generated from bidirsortedset.vala, do not modify */ + +/* bidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; + +#define GEE_TYPE_TREE_SET (gee_tree_set_get_type ()) +#define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet)) +#define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass)) +#define GEE_IS_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_SET)) +#define GEE_IS_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_SET)) +#define GEE_TREE_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_SET, GeeTreeSetClass)) + +typedef struct _GeeTreeSet GeeTreeSet; +typedef struct _GeeTreeSetClass GeeTreeSetClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GeeBidirIterator* gee_bidir_sorted_set_bidir_iterator (GeeBidirSortedSet* self); +GeeBidirSortedSet* gee_bidir_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_tree_set_get_type (void) G_GNUC_CONST; +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self); +GeeBidirSortedSet* gee_bidir_sorted_set_get_read_only_view (GeeBidirSortedSet* self); + + +/** + * Returns a {@link BidirIterator} that can be used for bi-directional + * iteration over this sorted set. + * + * @return a {@link BidirIterator} over this sorted set + */ +GeeBidirIterator* gee_bidir_sorted_set_bidir_iterator (GeeBidirSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_SORTED_SET_GET_INTERFACE (self)->bidir_iterator (self); +} + + +/** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ +GeeBidirSortedSet* gee_bidir_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeBidirSortedSet* result = NULL; + GeeTreeSet* _tmp0_; + GeeTreeSet* _tmp1_; + GeeBidirSortedSet* _tmp2_; + GeeBidirSortedSet* _tmp3_; + GeeBidirSortedSet* _tmp4_; + _tmp0_ = gee_tree_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL); + _tmp1_ = _tmp0_; + _tmp2_ = gee_abstract_bidir_sorted_set_get_read_only_view ((GeeAbstractBidirSortedSet*) _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + return result; +} + + +GeeBidirSortedSet* gee_bidir_sorted_set_get_read_only_view (GeeBidirSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_BIDIR_SORTED_SET_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static void gee_bidir_sorted_set_base_init (GeeBidirSortedSetIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + /** + * The read-only view of this set. + */ + g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + } +} + + +GType gee_bidir_sorted_set_get_type (void) { + static volatile gsize gee_bidir_sorted_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_bidir_sorted_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeBidirSortedSetIface), (GBaseInitFunc) gee_bidir_sorted_set_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_bidir_sorted_set_type_id; + gee_bidir_sorted_set_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBidirSortedSet", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_bidir_sorted_set_type_id, GEE_TYPE_SORTED_SET); + g_once_init_leave (&gee_bidir_sorted_set_type_id__volatile, gee_bidir_sorted_set_type_id); + } + return gee_bidir_sorted_set_type_id__volatile; +} + + + diff --git a/gee/bidirsortedset.vala b/gee/bidirsortedset.vala new file mode 100644 index 0000000..120484c --- /dev/null +++ b/gee/bidirsortedset.vala @@ -0,0 +1,46 @@ +/* bidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +[GenericAccessors] +public interface Gee.BidirSortedSet : SortedSet { + /** + * Returns a {@link BidirIterator} that can be used for bi-directional + * iteration over this sorted set. + * + * @return a {@link BidirIterator} over this sorted set + */ + public abstract BidirIterator bidir_iterator (); + + /** + * The read-only view of this set. + */ + public abstract new BidirSortedSet read_only_view { owned get; } + + /** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ + public static BidirSortedSet empty () { + return new TreeSet ().read_only_view; + } +} + diff --git a/gee/collection.c b/gee/collection.c index 93a556e..69decce 100644 --- a/gee/collection.c +++ b/gee/collection.c @@ -25,15 +25,30 @@ #include #include +#include +#include +#include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +58,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -50,6 +73,8 @@ typedef struct _GeeIteratorIface GeeIteratorIface; typedef struct _GeeCollection GeeCollection; typedef struct _GeeCollectionIface GeeCollectionIface; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL))) #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) @@ -88,25 +113,56 @@ typedef struct _GeeHashSetClass GeeHashSetClass; typedef struct _GeeSet GeeSet; typedef struct _GeeSetIface GeeSetIface; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -118,17 +174,32 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); @@ -136,21 +207,57 @@ gboolean gee_collection_add (GeeCollection* self, gconstpointer item); gboolean gee_collection_remove (GeeCollection* self, gconstpointer item); void gee_collection_clear (GeeCollection* self); gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection); +static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection); +gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed); +static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self); gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection); +static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static gboolean __lambda16_ (GeeCollection* self, gpointer item); +static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self); gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection); +static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection); +static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed); +static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self); gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection); +static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gboolean gee_iterator_next (GeeIterator* self); +gpointer gee_iterator_get (GeeIterator* self); +void gee_iterator_remove (GeeIterator* self); gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1); +static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1); +static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1); +static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1); +static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1); +static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1); +static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1); +static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1); +static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1); +static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1); +static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1); +static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1); +static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1); +gint gee_collection_get_size (GeeCollection* self); +gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1); +static gfloat* _float_dup (gfloat* self); +static gdouble* _double_dup (gdouble* self); GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; GType gee_hash_set_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self); -gint gee_collection_get_size (GeeCollection* self); gboolean gee_collection_get_is_empty (GeeCollection* self); +gboolean gee_collection_get_read_only (GeeCollection* self); GeeCollection* gee_collection_get_read_only_view (GeeCollection* self); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); /** @@ -212,6 +319,39 @@ void gee_collection_clear (GeeCollection* self) { * * @return ``true`` if the collection has been changed, ``false`` otherwise */ +static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed) { + gboolean result = FALSE; + gboolean _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + _tmp0_ = changed; + _tmp1_ = item; + _tmp2_ = gee_collection_add (self, _tmp1_); + result = _tmp0_ | _tmp2_; + ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + return result; +} + + +static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda15_ (self, g, a); + return result; +} + + +static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection) { + gboolean result = FALSE; + GeeCollection* _tmp0_; + gpointer _tmp1_ = NULL; + g_return_val_if_fail (collection != NULL, FALSE); + _tmp0_ = collection; + _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda15__gee_fold_func, self, (gpointer) ((gintptr) FALSE)); + result = (gboolean) ((gintptr) _tmp1_); + return result; +} + + gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection) { g_return_val_if_fail (self != NULL, FALSE); return GEE_COLLECTION_GET_INTERFACE (self)->add_all (self, collection); @@ -227,6 +367,37 @@ gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection) * * @return ``true`` if the collection has been changed, ``false`` otherwise */ +static gboolean __lambda16_ (GeeCollection* self, gpointer item) { + gboolean result = FALSE; + gconstpointer _tmp0_; + gboolean _tmp1_ = FALSE; + _tmp0_ = item; + _tmp1_ = gee_collection_contains (self, _tmp0_); + result = _tmp1_; + ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + return result; +} + + +static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda16_ (self, g); + return result; +} + + +static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection) { + gboolean result = FALSE; + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (collection != NULL, FALSE); + _tmp0_ = collection; + _tmp1_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, ___lambda16__gee_forall_func, self); + result = _tmp1_; + return result; +} + + gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection) { g_return_val_if_fail (self != NULL, FALSE); return GEE_COLLECTION_GET_INTERFACE (self)->contains_all (self, collection); @@ -244,6 +415,39 @@ gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collec * * @return ``true`` if the collection has been changed, ``false`` otherwise */ +static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed) { + gboolean result = FALSE; + gboolean _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + _tmp0_ = changed; + _tmp1_ = item; + _tmp2_ = gee_collection_remove (self, _tmp1_); + result = _tmp0_ | _tmp2_; + ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + return result; +} + + +static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda17_ (self, g, a); + return result; +} + + +static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection) { + gboolean result = FALSE; + GeeCollection* _tmp0_; + gpointer _tmp1_ = NULL; + g_return_val_if_fail (collection != NULL, FALSE); + _tmp0_ = collection; + _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda17__gee_fold_func, self, (gpointer) ((gintptr) FALSE)); + result = (gboolean) ((gintptr) _tmp1_); + return result; +} + + gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection) { g_return_val_if_fail (self != NULL, FALSE); return GEE_COLLECTION_GET_INTERFACE (self)->remove_all (self, collection); @@ -260,6 +464,60 @@ gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collecti * * @return ``true`` if the collection has been changed, ``false`` otherwise */ +static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection) { + gboolean result = FALSE; + gboolean changed; + g_return_val_if_fail (collection != NULL, FALSE); + changed = FALSE; + { + GeeIterator* _tmp0_ = NULL; + GeeIterator* iter; + _tmp0_ = gee_iterable_iterator ((GeeIterable*) self); + iter = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + GeeIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + GeeIterator* _tmp5_; + gpointer _tmp6_ = NULL; + gpointer item; + GeeCollection* _tmp7_; + gconstpointer _tmp8_; + gboolean _tmp9_ = FALSE; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + } + _tmp1_ = FALSE; + _tmp3_ = iter; + _tmp4_ = gee_iterator_next (_tmp3_); + if (!_tmp4_) { + break; + } + _tmp5_ = iter; + _tmp6_ = gee_iterator_get (_tmp5_); + item = _tmp6_; + _tmp7_ = collection; + _tmp8_ = item; + _tmp9_ = gee_collection_contains (_tmp7_, _tmp8_); + if (!_tmp9_) { + GeeIterator* _tmp10_; + _tmp10_ = iter; + gee_iterator_remove (_tmp10_); + changed = TRUE; + } + ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + } + } + _g_object_unref0 (iter); + } + result = changed; + return result; +} + + gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection) { g_return_val_if_fail (self != NULL, FALSE); return GEE_COLLECTION_GET_INTERFACE (self)->retain_all (self, collection); @@ -271,12 +529,1185 @@ gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collecti * * @return an array containing all of items from this collection */ +static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1) { + gpointer* result = NULL; + GType t; + GType _tmp0_; + t = GEE_COLLECTION_GET_INTERFACE (self)->get_g_type (self); + _tmp0_ = t; + if (_tmp0_ == G_TYPE_BOOLEAN) { + gint _tmp1_ = 0; + gboolean* _tmp2_ = NULL; + gpointer* _tmp3_; + gint _tmp3__length1; + _tmp2_ = gee_collection_to_bool_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp1_); + _tmp3_ = (gpointer*) _tmp2_; + _tmp3__length1 = (_tmp1_ * sizeof (gboolean)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp3__length1; + } + result = _tmp3_; + return result; + } else { + GType _tmp4_; + _tmp4_ = t; + if (_tmp4_ == G_TYPE_CHAR) { + gint _tmp5_ = 0; + gchar* _tmp6_ = NULL; + gpointer* _tmp7_; + gint _tmp7__length1; + _tmp6_ = gee_collection_to_char_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp5_); + _tmp7_ = (gpointer*) _tmp6_; + _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp7__length1; + } + result = _tmp7_; + return result; + } else { + GType _tmp8_; + _tmp8_ = t; + if (_tmp8_ == G_TYPE_UCHAR) { + gint _tmp9_ = 0; + guchar* _tmp10_ = NULL; + gpointer* _tmp11_; + gint _tmp11__length1; + _tmp10_ = gee_collection_to_uchar_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp9_); + _tmp11_ = (gpointer*) _tmp10_; + _tmp11__length1 = (_tmp9_ * sizeof (guchar)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp11__length1; + } + result = _tmp11_; + return result; + } else { + GType _tmp12_; + _tmp12_ = t; + if (_tmp12_ == G_TYPE_INT) { + gint _tmp13_ = 0; + gint* _tmp14_ = NULL; + gpointer* _tmp15_; + gint _tmp15__length1; + _tmp14_ = gee_collection_to_int_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_); + _tmp15_ = (gpointer*) _tmp14_; + _tmp15__length1 = (_tmp13_ * sizeof (gint)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp15__length1; + } + result = _tmp15_; + return result; + } else { + GType _tmp16_; + _tmp16_ = t; + if (_tmp16_ == G_TYPE_UINT) { + gint _tmp17_ = 0; + guint* _tmp18_ = NULL; + gpointer* _tmp19_; + gint _tmp19__length1; + _tmp18_ = gee_collection_to_uint_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp17_); + _tmp19_ = (gpointer*) _tmp18_; + _tmp19__length1 = (_tmp17_ * sizeof (guint)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp19__length1; + } + result = _tmp19_; + return result; + } else { + GType _tmp20_; + _tmp20_ = t; + if (_tmp20_ == G_TYPE_INT64) { + gint _tmp21_ = 0; + gint64* _tmp22_ = NULL; + gpointer* _tmp23_; + gint _tmp23__length1; + _tmp22_ = gee_collection_to_int64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp21_); + _tmp23_ = (gpointer*) _tmp22_; + _tmp23__length1 = (_tmp21_ * sizeof (gint64)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp23__length1; + } + result = _tmp23_; + return result; + } else { + GType _tmp24_; + _tmp24_ = t; + if (_tmp24_ == G_TYPE_UINT64) { + gint _tmp25_ = 0; + guint64* _tmp26_ = NULL; + gpointer* _tmp27_; + gint _tmp27__length1; + _tmp26_ = gee_collection_to_uint64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp25_); + _tmp27_ = (gpointer*) _tmp26_; + _tmp27__length1 = (_tmp25_ * sizeof (guint64)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp27__length1; + } + result = _tmp27_; + return result; + } else { + GType _tmp28_; + _tmp28_ = t; + if (_tmp28_ == G_TYPE_LONG) { + gint _tmp29_ = 0; + glong* _tmp30_ = NULL; + gpointer* _tmp31_; + gint _tmp31__length1; + _tmp30_ = gee_collection_to_long_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp29_); + _tmp31_ = (gpointer*) _tmp30_; + _tmp31__length1 = (_tmp29_ * sizeof (glong)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp31__length1; + } + result = _tmp31_; + return result; + } else { + GType _tmp32_; + _tmp32_ = t; + if (_tmp32_ == G_TYPE_ULONG) { + gint _tmp33_ = 0; + gulong* _tmp34_ = NULL; + gpointer* _tmp35_; + gint _tmp35__length1; + _tmp34_ = gee_collection_to_ulong_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp33_); + _tmp35_ = (gpointer*) _tmp34_; + _tmp35__length1 = (_tmp33_ * sizeof (gulong)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp35__length1; + } + result = _tmp35_; + return result; + } else { + GType _tmp36_; + _tmp36_ = t; + if (_tmp36_ == G_TYPE_FLOAT) { + gint _tmp37_ = 0; + gfloat** _tmp38_ = NULL; + gpointer* _tmp39_; + gint _tmp39__length1; + _tmp38_ = gee_collection_to_float_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp37_); + _tmp39_ = (gpointer*) _tmp38_; + _tmp39__length1 = (_tmp37_ * sizeof (gfloat*)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp39__length1; + } + result = _tmp39_; + return result; + } else { + GType _tmp40_; + _tmp40_ = t; + if (_tmp40_ == G_TYPE_DOUBLE) { + gint _tmp41_ = 0; + gdouble** _tmp42_ = NULL; + gpointer* _tmp43_; + gint _tmp43__length1; + _tmp42_ = gee_collection_to_double_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp41_); + _tmp43_ = (gpointer*) _tmp42_; + _tmp43__length1 = (_tmp41_ * sizeof (gdouble*)) / sizeof (gpointer); + if (result_length1) { + *result_length1 = _tmp43__length1; + } + result = _tmp43_; + return result; + } else { + gint _tmp44_; + gint _tmp45_; + gpointer* _tmp46_ = NULL; + gpointer* array; + gint array_length1; + gint _array_size_; + gint index; + gpointer* _tmp57_; + gint _tmp57__length1; + _tmp44_ = gee_collection_get_size (self); + _tmp45_ = _tmp44_; + _tmp46_ = g_new0 (gpointer, _tmp45_); + array = _tmp46_; + array_length1 = _tmp45_; + _array_size_ = array_length1; + index = 0; + { + GeeIterator* _tmp47_ = NULL; + GeeIterator* _element_it; + _tmp47_ = gee_iterable_iterator ((GeeIterable*) self); + _element_it = _tmp47_; + while (TRUE) { + GeeIterator* _tmp48_; + gboolean _tmp49_ = FALSE; + GeeIterator* _tmp50_; + gpointer _tmp51_ = NULL; + gpointer element; + gpointer* _tmp52_; + gint _tmp52__length1; + gint _tmp53_; + gconstpointer _tmp54_; + gpointer _tmp55_; + gpointer _tmp56_; + _tmp48_ = _element_it; + _tmp49_ = gee_iterator_next (_tmp48_); + if (!_tmp49_) { + break; + } + _tmp50_ = _element_it; + _tmp51_ = gee_iterator_get (_tmp50_); + element = _tmp51_; + _tmp52_ = array; + _tmp52__length1 = array_length1; + _tmp53_ = index; + index = _tmp53_ + 1; + _tmp54_ = element; + _tmp55_ = ((_tmp54_ != NULL) && (GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) != NULL)) ? GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) ((gpointer) _tmp54_) : ((gpointer) _tmp54_); + ((_tmp52_[_tmp53_] == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (_tmp52_[_tmp53_] = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (_tmp52_[_tmp53_]), NULL)); + _tmp52_[_tmp53_] = _tmp55_; + _tmp56_ = _tmp52_[_tmp53_]; + ((element == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (element = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (element), NULL)); + } + _g_object_unref0 (_element_it); + } + _tmp57_ = array; + _tmp57__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp57__length1; + } + result = _tmp57_; + return result; + } + } + } + } + } + } + } + } + } + } + } +} + + gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1) { g_return_val_if_fail (self != NULL, NULL); return GEE_COLLECTION_GET_INTERFACE (self)->to_array (self, result_length1); } +/** + * Adds all items in the input array to this collection. + * + * @param array the array which items will be added to this + * collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ +gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1) { + gboolean result = FALSE; + gboolean changed; + gpointer* _tmp0_; + gint _tmp0__length1; + changed = FALSE; + _tmp0_ = array; + _tmp0__length1 = array_length1; + { + gpointer* item_collection = NULL; + gint item_collection_length1 = 0; + gint _item_collection_size_ = 0; + gint item_it = 0; + item_collection = _tmp0_; + item_collection_length1 = _tmp0__length1; + for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) { + gconstpointer item = NULL; + item = item_collection[item_it]; + { + gboolean _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp1_ = changed; + _tmp2_ = item; + _tmp3_ = gee_collection_add (self, _tmp2_); + changed = _tmp1_ | _tmp3_; + } + } + } + result = changed; + return result; +} + + +/** + * Returns ``true`` it this collection contains all items as the input + * array. + * + * @param array the array which items will be compared with + * this collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ +gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1) { + gboolean result = FALSE; + gpointer* _tmp0_; + gint _tmp0__length1; + _tmp0_ = array; + _tmp0__length1 = array_length1; + { + gpointer* item_collection = NULL; + gint item_collection_length1 = 0; + gint _item_collection_size_ = 0; + gint item_it = 0; + item_collection = _tmp0_; + item_collection_length1 = _tmp0__length1; + for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) { + gconstpointer item = NULL; + item = item_collection[item_it]; + { + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + _tmp1_ = item; + _tmp2_ = gee_collection_contains (self, _tmp1_); + if (!_tmp2_) { + result = FALSE; + return result; + } + } + } + } + result = TRUE; + return result; +} + + +/** + * Removes the subset of items in this collection corresponding to the + * elments in the input array. If there is several occurrences of + * the same value in this collection they are decremented of the number + * of occurrences in the input array. + * + * @param array the array which items will be compared with + * this collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ +gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1) { + gboolean result = FALSE; + gboolean changed; + gpointer* _tmp0_; + gint _tmp0__length1; + changed = FALSE; + _tmp0_ = array; + _tmp0__length1 = array_length1; + { + gpointer* item_collection = NULL; + gint item_collection_length1 = 0; + gint _item_collection_size_ = 0; + gint item_it = 0; + item_collection = _tmp0_; + item_collection_length1 = _tmp0__length1; + for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) { + gconstpointer item = NULL; + item = item_collection[item_it]; + { + gboolean _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp1_ = changed; + _tmp2_ = item; + _tmp3_ = gee_collection_remove (self, _tmp2_); + changed = _tmp1_ | _tmp3_; + } + } + } + result = changed; + return result; +} + + +static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1) { + gboolean* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gboolean* _tmp3_ = NULL; + gboolean* array; + gint array_length1; + gint _array_size_; + gint index; + gboolean* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gboolean, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gboolean element; + gboolean* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + gboolean _tmp12_; + gboolean _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (gboolean) ((gintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1) { + gchar* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gchar* _tmp3_ = NULL; + gchar* array; + gint array_length1; + gint _array_size_; + gint index; + gchar* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gchar, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gchar element; + gchar* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + gchar _tmp12_; + gchar _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (gchar) ((gintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1) { + guchar* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + guchar* _tmp3_ = NULL; + guchar* array; + gint array_length1; + gint _array_size_; + gint index; + guchar* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (guchar, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + guchar element; + guchar* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + guchar _tmp12_; + guchar _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (guchar) ((guintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1) { + gint* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint* _tmp3_ = NULL; + gint* array; + gint array_length1; + gint _array_size_; + gint index; + gint* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gint, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gint element; + gint* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + gint _tmp12_; + gint _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (gint) ((gintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1) { + guint* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + guint* _tmp3_ = NULL; + guint* array; + gint array_length1; + gint _array_size_; + gint index; + guint* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (guint, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + guint element; + guint* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + guint _tmp12_; + guint _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (guint) ((guintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1) { + gint64* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint64* _tmp3_ = NULL; + gint64* array; + gint array_length1; + gint _array_size_; + gint index; + gint64* _tmp16_; + gint _tmp16__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gint64, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gint64* _tmp10_; + gint64 _tmp11_; + gint64 element; + gint64* _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + gint64 _tmp14_; + gint64 _tmp15_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + _tmp10_ = (gint64*) _tmp9_; + _tmp11_ = *_tmp10_; + _g_free0 (_tmp10_); + element = _tmp11_; + _tmp12_ = array; + _tmp12__length1 = array_length1; + _tmp13_ = index; + index = _tmp13_ + 1; + _tmp14_ = element; + _tmp12_[_tmp13_] = _tmp14_; + _tmp15_ = _tmp12_[_tmp13_]; + } + _g_object_unref0 (_element_it); + } + _tmp16_ = array; + _tmp16__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp16__length1; + } + result = _tmp16_; + return result; +} + + +static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1) { + guint64* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + guint64* _tmp3_ = NULL; + guint64* array; + gint array_length1; + gint _array_size_; + gint index; + guint64* _tmp16_; + gint _tmp16__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (guint64, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + guint64* _tmp10_; + guint64 _tmp11_; + guint64 element; + guint64* _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + guint64 _tmp14_; + guint64 _tmp15_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + _tmp10_ = (guint64*) _tmp9_; + _tmp11_ = *_tmp10_; + _g_free0 (_tmp10_); + element = _tmp11_; + _tmp12_ = array; + _tmp12__length1 = array_length1; + _tmp13_ = index; + index = _tmp13_ + 1; + _tmp14_ = element; + _tmp12_[_tmp13_] = _tmp14_; + _tmp15_ = _tmp12_[_tmp13_]; + } + _g_object_unref0 (_element_it); + } + _tmp16_ = array; + _tmp16__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp16__length1; + } + result = _tmp16_; + return result; +} + + +static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1) { + glong* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + glong* _tmp3_ = NULL; + glong* array; + gint array_length1; + gint _array_size_; + gint index; + glong* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (glong, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + glong element; + glong* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + glong _tmp12_; + glong _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (glong) ((gintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1) { + gulong* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gulong* _tmp3_ = NULL; + gulong* array; + gint array_length1; + gint _array_size_; + gint index; + gulong* _tmp14_; + gint _tmp14__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gulong, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gulong element; + gulong* _tmp10_; + gint _tmp10__length1; + gint _tmp11_; + gulong _tmp12_; + gulong _tmp13_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + element = (gulong) ((guintptr) _tmp9_); + _tmp10_ = array; + _tmp10__length1 = array_length1; + _tmp11_ = index; + index = _tmp11_ + 1; + _tmp12_ = element; + _tmp10_[_tmp11_] = _tmp12_; + _tmp13_ = _tmp10_[_tmp11_]; + } + _g_object_unref0 (_element_it); + } + _tmp14_ = array; + _tmp14__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp14__length1; + } + result = _tmp14_; + return result; +} + + +static gfloat* _float_dup (gfloat* self) { + gfloat* dup; + dup = g_new0 (gfloat, 1); + memcpy (dup, self, sizeof (gfloat)); + return dup; +} + + +static gpointer __float_dup0 (gpointer self) { + return self ? _float_dup (self) : NULL; +} + + +static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1) { + gfloat** result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gfloat** _tmp3_ = NULL; + gfloat** array; + gint array_length1; + gint _array_size_; + gint index; + gfloat** _tmp17_; + gint _tmp17__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gfloat*, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gfloat* _tmp10_; + gfloat _tmp11_; + gfloat element; + gfloat** _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + gfloat _tmp14_; + gfloat* _tmp15_; + gfloat* _tmp16_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + _tmp10_ = (gfloat*) _tmp9_; + _tmp11_ = *_tmp10_; + _g_free0 (_tmp10_); + element = _tmp11_; + _tmp12_ = array; + _tmp12__length1 = array_length1; + _tmp13_ = index; + index = _tmp13_ + 1; + _tmp14_ = element; + _tmp15_ = __float_dup0 (&_tmp14_); + _g_free0 (_tmp12_[_tmp13_]); + _tmp12_[_tmp13_] = _tmp15_; + _tmp16_ = _tmp12_[_tmp13_]; + } + _g_object_unref0 (_element_it); + } + _tmp17_ = array; + _tmp17__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp17__length1; + } + result = _tmp17_; + return result; +} + + +static gdouble* _double_dup (gdouble* self) { + gdouble* dup; + dup = g_new0 (gdouble, 1); + memcpy (dup, self, sizeof (gdouble)); + return dup; +} + + +static gpointer __double_dup0 (gpointer self) { + return self ? _double_dup (self) : NULL; +} + + +static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1) { + gdouble** result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gdouble** _tmp3_ = NULL; + gdouble** array; + gint array_length1; + gint _array_size_; + gint index; + gdouble** _tmp17_; + gint _tmp17__length1; + g_return_val_if_fail (coll != NULL, NULL); + _tmp0_ = coll; + _tmp1_ = gee_collection_get_size (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = g_new0 (gdouble*, _tmp2_); + array = _tmp3_; + array_length1 = _tmp2_; + _array_size_ = array_length1; + index = 0; + { + GeeCollection* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _element_it; + _tmp4_ = coll; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _element_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gdouble* _tmp10_; + gdouble _tmp11_; + gdouble element; + gdouble** _tmp12_; + gint _tmp12__length1; + gint _tmp13_; + gdouble _tmp14_; + gdouble* _tmp15_; + gdouble* _tmp16_; + _tmp6_ = _element_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _element_it; + _tmp9_ = gee_iterator_get (_tmp8_); + _tmp10_ = (gdouble*) _tmp9_; + _tmp11_ = *_tmp10_; + _g_free0 (_tmp10_); + element = _tmp11_; + _tmp12_ = array; + _tmp12__length1 = array_length1; + _tmp13_ = index; + index = _tmp13_ + 1; + _tmp14_ = element; + _tmp15_ = __double_dup0 (&_tmp14_); + _g_free0 (_tmp12_[_tmp13_]); + _tmp12_[_tmp13_] = _tmp15_; + _tmp16_ = _tmp12_[_tmp13_]; + } + _g_object_unref0 (_element_it); + } + _tmp17_ = array; + _tmp17__length1 = array_length1; + if (result_length1) { + *result_length1 = _tmp17__length1; + } + result = _tmp17_; + return result; +} + + /** * Returns an immutable empty collection. * @@ -289,7 +1720,7 @@ GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GD GeeSet* _tmp2_; GeeSet* _tmp3_; GeeCollection* _tmp4_; - _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL); + _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL); _tmp1_ = _tmp0_; _tmp2_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp1_); _tmp3_ = _tmp2_; @@ -312,6 +1743,25 @@ gboolean gee_collection_get_is_empty (GeeCollection* self) { } +static gboolean gee_collection_real_get_is_empty (GeeCollection* base) { + gboolean result; + GeeCollection* self; + gint _tmp0_; + gint _tmp1_; + self = base; + _tmp0_ = gee_collection_get_size (self); + _tmp1_ = _tmp0_; + result = _tmp1_ == 0; + return result; +} + + +gboolean gee_collection_get_read_only (GeeCollection* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only (self); +} + + GeeCollection* gee_collection_get_read_only_view (GeeCollection* self) { g_return_val_if_fail (self != NULL, NULL); return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only_view (self); @@ -327,13 +1777,20 @@ static void gee_collection_base_init (GeeCollectionIface * iface) { */ g_object_interface_install_property (iface, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * Specifies whether this collection is empty. + * Specifies whether this collection can change - i.e. wheather {@link add}, + * {@link remove} etc. are legal operations. */ - g_object_interface_install_property (iface, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_interface_install_property (iface, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * The read-only view of this collection. */ g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_COLLECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->add_all = gee_collection_real_add_all; + iface->contains_all = gee_collection_real_contains_all; + iface->remove_all = gee_collection_real_remove_all; + iface->retain_all = gee_collection_real_retain_all; + iface->to_array = gee_collection_real_to_array; + iface->get_is_empty = gee_collection_real_get_is_empty; } } @@ -354,4 +1811,22 @@ GType gee_collection_get_type (void) { } +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + diff --git a/gee/collection.vala b/gee/collection.vala index 3bc12a8..a6dfb4f 100644 --- a/gee/collection.vala +++ b/gee/collection.vala @@ -23,6 +23,7 @@ /** * A generic collection of objects. */ +[GenericAccessors] public interface Gee.Collection : Iterable { /** * The number of items in this collection. @@ -32,7 +33,13 @@ public interface Gee.Collection : Iterable { /** * Specifies whether this collection is empty. */ - public abstract bool is_empty { get; } + public virtual bool is_empty { get { return size == 0; } } + + /** + * Specifies whether this collection can change - i.e. wheather {@link add}, + * {@link remove} etc. are legal operations. + */ + public abstract bool read_only { get; } /** * Determines whether this collection contains the specified item. @@ -77,7 +84,9 @@ public interface Gee.Collection : Iterable { * * @return ``true`` if the collection has been changed, ``false`` otherwise */ - public abstract bool add_all (Collection collection); + public virtual bool add_all (Collection collection) { + return collection.fold ((item, changed) => changed | add (item), false); + } /** * Returns ``true`` it this collection contains all items as the input @@ -88,7 +97,9 @@ public interface Gee.Collection : Iterable { * * @return ``true`` if the collection has been changed, ``false`` otherwise */ - public abstract bool contains_all (Collection collection); + public virtual bool contains_all (Collection collection) { + return collection.foreach ((item) => contains (item)); + } /** * Removes the subset of items in this collection corresponding to the @@ -101,7 +112,9 @@ public interface Gee.Collection : Iterable { * * @return ``true`` if the collection has been changed, ``false`` otherwise */ - public abstract bool remove_all (Collection collection); + public virtual bool remove_all (Collection collection) { + return collection.fold ((item, changed) => changed | remove (item), false); + } /** * Removes all items in this collection that are not contained in the input @@ -113,14 +126,211 @@ public interface Gee.Collection : Iterable { * * @return ``true`` if the collection has been changed, ``false`` otherwise */ - public abstract bool retain_all (Collection collection); + public virtual bool retain_all (Collection collection) { + bool changed = false; + for (Iterator iter = iterator(); iter.next ();) { + G item = iter.get (); + if (!collection.contains (item)) { + iter.remove (); + changed = true; + } + } + return changed; + } /** * Returns an array containing all of items from this collection. * * @return an array containing all of items from this collection */ - public abstract G[] to_array(); + public virtual G[] to_array () { + var t = typeof (G); + if (t == typeof (bool)) { + return (G[]) to_bool_array ((Collection) this); + } else if (t == typeof (char)) { + return (G[]) to_char_array ((Collection) this); + } else if (t == typeof (uchar)) { + return (G[]) to_uchar_array ((Collection) this); + } else if (t == typeof (int)) { + return (G[]) to_int_array ((Collection) this); + } else if (t == typeof (uint)) { + return (G[]) to_uint_array ((Collection) this); + } else if (t == typeof (int64)) { + return (G[]) to_int64_array ((Collection) this); + } else if (t == typeof (uint64)) { + return (G[]) to_uint64_array ((Collection) this); + } else if (t == typeof (long)) { + return (G[]) to_long_array ((Collection) this); + } else if (t == typeof (ulong)) { + return (G[]) to_ulong_array ((Collection) this); + } else if (t == typeof (float)) { + return (G[]) to_float_array ((Collection) this); + } else if (t == typeof (double)) { + return (G[]) to_double_array ((Collection) this); + } else { + G[] array = new G[size]; + int index = 0; + foreach (G element in this) { + array[index++] = element; + } + return array; + } + } + + /** + * Adds all items in the input array to this collection. + * + * @param array the array which items will be added to this + * collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ + public bool add_all_array (G[] array) { + // FIXME: Change to virtual after bug #693455 is fixed + bool changed = false; + foreach (unowned G item in array) { + changed |= add (item); + } + return changed; + } + + /** + * Returns ``true`` it this collection contains all items as the input + * array. + * + * @param array the array which items will be compared with + * this collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ + public bool contains_all_array (G[] array) { + // FIXME: Change to virtual after bug #693455 is fixed + foreach (unowned G item in array) { + if (!contains (item)) { + return false; + } + } + return true; + } + + /** + * Removes the subset of items in this collection corresponding to the + * elments in the input array. If there is several occurrences of + * the same value in this collection they are decremented of the number + * of occurrences in the input array. + * + * @param array the array which items will be compared with + * this collection. + * + * @return ``true`` if the collection has been changed, ``false`` otherwise + */ + public bool remove_all_array (G[] array) { + // FIXME: Change to virtual after bug #693455 is fixed + bool changed = false; + foreach (unowned G item in array) { + changed |= remove (item); + } + return changed; + } + + private static bool[] to_bool_array (Collection coll) { + bool[] array = new bool[coll.size]; + int index = 0; + foreach (bool element in coll) { + array[index++] = element; + } + return array; + } + + private static char[] to_char_array (Collection coll) { + char[] array = new char[coll.size]; + int index = 0; + foreach (char element in coll) { + array[index++] = element; + } + return array; + } + + private static uchar[] to_uchar_array (Collection coll) { + uchar[] array = new uchar[coll.size]; + int index = 0; + foreach (uchar element in coll) { + array[index++] = element; + } + return array; + } + + private static int[] to_int_array (Collection coll) { + int[] array = new int[coll.size]; + int index = 0; + foreach (int element in coll) { + array[index++] = element; + } + return array; + } + + private static uint[] to_uint_array (Collection coll) { + uint[] array = new uint[coll.size]; + int index = 0; + foreach (uint element in coll) { + array[index++] = element; + } + return array; + } + + private static int64[] to_int64_array (Collection coll) { + int64[] array = new int64[coll.size]; + int index = 0; + foreach (int64 element in coll) { + array[index++] = element; + } + return array; + } + + private static uint64[] to_uint64_array (Collection coll) { + uint64[] array = new uint64[coll.size]; + int index = 0; + foreach (uint64 element in coll) { + array[index++] = element; + } + return array; + } + + private static long[] to_long_array (Collection coll) { + long[] array = new long[coll.size]; + int index = 0; + foreach (long element in coll) { + array[index++] = element; + } + return array; + } + + private static ulong[] to_ulong_array (Collection coll) { + ulong[] array = new ulong[coll.size]; + int index = 0; + foreach (ulong element in coll) { + array[index++] = element; + } + return array; + } + + private static float?[] to_float_array (Collection coll) { + float?[] array = new float?[coll.size]; + int index = 0; + foreach (float element in coll) { + array[index++] = element; + } + return array; + } + + private static double?[] to_double_array (Collection coll) { + double?[] array = new double?[coll.size]; + int index = 0; + foreach (double element in coll) { + array[index++] = element; + } + return array; + } /** * The read-only view of this collection. diff --git a/gee/comparable.c b/gee/comparable.c index e85f7ba..5f9cad9 100644 --- a/gee/comparable.c +++ b/gee/comparable.c @@ -69,6 +69,8 @@ static void gee_comparable_base_init (GeeComparableIface * iface) { /** * This interface defines a total ordering among instances of each class * implementing it. + * + * @see Hashable */ GType gee_comparable_get_type (void) { static volatile gsize gee_comparable_type_id__volatile = 0; diff --git a/gee/comparable.vala b/gee/comparable.vala index 01e9a5e..9639483 100644 --- a/gee/comparable.vala +++ b/gee/comparable.vala @@ -23,6 +23,8 @@ /** * This interface defines a total ordering among instances of each class * implementing it. + * + * @see Hashable */ public interface Gee.Comparable : Object { /** diff --git a/gee/concurrentlist.c b/gee/concurrentlist.c new file mode 100644 index 0000000..c0c1360 --- /dev/null +++ b/gee/concurrentlist.c @@ -0,0 +1,2773 @@ +/* concurrentlist.c generated by valac 0.18.0, the Vala compiler + * generated from concurrentlist.vala, do not modify */ + +/* concurrentlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_LIST (gee_list_get_type ()) +#define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList)) +#define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST)) +#define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface)) + +typedef struct _GeeList GeeList; +typedef struct _GeeListIface GeeListIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ()) +#define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList)) +#define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) +#define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) + +typedef struct _GeeAbstractList GeeAbstractList; +typedef struct _GeeAbstractListClass GeeAbstractListClass; +typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; + +#define GEE_TYPE_CONCURRENT_LIST (gee_concurrent_list_get_type ()) +#define GEE_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList)) +#define GEE_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) +#define GEE_IS_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_IS_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_CONCURRENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) + +typedef struct _GeeConcurrentList GeeConcurrentList; +typedef struct _GeeConcurrentListClass GeeConcurrentListClass; +typedef struct _GeeConcurrentListPrivate GeeConcurrentListPrivate; + +#define GEE_CONCURRENT_LIST_TYPE_NODE (gee_concurrent_list_node_get_type ()) +#define GEE_CONCURRENT_LIST_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNode)) +#define GEE_CONCURRENT_LIST_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNodeClass)) +#define GEE_CONCURRENT_LIST_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_LIST_TYPE_NODE)) +#define GEE_CONCURRENT_LIST_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_LIST_TYPE_NODE)) +#define GEE_CONCURRENT_LIST_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNodeClass)) + +typedef struct _GeeConcurrentListNode GeeConcurrentListNode; +typedef struct _GeeConcurrentListNodeClass GeeConcurrentListNodeClass; + +#define GEE_HAZARD_POINTER_TYPE_POLICY (gee_hazard_pointer_policy_get_type ()) +typedef struct _GeeHazardPointerContext GeeHazardPointerContext; +#define _gee_concurrent_list_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_concurrent_list_node_unref (var), NULL))) +#define _gee_hazard_pointer_context_free0(var) ((var == NULL) ? NULL : (var = (gee_hazard_pointer_context_free (var), NULL))) + +#define GEE_CONCURRENT_LIST_TYPE_STATE (gee_concurrent_list_state_get_type ()) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define GEE_CONCURRENT_LIST_TYPE_ITERATOR (gee_concurrent_list_iterator_get_type ()) +#define GEE_CONCURRENT_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator)) +#define GEE_CONCURRENT_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIteratorClass)) +#define GEE_CONCURRENT_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR)) +#define GEE_CONCURRENT_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_LIST_TYPE_ITERATOR)) +#define GEE_CONCURRENT_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIteratorClass)) + +typedef struct _GeeConcurrentListIterator GeeConcurrentListIterator; +typedef struct _GeeConcurrentListIteratorClass GeeConcurrentListIteratorClass; +typedef struct _GeeConcurrentListIteratorPrivate GeeConcurrentListIteratorPrivate; +typedef struct _GeeConcurrentListNodePrivate GeeConcurrentListNodePrivate; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) +typedef struct _GeeConcurrentListParamSpecNode GeeConcurrentListParamSpecNode; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); + GeeListIterator* (*list_iterator) (GeeList* self); + gpointer (*get) (GeeList* self, gint index); + void (*set) (GeeList* self, gint index, gconstpointer item); + gint (*index_of) (GeeList* self, gconstpointer item); + void (*insert) (GeeList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeList* self, gint index); + GeeList* (*slice) (GeeList* self, gint start, gint stop); + gpointer (*first) (GeeList* self); + gpointer (*last) (GeeList* self); + void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); + GeeList* (*get_read_only_view) (GeeList* self); +}; + +struct _GeeAbstractList { + GeeAbstractCollection parent_instance; + GeeAbstractListPrivate * priv; +}; + +struct _GeeAbstractListClass { + GeeAbstractCollectionClass parent_class; + GeeListIterator* (*list_iterator) (GeeAbstractList* self); + gpointer (*get) (GeeAbstractList* self, gint index); + void (*set) (GeeAbstractList* self, gint index, gconstpointer item); + gint (*index_of) (GeeAbstractList* self, gconstpointer item); + void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeAbstractList* self, gint index); + GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); + GeeList* (*get_read_only_view) (GeeAbstractList* self); +}; + +struct _GeeConcurrentList { + GeeAbstractList parent_instance; + GeeConcurrentListPrivate * priv; +}; + +struct _GeeConcurrentListClass { + GeeAbstractListClass parent_class; +}; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeConcurrentListPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeEqualDataFunc _equal_func; + gpointer _equal_func_target; + GDestroyNotify _equal_func_target_destroy_notify; + GeeConcurrentListNode* _head; + GeeConcurrentListNode* _tail; +}; + +typedef enum { + GEE_HAZARD_POINTER_POLICY_DEFAULT, + GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, + GEE_HAZARD_POINTER_POLICY_TRY_FREE, + GEE_HAZARD_POINTER_POLICY_FREE, + GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, + GEE_HAZARD_POINTER_POLICY_RELEASE +} GeeHazardPointerPolicy; + +typedef enum { + GEE_CONCURRENT_LIST_STATE_NONE = 0, + GEE_CONCURRENT_LIST_STATE_MARKED = 1, + GEE_CONCURRENT_LIST_STATE_FLAGGED = 2 +} GeeConcurrentListState; + +struct _GeeConcurrentListIterator { + GObject parent_instance; + GeeConcurrentListIteratorPrivate * priv; +}; + +struct _GeeConcurrentListIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeConcurrentListIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + gboolean _removed; + gint _index; + GeeConcurrentListNode* _prev; + GeeConcurrentListNode* _curr; +}; + +struct _GeeConcurrentListNode { + GTypeInstance parent_instance; + volatile int ref_count; + GeeConcurrentListNodePrivate * priv; + GeeConcurrentListNode* _succ; + GeeConcurrentListNode* _backlink; + gconstpointer* _data; +}; + +struct _GeeConcurrentListNodeClass { + GTypeClass parent_class; + void (*finalize) (GeeConcurrentListNode *self); +}; + +struct _GeeConcurrentListNodePrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeConcurrentListParamSpecNode { + GParamSpec parent_instance; +}; + + +static gpointer gee_concurrent_list_parent_class = NULL; +static gpointer gee_concurrent_list_iterator_parent_class = NULL; +static GeeTraversableIface* gee_concurrent_list_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_concurrent_list_iterator_gee_iterator_parent_iface = NULL; +static GeeListIteratorIface* gee_concurrent_list_iterator_gee_list_iterator_parent_iface = NULL; +static gpointer gee_concurrent_list_node_parent_class = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_concurrent_list_get_type (void) G_GNUC_CONST; +static gpointer gee_concurrent_list_node_ref (gpointer instance); +static void gee_concurrent_list_node_unref (gpointer instance); +static GParamSpec* gee_concurrent_list_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; +static void gee_concurrent_list_value_set_node (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static void gee_concurrent_list_value_take_node (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static gpointer gee_concurrent_list_value_get_node (const GValue* value) G_GNUC_UNUSED; +static GType gee_concurrent_list_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +#define GEE_CONCURRENT_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListPrivate)) +enum { + GEE_CONCURRENT_LIST_DUMMY_PROPERTY, + GEE_CONCURRENT_LIST_G_TYPE, + GEE_CONCURRENT_LIST_G_DUP_FUNC, + GEE_CONCURRENT_LIST_G_DESTROY_FUNC, + GEE_CONCURRENT_LIST_READ_ONLY, + GEE_CONCURRENT_LIST_SIZE, + GEE_CONCURRENT_LIST_IS_EMPTY +}; +GType gee_hazard_pointer_policy_get_type (void) G_GNUC_CONST; +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self); +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask); +static GType gee_concurrent_list_state_get_type (void) G_GNUC_UNUSED; +GeeConcurrentList* gee_concurrent_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeConcurrentList* gee_concurrent_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_concurrent_list_set_equal_func (GeeConcurrentList* self, GeeEqualDataFunc value, gpointer value_target); +static GeeConcurrentListNode* gee_concurrent_list_node_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static GeeConcurrentListNode* gee_concurrent_list_node_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static gboolean gee_concurrent_list_real_contains (GeeAbstractCollection* base, gconstpointer item); +GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); +gboolean gee_iterator_next (GeeIterator* self); +GeeEqualDataFunc gee_concurrent_list_get_equal_func (GeeConcurrentList* self, gpointer* result_target); +gpointer gee_iterator_get (GeeIterator* self); +static gboolean gee_concurrent_list_real_add (GeeAbstractCollection* base, gconstpointer item); +static GeeConcurrentListNode* gee_concurrent_list_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data); +static GeeConcurrentListNode* gee_concurrent_list_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data); +static inline void gee_concurrent_list_node_insert (GeeConcurrentListNode* self, GeeConcurrentListNode* prev, GeeConcurrentListNode* next); +static inline GeeConcurrentListNode* gee_concurrent_list_get_tail (GeeConcurrentList* self); +static gboolean gee_concurrent_list_real_remove (GeeAbstractCollection* base, gconstpointer item); +void gee_iterator_remove (GeeIterator* self); +static void gee_concurrent_list_real_clear (GeeAbstractCollection* base); +static GeeIterator* gee_concurrent_list_real_iterator (GeeAbstractCollection* base); +static GeeConcurrentListIterator* gee_concurrent_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* head); +static GeeConcurrentListIterator* gee_concurrent_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* head); +static GType gee_concurrent_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeListIterator* gee_concurrent_list_real_list_iterator (GeeAbstractList* base); +static gpointer gee_concurrent_list_real_get (GeeAbstractList* base, gint index); +static void gee_concurrent_list_real_set (GeeAbstractList* base, gint index, gconstpointer item); +GeeListIterator* gee_abstract_list_list_iterator (GeeAbstractList* self); +void gee_list_iterator_set (GeeListIterator* self, gconstpointer item); +static gint gee_concurrent_list_real_index_of (GeeAbstractList* base, gconstpointer item); +static void gee_concurrent_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item); +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_next (GeeConcurrentListNode* self); +void gee_list_iterator_add (GeeListIterator* self, gconstpointer item); +static gpointer gee_concurrent_list_real_remove_at (GeeAbstractList* base, gint index); +static GeeList* gee_concurrent_list_real_slice (GeeAbstractList* base, gint start, gint end); +gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); +static inline GeeConcurrentListNode* gee_concurrent_list_update_tail (GeeConcurrentList* self); +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +static inline void gee_concurrent_list_node_backtrace (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode** curr); +static inline gboolean gee_concurrent_list_node_search_for (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* goal, GeeConcurrentListNode** prev); +gboolean gee_concurrent_list_get_is_empty (GeeConcurrentList* self); +#define GEE_CONCURRENT_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIteratorPrivate)) +enum { + GEE_CONCURRENT_LIST_ITERATOR_DUMMY_PROPERTY, + GEE_CONCURRENT_LIST_ITERATOR_G_TYPE, + GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC, + GEE_CONCURRENT_LIST_ITERATOR_G_DESTROY_FUNC, + GEE_CONCURRENT_LIST_ITERATOR_VALID, + GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY +}; +static gboolean gee_concurrent_list_iterator_real_next (GeeIterator* base); +static inline gboolean gee_concurrent_list_node_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode** prev, GeeConcurrentListNode** curr, gboolean force); +static gboolean gee_concurrent_list_iterator_real_has_next (GeeIterator* base); +static gpointer gee_concurrent_list_iterator_real_get (GeeIterator* base); +gboolean gee_iterator_get_valid (GeeIterator* self); +static void gee_concurrent_list_iterator_real_set (GeeListIterator* base, gconstpointer item); +static void gee_concurrent_list_iterator_real_remove (GeeIterator* base); +static inline gboolean gee_concurrent_list_node_remove (GeeConcurrentListNode* self, GeeConcurrentListNode* prev_node); +static gint gee_concurrent_list_iterator_real_index (GeeListIterator* base); +static void gee_concurrent_list_iterator_real_add (GeeListIterator* base, gconstpointer item); +static gboolean gee_concurrent_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static void gee_concurrent_list_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +static void _vala_gee_concurrent_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_CONCURRENT_LIST_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNodePrivate)) +enum { + GEE_CONCURRENT_LIST_NODE_DUMMY_PROPERTY +}; +static inline GeeConcurrentListState gee_concurrent_list_node_get_state (GeeConcurrentListNode* self); +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_succ (GeeConcurrentListNode* self, GeeConcurrentListState* state); +static inline void gee_concurrent_list_node_help_marked (GeeConcurrentListNode* self, GeeConcurrentListNode* prev_node); +static inline gboolean gee_concurrent_list_node_try_flag (GeeConcurrentListNode* self, GeeConcurrentListNode** prev_node); +static inline void gee_concurrent_list_node_help_flagged (GeeConcurrentListNode* self, GeeConcurrentListNode* prev); +static inline void gee_concurrent_list_node_set_succ (GeeConcurrentListNode* self, GeeConcurrentListNode* next, GeeConcurrentListState state); +static inline gboolean gee_concurrent_list_node_compare_and_exchange (GeeConcurrentListNode* self, GeeConcurrentListNode* old_node, GeeConcurrentListState old_state, GeeConcurrentListNode* new_node, GeeConcurrentListState new_state); +static inline void gee_concurrent_list_node_set_backlink (GeeConcurrentListNode* self, GeeConcurrentListNode* backlink); +static inline void gee_concurrent_list_node_try_mark (GeeConcurrentListNode* self); +static inline gboolean gee_concurrent_list_node_compare_succ (GeeConcurrentListNode* self, GeeConcurrentListNode* next, GeeConcurrentListState state); +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_backlink (GeeConcurrentListNode* self); +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask); +static void gee_concurrent_list_node_finalize (GeeConcurrentListNode* obj); +static void gee_concurrent_list_finalize (GObject* obj); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +static void _vala_gee_concurrent_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +static GType gee_concurrent_list_state_get_type (void) { + static volatile gsize gee_concurrent_list_state_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_list_state_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_CONCURRENT_LIST_STATE_NONE, "GEE_CONCURRENT_LIST_STATE_NONE", "none"}, {GEE_CONCURRENT_LIST_STATE_MARKED, "GEE_CONCURRENT_LIST_STATE_MARKED", "marked"}, {GEE_CONCURRENT_LIST_STATE_FLAGGED, "GEE_CONCURRENT_LIST_STATE_FLAGGED", "flagged"}, {0, NULL, NULL}}; + GType gee_concurrent_list_state_type_id; + gee_concurrent_list_state_type_id = g_enum_register_static ("GeeConcurrentListState", values); + g_once_init_leave (&gee_concurrent_list_state_type_id__volatile, gee_concurrent_list_state_type_id); + } + return gee_concurrent_list_state_type_id__volatile; +} + + +/** + * Construct new, empty single linked list + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param equal_func an optional element equality testing function + */ +static gpointer _gee_concurrent_list_node_ref0 (gpointer self) { + return self ? gee_concurrent_list_node_ref (self) : NULL; +} + + +GeeConcurrentList* gee_concurrent_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + GeeConcurrentList * self = NULL; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GDestroyNotify _tmp4__target_destroy_notify; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GDestroyNotify _tmp5__target_destroy_notify; + GeeConcurrentListNode* _tmp6_; + GeeConcurrentListNode* _tmp7_; + GeeConcurrentListNode* _tmp8_; + self = (GeeConcurrentList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = equal_func; + _tmp0__target = equal_func_target; + if (_tmp0_ == NULL) { + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp3_; + equal_func_target = _tmp1_; + equal_func_target_destroy_notify = _tmp2_; + } + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + _tmp4__target_destroy_notify = equal_func_target_destroy_notify; + equal_func_target_destroy_notify = NULL; + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp5__target_destroy_notify = _tmp4__target_destroy_notify; + gee_concurrent_list_set_equal_func (self, _tmp5_, _tmp4__target); + (_tmp5__target_destroy_notify == NULL) ? NULL : (_tmp5__target_destroy_notify (_tmp5__target), NULL); + _tmp5_ = NULL; + _tmp5__target = NULL; + _tmp5__target_destroy_notify = NULL; + _tmp6_ = gee_concurrent_list_node_new_head (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + _gee_concurrent_list_node_unref0 (self->priv->_head); + self->priv->_head = _tmp6_; + _tmp7_ = self->priv->_head; + _tmp8_ = _gee_concurrent_list_node_ref0 (_tmp7_); + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->priv->_tail, _tmp8_, (gsize) 0, (gsize) 0); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + return self; +} + + +GeeConcurrentList* gee_concurrent_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_concurrent_list_construct (GEE_TYPE_CONCURRENT_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify); +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_concurrent_list_real_contains (GeeAbstractCollection* base, gconstpointer item) { + GeeConcurrentList * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + { + GeeIterator* _tmp1_ = NULL; + GeeIterator* iter; + _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iter = _tmp1_; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + GeeIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; + GeeEqualDataFunc _tmp7_; + void* _tmp7__target; + gconstpointer _tmp8_; + GeeIterator* _tmp9_; + gpointer _tmp10_ = NULL; + gpointer _tmp11_; + gboolean _tmp12_ = FALSE; + gboolean _tmp13_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + } + _tmp2_ = FALSE; + _tmp4_ = iter; + _tmp5_ = gee_iterator_next (_tmp4_); + if (!_tmp5_) { + break; + } + _tmp6_ = gee_concurrent_list_get_equal_func (self, &_tmp6__target); + _tmp7_ = _tmp6_; + _tmp7__target = _tmp6__target; + _tmp8_ = item; + _tmp9_ = iter; + _tmp10_ = gee_iterator_get (_tmp9_); + _tmp11_ = _tmp10_; + _tmp12_ = _tmp7_ (_tmp8_, _tmp11_, _tmp7__target); + _tmp13_ = _tmp12_; + ((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL)); + if (_tmp13_) { + result = TRUE; + _g_object_unref0 (iter); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + } + _g_object_unref0 (iter); + } + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_concurrent_list_real_add (GeeAbstractCollection* base, gconstpointer item) { + GeeConcurrentList * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gconstpointer _tmp1_; + GeeConcurrentListNode* _tmp2_; + GeeConcurrentListNode* node; + GeeConcurrentListNode* _tmp3_ = NULL; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = item; + _tmp2_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_); + node = _tmp2_; + _tmp3_ = gee_concurrent_list_get_tail (self); + gee_concurrent_list_node_insert (node, _tmp3_, NULL); + result = TRUE; + _gee_concurrent_list_node_unref0 (node); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_concurrent_list_real_remove (GeeAbstractCollection* base, gconstpointer item) { + GeeConcurrentList * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeIterator* _tmp1_ = NULL; + GeeIterator* iter; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iter = _tmp1_; + while (TRUE) { + GeeIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeIterator* _tmp7_; + gpointer _tmp8_ = NULL; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean _tmp11_; + _tmp2_ = iter; + _tmp3_ = gee_iterator_next (_tmp2_); + if (!_tmp3_) { + break; + } + _tmp4_ = gee_concurrent_list_get_equal_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = item; + _tmp7_ = iter; + _tmp8_ = gee_iterator_get (_tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = _tmp5_ (_tmp6_, _tmp9_, _tmp5__target); + _tmp11_ = _tmp10_; + ((_tmp9_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->g_destroy_func (_tmp9_), NULL)); + if (_tmp11_) { + GeeIterator* _tmp12_; + _tmp12_ = iter; + gee_iterator_remove (_tmp12_); + result = TRUE; + _g_object_unref0 (iter); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + result = FALSE; + _g_object_unref0 (iter); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +/** + * {@inheritDoc} + */ +static void gee_concurrent_list_real_clear (GeeAbstractCollection* base) { + GeeConcurrentList * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeIterator* _tmp1_ = NULL; + GeeIterator* iter; + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListNode* _tmp6_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iter = _tmp1_; + while (TRUE) { + GeeIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeIterator* _tmp4_; + _tmp2_ = iter; + _tmp3_ = gee_iterator_next (_tmp2_); + if (!_tmp3_) { + break; + } + _tmp4_ = iter; + gee_iterator_remove (_tmp4_); + } + _tmp5_ = self->priv->_head; + _tmp6_ = _gee_concurrent_list_node_ref0 (_tmp5_); + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->priv->_tail, _tmp6_, (gsize) 0, (gsize) 0); + _g_object_unref0 (iter); + _gee_hazard_pointer_context_free0 (ctx); +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_concurrent_list_real_iterator (GeeAbstractCollection* base) { + GeeConcurrentList * self; + GeeIterator* result = NULL; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListIterator* _tmp1_; + self = (GeeConcurrentList*) base; + _tmp0_ = self->priv->_head; + _tmp1_ = gee_concurrent_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp0_); + result = (GeeIterator*) _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeListIterator* gee_concurrent_list_real_list_iterator (GeeAbstractList* base) { + GeeConcurrentList * self; + GeeListIterator* result = NULL; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListIterator* _tmp1_; + self = (GeeConcurrentList*) base; + _tmp0_ = self->priv->_head; + _tmp1_ = gee_concurrent_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp0_); + result = (GeeListIterator*) _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_concurrent_list_real_get (GeeAbstractList* base, gint index) { + GeeConcurrentList * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint _tmp1_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = index; + _vala_assert (_tmp1_ >= 0, "index >= 0"); + { + GeeIterator* _tmp2_ = NULL; + GeeIterator* iterator; + _tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iterator = _tmp2_; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + GeeIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + gint _tmp7_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + } + _tmp3_ = FALSE; + _tmp5_ = iterator; + _tmp6_ = gee_iterator_next (_tmp5_); + if (!_tmp6_) { + break; + } + _tmp7_ = index; + index = _tmp7_ - 1; + if (_tmp7_ == 0) { + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + _tmp8_ = iterator; + _tmp9_ = gee_iterator_get (_tmp8_); + result = _tmp9_; + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + } + _g_object_unref0 (iterator); + } + g_assert_not_reached (); + _gee_hazard_pointer_context_free0 (ctx); +} + + +/** + * {@inheritDoc} + */ +static void gee_concurrent_list_real_set (GeeAbstractList* base, gint index, gconstpointer item) { + GeeConcurrentList * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint _tmp1_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = index; + _vala_assert (_tmp1_ >= 0, "index >= 0"); + { + GeeListIterator* _tmp2_ = NULL; + GeeListIterator* iterator; + _tmp2_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self); + iterator = _tmp2_; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + GeeListIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + gint _tmp7_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + } + _tmp3_ = FALSE; + _tmp5_ = iterator; + _tmp6_ = gee_iterator_next ((GeeIterator*) _tmp5_); + if (!_tmp6_) { + break; + } + _tmp7_ = index; + index = _tmp7_ - 1; + if (_tmp7_ == 0) { + GeeListIterator* _tmp8_; + gconstpointer _tmp9_; + _tmp8_ = iterator; + _tmp9_ = item; + gee_list_iterator_set (_tmp8_, _tmp9_); + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return; + } + } + } + _g_object_unref0 (iterator); + } + g_assert_not_reached (); + _gee_hazard_pointer_context_free0 (ctx); +} + + +/** + * {@inheritDoc} + */ +static gint gee_concurrent_list_real_index_of (GeeAbstractList* base, gconstpointer item) { + GeeConcurrentList * self; + gint result = 0; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint index; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + index = 0; + { + GeeListIterator* _tmp1_ = NULL; + GeeListIterator* iterator; + _tmp1_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self); + iterator = _tmp1_; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + GeeListIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + GeeEqualDataFunc _tmp7_; + void* _tmp7__target; + GeeEqualDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + GeeListIterator* _tmp10_; + gpointer _tmp11_ = NULL; + gpointer _tmp12_; + gboolean _tmp13_ = FALSE; + gboolean _tmp14_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + gint _tmp4_; + _tmp4_ = index; + index = _tmp4_ + 1; + } + _tmp2_ = FALSE; + _tmp5_ = iterator; + _tmp6_ = gee_iterator_next ((GeeIterator*) _tmp5_); + if (!_tmp6_) { + break; + } + _tmp7_ = gee_concurrent_list_get_equal_func (self, &_tmp7__target); + _tmp8_ = _tmp7_; + _tmp8__target = _tmp7__target; + _tmp9_ = item; + _tmp10_ = iterator; + _tmp11_ = gee_iterator_get ((GeeIterator*) _tmp10_); + _tmp12_ = _tmp11_; + _tmp13_ = _tmp8_ (_tmp9_, _tmp12_, _tmp8__target); + _tmp14_ = _tmp13_; + ((_tmp12_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp12_ = (self->priv->g_destroy_func (_tmp12_), NULL)); + if (_tmp14_) { + result = index; + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + } + _g_object_unref0 (iterator); + } + result = -1; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +/** + * {@inheritDoc} + */ +static void gee_concurrent_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item) { + GeeConcurrentList * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint _tmp1_; + gint _tmp2_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = index; + _vala_assert (_tmp1_ >= 0, "index >= 0"); + _tmp2_ = index; + if (_tmp2_ == 0) { + GeeConcurrentListNode* _tmp3_; + GeeConcurrentListNode* _tmp4_; + GeeConcurrentListNode* prev; + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListNode* _tmp6_ = NULL; + GeeConcurrentListNode* next; + gconstpointer _tmp7_; + GeeConcurrentListNode* _tmp8_; + GeeConcurrentListNode* new_node; + GeeConcurrentListNode* _tmp9_; + GeeConcurrentListNode* _tmp10_; + GeeConcurrentListNode* _tmp11_; + GeeConcurrentListNode* _tmp12_; + _tmp3_ = self->priv->_head; + _tmp4_ = _gee_concurrent_list_node_ref0 (_tmp3_); + prev = _tmp4_; + _tmp5_ = self->priv->_head; + _tmp6_ = gee_concurrent_list_node_get_next (_tmp5_); + next = _tmp6_; + _tmp7_ = item; + _tmp8_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_); + new_node = _tmp8_; + _tmp9_ = new_node; + _tmp10_ = prev; + _tmp11_ = _gee_concurrent_list_node_ref0 (_tmp10_); + _tmp12_ = next; + gee_concurrent_list_node_insert (_tmp9_, _tmp11_, _tmp12_); + _gee_concurrent_list_node_unref0 (new_node); + _gee_concurrent_list_node_unref0 (next); + _gee_concurrent_list_node_unref0 (prev); + } else { + { + GeeListIterator* _tmp13_ = NULL; + GeeListIterator* iterator; + _tmp13_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self); + iterator = _tmp13_; + { + gboolean _tmp14_; + _tmp14_ = TRUE; + while (TRUE) { + gboolean _tmp15_; + GeeListIterator* _tmp16_; + gboolean _tmp17_ = FALSE; + gint _tmp18_; + gint _tmp19_; + _tmp15_ = _tmp14_; + if (!_tmp15_) { + } + _tmp14_ = FALSE; + _tmp16_ = iterator; + _tmp17_ = gee_iterator_next ((GeeIterator*) _tmp16_); + if (!_tmp17_) { + break; + } + _tmp18_ = index; + index = _tmp18_ - 1; + _tmp19_ = index; + if (_tmp19_ == 0) { + GeeListIterator* _tmp20_; + gconstpointer _tmp21_; + _tmp20_ = iterator; + _tmp21_ = item; + gee_list_iterator_add (_tmp20_, _tmp21_); + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return; + } + } + } + _g_object_unref0 (iterator); + } + g_assert_not_reached (); + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_concurrent_list_real_remove_at (GeeAbstractList* base, gint index) { + GeeConcurrentList * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + { + GeeListIterator* _tmp1_ = NULL; + GeeListIterator* iterator; + _tmp1_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self); + iterator = _tmp1_; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + GeeListIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + gint _tmp6_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + } + _tmp2_ = FALSE; + _tmp4_ = iterator; + _tmp5_ = gee_iterator_next ((GeeIterator*) _tmp4_); + if (!_tmp5_) { + break; + } + _tmp6_ = index; + index = _tmp6_ - 1; + if (_tmp6_ == 0) { + GeeListIterator* _tmp7_; + gpointer _tmp8_ = NULL; + gpointer data; + GeeListIterator* _tmp9_; + _tmp7_ = iterator; + _tmp8_ = gee_iterator_get ((GeeIterator*) _tmp7_); + data = _tmp8_; + _tmp9_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp9_); + result = data; + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + } + _g_object_unref0 (iterator); + } + g_assert_not_reached (); + _gee_hazard_pointer_context_free0 (ctx); +} + + +/** + * {@inheritDoc} + */ +static GeeList* gee_concurrent_list_real_slice (GeeAbstractList* base, gint start, gint end) { + GeeConcurrentList * self; + GeeList* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GeeConcurrentList* _tmp6_; + GeeConcurrentList* list; + GeeIterator* _tmp7_ = NULL; + GeeIterator* iterator; + gint idx; + gint _tmp25_; + gint _tmp26_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = start; + _vala_assert (0 <= _tmp1_, "0 <= start"); + _tmp2_ = start; + _tmp3_ = end; + _vala_assert (_tmp2_ <= _tmp3_, "start <= end"); + _tmp4_ = gee_concurrent_list_get_equal_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = gee_concurrent_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_, _tmp5__target, NULL); + list = _tmp6_; + _tmp7_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iterator = _tmp7_; + idx = 0; + { + gboolean _tmp8_; + _tmp8_ = TRUE; + while (TRUE) { + gboolean _tmp9_; + GeeIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + gboolean _tmp13_ = FALSE; + gint _tmp14_; + gint _tmp15_; + gboolean _tmp18_; + _tmp9_ = _tmp8_; + if (!_tmp9_) { + gint _tmp10_; + _tmp10_ = idx; + idx = _tmp10_ + 1; + } + _tmp8_ = FALSE; + _tmp11_ = iterator; + _tmp12_ = gee_iterator_next (_tmp11_); + if (!_tmp12_) { + break; + } + _tmp14_ = idx; + _tmp15_ = start; + if (_tmp14_ >= _tmp15_) { + gint _tmp16_; + gint _tmp17_; + _tmp16_ = idx; + _tmp17_ = end; + _tmp13_ = _tmp16_ < _tmp17_; + } else { + _tmp13_ = FALSE; + } + _tmp18_ = _tmp13_; + if (_tmp18_) { + GeeConcurrentList* _tmp19_; + GeeIterator* _tmp20_; + gpointer _tmp21_ = NULL; + gpointer _tmp22_; + _tmp19_ = list; + _tmp20_ = iterator; + _tmp21_ = gee_iterator_get (_tmp20_); + _tmp22_ = _tmp21_; + gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp22_); + ((_tmp22_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp22_ = (self->priv->g_destroy_func (_tmp22_), NULL)); + } else { + gint _tmp23_; + gint _tmp24_; + _tmp23_ = idx; + _tmp24_ = end; + if (_tmp23_ >= _tmp24_) { + break; + } + } + } + } + _tmp25_ = idx; + _tmp26_ = end; + _vala_assert (_tmp25_ >= _tmp26_, "idx >= end"); + result = (GeeList*) list; + _g_object_unref0 (iterator); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static inline GeeConcurrentListNode* gee_concurrent_list_update_tail (GeeConcurrentList* self) { + GeeConcurrentListNode* result = NULL; + gpointer _tmp0_ = NULL; + GeeConcurrentListNode* tail; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListNode* _tmp2_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->priv->_tail, (gsize) 0, NULL); + tail = (GeeConcurrentListNode*) _tmp0_; + gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &tail); + gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, NULL, &tail); + _tmp1_ = tail; + _tmp2_ = _gee_concurrent_list_node_ref0 (_tmp1_); + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->priv->_tail, _tmp2_, (gsize) 0, (gsize) 0); + result = tail; + return result; +} + + +static inline GeeConcurrentListNode* gee_concurrent_list_get_tail (GeeConcurrentList* self) { + GeeConcurrentListNode* result = NULL; + GeeConcurrentListNode* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = gee_concurrent_list_update_tail (self); + result = _tmp0_; + return result; +} + + +GeeEqualDataFunc gee_concurrent_list_get_equal_func (GeeConcurrentList* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_equal_func; + _tmp0__target = self->priv->_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; + return result; +} + + +static void gee_concurrent_list_set_equal_func (GeeConcurrentList* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; + self->priv->_equal_func = _tmp0_; + self->priv->_equal_func_target = _tmp0__target; + self->priv->_equal_func_target_destroy_notify = NULL; +} + + +static gboolean gee_concurrent_list_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeConcurrentList* self; + self = (GeeConcurrentList*) base; + result = FALSE; + return result; +} + + +static gint gee_concurrent_list_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeConcurrentList* self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gint _result_; + gint _tmp7_; + self = (GeeConcurrentList*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _result_ = 0; + { + GeeIterator* _tmp1_ = NULL; + GeeIterator* iter; + _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iter = _tmp1_; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + GeeIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + gint _tmp6_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + } + _tmp2_ = FALSE; + _tmp4_ = iter; + _tmp5_ = gee_iterator_next (_tmp4_); + if (!_tmp5_) { + break; + } + _tmp6_ = _result_; + _result_ = _tmp6_ + 1; + } + } + _g_object_unref0 (iter); + } + _tmp7_ = _result_; + result = _tmp7_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +gboolean gee_concurrent_list_get_is_empty (GeeConcurrentList* self) { + gboolean result; + GeeIterator* _tmp0_ = NULL; + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + gboolean _tmp3_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterator_next (_tmp1_); + _tmp3_ = !_tmp2_; + _g_object_unref0 (_tmp1_); + result = _tmp3_; + return result; +} + + +static GeeConcurrentListIterator* gee_concurrent_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* head) { + GeeConcurrentListIterator * self = NULL; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_; + g_return_val_if_fail (head != NULL, NULL); + self = (GeeConcurrentListIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + self->priv->_removed = FALSE; + self->priv->_index = -1; + _gee_concurrent_list_node_unref0 (self->priv->_prev); + self->priv->_prev = NULL; + _tmp0_ = head; + _tmp1_ = _gee_concurrent_list_node_ref0 (_tmp0_); + _gee_concurrent_list_node_unref0 (self->priv->_curr); + self->priv->_curr = _tmp1_; + return self; +} + + +static GeeConcurrentListIterator* gee_concurrent_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* head) { + return gee_concurrent_list_iterator_construct (GEE_CONCURRENT_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, head); +} + + +static gboolean gee_concurrent_list_iterator_real_next (GeeIterator* base) { + GeeConcurrentListIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentListNode* _tmp1_ = NULL; + gboolean _tmp2_; + GeeConcurrentListNode* _tmp4_; + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListNode* _old_prev; + gboolean _tmp6_ = FALSE; + gboolean success; + gboolean _tmp7_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp2_ = self->priv->_removed; + if (_tmp2_) { + GeeConcurrentListNode* _tmp3_; + _tmp3_ = self->priv->_prev; + _tmp1_ = _tmp3_; + } else { + _tmp1_ = NULL; + } + _tmp4_ = _tmp1_; + _tmp5_ = _gee_concurrent_list_node_ref0 (_tmp4_); + _old_prev = _tmp5_; + _tmp6_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &self->priv->_prev, &self->priv->_curr, FALSE); + success = _tmp6_; + _tmp7_ = success; + if (_tmp7_) { + gboolean _tmp8_; + gint _tmp10_; + _tmp8_ = self->priv->_removed; + if (_tmp8_) { + GeeConcurrentListNode* _tmp9_; + _tmp9_ = _old_prev; + _old_prev = NULL; + _gee_concurrent_list_node_unref0 (self->priv->_prev); + self->priv->_prev = _tmp9_; + } + self->priv->_removed = FALSE; + _tmp10_ = self->priv->_index; + self->priv->_index = _tmp10_ + 1; + } + result = success; + _gee_concurrent_list_node_unref0 (_old_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_list_iterator_real_has_next (GeeIterator* base) { + GeeConcurrentListIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListNode* _tmp2_; + GeeConcurrentListNode* prev; + GeeConcurrentListNode* _tmp3_; + GeeConcurrentListNode* _tmp4_; + GeeConcurrentListNode* curr; + gboolean _tmp5_ = FALSE; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_prev; + _tmp2_ = _gee_concurrent_list_node_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_curr; + _tmp4_ = _gee_concurrent_list_node_ref0 (_tmp3_); + curr = _tmp4_; + _tmp5_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &prev, &curr, FALSE); + result = _tmp5_; + _gee_concurrent_list_node_unref0 (curr); + _gee_concurrent_list_node_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_list_iterator_real_get (GeeIterator* base) { + GeeConcurrentListIterator * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + GeeConcurrentListNode* _tmp3_; + gpointer _tmp4_ = NULL; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = self->priv->_curr; + _tmp4_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp3_->_data, (gsize) 0, NULL); + result = _tmp4_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static void gee_concurrent_list_iterator_real_set (GeeListIterator* base, gconstpointer item) { + GeeConcurrentListIterator * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + GeeConcurrentListNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = self->priv->_curr; + _tmp4_ = item; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + gee_hazard_pointer_set_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp3_->_data, _tmp5_, (gsize) 0, (gsize) 0); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static void gee_concurrent_list_iterator_real_remove (GeeIterator* base) { + GeeConcurrentListIterator * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + GeeConcurrentListNode* _tmp3_; + GeeConcurrentListNode* _tmp4_; + gint _tmp5_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = self->priv->_curr; + _tmp4_ = self->priv->_prev; + gee_concurrent_list_node_remove (_tmp3_, _tmp4_); + self->priv->_removed = TRUE; + _tmp5_ = self->priv->_index; + self->priv->_index = _tmp5_ - 1; + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gint gee_concurrent_list_iterator_real_index (GeeListIterator* base) { + GeeConcurrentListIterator * self; + gint result = 0; + gboolean _tmp0_; + gboolean _tmp1_; + gint _tmp2_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = self->priv->_index; + result = _tmp2_; + return result; +} + + +static void gee_concurrent_list_iterator_real_add (GeeListIterator* base, gconstpointer item) { + GeeConcurrentListIterator * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_ = FALSE; + gconstpointer _tmp5_; + GeeConcurrentListNode* _tmp6_; + GeeConcurrentListNode* new_node; + GeeConcurrentListNode* _tmp7_; + GeeConcurrentListNode* _tmp8_; + GeeConcurrentListNode* _tmp9_; + GeeConcurrentListNode* _tmp10_; + GeeConcurrentListNode* _tmp11_; + gint _tmp12_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &self->priv->_prev, &self->priv->_curr, FALSE); + if (!_tmp3_) { + GeeConcurrentListNode* _tmp4_; + _tmp4_ = self->priv->_curr; + self->priv->_curr = NULL; + _gee_concurrent_list_node_unref0 (self->priv->_prev); + self->priv->_prev = _tmp4_; + _gee_concurrent_list_node_unref0 (self->priv->_curr); + self->priv->_curr = NULL; + } + _tmp5_ = item; + _tmp6_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_); + new_node = _tmp6_; + _tmp7_ = new_node; + _tmp8_ = self->priv->_prev; + _tmp9_ = _gee_concurrent_list_node_ref0 (_tmp8_); + _tmp10_ = self->priv->_curr; + gee_concurrent_list_node_insert (_tmp7_, _tmp9_, _tmp10_); + _tmp11_ = new_node; + new_node = NULL; + _gee_concurrent_list_node_unref0 (self->priv->_curr); + self->priv->_curr = _tmp11_; + _tmp12_ = self->priv->_index; + self->priv->_index = _tmp12_ + 1; + _gee_concurrent_list_node_unref0 (new_node); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gboolean gee_concurrent_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeConcurrentListIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_ = FALSE; + GeeConcurrentListNode* _tmp2_; + gboolean _tmp4_; + GeeConcurrentListNode* _tmp9_ = NULL; + gboolean _tmp10_; + GeeConcurrentListNode* _tmp12_; + GeeConcurrentListNode* _tmp13_; + GeeConcurrentListNode* _old_prev; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp2_ = self->priv->_prev; + if (_tmp2_ != NULL) { + gboolean _tmp3_; + _tmp3_ = self->priv->_removed; + _tmp1_ = !_tmp3_; + } else { + _tmp1_ = FALSE; + } + _tmp4_ = _tmp1_; + if (_tmp4_) { + GeeForallFunc _tmp5_; + void* _tmp5__target; + GeeConcurrentListNode* _tmp6_; + gpointer _tmp7_ = NULL; + gboolean _tmp8_ = FALSE; + _tmp5_ = f; + _tmp5__target = f_target; + _tmp6_ = self->priv->_curr; + _tmp7_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp6_->_data, (gsize) 0, NULL); + _tmp8_ = _tmp5_ (_tmp7_, _tmp5__target); + if (!_tmp8_) { + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp10_ = self->priv->_removed; + if (_tmp10_) { + GeeConcurrentListNode* _tmp11_; + _tmp11_ = self->priv->_prev; + _tmp9_ = _tmp11_; + } else { + _tmp9_ = NULL; + } + _tmp12_ = _tmp9_; + _tmp13_ = _gee_concurrent_list_node_ref0 (_tmp12_); + _old_prev = _tmp13_; + while (TRUE) { + gboolean _tmp14_ = FALSE; + gboolean _tmp15_; + gint _tmp17_; + GeeForallFunc _tmp18_; + void* _tmp18__target; + GeeConcurrentListNode* _tmp19_; + gpointer _tmp20_ = NULL; + gboolean _tmp21_ = FALSE; + _tmp14_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &self->priv->_prev, &self->priv->_curr, FALSE); + if (!_tmp14_) { + break; + } + _tmp15_ = self->priv->_removed; + if (_tmp15_) { + GeeConcurrentListNode* _tmp16_; + _tmp16_ = _old_prev; + _old_prev = NULL; + _gee_concurrent_list_node_unref0 (self->priv->_prev); + self->priv->_prev = _tmp16_; + } + self->priv->_removed = FALSE; + _tmp17_ = self->priv->_index; + self->priv->_index = _tmp17_ + 1; + _tmp18_ = f; + _tmp18__target = f_target; + _tmp19_ = self->priv->_curr; + _tmp20_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &_tmp19_->_data, (gsize) 0, NULL); + _tmp21_ = _tmp18_ (_tmp20_, _tmp18__target); + if (!_tmp21_) { + result = FALSE; + _gee_concurrent_list_node_unref0 (_old_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + result = TRUE; + _gee_concurrent_list_node_unref0 (_old_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_list_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeConcurrentListIterator* self; + GeeConcurrentListNode* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeConcurrentListNode* _tmp2_; + gboolean _tmp4_; + self = (GeeConcurrentListIterator*) base; + _tmp0_ = self->priv->_curr; + _vala_assert (_tmp0_ != NULL, "_curr != null"); + _tmp2_ = self->priv->_prev; + if (_tmp2_ != NULL) { + gboolean _tmp3_; + _tmp3_ = self->priv->_removed; + _tmp1_ = !_tmp3_; + } else { + _tmp1_ = FALSE; + } + _tmp4_ = _tmp1_; + result = _tmp4_; + return result; +} + + +static gboolean gee_concurrent_list_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeConcurrentListIterator* self; + self = (GeeConcurrentListIterator*) base; + result = FALSE; + return result; +} + + +static void gee_concurrent_list_iterator_class_init (GeeConcurrentListIteratorClass * klass) { + gee_concurrent_list_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentListIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_list_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_list_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_list_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_concurrent_list_iterator_gee_traversable_get_g_type (GeeConcurrentListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_concurrent_list_iterator_gee_traversable_get_g_dup_func (GeeConcurrentListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_concurrent_list_iterator_gee_traversable_get_g_destroy_func (GeeConcurrentListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_concurrent_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_concurrent_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_concurrent_list_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_concurrent_list_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_concurrent_list_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_concurrent_list_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_concurrent_list_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_concurrent_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->next = (gboolean (*)(GeeIterator*)) gee_concurrent_list_iterator_real_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_concurrent_list_iterator_real_has_next; + iface->get = (gpointer (*)(GeeIterator*)) gee_concurrent_list_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_concurrent_list_iterator_real_remove; + iface->get_valid = gee_concurrent_list_iterator_real_get_valid; + iface->get_read_only = gee_concurrent_list_iterator_real_get_read_only; +} + + +static void gee_concurrent_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) { + gee_concurrent_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_concurrent_list_iterator_real_set; + iface->index = (gint (*)(GeeListIterator*)) gee_concurrent_list_iterator_real_index; + iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_concurrent_list_iterator_real_add; +} + + +static void gee_concurrent_list_iterator_instance_init (GeeConcurrentListIterator * self) { + self->priv = GEE_CONCURRENT_LIST_ITERATOR_GET_PRIVATE (self); +} + + +static void gee_concurrent_list_iterator_finalize (GObject* obj) { + GeeConcurrentListIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator); + _gee_concurrent_list_node_unref0 (self->priv->_prev); + _gee_concurrent_list_node_unref0 (self->priv->_curr); + G_OBJECT_CLASS (gee_concurrent_list_iterator_parent_class)->finalize (obj); +} + + +static GType gee_concurrent_list_iterator_get_type (void) { + static volatile gsize gee_concurrent_list_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_list_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentListIterator), 0, (GInstanceInitFunc) gee_concurrent_list_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_concurrent_list_iterator_type_id; + gee_concurrent_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeConcurrentListIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info); + g_once_init_leave (&gee_concurrent_list_iterator_type_id__volatile, gee_concurrent_list_iterator_type_id); + } + return gee_concurrent_list_iterator_type_id__volatile; +} + + +static void _vala_gee_concurrent_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentListIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator); + switch (property_id) { + case GEE_CONCURRENT_LIST_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentListIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator); + switch (property_id) { + case GEE_CONCURRENT_LIST_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_LIST_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeConcurrentListNode* gee_concurrent_list_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data) { + GeeConcurrentListNode* self = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + gpointer data_copy; + gpointer _tmp2_; + gconstpointer* data_ptr; + gconstpointer* _tmp3_; + self = (GeeConcurrentListNode*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + g_atomic_pointer_set ((volatile gpointer *) (&self->_succ), NULL); + g_atomic_pointer_set ((volatile gpointer *) (&self->_backlink), NULL); + _tmp0_ = data; + _tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + data_copy = _tmp1_; + _tmp2_ = data_copy; + data_copy = NULL; + data_ptr = _tmp2_; + _tmp3_ = data_ptr; + data_ptr = NULL; + g_atomic_pointer_set ((volatile gpointer *) (&self->_data), _tmp3_); + _g_destroy_func0 (data_copy); + return self; +} + + +static GeeConcurrentListNode* gee_concurrent_list_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data) { + return gee_concurrent_list_node_construct (GEE_CONCURRENT_LIST_TYPE_NODE, g_type, g_dup_func, g_destroy_func, data); +} + + +static GeeConcurrentListNode* gee_concurrent_list_node_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeConcurrentListNode* self = NULL; + self = (GeeConcurrentListNode*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + g_atomic_pointer_set ((volatile gpointer *) (&self->_succ), NULL); + g_atomic_pointer_set ((volatile gpointer *) (&self->_backlink), NULL); + g_atomic_pointer_set ((volatile gpointer *) (&self->_data), NULL); + return self; +} + + +static GeeConcurrentListNode* gee_concurrent_list_node_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + return gee_concurrent_list_node_construct_head (GEE_CONCURRENT_LIST_TYPE_NODE, g_type, g_dup_func, g_destroy_func); +} + + +static inline gboolean gee_concurrent_list_node_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode** prev, GeeConcurrentListNode** curr, gboolean force) { + gboolean result = FALSE; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_ = NULL; + GeeConcurrentListNode* next; + GeeConcurrentListNode* _tmp22_; + gboolean success; + gboolean _tmp23_ = FALSE; + gboolean _tmp24_; + gboolean _tmp26_; + g_return_val_if_fail (*curr != NULL, FALSE); + _tmp0_ = *curr; + _tmp1_ = gee_concurrent_list_node_get_next (_tmp0_); + next = _tmp1_; + while (TRUE) { + GeeConcurrentListNode* _tmp2_; + GeeConcurrentListNode* _tmp3_; + GeeConcurrentListState _tmp4_ = 0; + GeeConcurrentListState next_state; + GeeConcurrentListState curr_state = 0; + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListState _tmp6_ = 0; + GeeConcurrentListNode* _tmp7_ = NULL; + GeeConcurrentListNode* curr_next; + gboolean _tmp8_ = FALSE; + GeeConcurrentListState _tmp9_; + gboolean _tmp15_; + GeeConcurrentListNode* _tmp16_; + GeeConcurrentListNode* _tmp17_; + GeeConcurrentListNode* _tmp20_; + GeeConcurrentListNode* _tmp21_; + _tmp2_ = next; + if (!(_tmp2_ != NULL)) { + break; + } + _tmp3_ = next; + _tmp4_ = gee_concurrent_list_node_get_state (_tmp3_); + next_state = _tmp4_; + _tmp5_ = *curr; + _tmp7_ = gee_concurrent_list_node_get_succ (_tmp5_, &_tmp6_); + curr_state = _tmp6_; + curr_next = _tmp7_; + _tmp9_ = next_state; + if (_tmp9_ != GEE_CONCURRENT_LIST_STATE_MARKED) { + _tmp8_ = TRUE; + } else { + gboolean _tmp10_ = FALSE; + GeeConcurrentListState _tmp11_; + gboolean _tmp14_; + _tmp11_ = curr_state; + if (_tmp11_ == GEE_CONCURRENT_LIST_STATE_MARKED) { + GeeConcurrentListNode* _tmp12_; + GeeConcurrentListNode* _tmp13_; + _tmp12_ = curr_next; + _tmp13_ = next; + _tmp10_ = _tmp12_ == _tmp13_; + } else { + _tmp10_ = FALSE; + } + _tmp14_ = _tmp10_; + _tmp8_ = _tmp14_; + } + _tmp15_ = _tmp8_; + if (_tmp15_) { + _gee_concurrent_list_node_unref0 (curr_next); + break; + } + _tmp16_ = curr_next; + _tmp17_ = next; + if (_tmp16_ == _tmp17_) { + GeeConcurrentListNode* _tmp18_; + GeeConcurrentListNode* _tmp19_; + _tmp18_ = next; + _tmp19_ = *curr; + gee_concurrent_list_node_help_marked (_tmp18_, _tmp19_); + } + _tmp20_ = curr_next; + _tmp21_ = _gee_concurrent_list_node_ref0 (_tmp20_); + _gee_concurrent_list_node_unref0 (next); + next = _tmp21_; + _gee_concurrent_list_node_unref0 (curr_next); + } + _tmp22_ = next; + success = _tmp22_ != NULL; + _tmp24_ = success; + if (_tmp24_) { + _tmp23_ = TRUE; + } else { + gboolean _tmp25_; + _tmp25_ = force; + _tmp23_ = _tmp25_; + } + _tmp26_ = _tmp23_; + if (_tmp26_) { + GeeConcurrentListNode* _tmp27_; + GeeConcurrentListNode* _tmp28_; + _tmp27_ = *curr; + *curr = NULL; + _gee_concurrent_list_node_unref0 (*prev); + *prev = _tmp27_; + _tmp28_ = next; + next = NULL; + _gee_concurrent_list_node_unref0 (*curr); + *curr = _tmp28_; + } + result = success; + _gee_concurrent_list_node_unref0 (next); + return result; +} + + +static inline gboolean gee_concurrent_list_node_search_for (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode* goal, GeeConcurrentListNode** prev) { + gboolean result = FALSE; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_ = NULL; + GeeConcurrentListNode* curr; + GeeConcurrentListNode* _tmp10_; + GeeConcurrentListNode* _tmp11_; + _tmp0_ = *prev; + _tmp1_ = gee_concurrent_list_node_get_next (_tmp0_); + curr = _tmp1_; + while (TRUE) { + gboolean _tmp2_ = FALSE; + gboolean _tmp3_ = FALSE; + GeeConcurrentListNode* _tmp4_; + GeeConcurrentListNode* _tmp5_; + gboolean _tmp7_; + gboolean _tmp9_; + _tmp4_ = curr; + _tmp5_ = goal; + if (_tmp4_ != _tmp5_) { + _tmp3_ = TRUE; + } else { + GeeConcurrentListNode* _tmp6_; + _tmp6_ = curr; + _tmp3_ = _tmp6_ != NULL; + } + _tmp7_ = _tmp3_; + if (_tmp7_) { + gboolean _tmp8_ = FALSE; + _tmp8_ = gee_concurrent_list_node_proceed (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, prev, &curr, TRUE); + _tmp2_ = _tmp8_; + } else { + _tmp2_ = FALSE; + } + _tmp9_ = _tmp2_; + if (!_tmp9_) { + break; + } + } + _tmp10_ = curr; + _tmp11_ = goal; + result = _tmp10_ == _tmp11_; + _gee_concurrent_list_node_unref0 (curr); + return result; +} + + +static inline gboolean gee_concurrent_list_node_remove (GeeConcurrentListNode* self, GeeConcurrentListNode* prev_node) { + gboolean result = FALSE; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListNode* prev; + gboolean _tmp2_ = FALSE; + gboolean _result_; + GeeConcurrentListNode* _tmp3_; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (prev_node != NULL, FALSE); + _tmp0_ = prev_node; + _tmp1_ = _gee_concurrent_list_node_ref0 (_tmp0_); + prev = _tmp1_; + _tmp2_ = gee_concurrent_list_node_try_flag (self, &prev); + _result_ = _tmp2_; + _tmp3_ = prev; + if (_tmp3_ != NULL) { + GeeConcurrentListNode* _tmp4_; + _tmp4_ = prev; + gee_concurrent_list_node_help_flagged (self, _tmp4_); + } + result = _result_; + _gee_concurrent_list_node_unref0 (prev); + return result; +} + + +static inline void gee_concurrent_list_node_insert (GeeConcurrentListNode* self, GeeConcurrentListNode* prev, GeeConcurrentListNode* next) { + g_return_if_fail (self != NULL); + g_return_if_fail (prev != NULL); + while (TRUE) { + GeeConcurrentListState prev_state = 0; + GeeConcurrentListState _tmp0_ = 0; + GeeConcurrentListNode* _tmp1_ = NULL; + GeeConcurrentListNode* prev_next; + GeeConcurrentListState _tmp2_; + GeeConcurrentListNode* _tmp15_; + _tmp1_ = gee_concurrent_list_node_get_succ (self, &_tmp0_); + prev_state = _tmp0_; + prev_next = _tmp1_; + _tmp2_ = prev_state; + if (_tmp2_ == GEE_CONCURRENT_LIST_STATE_FLAGGED) { + GeeConcurrentListNode* _tmp3_; + GeeConcurrentListNode* _tmp4_; + _tmp3_ = prev_next; + _tmp4_ = prev; + gee_concurrent_list_node_help_flagged (_tmp3_, _tmp4_); + } else { + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListNode* _tmp6_; + GeeConcurrentListNode* _tmp7_; + gboolean _tmp8_ = FALSE; + gboolean _result_; + gboolean _tmp9_; + GeeConcurrentListState _tmp10_ = 0; + GeeConcurrentListNode* _tmp11_ = NULL; + GeeConcurrentListState _tmp12_; + _tmp5_ = next; + gee_concurrent_list_node_set_succ (self, _tmp5_, GEE_CONCURRENT_LIST_STATE_NONE); + _tmp6_ = prev; + _tmp7_ = next; + _tmp8_ = gee_concurrent_list_node_compare_and_exchange (_tmp6_, _tmp7_, GEE_CONCURRENT_LIST_STATE_NONE, self, GEE_CONCURRENT_LIST_STATE_NONE); + _result_ = _tmp8_; + _tmp9_ = _result_; + if (_tmp9_) { + _gee_concurrent_list_node_unref0 (prev_next); + _gee_concurrent_list_node_unref0 (prev); + return; + } + _tmp11_ = gee_concurrent_list_node_get_succ (self, &_tmp10_); + prev_state = _tmp10_; + _gee_concurrent_list_node_unref0 (prev_next); + prev_next = _tmp11_; + _tmp12_ = prev_state; + if (_tmp12_ == GEE_CONCURRENT_LIST_STATE_FLAGGED) { + GeeConcurrentListNode* _tmp13_; + GeeConcurrentListNode* _tmp14_; + _tmp13_ = prev_next; + _tmp14_ = prev; + gee_concurrent_list_node_help_flagged (_tmp13_, _tmp14_); + } + gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &prev); + } + _tmp15_ = next; + gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp15_, &prev); + _gee_concurrent_list_node_unref0 (prev_next); + } + _gee_concurrent_list_node_unref0 (prev); +} + + +static inline void gee_concurrent_list_node_help_flagged (GeeConcurrentListNode* self, GeeConcurrentListNode* prev) { + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListState _tmp1_ = 0; + GeeConcurrentListNode* _tmp2_; + g_return_if_fail (self != NULL); + g_return_if_fail (prev != NULL); + _tmp0_ = prev; + gee_concurrent_list_node_set_backlink (self, _tmp0_); + _tmp1_ = gee_concurrent_list_node_get_state (self); + if (_tmp1_ != GEE_CONCURRENT_LIST_STATE_MARKED) { + gee_concurrent_list_node_try_mark (self); + } + _tmp2_ = prev; + gee_concurrent_list_node_help_marked (self, _tmp2_); +} + + +static inline void gee_concurrent_list_node_try_mark (GeeConcurrentListNode* self) { + g_return_if_fail (self != NULL); + { + gboolean _tmp0_; + _tmp0_ = TRUE; + while (TRUE) { + gboolean _tmp1_; + GeeConcurrentListNode* _tmp3_ = NULL; + GeeConcurrentListNode* next_node; + GeeConcurrentListNode* _tmp4_; + GeeConcurrentListNode* _tmp5_; + gboolean _tmp6_ = FALSE; + gboolean _result_; + gboolean _tmp7_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + GeeConcurrentListState _tmp2_ = 0; + _tmp2_ = gee_concurrent_list_node_get_state (self); + if (!(_tmp2_ != GEE_CONCURRENT_LIST_STATE_MARKED)) { + break; + } + } + _tmp0_ = FALSE; + _tmp3_ = gee_concurrent_list_node_get_next (self); + next_node = _tmp3_; + _tmp4_ = next_node; + _tmp5_ = next_node; + _tmp6_ = gee_concurrent_list_node_compare_and_exchange (self, _tmp4_, GEE_CONCURRENT_LIST_STATE_NONE, _tmp5_, GEE_CONCURRENT_LIST_STATE_MARKED); + _result_ = _tmp6_; + _tmp7_ = _result_; + if (!_tmp7_) { + GeeConcurrentListState state = 0; + GeeConcurrentListState _tmp8_ = 0; + GeeConcurrentListNode* _tmp9_ = NULL; + GeeConcurrentListState _tmp10_; + _tmp9_ = gee_concurrent_list_node_get_succ (self, &_tmp8_); + state = _tmp8_; + _gee_concurrent_list_node_unref0 (next_node); + next_node = _tmp9_; + _tmp10_ = state; + if (_tmp10_ == GEE_CONCURRENT_LIST_STATE_FLAGGED) { + GeeConcurrentListNode* _tmp11_; + _tmp11_ = next_node; + gee_concurrent_list_node_help_flagged (self, _tmp11_); + } + } + _gee_concurrent_list_node_unref0 (next_node); + } + } +} + + +static inline void gee_concurrent_list_node_help_marked (GeeConcurrentListNode* self, GeeConcurrentListNode* prev_node) { + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_ = NULL; + GeeConcurrentListNode* _tmp2_; + g_return_if_fail (self != NULL); + g_return_if_fail (prev_node != NULL); + _tmp0_ = prev_node; + _tmp1_ = gee_concurrent_list_node_get_next (self); + _tmp2_ = _tmp1_; + gee_concurrent_list_node_compare_and_exchange (_tmp0_, self, GEE_CONCURRENT_LIST_STATE_FLAGGED, _tmp2_, GEE_CONCURRENT_LIST_STATE_NONE); + _gee_concurrent_list_node_unref0 (_tmp2_); +} + + +static inline gboolean gee_concurrent_list_node_try_flag (GeeConcurrentListNode* self, GeeConcurrentListNode** prev_node) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + while (TRUE) { + GeeConcurrentListNode* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeConcurrentListNode* _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _result_; + gboolean _tmp4_; + GeeConcurrentListState result_state = 0; + GeeConcurrentListNode* _tmp5_; + GeeConcurrentListState _tmp6_ = 0; + GeeConcurrentListNode* _tmp7_ = NULL; + GeeConcurrentListNode* result_node; + gboolean _tmp8_ = FALSE; + GeeConcurrentListNode* _tmp9_; + gboolean _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp0_ = *prev_node; + _tmp1_ = gee_concurrent_list_node_compare_succ (_tmp0_, self, GEE_CONCURRENT_LIST_STATE_FLAGGED); + if (_tmp1_) { + result = FALSE; + return result; + } + _tmp2_ = *prev_node; + _tmp3_ = gee_concurrent_list_node_compare_and_exchange (_tmp2_, self, GEE_CONCURRENT_LIST_STATE_NONE, self, GEE_CONCURRENT_LIST_STATE_FLAGGED); + _result_ = _tmp3_; + _tmp4_ = _result_; + if (_tmp4_) { + result = TRUE; + return result; + } + _tmp5_ = *prev_node; + _tmp7_ = gee_concurrent_list_node_get_succ (_tmp5_, &_tmp6_); + result_state = _tmp6_; + result_node = _tmp7_; + _tmp9_ = result_node; + if (_tmp9_ == self) { + GeeConcurrentListState _tmp10_; + _tmp10_ = result_state; + _tmp8_ = _tmp10_ == GEE_CONCURRENT_LIST_STATE_FLAGGED; + } else { + _tmp8_ = FALSE; + } + _tmp11_ = _tmp8_; + if (_tmp11_) { + result = FALSE; + _gee_concurrent_list_node_unref0 (result_node); + return result; + } + gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, prev_node); + _tmp12_ = gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, prev_node); + if (!_tmp12_) { + _gee_concurrent_list_node_unref0 (*prev_node); + *prev_node = NULL; + result = FALSE; + _gee_concurrent_list_node_unref0 (result_node); + return result; + } + _gee_concurrent_list_node_unref0 (result_node); + } +} + + +static inline void gee_concurrent_list_node_backtrace (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentListNode** curr) { + while (TRUE) { + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListState _tmp1_ = 0; + GeeConcurrentListNode* _tmp2_; + GeeConcurrentListNode* _tmp3_ = NULL; + _tmp0_ = *curr; + _tmp1_ = gee_concurrent_list_node_get_state (_tmp0_); + if (!(_tmp1_ == GEE_CONCURRENT_LIST_STATE_MARKED)) { + break; + } + _tmp2_ = *curr; + _tmp3_ = gee_concurrent_list_node_get_backlink (_tmp2_); + _gee_concurrent_list_node_unref0 (*curr); + *curr = _tmp3_; + } +} + + +static inline gboolean gee_concurrent_list_node_compare_and_exchange (GeeConcurrentListNode* self, GeeConcurrentListNode* old_node, GeeConcurrentListState old_state, GeeConcurrentListNode* new_node, GeeConcurrentListState new_state) { + gboolean result = FALSE; + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListNode* _tmp2_; + GeeConcurrentListState _tmp3_; + GeeConcurrentListState _tmp4_; + gboolean _tmp5_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = old_node; + _tmp1_ = new_node; + _tmp2_ = _gee_concurrent_list_node_ref0 (_tmp1_); + _tmp3_ = old_state; + _tmp4_ = new_state; + _tmp5_ = gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_succ, _tmp0_, _tmp2_, (gsize) 3, (gsize) _tmp3_, (gsize) _tmp4_); + result = _tmp5_; + return result; +} + + +static inline gboolean gee_concurrent_list_node_compare_succ (GeeConcurrentListNode* self, GeeConcurrentListNode* next, GeeConcurrentListState state) { + gboolean result = FALSE; + void* _tmp0_ = NULL; + gsize cur; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListState _tmp2_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_succ)); + cur = (gsize) _tmp0_; + _tmp1_ = next; + _tmp2_ = state; + result = cur == (((gsize) _tmp1_) | ((gsize) _tmp2_)); + return result; +} + + +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_next (GeeConcurrentListNode* self) { + GeeConcurrentListNode* result = NULL; + GeeConcurrentListNode* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = gee_concurrent_list_node_get_succ (self, NULL); + result = _tmp0_; + return result; +} + + +static inline GeeConcurrentListState gee_concurrent_list_node_get_state (GeeConcurrentListNode* self) { + GeeConcurrentListState result = 0; + void* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, 0); + _tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_succ)); + result = (GeeConcurrentListState) (((gsize) _tmp0_) & 3); + return result; +} + + +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_succ (GeeConcurrentListNode* self, GeeConcurrentListState* state) { + GeeConcurrentListState _vala_state = 0; + GeeConcurrentListNode* result = NULL; + gsize rstate = 0UL; + gsize _tmp0_ = 0UL; + gpointer _tmp1_ = NULL; + GeeConcurrentListNode* succ; + GeeConcurrentListNode* _tmp2_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_succ, (gsize) 3, &_tmp0_); + rstate = _tmp0_; + succ = (GeeConcurrentListNode*) _tmp1_; + _vala_state = (GeeConcurrentListState) rstate; + _tmp2_ = succ; + succ = NULL; + result = _tmp2_; + _gee_concurrent_list_node_unref0 (succ); + if (state) { + *state = _vala_state; + } + return result; +} + + +static inline void gee_concurrent_list_node_set_succ (GeeConcurrentListNode* self, GeeConcurrentListNode* next, GeeConcurrentListState state) { + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_; + GeeConcurrentListState _tmp2_; + g_return_if_fail (self != NULL); + _tmp0_ = next; + _tmp1_ = _gee_concurrent_list_node_ref0 (_tmp0_); + _tmp2_ = state; + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_succ, _tmp1_, (gsize) 3, (gsize) _tmp2_); +} + + +static inline GeeConcurrentListNode* gee_concurrent_list_node_get_backlink (GeeConcurrentListNode* self) { + GeeConcurrentListNode* result = NULL; + gpointer _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_backlink, (gsize) 0, NULL); + result = (GeeConcurrentListNode*) _tmp0_; + return result; +} + + +static inline void gee_concurrent_list_node_set_backlink (GeeConcurrentListNode* self, GeeConcurrentListNode* backlink) { + GeeConcurrentListNode* _tmp0_; + GeeConcurrentListNode* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = backlink; + _tmp1_ = _gee_concurrent_list_node_ref0 (_tmp0_); + gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_backlink, NULL, _tmp1_, (gsize) 0, (gsize) 0, (gsize) 0); +} + + +static void gee_concurrent_list_value_node_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void gee_concurrent_list_value_node_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_concurrent_list_node_unref (value->data[0].v_pointer); + } +} + + +static void gee_concurrent_list_value_node_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_concurrent_list_node_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer gee_concurrent_list_value_node_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* gee_concurrent_list_value_node_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeConcurrentListNode* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_concurrent_list_node_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* gee_concurrent_list_value_node_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeConcurrentListNode** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_concurrent_list_node_ref (value->data[0].v_pointer); + } + return NULL; +} + + +static GParamSpec* gee_concurrent_list_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeConcurrentListParamSpecNode* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_CONCURRENT_LIST_TYPE_NODE), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +static gpointer gee_concurrent_list_value_get_node (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE), NULL); + return value->data[0].v_pointer; +} + + +static void gee_concurrent_list_value_set_node (GValue* value, gpointer v_object) { + GeeConcurrentListNode* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_LIST_TYPE_NODE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_concurrent_list_node_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_list_node_unref (old); + } +} + + +static void gee_concurrent_list_value_take_node (GValue* value, gpointer v_object) { + GeeConcurrentListNode* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_LIST_TYPE_NODE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_list_node_unref (old); + } +} + + +static void gee_concurrent_list_node_class_init (GeeConcurrentListNodeClass * klass) { + gee_concurrent_list_node_parent_class = g_type_class_peek_parent (klass); + GEE_CONCURRENT_LIST_NODE_CLASS (klass)->finalize = gee_concurrent_list_node_finalize; + g_type_class_add_private (klass, sizeof (GeeConcurrentListNodePrivate)); +} + + +static void gee_concurrent_list_node_instance_init (GeeConcurrentListNode * self) { + self->priv = GEE_CONCURRENT_LIST_NODE_GET_PRIVATE (self); + self->ref_count = 1; +} + + +static void gee_concurrent_list_node_finalize (GeeConcurrentListNode* obj) { + GeeConcurrentListNode * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNode); + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_succ, NULL, (gsize) 3, (gsize) 0); + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->_backlink, NULL, (gsize) 0, (gsize) 0); + gee_hazard_pointer_set_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, &self->_data, NULL, (gsize) 0, (gsize) 0); +} + + +static GType gee_concurrent_list_node_get_type (void) { + static volatile gsize gee_concurrent_list_node_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_list_node_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_concurrent_list_value_node_init, gee_concurrent_list_value_node_free_value, gee_concurrent_list_value_node_copy_value, gee_concurrent_list_value_node_peek_pointer, "p", gee_concurrent_list_value_node_collect_value, "p", gee_concurrent_list_value_node_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentListNode), 0, (GInstanceInitFunc) gee_concurrent_list_node_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_concurrent_list_node_type_id; + gee_concurrent_list_node_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeConcurrentListNode", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_concurrent_list_node_type_id__volatile, gee_concurrent_list_node_type_id); + } + return gee_concurrent_list_node_type_id__volatile; +} + + +static gpointer gee_concurrent_list_node_ref (gpointer instance) { + GeeConcurrentListNode* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +static void gee_concurrent_list_node_unref (gpointer instance) { + GeeConcurrentListNode* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_CONCURRENT_LIST_NODE_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +static void gee_concurrent_list_class_init (GeeConcurrentListClass * klass) { + gee_concurrent_list_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentListPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_concurrent_list_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_concurrent_list_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_concurrent_list_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_concurrent_list_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_concurrent_list_real_iterator; + GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_concurrent_list_real_list_iterator; + GEE_ABSTRACT_LIST_CLASS (klass)->get = gee_concurrent_list_real_get; + GEE_ABSTRACT_LIST_CLASS (klass)->set = gee_concurrent_list_real_set; + GEE_ABSTRACT_LIST_CLASS (klass)->index_of = gee_concurrent_list_real_index_of; + GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_concurrent_list_real_insert; + GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_concurrent_list_real_remove_at; + GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_concurrent_list_real_slice; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_concurrent_list_real_get_read_only; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_concurrent_list_real_get_size; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_list_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_list_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_list_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_concurrent_list_instance_init (GeeConcurrentList * self) { + self->priv = GEE_CONCURRENT_LIST_GET_PRIVATE (self); +} + + +static void gee_concurrent_list_finalize (GObject* obj) { + GeeConcurrentList * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList); + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _gee_concurrent_list_node_unref0 (self->priv->_head); + self->priv->_head = NULL; + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, gee_concurrent_list_node_unref, &self->priv->_tail, NULL, (gsize) 0, (gsize) 0); + _gee_hazard_pointer_context_free0 (ctx); + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; + _gee_concurrent_list_node_unref0 (self->priv->_head); + G_OBJECT_CLASS (gee_concurrent_list_parent_class)->finalize (obj); +} + + +/** + * A single-linked list. This implementation is based on + * [[http://www.cse.yorku.ca/~ruppert/papers/lfll.pdf|Mikhail Fomitchev and Eric Ruppert paper ]]. + * + * Many threads are allowed to operate on the same structure as well as modification + * of structure during iteration is allowed. However the change may not be immidiatly + * visible to other threads. + */ +GType gee_concurrent_list_get_type (void) { + static volatile gsize gee_concurrent_list_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_list_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentList), 0, (GInstanceInitFunc) gee_concurrent_list_instance_init, NULL }; + GType gee_concurrent_list_type_id; + gee_concurrent_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_LIST, "GeeConcurrentList", &g_define_type_info, 0); + g_once_init_leave (&gee_concurrent_list_type_id__volatile, gee_concurrent_list_type_id); + } + return gee_concurrent_list_type_id__volatile; +} + + +static void _vala_gee_concurrent_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList); + switch (property_id) { + case GEE_CONCURRENT_LIST_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + case GEE_CONCURRENT_LIST_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_CONCURRENT_LIST_IS_EMPTY: + g_value_set_boolean (value, gee_concurrent_list_get_is_empty (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList); + switch (property_id) { + case GEE_CONCURRENT_LIST_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_LIST_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_LIST_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/concurrentlist.vala b/gee/concurrentlist.vala new file mode 100644 index 0000000..d645b68 --- /dev/null +++ b/gee/concurrentlist.vala @@ -0,0 +1,586 @@ +/* concurrentlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * A single-linked list. This implementation is based on + * [[http://www.cse.yorku.ca/~ruppert/papers/lfll.pdf|Mikhail Fomitchev and Eric Ruppert paper ]]. + * + * Many threads are allowed to operate on the same structure as well as modification + * of structure during iteration is allowed. However the change may not be immidiatly + * visible to other threads. + */ +public class Gee.ConcurrentList : AbstractList { + /** + * The elements' equality testing function. + */ + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { private set; get; } + + /** + * Construct new, empty single linked list + * + * If not provided, the function parameter is requested to the + * {@link Functions} function factory methods. + * + * @param equal_func an optional element equality testing function + */ + public ConcurrentList (owned Gee.EqualDataFunc? equal_func = null) { + if (equal_func == null) + equal_func = Gee.Functions.get_equal_func_for (typeof (G)); + this.equal_func = (owned)equal_func; + _head = new Node.head (); + HazardPointer.set_pointer> (&_tail, _head); + } + + ~ConcurrentList () { + HazardPointer.Context ctx = new HazardPointer.Context (); + _head = null; + HazardPointer.set_pointer?> (&_tail, null); + } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { + return false; + } + } + + /** + * {@inheritDoc} + */ + public override int size { + get { + HazardPointer.Context ctx = new HazardPointer.Context (); + int result = 0; + for (var iter = iterator (); iter.next ();) + result++; + return result; + } + } + + /** + * {@inheritDoc} + */ + public bool is_empty { + get { + return !iterator ().next (); + } + } + + /** + * {@inheritDoc} + */ + public override bool contains (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + for (var iter = iterator (); iter.next ();) + if (equal_func (item, iter.get ())) + return true; + return false; + } + + /** + * {@inheritDoc} + */ + public override bool add (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Node node = new Node (item); + node.insert (get_tail (), null); + return true; + } + + /** + * {@inheritDoc} + */ + public override bool remove (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Gee.Iterator iter = iterator (); + while (iter.next ()) { + if (equal_func (item, iter.get ())) { + iter.remove (); + return true; + } + } + return false; + } + + /** + * {@inheritDoc} + */ + public override void clear () { + HazardPointer.Context ctx = new HazardPointer.Context (); + var iter = iterator (); + while (iter.next ()) + iter.remove (); + HazardPointer.set_pointer (&_tail, _head); + } + + /** + * {@inheritDoc} + */ + public override Gee.Iterator iterator () { + return new Iterator (_head); + } + + /** + * {@inheritDoc} + */ + public override ListIterator list_iterator () { + return new Iterator (_head); + } + + /** + * {@inheritDoc} + */ + public override G? get (int index) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (index >= 0); + for (var iterator = iterator (); iterator.next ();) + if (index-- == 0) + return iterator.get (); + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public override void set (int index, G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (index >= 0); + for (var iterator = list_iterator (); iterator.next ();) { + if (index-- == 0) { + iterator.set (item); + return; + } + } + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public override int index_of (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + int index = 0; + for (var iterator = list_iterator (); iterator.next (); index++) + if (equal_func (item, iterator.get ())) + return index; + return -1; + } + + /** + * {@inheritDoc} + */ + public override void insert (int index, G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (index >= 0); + if (index == 0) { + var prev = _head; + var next = _head.get_next (); + Node new_node = new Node (item); + new_node.insert (prev, next); + } else { + for (var iterator = list_iterator (); iterator.next ();) { + if (--index == 0) { + iterator.add (item); + return; + } + } + assert_not_reached (); + } + } + + /** + * {@inheritDoc} + */ + public override G remove_at (int index) { + HazardPointer.Context ctx = new HazardPointer.Context (); + for (var iterator = list_iterator (); iterator.next ();) { + if (index-- == 0) { + G data = iterator.get (); + iterator.remove (); + return data; + } + } + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public override List? slice (int start, int end) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (0 <= start); + assert (start <= end); + var list = new ConcurrentList (equal_func); + var iterator = iterator (); + int idx = 0; + for (; iterator.next (); idx++) + if (idx >= start && idx < end) + list.add (iterator.get ()); + else if (idx >= end) + break; + assert (idx >= end); + return list; + } + + private inline Node update_tail () { + Node tail = HazardPointer.get_pointer (&_tail); + Node.backtrace (ref tail); + Node.search_for (null, ref tail); + HazardPointer.set_pointer> (&_tail, tail); + return tail; + } + + private inline Node get_tail () { + return update_tail (); + } + + private Node _head; + private Node *_tail; + + private class Iterator : Object, Gee.Traversable, Gee.Iterator, ListIterator { + public Iterator (Node head) { + _removed = false; + _index = -1; + _prev = null; + _curr = head; + } + + public bool next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Node? _old_prev = _removed ? _prev : null; + bool success = Node.proceed (ref _prev, ref _curr); + if (success) { + if (_removed) + _prev = (owned)_old_prev; + _removed = false; + _index++; + } + return success; + } + + public bool has_next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Node? prev = _prev; + Node curr = _curr; + return Node.proceed (ref prev, ref curr); + } + + public new G get () { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); + return HazardPointer.get_pointer (&_curr._data); + } + + public new void set (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); +#if DEBUG + G item_copy = item; + stderr.printf (" Setting data %p to %p\n", _curr, item_copy); + HazardPointer.set_pointer (&_curr._data, (owned)item_copy); +#else + HazardPointer.set_pointer (&_curr._data, item); +#endif + } + + public void remove () { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); + _curr.remove (_prev); + _removed = true; + _index--; + } + + public bool valid { + get { + assert (_curr != null); + return _prev != null && !_removed; + } + } + + public bool read_only { get { return false; } } + + public int index() { + assert (valid); + return _index; + } + + public void add (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); + if (!Node.proceed (ref _prev, ref _curr)) { + _prev = (owned)_curr; + _curr = null; + } + Node new_node = new Node (item); + new_node.insert (_prev, _curr); + _curr = (owned)new_node; + _index++; + } + + public new bool foreach (ForallFunc f) { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (_prev != null && !_removed) { + if (!f (HazardPointer.get_pointer (&_curr._data))) { + return false; + } + } + Node? _old_prev = _removed ? _prev : null; + while (Node.proceed (ref _prev, ref _curr)) { + if (_removed) + _prev = (owned)_old_prev; + _removed = false; + _index++; + if (!f (HazardPointer.get_pointer (&_curr._data))) { + return false; + } + } + return true; + } + + private bool _removed; + private int _index; + private Node? _prev; + private Node _curr; + } + + private class Node { + public inline Node (G data) { + AtomicPointer.set (&_succ, null); + AtomicPointer.set (&_backlink, null); + G data_copy = data; + G *data_ptr = (owned)data_copy; +#if DEBUG + stderr.printf (" Creating node %p with data %p\n", this, data_ptr); +#endif + AtomicPointer.set (&_data, (owned)data_ptr); + } + + public inline Node.head () { + AtomicPointer.set (&_succ, null); + AtomicPointer.set (&_backlink, null); + AtomicPointer.set (&_data, null); +#if DEBUG + stderr.printf (" Creating head node %p\n", this); +#endif + } + + inline ~Node () { + HazardPointer.set_pointer?> (&_succ, null, 3); + HazardPointer.set_pointer?> (&_backlink, null); +#if DEBUG + HazardPointer? old_data = HazardPointer.exchange_hazard_pointer (&_data, null); + stderr.printf (" Freeing node %p (with data %p)\n", this, old_data != null ? old_data.get() : null); + if (old_data != null) { + old_data.release (HazardPointer.get_destroy_notify ()); + } +#else + HazardPointer.set_pointer (&_data, null); +#endif + } + + public static inline bool proceed (ref Node? prev, ref Node curr, bool force = false) { + Node? next = curr.get_next (); + while (next != null) { + State next_state = next.get_state (); + State curr_state; + Node curr_next = curr.get_succ (out curr_state); + if (next_state != State.MARKED || (curr_state == State.MARKED && curr_next == next)) + break; + if (curr_next == next) + next.help_marked (curr); + next = curr_next; + } + bool success = next != null; + if (success || force) { + prev = (owned)curr; + curr = (owned)next; +#if DEBUG + stderr.printf (" Procceed to %p (previous %p)\n", curr, prev); +#endif + } + return success; + } + + public static inline bool search_for (Node? goal, ref Node? prev) { + Node? curr = prev.get_next (); + while ((curr != goal || curr != null) && proceed (ref prev, ref curr, true)); + return curr == goal; + } + + public inline bool remove (Node prev_node) { +#if DEBUG + stderr.printf (" Removing %p (previous %p)\n", this, prev_node); +#endif + Node? prev = prev_node; + bool result = try_flag (ref prev); + if (prev != null) + help_flagged (prev); + return result; + } + + public inline void insert (owned Node prev, Node? next) { +#if DEBUG + stderr.printf (" Inserting %p between %p and %p\n", this, prev, next); +#endif + while (true) { + State prev_state; + Node? prev_next = get_succ (out prev_state); + if (prev_state == State.FLAGGED) { + prev_next.help_flagged (prev); + } else { + set_succ (next, State.NONE); + bool result = prev.compare_and_exchange (next, State.NONE, this, State.NONE); + if (result) + return; + prev_next = get_succ (out prev_state); + if (prev_state == State.FLAGGED) + prev_next.help_flagged (prev); + backtrace (ref prev); + } + search_for (next, ref prev); + } + + } + + public inline void help_flagged (Node prev) { +#if DEBUG + stderr.printf (" Help flagging %p (previous %p)\n", this, prev); +#endif + set_backlink (prev); + if (get_state () != State.MARKED) + try_mark (); + help_marked (prev); + } + + public inline void try_mark () { +#if DEBUG + stderr.printf (" Try flagging %p\n", this); +#endif + do { + Node? next_node = get_next (); + bool result = compare_and_exchange (next_node, State.NONE, next_node, State.MARKED); + if (!result) { + State state; + next_node = get_succ (out state); + if (state == State.FLAGGED) + help_flagged (next_node); + } + } while (get_state () != State.MARKED); + } + + public inline void help_marked (Node prev_node) { +#if DEBUG + stderr.printf (" Help marking %p (previous %p)\n", this, prev_node); +#endif + prev_node.compare_and_exchange (this, State.FLAGGED, get_next (), State.NONE); + } + + public inline bool try_flag (ref Node? prev_node) { +#if DEBUG + stderr.printf (" Try flagging %p (previous %p)\n", this, prev_node); +#endif + while (true) { + if (prev_node.compare_succ (this, State.FLAGGED)) + return false; + bool result = prev_node.compare_and_exchange (this, State.NONE, this, State.FLAGGED); + if (result) + return true; + State result_state; + Node? result_node = prev_node.get_succ (out result_state); + if (result_node == this && result_state == State.FLAGGED) + return false; + backtrace (ref prev_node); + if (!search_for (this, ref prev_node)) { + prev_node = null; + return false; + } + } + } + + public static inline void backtrace (ref Node? curr) { + while (curr.get_state () == State.MARKED) + curr = curr.get_backlink (); + } + + public inline bool compare_and_exchange (Node? old_node, State old_state, Node? new_node, State new_state) { +#if DEBUG + bool b = HazardPointer.compare_and_exchange_pointer (&_succ, old_node, new_node, 3, (size_t)old_state, (size_t)new_state); + stderr.printf (" Setting %p.succ to (%p, %s) if %p.succ is (%p, %s): %s\n", this, new_node, new_state.to_string (), this, old_node, old_state.to_string (), b ? "success" : "failure"); + return b; +#else + return HazardPointer.compare_and_exchange_pointer> (&_succ, old_node, new_node, 3, (size_t)old_state, (size_t)new_state); +#endif + } + + public inline bool compare_succ (Node? next, State state) { + size_t cur = (size_t)AtomicPointer.get (&_succ); + return cur == ((size_t)next | (size_t)state); + } + + public inline Node? get_next () { + return get_succ (null); + } + + public inline State get_state () { + return (State)((size_t)AtomicPointer.get (&_succ) & 3); + } + + public inline Node? get_succ (out State state) { + size_t rstate; + Node? succ = HazardPointer.get_pointer> (&_succ, 3, out rstate); + state = (State)rstate; + return (owned)succ; + } + + public inline void set_succ (Node? next, State state) { +#if DEBUG + stderr.printf (" Setting %p.succ to (%p, %s)\n", this, next, state.to_string ()); +#endif + HazardPointer.set_pointer> (&_succ, next, 3, (size_t)state); + } + + public inline Node? get_backlink () { + return HazardPointer.get_pointer> (&_backlink); + } + + public inline void set_backlink (Node? backlink) { +#if DEBUG + stderr.printf (" Setting backlink from %p to %p\n", this, backlink); +#endif + HazardPointer.compare_and_exchange_pointer?> (&_backlink, null, backlink); + } + + public Node *_succ; + public Node *_backlink; + public G *_data; + } + + private enum State { + NONE = 0, + MARKED = 1, + FLAGGED = 2 + } +} diff --git a/gee/concurrentset.c b/gee/concurrentset.c new file mode 100644 index 0000000..f67f8aa --- /dev/null +++ b/gee/concurrentset.c @@ -0,0 +1,8065 @@ +/* concurrentset.c generated by valac 0.18.0, the Vala compiler + * generated from concurrentset.vala, do not modify */ + +/* concurrentset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_CONCURRENT_SET (gee_concurrent_set_get_type ()) +#define GEE_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet)) +#define GEE_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) +#define GEE_IS_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_SET)) +#define GEE_IS_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_SET)) +#define GEE_CONCURRENT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) + +typedef struct _GeeConcurrentSet GeeConcurrentSet; +typedef struct _GeeConcurrentSetClass GeeConcurrentSetClass; +typedef struct _GeeConcurrentSetPrivate GeeConcurrentSetPrivate; + +#define GEE_CONCURRENT_SET_TYPE_TOWER (gee_concurrent_set_tower_get_type ()) +#define GEE_CONCURRENT_SET_TOWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_SET_TYPE_TOWER, GeeConcurrentSetTower)) +#define GEE_CONCURRENT_SET_TOWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_SET_TYPE_TOWER, GeeConcurrentSetTowerClass)) +#define GEE_CONCURRENT_SET_IS_TOWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_SET_TYPE_TOWER)) +#define GEE_CONCURRENT_SET_IS_TOWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_SET_TYPE_TOWER)) +#define GEE_CONCURRENT_SET_TOWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_SET_TYPE_TOWER, GeeConcurrentSetTowerClass)) + +typedef struct _GeeConcurrentSetTower GeeConcurrentSetTower; +typedef struct _GeeConcurrentSetTowerClass GeeConcurrentSetTowerClass; + +#define GEE_HAZARD_POINTER_TYPE_POLICY (gee_hazard_pointer_policy_get_type ()) +typedef struct _GeeHazardPointerContext GeeHazardPointerContext; +#define _gee_concurrent_set_tower_unref0(var) ((var == NULL) ? NULL : (var = (gee_concurrent_set_tower_unref (var), NULL))) +#define _gee_hazard_pointer_context_free0(var) ((var == NULL) ? NULL : (var = (gee_hazard_pointer_context_free (var), NULL))) + +#define GEE_CONCURRENT_SET_TYPE_RANGE_TYPE (gee_concurrent_set_range_type_get_type ()) + +#define GEE_CONCURRENT_SET_TYPE_STATE (gee_concurrent_set_state_get_type ()) + +#define GEE_CONCURRENT_SET_TYPE_ITERATOR (gee_concurrent_set_iterator_get_type ()) +#define GEE_CONCURRENT_SET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIterator)) +#define GEE_CONCURRENT_SET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIteratorClass)) +#define GEE_CONCURRENT_SET_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_SET_TYPE_ITERATOR)) +#define GEE_CONCURRENT_SET_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_SET_TYPE_ITERATOR)) +#define GEE_CONCURRENT_SET_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIteratorClass)) + +typedef struct _GeeConcurrentSetIterator GeeConcurrentSetIterator; +typedef struct _GeeConcurrentSetIteratorClass GeeConcurrentSetIteratorClass; + +#define GEE_CONCURRENT_SET_TYPE_TOWER_ITER (gee_concurrent_set_tower_iter_get_type ()) +typedef struct _GeeConcurrentSetTowerIter GeeConcurrentSetTowerIter; +typedef struct _GeeConcurrentSetTowerPrivate GeeConcurrentSetTowerPrivate; + +#define GEE_CONCURRENT_SET_TYPE_TOWER_NODE (gee_concurrent_set_tower_node_get_type ()) +typedef struct _GeeConcurrentSetTowerNode GeeConcurrentSetTowerNode; + +#define GEE_CONCURRENT_SET_TYPE_RANGE (gee_concurrent_set_range_get_type ()) +#define GEE_CONCURRENT_SET_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_SET_TYPE_RANGE, GeeConcurrentSetRange)) +#define GEE_CONCURRENT_SET_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_SET_TYPE_RANGE, GeeConcurrentSetRangeClass)) +#define GEE_CONCURRENT_SET_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_SET_TYPE_RANGE)) +#define GEE_CONCURRENT_SET_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_SET_TYPE_RANGE)) +#define GEE_CONCURRENT_SET_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_SET_TYPE_RANGE, GeeConcurrentSetRangeClass)) + +typedef struct _GeeConcurrentSetRange GeeConcurrentSetRange; +typedef struct _GeeConcurrentSetRangeClass GeeConcurrentSetRangeClass; + +#define GEE_CONCURRENT_SET_TYPE_SUB_SET (gee_concurrent_set_sub_set_get_type ()) +#define GEE_CONCURRENT_SET_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSet)) +#define GEE_CONCURRENT_SET_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSetClass)) +#define GEE_CONCURRENT_SET_IS_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_SET_TYPE_SUB_SET)) +#define GEE_CONCURRENT_SET_IS_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_SET_TYPE_SUB_SET)) +#define GEE_CONCURRENT_SET_SUB_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSetClass)) + +typedef struct _GeeConcurrentSetSubSet GeeConcurrentSetSubSet; +typedef struct _GeeConcurrentSetSubSetClass GeeConcurrentSetSubSetClass; +#define _gee_concurrent_set_range_unref0(var) ((var == NULL) ? NULL : (var = (gee_concurrent_set_range_unref (var), NULL))) +typedef struct _GeeConcurrentSetIteratorPrivate GeeConcurrentSetIteratorPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _GeeConcurrentSetSubSetPrivate GeeConcurrentSetSubSetPrivate; + +#define GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR (gee_concurrent_set_sub_iterator_get_type ()) +#define GEE_CONCURRENT_SET_SUB_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIterator)) +#define GEE_CONCURRENT_SET_SUB_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIteratorClass)) +#define GEE_CONCURRENT_SET_IS_SUB_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR)) +#define GEE_CONCURRENT_SET_IS_SUB_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR)) +#define GEE_CONCURRENT_SET_SUB_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIteratorClass)) + +typedef struct _GeeConcurrentSetSubIterator GeeConcurrentSetSubIterator; +typedef struct _GeeConcurrentSetSubIteratorClass GeeConcurrentSetSubIteratorClass; +typedef struct _GeeConcurrentSetRangePrivate GeeConcurrentSetRangePrivate; + +#define GEE_CONCURRENT_SET_RANGE_TYPE_POSITION (gee_concurrent_set_range_position_get_type ()) +typedef struct _GeeConcurrentSetSubIteratorPrivate GeeConcurrentSetSubIteratorPrivate; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) +typedef struct _GeeConcurrentSetParamSpecRange GeeConcurrentSetParamSpecRange; +typedef struct _GeeConcurrentSetParamSpecTower GeeConcurrentSetParamSpecTower; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeAbstractSet { + GeeAbstractCollection parent_instance; + GeeAbstractSetPrivate * priv; +}; + +struct _GeeAbstractSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); + GeeSet* (*get_read_only_view) (GeeAbstractSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeAbstractSortedSet { + GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeConcurrentSet { + GeeAbstractSortedSet parent_instance; + GeeConcurrentSetPrivate * priv; +}; + +struct _GeeConcurrentSetClass { + GeeAbstractSortedSetClass parent_class; +}; + +struct _GeeConcurrentSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + gint _size; + GeeConcurrentSetTower* _head; + GCompareDataFunc _cmp; + gpointer _cmp_target; + GDestroyNotify _cmp_target_destroy_notify; +}; + +typedef enum { + GEE_HAZARD_POINTER_POLICY_DEFAULT, + GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, + GEE_HAZARD_POINTER_POLICY_TRY_FREE, + GEE_HAZARD_POINTER_POLICY_FREE, + GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, + GEE_HAZARD_POINTER_POLICY_RELEASE +} GeeHazardPointerPolicy; + +typedef enum { + GEE_CONCURRENT_SET_RANGE_TYPE_HEAD, + GEE_CONCURRENT_SET_RANGE_TYPE_TAIL, + GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED, + GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY +} GeeConcurrentSetRangeType; + +typedef enum { + GEE_CONCURRENT_SET_STATE_NONE = 0, + GEE_CONCURRENT_SET_STATE_MARKED = 1, + GEE_CONCURRENT_SET_STATE_FLAGGED = 2 +} GeeConcurrentSetState; + +struct _GeeConcurrentSetTowerIter { + GeeConcurrentSetTower* _iter[31]; +}; + +struct _GeeConcurrentSetTowerNode { + GeeConcurrentSetTower* _succ; + GeeConcurrentSetTower* _backlink; +}; + +struct _GeeConcurrentSetTower { + GTypeInstance parent_instance; + volatile int ref_count; + GeeConcurrentSetTowerPrivate * priv; + GeeConcurrentSetTowerNode* _nodes; + gpointer _data; + gint _height; +}; + +struct _GeeConcurrentSetTowerClass { + GTypeClass parent_class; + void (*finalize) (GeeConcurrentSetTower *self); +}; + +struct _GeeConcurrentSetIterator { + GObject parent_instance; + GeeConcurrentSetIteratorPrivate * priv; +}; + +struct _GeeConcurrentSetIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeConcurrentSetIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + gboolean _removed; + GeeConcurrentSet* _set; + GeeConcurrentSetTowerIter _prev; + GeeConcurrentSetTower* _curr; +}; + +struct _GeeConcurrentSetSubSet { + GeeAbstractSortedSet parent_instance; + GeeConcurrentSetSubSetPrivate * priv; +}; + +struct _GeeConcurrentSetSubSetClass { + GeeAbstractSortedSetClass parent_class; +}; + +struct _GeeConcurrentSetSubSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeConcurrentSetRange* _range; +}; + +struct _GeeConcurrentSetRange { + GTypeInstance parent_instance; + volatile int ref_count; + GeeConcurrentSetRangePrivate * priv; + gpointer _start; + gpointer _end; + GeeConcurrentSetRangeType _type; + GeeConcurrentSetTowerIter _bookmark; + GeeConcurrentSet* _set; +}; + +struct _GeeConcurrentSetRangeClass { + GTypeClass parent_class; + void (*finalize) (GeeConcurrentSetRange *self); +}; + +typedef enum { + GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE = -1, + GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE = 0, + GEE_CONCURRENT_SET_RANGE_POSITION_AFTER = 1, + GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY +} GeeConcurrentSetRangePosition; + +struct _GeeConcurrentSetSubIterator { + GObject parent_instance; + GeeConcurrentSetSubIteratorPrivate * priv; +}; + +struct _GeeConcurrentSetSubIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeConcurrentSetSubIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeConcurrentSetRange* _range; + GeeConcurrentSetTowerIter _prev; + GeeConcurrentSetTower* _curr; + gboolean _removed; +}; + +struct _GeeConcurrentSetRangePrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeConcurrentSetParamSpecRange { + GParamSpec parent_instance; +}; + +struct _GeeConcurrentSetTowerPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeConcurrentSetParamSpecTower { + GParamSpec parent_instance; +}; + + +static gpointer gee_concurrent_set_parent_class = NULL; +static GPrivate* gee_concurrent_set_rand; +static GPrivate* gee_concurrent_set_rand = NULL; +static gpointer gee_concurrent_set_iterator_parent_class = NULL; +static GeeTraversableIface* gee_concurrent_set_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_concurrent_set_iterator_gee_iterator_parent_iface = NULL; +static gpointer gee_concurrent_set_sub_set_parent_class = NULL; +static gpointer gee_concurrent_set_sub_iterator_parent_class = NULL; +static GeeTraversableIface* gee_concurrent_set_sub_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_concurrent_set_sub_iterator_gee_iterator_parent_iface = NULL; +static gpointer gee_concurrent_set_range_parent_class = NULL; +static gpointer gee_concurrent_set_tower_parent_class = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_concurrent_set_get_type (void) G_GNUC_CONST; +static gpointer gee_concurrent_set_tower_ref (gpointer instance); +static void gee_concurrent_set_tower_unref (gpointer instance); +static GParamSpec* gee_concurrent_set_param_spec_tower (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; +static void gee_concurrent_set_value_set_tower (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static void gee_concurrent_set_value_take_tower (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static gpointer gee_concurrent_set_value_get_tower (const GValue* value) G_GNUC_UNUSED; +static GType gee_concurrent_set_tower_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +#define GEE_CONCURRENT_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetPrivate)) +enum { + GEE_CONCURRENT_SET_DUMMY_PROPERTY, + GEE_CONCURRENT_SET_G_TYPE, + GEE_CONCURRENT_SET_G_DUP_FUNC, + GEE_CONCURRENT_SET_G_DESTROY_FUNC, + GEE_CONCURRENT_SET_SIZE, + GEE_CONCURRENT_SET_READ_ONLY +}; +GType gee_hazard_pointer_policy_get_type (void) G_GNUC_CONST; +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self); +GType gee_concurrent_set_range_type_get_type (void) G_GNUC_CONST; +static GType gee_concurrent_set_state_get_type (void) G_GNUC_UNUSED; +static GeeConcurrentSetTower* gee_concurrent_set_tower_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static GeeConcurrentSetTower* gee_concurrent_set_tower_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +static void _gee_concurrent_set_rand_lambda37_ (void* ptr); +static void __gee_concurrent_set_rand_lambda37__gdestroy_notify (void* data); +#define GEE_CONCURRENT_SET__MAX_HEIGHT 31 +GeeConcurrentSet* gee_concurrent_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeConcurrentSet* gee_concurrent_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static GeeIterator* gee_concurrent_set_real_iterator (GeeAbstractCollection* base); +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTower* head); +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTower* head); +static GType gee_concurrent_set_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_concurrent_set_real_contains (GeeAbstractCollection* base, gconstpointer key); +static inline gboolean gee_concurrent_set_tower_search (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** next, guint8 to_level, guint8 from_level); +static gboolean gee_concurrent_set_real_add (GeeAbstractCollection* base, gconstpointer key); +static GType gee_concurrent_set_tower_iter_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeConcurrentSetTowerIter* gee_concurrent_set_tower_iter_dup (const GeeConcurrentSetTowerIter* self); +static void gee_concurrent_set_tower_iter_free (GeeConcurrentSetTowerIter* self); +static void gee_concurrent_set_tower_iter_copy (const GeeConcurrentSetTowerIter* self, GeeConcurrentSetTowerIter* dest); +static void gee_concurrent_set_tower_iter_destroy (GeeConcurrentSetTowerIter* self); +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_insert (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 chosen_level); +static gboolean gee_concurrent_set_real_remove (GeeAbstractCollection* base, gconstpointer item); +static inline gboolean gee_concurrent_set_tower_remove_key (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 from_level); +static void gee_concurrent_set_real_clear (GeeAbstractCollection* base); +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_next (GeeConcurrentSetTower* self, guint8 level); +gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpointer item); +static GType gee_concurrent_set_tower_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeConcurrentSetTowerNode* gee_concurrent_set_tower_node_dup (const GeeConcurrentSetTowerNode* self); +static void gee_concurrent_set_tower_node_free (GeeConcurrentSetTowerNode* self); +static gpointer gee_concurrent_set_real_first (GeeAbstractSortedSet* base); +static inline gboolean gee_concurrent_set_tower_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** arg_prev, GeeConcurrentSetTower** arg_curr, guint8 level, gboolean force); +static gpointer gee_concurrent_set_real_last (GeeAbstractSortedSet* base); +static GeeIterator* gee_concurrent_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer element); +static inline gboolean gee_concurrent_set_tower_search_from_bookmark (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTowerIter* next, guint8 to_level, guint8 from_level); +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_new_point_at (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr); +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_construct_point_at (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr); +static gpointer gee_concurrent_set_real_lower (GeeAbstractSortedSet* base, gconstpointer element); +static gpointer gee_concurrent_set_real_higher (GeeAbstractSortedSet* base, gconstpointer element); +static gpointer gee_concurrent_set_real_floor (GeeAbstractSortedSet* base, gconstpointer element); +static gpointer gee_concurrent_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer element); +static GeeSortedSet* gee_concurrent_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); +static GeeConcurrentSetRange* gee_concurrent_set_range_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer end); +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer end); +static gpointer gee_concurrent_set_range_ref (gpointer instance); +static void gee_concurrent_set_range_unref (gpointer instance); +static GParamSpec* gee_concurrent_set_param_spec_range (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; +static void gee_concurrent_set_value_set_range (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static void gee_concurrent_set_value_take_range (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static gpointer gee_concurrent_set_value_get_range (const GValue* value) G_GNUC_UNUSED; +static GType gee_concurrent_set_range_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeConcurrentSetSubSet* gee_concurrent_set_sub_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range); +static GeeConcurrentSetSubSet* gee_concurrent_set_sub_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range); +static GType gee_concurrent_set_sub_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeSortedSet* gee_concurrent_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); +static GeeConcurrentSetRange* gee_concurrent_set_range_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start); +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start); +static GeeSortedSet* gee_concurrent_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer from, gconstpointer to); +static GeeConcurrentSetRange* gee_concurrent_set_range_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start, gconstpointer end); +static GeeConcurrentSetRange* gee_concurrent_set_range_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start, gconstpointer end); +static gconstpointer gee_concurrent_set_max (GeeConcurrentSet* self, gconstpointer a, gconstpointer b, gboolean* changed); +static gconstpointer gee_concurrent_set_min (GeeConcurrentSet* self, gconstpointer a, gconstpointer b, gboolean* changed); +#define GEE_CONCURRENT_SET_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIteratorPrivate)) +enum { + GEE_CONCURRENT_SET_ITERATOR_DUMMY_PROPERTY, + GEE_CONCURRENT_SET_ITERATOR_G_TYPE, + GEE_CONCURRENT_SET_ITERATOR_G_DUP_FUNC, + GEE_CONCURRENT_SET_ITERATOR_G_DESTROY_FUNC, + GEE_CONCURRENT_SET_ITERATOR_VALID, + GEE_CONCURRENT_SET_ITERATOR_READ_ONLY +}; +static gboolean gee_concurrent_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static inline gint gee_concurrent_set_tower_get_height (GeeConcurrentSetTower* self); +static gboolean gee_concurrent_set_iterator_real_next (GeeIterator* base); +static gboolean gee_concurrent_set_iterator_real_has_next (GeeIterator* base); +static gpointer gee_concurrent_set_iterator_real_get (GeeIterator* base); +gboolean gee_iterator_get_valid (GeeIterator* self); +static void gee_concurrent_set_iterator_real_remove (GeeIterator* base); +static inline gboolean gee_concurrent_set_tower_remove (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr); +static void gee_concurrent_set_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +static void _vala_gee_concurrent_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_CONCURRENT_SET_SUB_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSetPrivate)) +enum { + GEE_CONCURRENT_SET_SUB_SET_DUMMY_PROPERTY, + GEE_CONCURRENT_SET_SUB_SET_G_TYPE, + GEE_CONCURRENT_SET_SUB_SET_G_DUP_FUNC, + GEE_CONCURRENT_SET_SUB_SET_G_DESTROY_FUNC, + GEE_CONCURRENT_SET_SUB_SET_SIZE, + GEE_CONCURRENT_SET_SUB_SET_IS_EMPTY, + GEE_CONCURRENT_SET_SUB_SET_READ_ONLY +}; +static GeeIterator* gee_concurrent_set_sub_set_real_iterator (GeeAbstractCollection* base); +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range); +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range); +static GType gee_concurrent_set_sub_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_concurrent_set_sub_set_real_contains (GeeAbstractCollection* base, gconstpointer item); +static gboolean gee_concurrent_set_range_inside (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, gconstpointer val); +static void gee_concurrent_set_range_improve_bookmark (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower** out_curr, GeeConcurrentSetTowerIter* prev); +static gboolean gee_concurrent_set_sub_set_real_add (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_concurrent_set_sub_set_real_remove (GeeAbstractCollection* base, gconstpointer key); +static void gee_concurrent_set_sub_set_real_clear (GeeAbstractCollection* base); +static gpointer gee_concurrent_set_sub_set_real_first (GeeAbstractSortedSet* base); +static gpointer gee_concurrent_set_sub_set_real_last (GeeAbstractSortedSet* base); +static gboolean gee_concurrent_set_range_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** curr, guint8 level); +static GeeIterator* gee_concurrent_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer element); +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_new_point_at (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr); +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_construct_point_at (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr); +static gpointer gee_concurrent_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer element); +static gint gee_concurrent_set_range_cmp (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, gconstpointer val); +static GType gee_concurrent_set_range_position_get_type (void) G_GNUC_UNUSED; +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +static gpointer gee_concurrent_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer element); +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +static gpointer gee_concurrent_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer element); +static inline gboolean gee_concurrent_set_tower_is_head (GeeConcurrentSetTower* self); +static gpointer gee_concurrent_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer element); +static GeeSortedSet* gee_concurrent_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); +static GeeConcurrentSetRange* gee_concurrent_set_range_cut_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer end); +static GeeSortedSet* gee_concurrent_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); +static GeeConcurrentSetRange* gee_concurrent_set_range_cut_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer start); +static GeeSortedSet* gee_concurrent_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer from, gconstpointer to); +static GeeConcurrentSetRange* gee_concurrent_set_range_cut (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer start, gconstpointer end); +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +static gboolean gee_concurrent_set_sub_set_get_is_empty (GeeConcurrentSetSubSet* self); +static void gee_concurrent_set_sub_set_finalize (GObject* obj); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); +static void _vala_gee_concurrent_set_sub_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_set_sub_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_CONCURRENT_SET_SUB_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIteratorPrivate)) +enum { + GEE_CONCURRENT_SET_SUB_ITERATOR_DUMMY_PROPERTY, + GEE_CONCURRENT_SET_SUB_ITERATOR_G_TYPE, + GEE_CONCURRENT_SET_SUB_ITERATOR_G_DUP_FUNC, + GEE_CONCURRENT_SET_SUB_ITERATOR_G_DESTROY_FUNC, + GEE_CONCURRENT_SET_SUB_ITERATOR_VALID, + GEE_CONCURRENT_SET_SUB_ITERATOR_READ_ONLY +}; +static gboolean gee_concurrent_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static gboolean gee_concurrent_set_sub_iterator_begin (GeeConcurrentSetSubIterator* self); +static gboolean gee_concurrent_set_sub_iterator_real_next (GeeIterator* base); +static gboolean gee_concurrent_set_sub_iterator_real_has_next (GeeIterator* base); +static gboolean gee_concurrent_set_range_beyond (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower* tw); +static gpointer gee_concurrent_set_sub_iterator_real_get (GeeIterator* base); +static void gee_concurrent_set_sub_iterator_real_remove (GeeIterator* base); +static void gee_concurrent_set_sub_iterator_finalize (GObject* obj); +static void _vala_gee_concurrent_set_sub_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_set_sub_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_CONCURRENT_SET_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_SET_TYPE_RANGE, GeeConcurrentSetRangePrivate)) +enum { + GEE_CONCURRENT_SET_RANGE_DUMMY_PROPERTY +}; +static GeeConcurrentSetRange* gee_concurrent_set_range_new_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset); +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_empty (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset); +static void gee_concurrent_set_range_copy_bookmark (GeeConcurrentSetRange* self, GeeConcurrentSetRange* range); +static inline void gee_concurrent_set_tower_backtrace (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetTower** curr, guint8 level); +static inline gint gee_concurrent_set_tower_compare (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower* a, GeeConcurrentSetTower* b); +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask); +static inline gint gee_concurrent_set_tower_compare_data (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower* a, gconstpointer b); +static void gee_concurrent_set_range_finalize (GeeConcurrentSetRange* obj); +#define GEE_CONCURRENT_SET_TOWER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_CONCURRENT_SET_TYPE_TOWER, GeeConcurrentSetTowerPrivate)) +enum { + GEE_CONCURRENT_SET_TOWER_DUMMY_PROPERTY +}; +static inline void gee_concurrent_set_tower_set_succ (GeeConcurrentSetTower* self, GeeConcurrentSetTower* next, GeeConcurrentSetState state, guint8 level); +static inline void gee_concurrent_set_tower_set_backlink (GeeConcurrentSetTower* self, GeeConcurrentSetTower* backlink, guint8 level); +static GeeConcurrentSetTower* gee_concurrent_set_tower_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, guint8 height); +static GeeConcurrentSetTower* gee_concurrent_set_tower_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, guint8 height); +static inline gboolean gee_concurrent_set_tower_search_helper (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** next, guint8 level); +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_insert_helper (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 chosen_level, guint8 level); +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_succ (GeeConcurrentSetTower* self, GeeConcurrentSetState* state, guint8 level); +static inline void gee_concurrent_set_tower_help_flagged (GeeConcurrentSetTower* self, GeeConcurrentSetTower* prev, guint8 level); +static inline gboolean gee_concurrent_set_tower_compare_and_exchange (GeeConcurrentSetTower* self, GeeConcurrentSetTower* old_tower, GeeConcurrentSetState old_state, GeeConcurrentSetTower* new_tower, GeeConcurrentSetState new_state, guint8 level); +static inline GeeConcurrentSetState gee_concurrent_set_tower_get_state (GeeConcurrentSetTower* self, guint8 level); +static inline gboolean gee_concurrent_set_tower_remove_level (GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** prev, GeeConcurrentSetTower* curr, guint8 level); +static inline gboolean gee_concurrent_set_tower_try_flag (GeeConcurrentSetTower* self, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** prev_tower, gboolean* status, guint8 level); +static inline void gee_concurrent_set_tower_help_marked (GeeConcurrentSetTower* self, GeeConcurrentSetTower* prev_tower, guint8 level); +static inline void gee_concurrent_set_tower_try_mark (GeeConcurrentSetTower* self, guint8 level); +static inline gboolean gee_concurrent_set_tower_compare_succ (GeeConcurrentSetTower* self, GeeConcurrentSetTower* next, GeeConcurrentSetState state, guint8 level); +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_backlink (GeeConcurrentSetTower* self, guint8 level); +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask); +static void gee_concurrent_set_tower_finalize (GeeConcurrentSetTower* obj); +static void _vala_array_copy2 (GeeConcurrentSetTower** self, GeeConcurrentSetTower** dest); +static void gee_concurrent_set_finalize (GObject* obj); +static void _vala_gee_concurrent_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_concurrent_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +GType gee_concurrent_set_range_type_get_type (void) { + static volatile gsize gee_concurrent_set_range_type_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_range_type_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_CONCURRENT_SET_RANGE_TYPE_HEAD, "GEE_CONCURRENT_SET_RANGE_TYPE_HEAD", "head"}, {GEE_CONCURRENT_SET_RANGE_TYPE_TAIL, "GEE_CONCURRENT_SET_RANGE_TYPE_TAIL", "tail"}, {GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED, "GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED", "bounded"}, {GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY, "GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY", "empty"}, {0, NULL, NULL}}; + GType gee_concurrent_set_range_type_type_id; + gee_concurrent_set_range_type_type_id = g_enum_register_static ("GeeConcurrentSetRangeType", values); + g_once_init_leave (&gee_concurrent_set_range_type_type_id__volatile, gee_concurrent_set_range_type_type_id); + } + return gee_concurrent_set_range_type_type_id__volatile; +} + + +static GType gee_concurrent_set_state_get_type (void) { + static volatile gsize gee_concurrent_set_state_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_state_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_CONCURRENT_SET_STATE_NONE, "GEE_CONCURRENT_SET_STATE_NONE", "none"}, {GEE_CONCURRENT_SET_STATE_MARKED, "GEE_CONCURRENT_SET_STATE_MARKED", "marked"}, {GEE_CONCURRENT_SET_STATE_FLAGGED, "GEE_CONCURRENT_SET_STATE_FLAGGED", "flagged"}, {0, NULL, NULL}}; + GType gee_concurrent_set_state_type_id; + gee_concurrent_set_state_type_id = g_enum_register_static ("GeeConcurrentSetState", values); + g_once_init_leave (&gee_concurrent_set_state_type_id__volatile, gee_concurrent_set_state_type_id); + } + return gee_concurrent_set_state_type_id__volatile; +} + + +static void _gee_concurrent_set_rand_lambda37_ (void* ptr) { + void* _tmp0_; + GRand* rnd; + GRand* _tmp1_; + _tmp0_ = ptr; + rnd = (GRand*) _tmp0_; + _tmp1_ = rnd; + g_rand_free (_tmp1_); +} + + +static void __gee_concurrent_set_rand_lambda37__gdestroy_notify (void* data) { + _gee_concurrent_set_rand_lambda37_ (data); +} + + +GeeConcurrentSet* gee_concurrent_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + GeeConcurrentSet * self = NULL; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + self = (GeeConcurrentSet*) gee_abstract_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = compare_func; + _tmp0__target = compare_func_target; + if (_tmp0_ == NULL) { + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GCompareDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_compare_func_for (g_type, &_tmp1_, &_tmp2_); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; + compare_func = _tmp3_; + compare_func_target = _tmp1_; + compare_func_target_destroy_notify = _tmp2_; + } + _tmp4_ = compare_func; + _tmp4__target = compare_func_target; + (self->priv->_cmp_target_destroy_notify == NULL) ? NULL : (self->priv->_cmp_target_destroy_notify (self->priv->_cmp_target), NULL); + self->priv->_cmp = NULL; + self->priv->_cmp_target = NULL; + self->priv->_cmp_target_destroy_notify = NULL; + self->priv->_cmp = _tmp4_; + self->priv->_cmp_target = _tmp4__target; + self->priv->_cmp_target_destroy_notify = NULL; + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; + return self; +} + + +GeeConcurrentSet* gee_concurrent_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + return gee_concurrent_set_construct (GEE_TYPE_CONCURRENT_SET, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify); +} + + +static GeeIterator* gee_concurrent_set_real_iterator (GeeAbstractCollection* base) { + GeeConcurrentSet * self; + GeeIterator* result = NULL; + GeeConcurrentSetTower* _tmp0_; + GeeConcurrentSetIterator* _tmp1_; + self = (GeeConcurrentSet*) base; + _tmp0_ = self->priv->_head; + _tmp1_ = gee_concurrent_set_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, _tmp0_); + result = (GeeIterator*) _tmp1_; + return result; +} + + +static gpointer _gee_concurrent_set_tower_ref0 (gpointer self) { + return self ? gee_concurrent_set_tower_ref (self) : NULL; +} + + +static gboolean gee_concurrent_set_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeConcurrentSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* prev; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + gboolean _tmp5_ = FALSE; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = key; + _tmp5_ = gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, _tmp4_, &prev, NULL, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + result = _tmp5_; + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeConcurrentSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GPrivate* _tmp1_; + void* _tmp2_ = NULL; + GRand* rnd; + GRand* _tmp3_; + GRand* _tmp7_; + gint32 _tmp8_; + gint32 _tmp9_ = 0; + guint32 rand_int; + guint32 _tmp10_; + gint _tmp11_ = 0; + guint8 height; + GeeConcurrentSetTowerIter prev = {0}; + guint8 _tmp12_; + GeeConcurrentSetTower* _tmp13_; + GeeConcurrentSetTower* _tmp14_; + GeeConcurrentSetTower* _tmp15_; + GCompareDataFunc _tmp16_; + void* _tmp16__target; + gconstpointer _tmp17_; + guint8 _tmp18_; + guint8 _tmp19_; + gboolean _tmp20_ = FALSE; + GCompareDataFunc _tmp32_; + void* _tmp32__target; + gconstpointer _tmp33_; + guint8 _tmp34_; + GeeConcurrentSetTower* _tmp35_ = NULL; + GeeConcurrentSetTower* _result_; + GeeConcurrentSetTower* _tmp36_; + GeeConcurrentSetTower* _tmp37_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_concurrent_set_rand; + _tmp2_ = g_private_get (_tmp1_); + rnd = _tmp2_; + _tmp3_ = rnd; + if (_tmp3_ == NULL) { + GPrivate* _tmp4_; + GRand* _tmp5_; + GRand* _tmp6_; + _tmp4_ = gee_concurrent_set_rand; + _tmp5_ = g_rand_new (); + rnd = _tmp5_; + _tmp6_ = rnd; + g_private_set (_tmp4_, _tmp6_); + } + _tmp7_ = rnd; + _tmp8_ = G_MAXINT32; + _tmp9_ = g_rand_int_range (_tmp7_, (gint32) 0, _tmp8_); + rand_int = (guint32) _tmp9_; + _tmp10_ = rand_int; + _tmp11_ = g_bit_nth_lsf ((gulong) (~_tmp10_), -1); + height = (guint8) (1 + ((guint8) _tmp11_)); + memset (&prev, 0, sizeof (GeeConcurrentSetTowerIter)); + _tmp12_ = height; + _tmp13_ = self->priv->_head; + _tmp14_ = _gee_concurrent_set_tower_ref0 (_tmp13_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp12_ - 1]); + prev._iter[_tmp12_ - 1] = _tmp14_; + _tmp15_ = prev._iter[_tmp12_ - 1]; + _tmp16_ = self->priv->_cmp; + _tmp16__target = self->priv->_cmp_target; + _tmp17_ = key; + _tmp18_ = height; + _tmp19_ = height; + _tmp20_ = gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp16_, _tmp16__target, _tmp17_, &prev._iter[_tmp18_ - 1], NULL, (guint8) (_tmp19_ - 1), (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + if (_tmp20_) { + result = FALSE; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + { + guint8 _tmp21_; + gint i; + _tmp21_ = height; + i = _tmp21_ - 2; + { + gboolean _tmp22_; + _tmp22_ = TRUE; + while (TRUE) { + gboolean _tmp23_; + gint _tmp25_; + gint _tmp26_; + GeeConcurrentSetTowerIter _tmp27_; + guint8 _tmp28_; + GeeConcurrentSetTower* _tmp29_; + GeeConcurrentSetTower* _tmp30_; + GeeConcurrentSetTower* _tmp31_; + _tmp23_ = _tmp22_; + if (!_tmp23_) { + gint _tmp24_; + _tmp24_ = i; + i = _tmp24_ - 1; + } + _tmp22_ = FALSE; + _tmp25_ = i; + if (!(_tmp25_ >= 0)) { + break; + } + _tmp26_ = i; + _tmp27_ = prev; + _tmp28_ = height; + _tmp29_ = _tmp27_._iter[_tmp28_ - 1]; + _tmp30_ = _gee_concurrent_set_tower_ref0 (_tmp29_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp26_]); + prev._iter[_tmp26_] = _tmp30_; + _tmp31_ = prev._iter[_tmp26_]; + } + } + } + _tmp32_ = self->priv->_cmp; + _tmp32__target = self->priv->_cmp_target; + _tmp33_ = key; + _tmp34_ = height; + _tmp35_ = gee_concurrent_set_tower_insert (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp32_, _tmp32__target, &prev, _tmp33_, (guint8) (_tmp34_ - 1)); + _result_ = _tmp35_; + _tmp36_ = _result_; + if (_tmp36_ != NULL) { + g_atomic_int_inc ((volatile gint *) (&self->priv->_size)); + } + _tmp37_ = _result_; + result = _tmp37_ != NULL; + _gee_concurrent_set_tower_unref0 (_result_); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_real_remove (GeeAbstractCollection* base, gconstpointer item) { + GeeConcurrentSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter prev = {0}; + GCompareDataFunc _tmp9_; + void* _tmp9__target; + gconstpointer _tmp10_; + gboolean _tmp11_ = FALSE; + gboolean _result_; + gboolean _tmp12_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + memset (&prev, 0, sizeof (GeeConcurrentSetTowerIter)); + { + gint i; + i = 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gint _tmp4_; + gint _tmp5_; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + gint _tmp3_; + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + if (!(_tmp4_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp5_ = i; + _tmp6_ = self->priv->_head; + _tmp7_ = _gee_concurrent_set_tower_ref0 (_tmp6_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp5_]); + prev._iter[_tmp5_] = _tmp7_; + _tmp8_ = prev._iter[_tmp5_]; + } + } + } + _tmp9_ = self->priv->_cmp; + _tmp9__target = self->priv->_cmp_target; + _tmp10_ = item; + _tmp11_ = gee_concurrent_set_tower_remove_key (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, _tmp9__target, &prev, _tmp10_, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _result_ = _tmp11_; + _tmp12_ = _result_; + if (_tmp12_) { + g_atomic_int_dec_and_test ((volatile gint *) (&self->priv->_size)); + } + result = _result_; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static void gee_concurrent_set_real_clear (GeeAbstractCollection* base) { + GeeConcurrentSet * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* first = NULL; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + while (TRUE) { + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetTower* _tmp4_; + gconstpointer _tmp5_; + _tmp1_ = self->priv->_head; + _tmp2_ = gee_concurrent_set_tower_get_next (_tmp1_, (guint8) 0); + _gee_concurrent_set_tower_unref0 (first); + first = _tmp2_; + _tmp3_ = first; + if (!(_tmp3_ != NULL)) { + break; + } + _tmp4_ = first; + _tmp5_ = _tmp4_->_data; + gee_abstract_collection_remove ((GeeAbstractCollection*) self, _tmp5_); + } + _gee_concurrent_set_tower_unref0 (first); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_real_first (GeeAbstractSortedSet* base) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* curr; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gboolean _tmp4_ = FALSE; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + prev = NULL; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + curr = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, &prev, &curr, (guint8) 0, FALSE); + if (_tmp4_) { + GeeConcurrentSetTower* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; + _tmp5_ = curr; + _tmp6_ = _tmp5_->_data; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + result = _tmp7_; + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + result = NULL; + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_real_last (GeeAbstractSortedSet* base) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* curr; + gboolean found; + gboolean _tmp9_; + GeeConcurrentSetTower* _tmp10_; + gconstpointer _tmp11_; + gpointer _tmp12_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + prev = NULL; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + curr = _tmp2_; + found = FALSE; + { + gint i; + i = GEE_CONCURRENT_SET__MAX_HEIGHT; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + gint _tmp6_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = i; + i = _tmp5_ - 1; + } + _tmp3_ = FALSE; + _tmp6_ = i; + if (!(_tmp6_ >= 0)) { + break; + } + while (TRUE) { + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gboolean _tmp8_ = FALSE; + _tmp7_ = self->priv->_cmp; + _tmp7__target = self->priv->_cmp_target; + _tmp8_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp7__target, &prev, &curr, (guint8) 0, FALSE); + if (!_tmp8_) { + break; + } + found = TRUE; + } + } + } + } + _tmp9_ = found; + if (!_tmp9_) { + result = NULL; + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp10_ = curr; + _tmp11_ = _tmp10_->_data; + _tmp12_ = ((_tmp11_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_); + result = _tmp12_; + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeIterator* gee_concurrent_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSet * self; + GeeIterator* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetTowerIter curr = {0}; + GCompareDataFunc _tmp9_; + void* _tmp9__target; + gconstpointer _tmp10_; + GeeConcurrentSetTowerIter _tmp11_ = {0}; + gboolean _tmp12_ = FALSE; + GeeConcurrentSetTowerIter _tmp13_; + GeeConcurrentSetTower* _tmp14_; + GeeConcurrentSetIterator* _tmp15_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + memset (&prev, 0, sizeof (GeeConcurrentSetTowerIter)); + { + gint i; + i = 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gint _tmp4_; + gint _tmp5_; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + gint _tmp3_; + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + if (!(_tmp4_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp5_ = i; + _tmp6_ = self->priv->_head; + _tmp7_ = _gee_concurrent_set_tower_ref0 (_tmp6_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp5_]); + prev._iter[_tmp5_] = _tmp7_; + _tmp8_ = prev._iter[_tmp5_]; + } + } + } + _tmp9_ = self->priv->_cmp; + _tmp9__target = self->priv->_cmp_target; + _tmp10_ = element; + _tmp12_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, _tmp9__target, _tmp10_, &prev, &_tmp11_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + gee_concurrent_set_tower_iter_destroy (&curr); + curr = _tmp11_; + if (!_tmp12_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp13_ = curr; + _tmp14_ = _tmp13_._iter[0]; + _tmp15_ = gee_concurrent_set_iterator_new_point_at (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, &prev, _tmp14_); + result = (GeeIterator*) _tmp15_; + gee_concurrent_set_tower_iter_destroy (&curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_real_lower (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* prev; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = element; + gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, _tmp4_, &prev, NULL, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _tmp5_ = prev; + _tmp6_ = self->priv->_head; + if (_tmp5_ == _tmp6_) { + result = NULL; + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp7_ = prev; + _tmp8_ = _tmp7_->_data; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + result = _tmp9_; + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_real_higher (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* next = NULL; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeConcurrentSetTower* _tmp5_ = NULL; + gboolean _tmp6_ = FALSE; + GeeConcurrentSetTower* _tmp9_; + GeeConcurrentSetTower* _tmp10_; + gconstpointer _tmp11_; + gpointer _tmp12_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = element; + _tmp6_ = gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, _tmp4_, &prev, &_tmp5_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp5_; + if (_tmp6_) { + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gboolean _tmp8_ = FALSE; + _tmp7_ = self->priv->_cmp; + _tmp7__target = self->priv->_cmp_target; + _tmp8_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp7__target, &prev, &next, (guint8) 0, FALSE); + if (!_tmp8_) { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp9_ = next; + if (_tmp9_ == NULL) { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp10_ = next; + _tmp11_ = _tmp10_->_data; + _tmp12_ = ((_tmp11_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_); + result = _tmp12_; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_real_floor (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* next = NULL; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeConcurrentSetTower* _tmp5_ = NULL; + gboolean _tmp6_ = FALSE; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = element; + _tmp6_ = gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, _tmp4_, &prev, &_tmp5_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp5_; + if (_tmp6_) { + GeeConcurrentSetTower* _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_; + _tmp7_ = next; + _tmp8_ = _tmp7_->_data; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + result = _tmp9_; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + GeeConcurrentSetTower* _tmp10_; + GeeConcurrentSetTower* _tmp11_; + _tmp10_ = prev; + _tmp11_ = self->priv->_head; + if (_tmp10_ != _tmp11_) { + GeeConcurrentSetTower* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + _tmp12_ = prev; + _tmp13_ = _tmp12_->_data; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + result = _tmp14_; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* next = NULL; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeConcurrentSetTower* _tmp5_ = NULL; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_head; + _tmp2_ = _gee_concurrent_set_tower_ref0 (_tmp1_); + prev = _tmp2_; + _tmp3_ = self->priv->_cmp; + _tmp3__target = self->priv->_cmp_target; + _tmp4_ = element; + gee_concurrent_set_tower_search (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, _tmp3__target, _tmp4_, &prev, &_tmp5_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp5_; + _tmp6_ = next; + if (_tmp6_ == NULL) { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp7_ = next; + _tmp8_ = _tmp7_->_data; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + result = _tmp9_; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeSortedSet* gee_concurrent_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { + GeeConcurrentSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gconstpointer _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetSubSet* _tmp4_; + GeeSortedSet* _tmp5_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = before; + _tmp2_ = gee_concurrent_set_range_new_head (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_); + _tmp5_ = (GeeSortedSet*) _tmp4_; + _gee_concurrent_set_range_unref0 (_tmp3_); + result = _tmp5_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeSortedSet* gee_concurrent_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { + GeeConcurrentSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gconstpointer _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetSubSet* _tmp4_; + GeeSortedSet* _tmp5_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = after; + _tmp2_ = gee_concurrent_set_range_new_tail (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_); + _tmp5_ = (GeeSortedSet*) _tmp4_; + _gee_concurrent_set_range_unref0 (_tmp3_); + result = _tmp5_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeSortedSet* gee_concurrent_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer from, gconstpointer to) { + GeeConcurrentSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetSubSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeConcurrentSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = from; + _tmp2_ = to; + _tmp3_ = gee_concurrent_set_range_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_concurrent_set_range_unref0 (_tmp4_); + result = _tmp6_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gconstpointer gee_concurrent_set_max (GeeConcurrentSet* self, gconstpointer a, gconstpointer b, gboolean* changed) { + gboolean _vala_changed = FALSE; + gconstpointer result = NULL; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + gconstpointer _tmp4_ = NULL; + gboolean _tmp5_; + gconstpointer _tmp8_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_cmp; + _tmp0__target = self->priv->_cmp_target; + _tmp1_ = a; + _tmp2_ = b; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); + _vala_changed = _tmp3_ < 0; + _tmp5_ = _vala_changed; + if (_tmp5_) { + gconstpointer _tmp6_; + _tmp6_ = b; + _tmp4_ = _tmp6_; + } else { + gconstpointer _tmp7_; + _tmp7_ = a; + _tmp4_ = _tmp7_; + } + _tmp8_ = _tmp4_; + result = _tmp8_; + if (changed) { + *changed = _vala_changed; + } + return result; +} + + +static gconstpointer gee_concurrent_set_min (GeeConcurrentSet* self, gconstpointer a, gconstpointer b, gboolean* changed) { + gboolean _vala_changed = FALSE; + gconstpointer result = NULL; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + gconstpointer _tmp4_ = NULL; + gboolean _tmp5_; + gconstpointer _tmp8_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_cmp; + _tmp0__target = self->priv->_cmp_target; + _tmp1_ = a; + _tmp2_ = b; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); + _vala_changed = _tmp3_ > 0; + _tmp5_ = _vala_changed; + if (_tmp5_) { + gconstpointer _tmp6_; + _tmp6_ = b; + _tmp4_ = _tmp6_; + } else { + gconstpointer _tmp7_; + _tmp7_ = a; + _tmp4_ = _tmp7_; + } + _tmp8_ = _tmp4_; + result = _tmp8_; + if (changed) { + *changed = _vala_changed; + } + return result; +} + + +static gint gee_concurrent_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeConcurrentSet* self; + gint _tmp0_ = 0; + self = (GeeConcurrentSet*) base; + _tmp0_ = g_atomic_int_get ((volatile gint *) (&self->priv->_size)); + result = _tmp0_; + return result; +} + + +static gboolean gee_concurrent_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeConcurrentSet* self; + self = (GeeConcurrentSet*) base; + result = FALSE; + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTower* head) { + GeeConcurrentSetIterator * self = NULL; + GeeConcurrentSetTower* _tmp0_; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSet* _tmp2_; + GeeConcurrentSet* _tmp3_; + GeeConcurrentSetTower* _tmp4_; + g_return_val_if_fail (cset != NULL, NULL); + g_return_val_if_fail (head != NULL, NULL); + self = (GeeConcurrentSetIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = head; + _tmp1_ = _gee_concurrent_set_tower_ref0 (_tmp0_); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp1_; + _tmp2_ = cset; + _tmp3_ = _g_object_ref0 (_tmp2_); + _g_object_unref0 (self->priv->_set); + self->priv->_set = _tmp3_; + _tmp4_ = self->priv->_curr; + _vala_assert (_tmp4_ != NULL, "_curr != null"); + return self; +} + + +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTower* head) { + return gee_concurrent_set_iterator_construct (GEE_CONCURRENT_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, cset, head); +} + + +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_construct_point_at (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr) { + GeeConcurrentSetIterator * self = NULL; + GeeConcurrentSetTower* _tmp0_; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSet* _tmp2_; + GeeConcurrentSet* _tmp3_; + GeeConcurrentSetTowerIter _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetTower* _tmp6_; + g_return_val_if_fail (cset != NULL, NULL); + g_return_val_if_fail (prev != NULL, NULL); + g_return_val_if_fail (curr != NULL, NULL); + self = (GeeConcurrentSetIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = curr; + _tmp1_ = _gee_concurrent_set_tower_ref0 (_tmp0_); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp1_; + _tmp2_ = cset; + _tmp3_ = _g_object_ref0 (_tmp2_); + _g_object_unref0 (self->priv->_set); + self->priv->_set = _tmp3_; + _tmp4_ = *prev; + gee_concurrent_set_tower_iter_copy (&_tmp4_, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&self->priv->_prev); + self->priv->_prev = _tmp5_; + _tmp6_ = self->priv->_curr; + _vala_assert (_tmp6_ != NULL, "_curr != null"); + return self; +} + + +static GeeConcurrentSetIterator* gee_concurrent_set_iterator_new_point_at (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr) { + return gee_concurrent_set_iterator_construct_point_at (GEE_CONCURRENT_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, cset, prev, curr); +} + + +static gboolean gee_concurrent_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeConcurrentSetIterator * self; + gboolean result = FALSE; + GeeConcurrentSetTower* _tmp0_; + GeeHazardPointerContext* _tmp1_; + GeeHazardPointerContext* ctx; + gboolean _tmp2_ = FALSE; + GeeConcurrentSetTowerIter _tmp3_; + GeeConcurrentSetTower* _tmp4_; + gboolean _tmp6_; + GeeConcurrentSetTowerIter _tmp13_; + GeeConcurrentSetTower* _tmp14_; + GeeConcurrentSetTower* _tmp15_; + GeeConcurrentSetTower* new_prev; + GeeConcurrentSetTower* _tmp16_; + GeeConcurrentSetTower* _tmp17_; + GeeConcurrentSetTower* new_curr; + GeeConcurrentSetTower* _tmp47_; + self = (GeeConcurrentSetIterator*) base; + _tmp0_ = self->priv->_curr; + _vala_assert (_tmp0_ != NULL, "_curr != null"); + _tmp1_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp1_; + _tmp3_ = self->priv->_prev; + _tmp4_ = _tmp3_._iter[0]; + if (_tmp4_ != NULL) { + gboolean _tmp5_; + _tmp5_ = self->priv->_removed; + _tmp2_ = !_tmp5_; + } else { + _tmp2_ = FALSE; + } + _tmp6_ = _tmp2_; + if (_tmp6_) { + GeeForallFunc _tmp7_; + void* _tmp7__target; + GeeConcurrentSetTower* _tmp8_; + gconstpointer _tmp9_; + gpointer _tmp10_; + gboolean _tmp11_ = FALSE; + _tmp7_ = f; + _tmp7__target = f_target; + _tmp8_ = self->priv->_curr; + _tmp9_ = _tmp8_->_data; + _tmp10_ = ((_tmp9_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp9_) : ((gpointer) _tmp9_); + _tmp11_ = _tmp7_ (_tmp10_, _tmp7__target); + if (!_tmp11_) { + GeeConcurrentSetTower* _tmp12_; + _tmp12_ = self->priv->_curr; + _vala_assert (_tmp12_ != NULL, "_curr != null"); + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp13_ = self->priv->_prev; + _tmp14_ = _tmp13_._iter[0]; + _tmp15_ = _gee_concurrent_set_tower_ref0 (_tmp14_); + new_prev = _tmp15_; + _tmp16_ = self->priv->_curr; + _tmp17_ = _gee_concurrent_set_tower_ref0 (_tmp16_); + new_curr = _tmp17_; + while (TRUE) { + GeeConcurrentSet* _tmp18_; + GCompareDataFunc _tmp19_; + void* _tmp19__target; + gboolean _tmp20_ = FALSE; + GeeConcurrentSetTower* _tmp21_; + gboolean _tmp22_; + GeeConcurrentSetTower* _tmp39_; + GeeConcurrentSetTower* _tmp40_; + GeeForallFunc _tmp41_; + void* _tmp41__target; + GeeConcurrentSetTower* _tmp42_; + gconstpointer _tmp43_; + gpointer _tmp44_; + gboolean _tmp45_ = FALSE; + _tmp18_ = self->priv->_set; + _tmp19_ = _tmp18_->priv->_cmp; + _tmp19__target = _tmp18_->priv->_cmp_target; + _tmp20_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp19_, _tmp19__target, &new_prev, &new_curr, (guint8) 0, FALSE); + if (!_tmp20_) { + break; + } + _tmp21_ = self->priv->_curr; + _vala_assert (_tmp21_ != NULL, "_curr != null"); + _tmp22_ = self->priv->_removed; + if (!_tmp22_) { + GeeConcurrentSetTower* _tmp23_; + GeeConcurrentSetTower* _tmp24_; + GeeConcurrentSetTower* _tmp25_; + GeeConcurrentSetTowerIter _tmp26_; + GeeConcurrentSetTower* _tmp27_; + gint _tmp28_ = 0; + gint prev_height; + _tmp23_ = new_prev; + _tmp24_ = _gee_concurrent_set_tower_ref0 (_tmp23_); + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[0]); + self->priv->_prev._iter[0] = _tmp24_; + _tmp25_ = self->priv->_prev._iter[0]; + _tmp26_ = self->priv->_prev; + _tmp27_ = _tmp26_._iter[0]; + _tmp28_ = gee_concurrent_set_tower_get_height (_tmp27_); + prev_height = _tmp28_; + { + gint i; + i = 1; + { + gboolean _tmp29_; + _tmp29_ = TRUE; + while (TRUE) { + gboolean _tmp30_; + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; + GeeConcurrentSetTowerIter _tmp35_; + GeeConcurrentSetTower* _tmp36_; + GeeConcurrentSetTower* _tmp37_; + GeeConcurrentSetTower* _tmp38_; + _tmp30_ = _tmp29_; + if (!_tmp30_) { + gint _tmp31_; + _tmp31_ = i; + i = _tmp31_ + 1; + } + _tmp29_ = FALSE; + _tmp32_ = i; + _tmp33_ = prev_height; + if (!(_tmp32_ < _tmp33_)) { + break; + } + _tmp34_ = i; + _tmp35_ = self->priv->_prev; + _tmp36_ = _tmp35_._iter[0]; + _tmp37_ = _gee_concurrent_set_tower_ref0 (_tmp36_); + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[_tmp34_]); + self->priv->_prev._iter[_tmp34_] = _tmp37_; + _tmp38_ = self->priv->_prev._iter[_tmp34_]; + } + } + } + } + _tmp39_ = new_curr; + _tmp40_ = _gee_concurrent_set_tower_ref0 (_tmp39_); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp40_; + self->priv->_removed = FALSE; + _tmp41_ = f; + _tmp41__target = f_target; + _tmp42_ = self->priv->_curr; + _tmp43_ = _tmp42_->_data; + _tmp44_ = ((_tmp43_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp43_) : ((gpointer) _tmp43_); + _tmp45_ = _tmp41_ (_tmp44_, _tmp41__target); + if (!_tmp45_) { + GeeConcurrentSetTower* _tmp46_; + _tmp46_ = self->priv->_curr; + _vala_assert (_tmp46_ != NULL, "_curr != null"); + result = FALSE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp47_ = self->priv->_curr; + _vala_assert (_tmp47_ != NULL, "_curr != null"); + result = TRUE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_iterator_real_next (GeeIterator* base) { + GeeConcurrentSetIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetTower* new_prev; + GeeConcurrentSetTower* _tmp4_; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* new_curr; + GeeConcurrentSet* _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gboolean _tmp8_ = FALSE; + gboolean success; + gboolean _tmp9_; + GeeConcurrentSetTower* _tmp27_; + self = (GeeConcurrentSetIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + _tmp3_ = _gee_concurrent_set_tower_ref0 (_tmp2_); + new_prev = _tmp3_; + _tmp4_ = self->priv->_curr; + _tmp5_ = _gee_concurrent_set_tower_ref0 (_tmp4_); + new_curr = _tmp5_; + _tmp6_ = self->priv->_set; + _tmp7_ = _tmp6_->priv->_cmp; + _tmp7__target = _tmp6_->priv->_cmp_target; + _tmp8_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp7__target, &new_prev, &new_curr, (guint8) 0, FALSE); + success = _tmp8_; + _tmp9_ = success; + if (_tmp9_) { + gboolean _tmp10_; + GeeConcurrentSetTower* _tmp26_; + _tmp10_ = self->priv->_removed; + if (!_tmp10_) { + GeeConcurrentSetTower* _tmp11_; + GeeConcurrentSetTower* _tmp12_; + GeeConcurrentSetTowerIter _tmp13_; + GeeConcurrentSetTower* _tmp14_; + gint _tmp15_ = 0; + gint prev_height; + _tmp11_ = new_prev; + new_prev = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[0]); + self->priv->_prev._iter[0] = _tmp11_; + _tmp12_ = self->priv->_prev._iter[0]; + _tmp13_ = self->priv->_prev; + _tmp14_ = _tmp13_._iter[0]; + _tmp15_ = gee_concurrent_set_tower_get_height (_tmp14_); + prev_height = _tmp15_; + { + gint i; + i = 1; + { + gboolean _tmp16_; + _tmp16_ = TRUE; + while (TRUE) { + gboolean _tmp17_; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + GeeConcurrentSetTowerIter _tmp22_; + GeeConcurrentSetTower* _tmp23_; + GeeConcurrentSetTower* _tmp24_; + GeeConcurrentSetTower* _tmp25_; + _tmp17_ = _tmp16_; + if (!_tmp17_) { + gint _tmp18_; + _tmp18_ = i; + i = _tmp18_ + 1; + } + _tmp16_ = FALSE; + _tmp19_ = i; + _tmp20_ = prev_height; + if (!(_tmp19_ < _tmp20_)) { + break; + } + _tmp21_ = i; + _tmp22_ = self->priv->_prev; + _tmp23_ = _tmp22_._iter[0]; + _tmp24_ = _gee_concurrent_set_tower_ref0 (_tmp23_); + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[_tmp21_]); + self->priv->_prev._iter[_tmp21_] = _tmp24_; + _tmp25_ = self->priv->_prev._iter[_tmp21_]; + } + } + } + } + _tmp26_ = new_curr; + new_curr = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp26_; + self->priv->_removed = FALSE; + } + _tmp27_ = self->priv->_curr; + _vala_assert (_tmp27_ != NULL, "_curr != null"); + result = success; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_iterator_real_has_next (GeeIterator* base) { + GeeConcurrentSetIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetTower* prev; + GeeConcurrentSetTower* _tmp4_; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* curr; + GeeConcurrentSet* _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gboolean _tmp8_ = FALSE; + self = (GeeConcurrentSetIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + _tmp3_ = _gee_concurrent_set_tower_ref0 (_tmp2_); + prev = _tmp3_; + _tmp4_ = self->priv->_curr; + _tmp5_ = _gee_concurrent_set_tower_ref0 (_tmp4_); + curr = _tmp5_; + _tmp6_ = self->priv->_set; + _tmp7_ = _tmp6_->priv->_cmp; + _tmp7__target = _tmp6_->priv->_cmp_target; + _tmp8_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp7__target, &prev, &curr, (guint8) 0, FALSE); + result = _tmp8_; + _gee_concurrent_set_tower_unref0 (curr); + _gee_concurrent_set_tower_unref0 (prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_iterator_real_get (GeeIterator* base) { + GeeConcurrentSetIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeConcurrentSetTower* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + self = (GeeConcurrentSetIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = self->priv->_curr; + _tmp3_ = _tmp2_->_data; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + result = _tmp4_; + return result; +} + + +static void gee_concurrent_set_iterator_real_remove (GeeIterator* base) { + GeeConcurrentSetIterator * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + GeeConcurrentSet* _tmp3_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GeeConcurrentSetTower* _tmp5_; + gboolean _tmp6_ = FALSE; + self = (GeeConcurrentSetIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = self->priv->_set; + _tmp4_ = _tmp3_->priv->_cmp; + _tmp4__target = _tmp3_->priv->_cmp_target; + _tmp5_ = self->priv->_curr; + _tmp6_ = gee_concurrent_set_tower_remove (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, _tmp4__target, &self->priv->_prev, _tmp5_); + if (_tmp6_) { + GeeConcurrentSet* _tmp7_; + _tmp7_ = self->priv->_set; + g_atomic_int_dec_and_test ((volatile gint *) (&_tmp7_->priv->_size)); + } + self->priv->_removed = TRUE; + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gboolean gee_concurrent_set_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeConcurrentSetIterator* self; + gboolean _tmp0_ = FALSE; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + gboolean _tmp4_; + self = (GeeConcurrentSetIterator*) base; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + if (_tmp2_ != NULL) { + gboolean _tmp3_; + _tmp3_ = self->priv->_removed; + _tmp0_ = !_tmp3_; + } else { + _tmp0_ = FALSE; + } + _tmp4_ = _tmp0_; + result = _tmp4_; + return result; +} + + +static gboolean gee_concurrent_set_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeConcurrentSetIterator* self; + self = (GeeConcurrentSetIterator*) base; + result = TRUE; + return result; +} + + +static void gee_concurrent_set_iterator_class_init (GeeConcurrentSetIteratorClass * klass) { + gee_concurrent_set_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentSetIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_set_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_set_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_set_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_concurrent_set_iterator_gee_traversable_get_g_type (GeeConcurrentSetIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_concurrent_set_iterator_gee_traversable_get_g_dup_func (GeeConcurrentSetIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_concurrent_set_iterator_gee_traversable_get_g_destroy_func (GeeConcurrentSetIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_concurrent_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_concurrent_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_concurrent_set_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_concurrent_set_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_concurrent_set_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_concurrent_set_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_concurrent_set_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_concurrent_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->next = (gboolean (*)(GeeIterator*)) gee_concurrent_set_iterator_real_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_concurrent_set_iterator_real_has_next; + iface->get = (gpointer (*)(GeeIterator*)) gee_concurrent_set_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_concurrent_set_iterator_real_remove; + iface->get_valid = gee_concurrent_set_iterator_real_get_valid; + iface->get_read_only = gee_concurrent_set_iterator_real_get_read_only; +} + + +static void gee_concurrent_set_iterator_instance_init (GeeConcurrentSetIterator * self) { + self->priv = GEE_CONCURRENT_SET_ITERATOR_GET_PRIVATE (self); + self->priv->_removed = FALSE; +} + + +static void gee_concurrent_set_iterator_finalize (GObject* obj) { + GeeConcurrentSetIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIterator); + _g_object_unref0 (self->priv->_set); + gee_concurrent_set_tower_iter_destroy (&self->priv->_prev); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + G_OBJECT_CLASS (gee_concurrent_set_iterator_parent_class)->finalize (obj); +} + + +static GType gee_concurrent_set_iterator_get_type (void) { + static volatile gsize gee_concurrent_set_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSetIterator), 0, (GInstanceInitFunc) gee_concurrent_set_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_concurrent_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_concurrent_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_concurrent_set_iterator_type_id; + gee_concurrent_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeConcurrentSetIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_concurrent_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_concurrent_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_concurrent_set_iterator_type_id__volatile, gee_concurrent_set_iterator_type_id); + } + return gee_concurrent_set_iterator_type_id__volatile; +} + + +static void _vala_gee_concurrent_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentSetIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIterator); + switch (property_id) { + case GEE_CONCURRENT_SET_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_CONCURRENT_SET_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentSetIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_ITERATOR, GeeConcurrentSetIterator); + switch (property_id) { + case GEE_CONCURRENT_SET_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_SET_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_SET_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static gpointer _gee_concurrent_set_range_ref0 (gpointer self) { + return self ? gee_concurrent_set_range_ref (self) : NULL; +} + + +static GeeConcurrentSetSubSet* gee_concurrent_set_sub_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range) { + GeeConcurrentSetSubSet * self = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRange* _tmp1_; + g_return_val_if_fail (range != NULL, NULL); + self = (GeeConcurrentSetSubSet*) gee_abstract_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = range; + _tmp1_ = _gee_concurrent_set_range_ref0 (_tmp0_); + _gee_concurrent_set_range_unref0 (self->priv->_range); + self->priv->_range = _tmp1_; + return self; +} + + +static GeeConcurrentSetSubSet* gee_concurrent_set_sub_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range) { + return gee_concurrent_set_sub_set_construct (GEE_CONCURRENT_SET_TYPE_SUB_SET, g_type, g_dup_func, g_destroy_func, range); +} + + +static GeeIterator* gee_concurrent_set_sub_set_real_iterator (GeeAbstractCollection* base) { + GeeConcurrentSetSubSet * self; + GeeIterator* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetSubIterator* _tmp2_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_concurrent_set_sub_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_); + result = (GeeIterator*) _tmp2_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_sub_set_real_contains (GeeAbstractCollection* base, gconstpointer item) { + GeeConcurrentSetSubSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + gboolean _tmp10_ = FALSE; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = item; + _tmp3_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + if (!_tmp3_) { + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = self->priv->_range; + _tmp7_ = _tmp6_->_set; + _tmp8_ = _tmp7_->priv->_cmp; + _tmp8__target = _tmp7_->priv->_cmp_target; + _tmp9_ = item; + _tmp10_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp8_, _tmp8__target, _tmp9_, &prev, NULL, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + result = _tmp10_; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_sub_set_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeConcurrentSetSubSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GPrivate* _tmp6_; + void* _tmp7_ = NULL; + GRand* rnd; + GRand* _tmp8_; + GRand* _tmp12_; + gint32 _tmp13_; + gint32 _tmp14_ = 0; + guint32 rand_int; + guint32 _tmp15_; + gint _tmp16_ = 0; + guint8 height; + GeeConcurrentSetRange* _tmp17_; + GeeConcurrentSet* _tmp18_; + GCompareDataFunc _tmp19_; + void* _tmp19__target; + gconstpointer _tmp20_; + guint8 _tmp21_; + gboolean _tmp22_ = FALSE; + GeeConcurrentSetRange* _tmp34_; + GeeConcurrentSet* _tmp35_; + GCompareDataFunc _tmp36_; + void* _tmp36__target; + gconstpointer _tmp37_; + guint8 _tmp38_; + GeeConcurrentSetTower* _tmp39_ = NULL; + GeeConcurrentSetTower* _result_; + GeeConcurrentSetTower* _tmp40_; + GeeConcurrentSetTower* _tmp43_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = key; + _tmp3_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + if (!_tmp3_) { + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = gee_concurrent_set_rand; + _tmp7_ = g_private_get (_tmp6_); + rnd = _tmp7_; + _tmp8_ = rnd; + if (_tmp8_ == NULL) { + GPrivate* _tmp9_; + GRand* _tmp10_; + GRand* _tmp11_; + _tmp9_ = gee_concurrent_set_rand; + _tmp10_ = g_rand_new (); + rnd = _tmp10_; + _tmp11_ = rnd; + g_private_set (_tmp9_, _tmp11_); + } + _tmp12_ = rnd; + _tmp13_ = G_MAXINT32; + _tmp14_ = g_rand_int_range (_tmp12_, (gint32) 0, _tmp13_); + rand_int = (guint32) _tmp14_; + _tmp15_ = rand_int; + _tmp16_ = g_bit_nth_lsf ((gulong) (~_tmp15_), -1); + height = (guint8) (1 + ((guint8) _tmp16_)); + _tmp17_ = self->priv->_range; + _tmp18_ = _tmp17_->_set; + _tmp19_ = _tmp18_->priv->_cmp; + _tmp19__target = _tmp18_->priv->_cmp_target; + _tmp20_ = key; + _tmp21_ = height; + _tmp22_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp19_, _tmp19__target, _tmp20_, &prev, NULL, (guint8) (_tmp21_ - 1), (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + if (_tmp22_) { + result = FALSE; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + { + guint8 _tmp23_; + gint i; + _tmp23_ = height; + i = _tmp23_ - 2; + { + gboolean _tmp24_; + _tmp24_ = TRUE; + while (TRUE) { + gboolean _tmp25_; + gint _tmp27_; + gint _tmp28_; + GeeConcurrentSetTowerIter _tmp29_; + guint8 _tmp30_; + GeeConcurrentSetTower* _tmp31_; + GeeConcurrentSetTower* _tmp32_; + GeeConcurrentSetTower* _tmp33_; + _tmp25_ = _tmp24_; + if (!_tmp25_) { + gint _tmp26_; + _tmp26_ = i; + i = _tmp26_ - 1; + } + _tmp24_ = FALSE; + _tmp27_ = i; + if (!(_tmp27_ >= 0)) { + break; + } + _tmp28_ = i; + _tmp29_ = prev; + _tmp30_ = height; + _tmp31_ = _tmp29_._iter[_tmp30_ - 1]; + _tmp32_ = _gee_concurrent_set_tower_ref0 (_tmp31_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp28_]); + prev._iter[_tmp28_] = _tmp32_; + _tmp33_ = prev._iter[_tmp28_]; + } + } + } + _tmp34_ = self->priv->_range; + _tmp35_ = _tmp34_->_set; + _tmp36_ = _tmp35_->priv->_cmp; + _tmp36__target = _tmp35_->priv->_cmp_target; + _tmp37_ = key; + _tmp38_ = height; + _tmp39_ = gee_concurrent_set_tower_insert (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp36_, _tmp36__target, &prev, _tmp37_, (guint8) (_tmp38_ - 1)); + _result_ = _tmp39_; + _tmp40_ = _result_; + if (_tmp40_ != NULL) { + GeeConcurrentSetRange* _tmp41_; + GeeConcurrentSet* _tmp42_; + _tmp41_ = self->priv->_range; + _tmp42_ = _tmp41_->_set; + g_atomic_int_inc ((volatile gint *) (&_tmp42_->priv->_size)); + } + _tmp43_ = _result_; + result = _tmp43_ != NULL; + _gee_concurrent_set_tower_unref0 (_result_); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_sub_set_real_remove (GeeAbstractCollection* base, gconstpointer key) { + GeeConcurrentSetSubSet * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean _result_; + gboolean _tmp11_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = key; + _tmp3_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + if (!_tmp3_) { + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = self->priv->_range; + _tmp7_ = _tmp6_->_set; + _tmp8_ = _tmp7_->priv->_cmp; + _tmp8__target = _tmp7_->priv->_cmp_target; + _tmp9_ = key; + _tmp10_ = gee_concurrent_set_tower_remove_key (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp8_, _tmp8__target, &prev, _tmp9_, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _result_ = _tmp10_; + _tmp11_ = _result_; + if (_tmp11_) { + GeeConcurrentSetRange* _tmp12_; + GeeConcurrentSet* _tmp13_; + _tmp12_ = self->priv->_range; + _tmp13_ = _tmp12_->_set; + g_atomic_int_dec_and_test ((volatile gint *) (&_tmp13_->priv->_size)); + } + result = _result_; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static void gee_concurrent_set_sub_set_real_clear (GeeAbstractCollection* base) { + GeeConcurrentSetSubSet * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetTower* first = NULL; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + GeeConcurrentSetTowerIter _tmp3_ = {0}; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, &_tmp2_, &_tmp3_); + _gee_concurrent_set_tower_unref0 (first); + first = _tmp2_; + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp3_; + while (TRUE) { + GeeConcurrentSetTower* _tmp4_; + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSet* _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetRange* _tmp9_; + GeeConcurrentSetTower* _tmp10_ = NULL; + GeeConcurrentSetTowerIter _tmp11_ = {0}; + _tmp4_ = first; + if (!(_tmp4_ != NULL)) { + break; + } + _tmp5_ = self->priv->_range; + _tmp6_ = _tmp5_->_set; + _tmp7_ = _tmp6_->priv->_cmp; + _tmp7__target = _tmp6_->priv->_cmp_target; + _tmp8_ = first; + gee_concurrent_set_tower_remove (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp7__target, &prev, _tmp8_); + _tmp9_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, &_tmp10_, &_tmp11_); + _gee_concurrent_set_tower_unref0 (first); + first = _tmp10_; + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp11_; + } + _gee_concurrent_set_tower_unref0 (first); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_sub_set_real_first (GeeAbstractSortedSet* base) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* first = NULL; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetTower* _tmp4_; + gconstpointer _tmp5_; + gpointer _tmp6_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, &_tmp2_, NULL); + _gee_concurrent_set_tower_unref0 (first); + first = _tmp2_; + _tmp3_ = first; + if (_tmp3_ == NULL) { + result = NULL; + _gee_concurrent_set_tower_unref0 (first); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = first; + _tmp5_ = _tmp4_->_data; + _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + result = _tmp6_; + _gee_concurrent_set_tower_unref0 (first); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_sub_set_real_last (GeeAbstractSortedSet* base) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetTowerIter _tmp2_ = {0}; + GeeConcurrentSetTower* curr; + GeeConcurrentSetTower* _tmp34_; + GeeConcurrentSetTower* _tmp35_; + gconstpointer _tmp36_; + gpointer _tmp37_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, NULL, &_tmp2_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp2_; + curr = NULL; + { + gint i; + i = GEE_CONCURRENT_SET__MAX_HEIGHT - 1; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + gint _tmp6_; + GeeConcurrentSetTower* _tmp7_; + gboolean improved; + gboolean _tmp24_ = FALSE; + gboolean _tmp25_; + gboolean _tmp27_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = i; + i = _tmp5_ - 1; + } + _tmp3_ = FALSE; + _tmp6_ = i; + if (!(_tmp6_ >= 0)) { + break; + } + _tmp7_ = curr; + if (_tmp7_ == NULL) { + GeeConcurrentSetTowerIter _tmp8_; + gint _tmp9_; + GeeConcurrentSetTower* _tmp10_; + gint _tmp11_; + GeeConcurrentSetTower* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeConcurrentSetTower* _tmp14_; + gboolean _tmp19_; + _tmp8_ = prev; + _tmp9_ = i; + _tmp10_ = _tmp8_._iter[_tmp9_]; + _tmp11_ = i; + _tmp12_ = gee_concurrent_set_tower_get_next (_tmp10_, (guint8) _tmp11_); + _gee_concurrent_set_tower_unref0 (curr); + curr = _tmp12_; + _tmp14_ = curr; + if (_tmp14_ == NULL) { + _tmp13_ = TRUE; + } else { + GeeConcurrentSetRange* _tmp15_; + GeeConcurrentSetTower* _tmp16_; + gconstpointer _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = curr; + _tmp17_ = _tmp16_->_data; + _tmp18_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp15_, _tmp17_); + _tmp13_ = !_tmp18_; + } + _tmp19_ = _tmp13_; + if (_tmp19_) { + _gee_concurrent_set_tower_unref0 (curr); + curr = NULL; + continue; + } + } + improved = FALSE; + while (TRUE) { + GeeConcurrentSetRange* _tmp20_; + gint _tmp21_; + gint _tmp22_; + gboolean _tmp23_ = FALSE; + _tmp20_ = self->priv->_range; + _tmp21_ = i; + _tmp22_ = i; + _tmp23_ = gee_concurrent_set_range_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp20_, &prev._iter[_tmp21_], &curr, (guint8) _tmp22_); + if (!_tmp23_) { + break; + } + improved = TRUE; + } + _tmp25_ = improved; + if (_tmp25_) { + gint _tmp26_; + _tmp26_ = i; + _tmp24_ = _tmp26_ > 0; + } else { + _tmp24_ = FALSE; + } + _tmp27_ = _tmp24_; + if (_tmp27_) { + gint _tmp28_; + GeeConcurrentSetTowerIter _tmp29_; + gint _tmp30_; + GeeConcurrentSetTower* _tmp31_; + GeeConcurrentSetTower* _tmp32_; + GeeConcurrentSetTower* _tmp33_; + _tmp28_ = i; + _tmp29_ = prev; + _tmp30_ = i; + _tmp31_ = _tmp29_._iter[_tmp30_]; + _tmp32_ = _gee_concurrent_set_tower_ref0 (_tmp31_); + _gee_concurrent_set_tower_unref0 (prev._iter[_tmp28_ - 1]); + prev._iter[_tmp28_ - 1] = _tmp32_; + _tmp33_ = prev._iter[_tmp28_ - 1]; + } + } + } + } + _tmp34_ = curr; + if (_tmp34_ == NULL) { + result = NULL; + _gee_concurrent_set_tower_unref0 (curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp35_ = curr; + _tmp36_ = _tmp35_->_data; + _tmp37_ = ((_tmp36_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp36_) : ((gpointer) _tmp36_); + result = _tmp37_; + _gee_concurrent_set_tower_unref0 (curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeIterator* gee_concurrent_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSetSubSet * self; + GeeIterator* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetTowerIter next = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + GeeConcurrentSetTowerIter _tmp10_ = {0}; + gboolean _tmp11_ = FALSE; + GeeConcurrentSetRange* _tmp12_; + GeeConcurrentSetTowerIter _tmp13_; + GeeConcurrentSetTower* _tmp14_; + GeeConcurrentSetTower* _tmp15_; + GeeConcurrentSetSubIterator* _tmp16_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = element; + _tmp3_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + if (!_tmp3_) { + result = NULL; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = self->priv->_range; + _tmp7_ = _tmp6_->_set; + _tmp8_ = _tmp7_->priv->_cmp; + _tmp8__target = _tmp7_->priv->_cmp_target; + _tmp9_ = element; + _tmp11_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp8_, _tmp8__target, _tmp9_, &prev, &_tmp10_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + gee_concurrent_set_tower_iter_destroy (&next); + next = _tmp10_; + if (!_tmp11_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&next); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp12_ = self->priv->_range; + _tmp13_ = next; + _tmp14_ = _tmp13_._iter[0]; + _tmp15_ = _gee_concurrent_set_tower_ref0 (_tmp14_); + _tmp16_ = gee_concurrent_set_sub_iterator_new_point_at (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp12_, &prev, _tmp15_); + result = (GeeIterator*) _tmp16_; + gee_concurrent_set_tower_iter_destroy (&next); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gpointer gee_concurrent_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = element; + _tmp3_ = gee_concurrent_set_range_cmp (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + switch (_tmp3_) { + case GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE: + case GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY: + { + result = NULL; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE: + { + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + gboolean _tmp10_ = FALSE; + GeeConcurrentSetTowerIter _tmp11_; + GeeConcurrentSetTower* _tmp12_; + GeeConcurrentSetRange* _tmp13_; + GeeConcurrentSet* _tmp14_; + GeeConcurrentSetTower* _tmp15_; + gboolean _tmp21_; + GeeConcurrentSetTowerIter _tmp22_; + GeeConcurrentSetTower* _tmp23_; + gconstpointer _tmp24_; + gpointer _tmp25_; + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = self->priv->_range; + _tmp7_ = _tmp6_->_set; + _tmp8_ = _tmp7_->priv->_cmp; + _tmp8__target = _tmp7_->priv->_cmp_target; + _tmp9_ = element; + gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp8_, _tmp8__target, _tmp9_, &prev, NULL, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + _tmp11_ = prev; + _tmp12_ = _tmp11_._iter[0]; + _tmp13_ = self->priv->_range; + _tmp14_ = _tmp13_->_set; + _tmp15_ = _tmp14_->priv->_head; + if (_tmp12_ == _tmp15_) { + _tmp10_ = TRUE; + } else { + GeeConcurrentSetRange* _tmp16_; + GeeConcurrentSetTowerIter _tmp17_; + GeeConcurrentSetTower* _tmp18_; + gconstpointer _tmp19_; + gboolean _tmp20_ = FALSE; + _tmp16_ = self->priv->_range; + _tmp17_ = prev; + _tmp18_ = _tmp17_._iter[0]; + _tmp19_ = _tmp18_->_data; + _tmp20_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp16_, _tmp19_); + _tmp10_ = !_tmp20_; + } + _tmp21_ = _tmp10_; + if (_tmp21_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp22_ = prev; + _tmp23_ = _tmp22_._iter[0]; + _tmp24_ = _tmp23_->_data; + _tmp25_ = ((_tmp24_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp24_) : ((gpointer) _tmp24_); + result = _tmp25_; + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_AFTER: + { + gpointer _tmp26_ = NULL; + _tmp26_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = _tmp26_; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = element; + _tmp3_ = gee_concurrent_set_range_cmp (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + switch (_tmp3_) { + case GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE: + { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = _tmp4_; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE: + { + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetTowerIter curr = {0}; + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSetTowerIter _tmp6_ = {0}; + GeeConcurrentSetRange* _tmp7_; + GeeConcurrentSet* _tmp8_; + GCompareDataFunc _tmp9_; + void* _tmp9__target; + gconstpointer _tmp10_; + GeeConcurrentSetTowerIter _tmp11_ = {0}; + gboolean _tmp12_ = FALSE; + gboolean _tmp17_ = FALSE; + GeeConcurrentSetTowerIter _tmp18_; + GeeConcurrentSetTower* _tmp19_; + gboolean _tmp25_; + GeeConcurrentSetTowerIter _tmp26_; + GeeConcurrentSetTower* _tmp27_; + gconstpointer _tmp28_; + gpointer _tmp29_; + _tmp5_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_, NULL, &_tmp6_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp6_; + _tmp7_ = self->priv->_range; + _tmp8_ = _tmp7_->_set; + _tmp9_ = _tmp8_->priv->_cmp; + _tmp9__target = _tmp8_->priv->_cmp_target; + _tmp10_ = element; + _tmp12_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, _tmp9__target, _tmp10_, &prev, &_tmp11_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + gee_concurrent_set_tower_iter_destroy (&curr); + curr = _tmp11_; + if (_tmp12_) { + GeeConcurrentSetRange* _tmp13_; + GeeConcurrentSet* _tmp14_; + GCompareDataFunc _tmp15_; + void* _tmp15__target; + gboolean _tmp16_ = FALSE; + _tmp13_ = self->priv->_range; + _tmp14_ = _tmp13_->_set; + _tmp15_ = _tmp14_->priv->_cmp; + _tmp15__target = _tmp14_->priv->_cmp_target; + _tmp16_ = gee_concurrent_set_tower_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp15_, _tmp15__target, &prev._iter[0], &curr._iter[0], (guint8) 0, FALSE); + if (!_tmp16_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp18_ = curr; + _tmp19_ = _tmp18_._iter[0]; + if (_tmp19_ == NULL) { + _tmp17_ = TRUE; + } else { + GeeConcurrentSetRange* _tmp20_; + GeeConcurrentSetTowerIter _tmp21_; + GeeConcurrentSetTower* _tmp22_; + gconstpointer _tmp23_; + gboolean _tmp24_ = FALSE; + _tmp20_ = self->priv->_range; + _tmp21_ = curr; + _tmp22_ = _tmp21_._iter[0]; + _tmp23_ = _tmp22_->_data; + _tmp24_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp20_, _tmp23_); + _tmp17_ = !_tmp24_; + } + _tmp25_ = _tmp17_; + if (_tmp25_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp26_ = curr; + _tmp27_ = _tmp26_._iter[0]; + _tmp28_ = _tmp27_->_data; + _tmp29_ = ((_tmp28_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp28_) : ((gpointer) _tmp28_); + result = _tmp29_; + gee_concurrent_set_tower_iter_destroy (&curr); + gee_concurrent_set_tower_iter_destroy (&prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_AFTER: + case GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY: + { + result = NULL; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = element; + _tmp3_ = gee_concurrent_set_range_cmp (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + switch (_tmp3_) { + case GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE: + case GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY: + { + result = NULL; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE: + { + GeeConcurrentSetTowerIter curr = {0}; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetTowerIter _tmp5_ = {0}; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + GeeConcurrentSetTowerIter _tmp10_ = {0}; + gboolean _tmp11_ = FALSE; + gboolean _tmp14_ = FALSE; + gboolean _tmp15_ = FALSE; + GeeConcurrentSetTowerIter _tmp16_; + GeeConcurrentSetTower* _tmp17_; + gboolean _tmp21_; + gboolean _tmp27_; + GeeConcurrentSetTowerIter _tmp28_; + GeeConcurrentSetTower* _tmp29_; + gconstpointer _tmp30_; + gpointer _tmp31_; + _tmp4_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_, NULL, &_tmp5_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp5_; + _tmp6_ = self->priv->_range; + _tmp7_ = _tmp6_->_set; + _tmp8_ = _tmp7_->priv->_cmp; + _tmp8__target = _tmp7_->priv->_cmp_target; + _tmp9_ = element; + _tmp11_ = gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp8_, _tmp8__target, _tmp9_, &prev, &_tmp10_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + gee_concurrent_set_tower_iter_destroy (&curr); + curr = _tmp10_; + if (!_tmp11_) { + GeeConcurrentSetTower* _tmp12_; + GeeConcurrentSetTower* _tmp13_; + _tmp12_ = prev._iter[0]; + prev._iter[0] = NULL; + _gee_concurrent_set_tower_unref0 (curr._iter[0]); + curr._iter[0] = _tmp12_; + _tmp13_ = curr._iter[0]; + } + _tmp16_ = curr; + _tmp17_ = _tmp16_._iter[0]; + if (_tmp17_ == NULL) { + _tmp15_ = TRUE; + } else { + GeeConcurrentSetTowerIter _tmp18_; + GeeConcurrentSetTower* _tmp19_; + gboolean _tmp20_ = FALSE; + _tmp18_ = curr; + _tmp19_ = _tmp18_._iter[0]; + _tmp20_ = gee_concurrent_set_tower_is_head (_tmp19_); + _tmp15_ = _tmp20_; + } + _tmp21_ = _tmp15_; + if (_tmp21_) { + _tmp14_ = TRUE; + } else { + GeeConcurrentSetRange* _tmp22_; + GeeConcurrentSetTowerIter _tmp23_; + GeeConcurrentSetTower* _tmp24_; + gconstpointer _tmp25_; + gboolean _tmp26_ = FALSE; + _tmp22_ = self->priv->_range; + _tmp23_ = curr; + _tmp24_ = _tmp23_._iter[0]; + _tmp25_ = _tmp24_->_data; + _tmp26_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp22_, _tmp25_); + _tmp14_ = !_tmp26_; + } + _tmp27_ = _tmp14_; + if (_tmp27_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&prev); + gee_concurrent_set_tower_iter_destroy (&curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp28_ = curr; + _tmp29_ = _tmp28_._iter[0]; + _tmp30_ = _tmp29_->_data; + _tmp31_ = ((_tmp30_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp30_) : ((gpointer) _tmp30_); + result = _tmp31_; + gee_concurrent_set_tower_iter_destroy (&prev); + gee_concurrent_set_tower_iter_destroy (&curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_AFTER: + { + gpointer _tmp32_ = NULL; + _tmp32_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = _tmp32_; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer element) { + GeeConcurrentSetSubSet * self; + gpointer result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = element; + _tmp3_ = gee_concurrent_set_range_cmp (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + switch (_tmp3_) { + case GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE: + { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = _tmp4_; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE: + { + GeeConcurrentSetTowerIter curr = {0}; + GeeConcurrentSetTowerIter prev = {0}; + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSetTowerIter _tmp6_ = {0}; + GeeConcurrentSetRange* _tmp7_; + GeeConcurrentSet* _tmp8_; + GCompareDataFunc _tmp9_; + void* _tmp9__target; + gconstpointer _tmp10_; + GeeConcurrentSetTowerIter _tmp11_ = {0}; + gboolean _tmp12_ = FALSE; + GeeConcurrentSetTowerIter _tmp13_; + GeeConcurrentSetTower* _tmp14_; + gboolean _tmp20_; + GeeConcurrentSetTowerIter _tmp21_; + GeeConcurrentSetTower* _tmp22_; + gconstpointer _tmp23_; + gpointer _tmp24_; + _tmp5_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_, NULL, &_tmp6_); + gee_concurrent_set_tower_iter_destroy (&prev); + prev = _tmp6_; + _tmp7_ = self->priv->_range; + _tmp8_ = _tmp7_->_set; + _tmp9_ = _tmp8_->priv->_cmp; + _tmp9__target = _tmp8_->priv->_cmp_target; + _tmp10_ = element; + gee_concurrent_set_tower_search_from_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, _tmp9__target, _tmp10_, &prev, &_tmp11_, (guint8) 0, (guint8) (((guint8) GEE_CONCURRENT_SET__MAX_HEIGHT) - 1)); + gee_concurrent_set_tower_iter_destroy (&curr); + curr = _tmp11_; + _tmp13_ = curr; + _tmp14_ = _tmp13_._iter[0]; + if (_tmp14_ == NULL) { + _tmp12_ = TRUE; + } else { + GeeConcurrentSetRange* _tmp15_; + GeeConcurrentSetTowerIter _tmp16_; + GeeConcurrentSetTower* _tmp17_; + gconstpointer _tmp18_; + gboolean _tmp19_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = curr; + _tmp17_ = _tmp16_._iter[0]; + _tmp18_ = _tmp17_->_data; + _tmp19_ = gee_concurrent_set_range_inside (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp15_, _tmp18_); + _tmp12_ = !_tmp19_; + } + _tmp20_ = _tmp12_; + if (_tmp20_) { + result = NULL; + gee_concurrent_set_tower_iter_destroy (&prev); + gee_concurrent_set_tower_iter_destroy (&curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp21_ = curr; + _tmp22_ = _tmp21_._iter[0]; + _tmp23_ = _tmp22_->_data; + _tmp24_ = ((_tmp23_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp23_) : ((gpointer) _tmp23_); + result = _tmp24_; + gee_concurrent_set_tower_iter_destroy (&prev); + gee_concurrent_set_tower_iter_destroy (&curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + case GEE_CONCURRENT_SET_RANGE_POSITION_AFTER: + case GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY: + { + result = NULL; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static GeeSortedSet* gee_concurrent_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { + GeeConcurrentSetSubSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + GeeConcurrentSetRange* _tmp3_ = NULL; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetSubSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = before; + _tmp3_ = gee_concurrent_set_range_cut_tail (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_concurrent_set_range_unref0 (_tmp4_); + result = _tmp6_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeSortedSet* gee_concurrent_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { + GeeConcurrentSetSubSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + GeeConcurrentSetRange* _tmp3_ = NULL; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetSubSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = after; + _tmp3_ = gee_concurrent_set_range_cut_head (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_concurrent_set_range_unref0 (_tmp4_); + result = _tmp6_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static GeeSortedSet* gee_concurrent_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer from, gconstpointer to) { + GeeConcurrentSetSubSet * self; + GeeSortedSet* result = NULL; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetRange* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeConcurrentSetRange* _tmp4_ = NULL; + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSetSubSet* _tmp6_; + GeeSortedSet* _tmp7_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + _tmp2_ = from; + _tmp3_ = to; + _tmp4_ = gee_concurrent_set_range_cut (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, _tmp2_, _tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_concurrent_set_sub_set_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_); + _tmp7_ = (GeeSortedSet*) _tmp6_; + _gee_concurrent_set_range_unref0 (_tmp5_); + result = _tmp7_; + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gint gee_concurrent_set_sub_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeConcurrentSetSubSet* self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* curr = NULL; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + GeeConcurrentSetTower* _tmp3_; + self = (GeeConcurrentSetSubSet*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, &_tmp2_, NULL); + _gee_concurrent_set_tower_unref0 (curr); + curr = _tmp2_; + _tmp3_ = curr; + if (_tmp3_ != NULL) { + gint acc; + GeeConcurrentSetRange* _tmp4_; + gpointer _tmp5_ = NULL; + GeeConcurrentSetTower* prev; + gint _tmp9_; + acc = 1; + _tmp4_ = self->priv->_range; + _tmp5_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp4_->_bookmark._iter[0], (gsize) 0, NULL); + prev = (GeeConcurrentSetTower*) _tmp5_; + while (TRUE) { + GeeConcurrentSetRange* _tmp6_; + gboolean _tmp7_ = FALSE; + gint _tmp8_; + _tmp6_ = self->priv->_range; + _tmp7_ = gee_concurrent_set_range_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, &prev, &curr, (guint8) 0); + if (!_tmp7_) { + break; + } + _tmp8_ = acc; + acc = _tmp8_ + 1; + } + _tmp9_ = acc; + result = _tmp9_; + _gee_concurrent_set_tower_unref0 (prev); + _gee_concurrent_set_tower_unref0 (curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + result = 0; + _gee_concurrent_set_tower_unref0 (curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _gee_concurrent_set_tower_unref0 (curr); + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gboolean gee_concurrent_set_sub_set_get_is_empty (GeeConcurrentSetSubSet* self) { + gboolean result; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTower* curr = NULL; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp1_, &_tmp2_, NULL); + _gee_concurrent_set_tower_unref0 (curr); + curr = _tmp2_; + result = curr != NULL; + _gee_concurrent_set_tower_unref0 (curr); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_sub_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeConcurrentSetSubSet* self; + self = (GeeConcurrentSetSubSet*) base; + result = FALSE; + return result; +} + + +static void gee_concurrent_set_sub_set_class_init (GeeConcurrentSetSubSetClass * klass) { + gee_concurrent_set_sub_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentSetSubSetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_concurrent_set_sub_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_concurrent_set_sub_set_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_concurrent_set_sub_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_concurrent_set_sub_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_concurrent_set_sub_set_real_clear; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_concurrent_set_sub_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_concurrent_set_sub_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_concurrent_set_sub_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_concurrent_set_sub_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_concurrent_set_sub_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_concurrent_set_sub_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_concurrent_set_sub_set_real_ceil; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_concurrent_set_sub_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_concurrent_set_sub_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_concurrent_set_sub_set_real_sub_set; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_concurrent_set_sub_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_concurrent_set_sub_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_set_sub_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_set_sub_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_set_sub_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_concurrent_set_sub_set_instance_init (GeeConcurrentSetSubSet * self) { + self->priv = GEE_CONCURRENT_SET_SUB_SET_GET_PRIVATE (self); +} + + +static void gee_concurrent_set_sub_set_finalize (GObject* obj) { + GeeConcurrentSetSubSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSet); + _gee_concurrent_set_range_unref0 (self->priv->_range); + G_OBJECT_CLASS (gee_concurrent_set_sub_set_parent_class)->finalize (obj); +} + + +static GType gee_concurrent_set_sub_set_get_type (void) { + static volatile gsize gee_concurrent_set_sub_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_sub_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetSubSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_sub_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSetSubSet), 0, (GInstanceInitFunc) gee_concurrent_set_sub_set_instance_init, NULL }; + GType gee_concurrent_set_sub_set_type_id; + gee_concurrent_set_sub_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SORTED_SET, "GeeConcurrentSetSubSet", &g_define_type_info, 0); + g_once_init_leave (&gee_concurrent_set_sub_set_type_id__volatile, gee_concurrent_set_sub_set_type_id); + } + return gee_concurrent_set_sub_set_type_id__volatile; +} + + +static void _vala_gee_concurrent_set_sub_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentSetSubSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSet); + switch (property_id) { + case GEE_CONCURRENT_SET_SUB_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_CONCURRENT_SET_SUB_SET_IS_EMPTY: + g_value_set_boolean (value, gee_concurrent_set_sub_set_get_is_empty (self)); + break; + case GEE_CONCURRENT_SET_SUB_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_set_sub_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentSetSubSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_SUB_SET, GeeConcurrentSetSubSet); + switch (property_id) { + case GEE_CONCURRENT_SET_SUB_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_SET_SUB_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_SET_SUB_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range) { + GeeConcurrentSetSubIterator * self = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + g_return_val_if_fail (range != NULL, NULL); + self = (GeeConcurrentSetSubIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = range; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, NULL, NULL); + _tmp1_ = range; + _tmp2_ = _gee_concurrent_set_range_ref0 (_tmp1_); + _gee_concurrent_set_range_unref0 (self->priv->_range); + self->priv->_range = _tmp2_; + return self; +} + + +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range) { + return gee_concurrent_set_sub_iterator_construct (GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, g_type, g_dup_func, g_destroy_func, range); +} + + +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_construct_point_at (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr) { + GeeConcurrentSetSubIterator * self = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRange* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetTowerIter _tmp3_; + GeeConcurrentSetTowerIter _tmp4_ = {0}; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* _tmp6_; + g_return_val_if_fail (range != NULL, NULL); + g_return_val_if_fail (prev != NULL, NULL); + g_return_val_if_fail (curr != NULL, NULL); + self = (GeeConcurrentSetSubIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = range; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, NULL, NULL); + _tmp1_ = range; + _tmp2_ = _gee_concurrent_set_range_ref0 (_tmp1_); + _gee_concurrent_set_range_unref0 (self->priv->_range); + self->priv->_range = _tmp2_; + _tmp3_ = *prev; + gee_concurrent_set_tower_iter_copy (&_tmp3_, &_tmp4_); + gee_concurrent_set_tower_iter_destroy (&self->priv->_prev); + self->priv->_prev = _tmp4_; + _tmp5_ = curr; + _tmp6_ = _gee_concurrent_set_tower_ref0 (_tmp5_); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp6_; + _gee_concurrent_set_tower_unref0 (curr); + return self; +} + + +static GeeConcurrentSetSubIterator* gee_concurrent_set_sub_iterator_new_point_at (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr) { + return gee_concurrent_set_sub_iterator_construct_point_at (GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, g_type, g_dup_func, g_destroy_func, range, prev, curr); +} + + +static gboolean gee_concurrent_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeConcurrentSetSubIterator * self; + gboolean result = FALSE; + GeeConcurrentSetTower* _tmp0_; + GeeHazardPointerContext* _tmp1_; + GeeHazardPointerContext* ctx; + gboolean _tmp2_ = FALSE; + gboolean _tmp3_ = FALSE; + GeeConcurrentSetTowerIter _tmp4_; + GeeConcurrentSetTower* _tmp5_; + gboolean _tmp7_; + GeeConcurrentSetTowerIter _tmp14_; + GeeConcurrentSetTower* _tmp15_; + GeeConcurrentSetTower* _tmp16_; + GeeConcurrentSetTower* new_prev; + GeeConcurrentSetTower* _tmp17_; + GeeConcurrentSetTower* _tmp18_; + GeeConcurrentSetTower* new_curr; + GeeConcurrentSetTower* _tmp45_; + self = (GeeConcurrentSetSubIterator*) base; + _tmp0_ = self->priv->_curr; + _vala_assert (_tmp0_ != NULL, "_curr != null"); + _tmp1_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp1_; + _tmp2_ = gee_concurrent_set_sub_iterator_begin (self); + if (!_tmp2_) { + result = TRUE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp4_ = self->priv->_prev; + _tmp5_ = _tmp4_._iter[0]; + if (_tmp5_ != NULL) { + gboolean _tmp6_; + _tmp6_ = self->priv->_removed; + _tmp3_ = !_tmp6_; + } else { + _tmp3_ = FALSE; + } + _tmp7_ = _tmp3_; + if (_tmp7_) { + GeeForallFunc _tmp8_; + void* _tmp8__target; + GeeConcurrentSetTower* _tmp9_; + gconstpointer _tmp10_; + gpointer _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp8_ = f; + _tmp8__target = f_target; + _tmp9_ = self->priv->_curr; + _tmp10_ = _tmp9_->_data; + _tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_); + _tmp12_ = _tmp8_ (_tmp11_, _tmp8__target); + if (!_tmp12_) { + GeeConcurrentSetTower* _tmp13_; + _tmp13_ = self->priv->_curr; + _vala_assert (_tmp13_ != NULL, "_curr != null"); + result = FALSE; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + } + _tmp14_ = self->priv->_prev; + _tmp15_ = _tmp14_._iter[0]; + _tmp16_ = _gee_concurrent_set_tower_ref0 (_tmp15_); + new_prev = _tmp16_; + _tmp17_ = self->priv->_curr; + _tmp18_ = _gee_concurrent_set_tower_ref0 (_tmp17_); + new_curr = _tmp18_; + while (TRUE) { + GeeConcurrentSetRange* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeConcurrentSetTower* _tmp21_; + GeeForallFunc _tmp22_; + void* _tmp22__target; + GeeConcurrentSetTower* _tmp23_; + gconstpointer _tmp24_; + gpointer _tmp25_; + gboolean _tmp26_ = FALSE; + gboolean _tmp28_; + GeeConcurrentSetTower* _tmp44_; + _tmp19_ = self->priv->_range; + _tmp20_ = gee_concurrent_set_range_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp19_, &new_prev, &new_curr, (guint8) 0); + if (!_tmp20_) { + break; + } + _tmp21_ = self->priv->_curr; + _vala_assert (_tmp21_ != NULL, "_curr != null"); + _tmp22_ = f; + _tmp22__target = f_target; + _tmp23_ = self->priv->_curr; + _tmp24_ = _tmp23_->_data; + _tmp25_ = ((_tmp24_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp24_) : ((gpointer) _tmp24_); + _tmp26_ = _tmp22_ (_tmp25_, _tmp22__target); + if (!_tmp26_) { + GeeConcurrentSetTower* _tmp27_; + _tmp27_ = self->priv->_curr; + _vala_assert (_tmp27_ != NULL, "_curr != null"); + result = FALSE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _tmp28_ = self->priv->_removed; + if (!_tmp28_) { + GeeConcurrentSetTower* _tmp29_; + GeeConcurrentSetTower* _tmp30_; + GeeConcurrentSetTowerIter _tmp31_; + GeeConcurrentSetTower* _tmp32_; + gint _tmp33_ = 0; + gint prev_height; + _tmp29_ = new_prev; + new_prev = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[0]); + self->priv->_prev._iter[0] = _tmp29_; + _tmp30_ = self->priv->_prev._iter[0]; + _tmp31_ = self->priv->_prev; + _tmp32_ = _tmp31_._iter[0]; + _tmp33_ = gee_concurrent_set_tower_get_height (_tmp32_); + prev_height = _tmp33_; + { + gint i; + i = 1; + { + gboolean _tmp34_; + _tmp34_ = TRUE; + while (TRUE) { + gboolean _tmp35_; + gint _tmp37_; + gint _tmp38_; + gint _tmp39_; + GeeConcurrentSetTowerIter _tmp40_; + GeeConcurrentSetTower* _tmp41_; + GeeConcurrentSetTower* _tmp42_; + GeeConcurrentSetTower* _tmp43_; + _tmp35_ = _tmp34_; + if (!_tmp35_) { + gint _tmp36_; + _tmp36_ = i; + i = _tmp36_ + 1; + } + _tmp34_ = FALSE; + _tmp37_ = i; + _tmp38_ = prev_height; + if (!(_tmp37_ < _tmp38_)) { + break; + } + _tmp39_ = i; + _tmp40_ = self->priv->_prev; + _tmp41_ = _tmp40_._iter[0]; + _tmp42_ = _gee_concurrent_set_tower_ref0 (_tmp41_); + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[_tmp39_]); + self->priv->_prev._iter[_tmp39_] = _tmp42_; + _tmp43_ = self->priv->_prev._iter[_tmp39_]; + } + } + } + } + _tmp44_ = new_curr; + new_curr = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp44_; + self->priv->_removed = FALSE; + } + _tmp45_ = self->priv->_curr; + _vala_assert (_tmp45_ != NULL, "_curr != null"); + result = TRUE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; +} + + +static gboolean gee_concurrent_set_sub_iterator_real_next (GeeIterator* base) { + GeeConcurrentSetSubIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + self = (GeeConcurrentSetSubIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + if (_tmp2_ == NULL) { + gboolean _tmp3_ = FALSE; + _tmp3_ = gee_concurrent_set_sub_iterator_begin (self); + result = _tmp3_; + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + GeeConcurrentSetTowerIter _tmp4_; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* new_prev; + GeeConcurrentSetTower* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetTower* new_curr; + GeeConcurrentSetRange* _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp4_ = self->priv->_prev; + _tmp5_ = _tmp4_._iter[0]; + _tmp6_ = _gee_concurrent_set_tower_ref0 (_tmp5_); + new_prev = _tmp6_; + _tmp7_ = self->priv->_curr; + _tmp8_ = _gee_concurrent_set_tower_ref0 (_tmp7_); + new_curr = _tmp8_; + _tmp9_ = self->priv->_range; + _tmp10_ = gee_concurrent_set_range_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp9_, &new_prev, &new_curr, (guint8) 0); + if (_tmp10_) { + gboolean _tmp11_; + GeeConcurrentSetTower* _tmp27_; + _tmp11_ = self->priv->_removed; + if (!_tmp11_) { + GeeConcurrentSetTower* _tmp12_; + GeeConcurrentSetTower* _tmp13_; + GeeConcurrentSetTowerIter _tmp14_; + GeeConcurrentSetTower* _tmp15_; + gint _tmp16_ = 0; + gint prev_height; + _tmp12_ = new_prev; + new_prev = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[0]); + self->priv->_prev._iter[0] = _tmp12_; + _tmp13_ = self->priv->_prev._iter[0]; + _tmp14_ = self->priv->_prev; + _tmp15_ = _tmp14_._iter[0]; + _tmp16_ = gee_concurrent_set_tower_get_height (_tmp15_); + prev_height = _tmp16_; + { + gint i; + i = 1; + { + gboolean _tmp17_; + _tmp17_ = TRUE; + while (TRUE) { + gboolean _tmp18_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + GeeConcurrentSetTowerIter _tmp23_; + GeeConcurrentSetTower* _tmp24_; + GeeConcurrentSetTower* _tmp25_; + GeeConcurrentSetTower* _tmp26_; + _tmp18_ = _tmp17_; + if (!_tmp18_) { + gint _tmp19_; + _tmp19_ = i; + i = _tmp19_ + 1; + } + _tmp17_ = FALSE; + _tmp20_ = i; + _tmp21_ = prev_height; + if (!(_tmp20_ < _tmp21_)) { + break; + } + _tmp22_ = i; + _tmp23_ = self->priv->_prev; + _tmp24_ = _tmp23_._iter[0]; + _tmp25_ = _gee_concurrent_set_tower_ref0 (_tmp24_); + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[_tmp22_]); + self->priv->_prev._iter[_tmp22_] = _tmp25_; + _tmp26_ = self->priv->_prev._iter[_tmp22_]; + } + } + } + } + _tmp27_ = new_curr; + new_curr = NULL; + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp27_; + self->priv->_removed = FALSE; + result = TRUE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + result = FALSE; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gboolean gee_concurrent_set_sub_iterator_real_has_next (GeeIterator* base) { + GeeConcurrentSetSubIterator * self; + gboolean result = FALSE; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + self = (GeeConcurrentSetSubIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + if (_tmp2_ == NULL) { + GeeConcurrentSetTower* next = NULL; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetTower* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + GeeConcurrentSetTower* _tmp6_; + gboolean _tmp10_; + GeeConcurrentSetTower* _tmp11_; + _tmp3_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp3_, &_tmp4_, NULL); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp4_; + _tmp6_ = next; + if (_tmp6_ != NULL) { + GeeConcurrentSetRange* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + gboolean _tmp9_ = FALSE; + _tmp7_ = self->priv->_range; + _tmp8_ = next; + _tmp9_ = gee_concurrent_set_range_beyond (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp8_); + _tmp5_ = _tmp9_; + } else { + _tmp5_ = FALSE; + } + _tmp10_ = _tmp5_; + if (_tmp10_) { + _gee_concurrent_set_tower_unref0 (next); + next = NULL; + } + _tmp11_ = next; + result = _tmp11_ != NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } else { + GeeConcurrentSetTowerIter _tmp12_; + GeeConcurrentSetTower* _tmp13_; + GeeConcurrentSetTower* _tmp14_; + GeeConcurrentSetTower* new_prev; + GeeConcurrentSetTower* _tmp15_; + GeeConcurrentSetTower* _tmp16_; + GeeConcurrentSetTower* new_curr; + GeeConcurrentSetRange* _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp12_ = self->priv->_prev; + _tmp13_ = _tmp12_._iter[0]; + _tmp14_ = _gee_concurrent_set_tower_ref0 (_tmp13_); + new_prev = _tmp14_; + _tmp15_ = self->priv->_curr; + _tmp16_ = _gee_concurrent_set_tower_ref0 (_tmp15_); + new_curr = _tmp16_; + _tmp17_ = self->priv->_range; + _tmp18_ = gee_concurrent_set_range_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp17_, &new_prev, &new_curr, (guint8) 0); + result = _tmp18_; + _gee_concurrent_set_tower_unref0 (new_curr); + _gee_concurrent_set_tower_unref0 (new_prev); + _gee_hazard_pointer_context_free0 (ctx); + return result; + } + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gpointer gee_concurrent_set_sub_iterator_real_get (GeeIterator* base) { + GeeConcurrentSetSubIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeConcurrentSetTower* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + self = (GeeConcurrentSetSubIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = self->priv->_curr; + _tmp3_ = _tmp2_->_data; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + result = _tmp4_; + return result; +} + + +static void gee_concurrent_set_sub_iterator_real_remove (GeeIterator* base) { + GeeConcurrentSetSubIterator * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + gboolean _tmp1_; + gboolean _tmp2_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSet* _tmp4_; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + GeeConcurrentSetTower* _tmp6_; + gboolean _tmp7_ = FALSE; + self = (GeeConcurrentSetSubIterator*) base; + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp2_ = _tmp1_; + _vala_assert (_tmp2_, "valid"); + _tmp3_ = self->priv->_range; + _tmp4_ = _tmp3_->_set; + _tmp5_ = _tmp4_->priv->_cmp; + _tmp5__target = _tmp4_->priv->_cmp_target; + _tmp6_ = self->priv->_curr; + _tmp7_ = gee_concurrent_set_tower_remove (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_, _tmp5__target, &self->priv->_prev, _tmp6_); + if (_tmp7_) { + GeeConcurrentSetRange* _tmp8_; + GeeConcurrentSet* _tmp9_; + _tmp8_ = self->priv->_range; + _tmp9_ = _tmp8_->_set; + g_atomic_int_dec_and_test ((volatile gint *) (&_tmp9_->priv->_size)); + } + self->priv->_removed = TRUE; + _gee_hazard_pointer_context_free0 (ctx); +} + + +static gboolean gee_concurrent_set_sub_iterator_begin (GeeConcurrentSetSubIterator* self) { + gboolean result = FALSE; + GeeConcurrentSetTowerIter _tmp0_; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetTower* _tmp3_ = NULL; + GeeConcurrentSetTowerIter _tmp4_ = {0}; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* _tmp12_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->_prev; + _tmp1_ = _tmp0_._iter[0]; + if (_tmp1_ != NULL) { + result = TRUE; + return result; + } + _tmp2_ = self->priv->_range; + gee_concurrent_set_range_improve_bookmark (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp2_, &_tmp3_, &_tmp4_); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + self->priv->_curr = _tmp3_; + gee_concurrent_set_tower_iter_destroy (&self->priv->_prev); + self->priv->_prev = _tmp4_; + _tmp5_ = self->priv->_curr; + if (_tmp5_ == NULL) { + { + gint i; + i = 0; + { + gboolean _tmp6_; + _tmp6_ = TRUE; + while (TRUE) { + gboolean _tmp7_; + gint _tmp9_; + gint _tmp10_; + GeeConcurrentSetTower* _tmp11_; + _tmp7_ = _tmp6_; + if (!_tmp7_) { + gint _tmp8_; + _tmp8_ = i; + i = _tmp8_ + 1; + } + _tmp6_ = FALSE; + _tmp9_ = i; + if (!(_tmp9_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp10_ = i; + _gee_concurrent_set_tower_unref0 (self->priv->_prev._iter[_tmp10_]); + self->priv->_prev._iter[_tmp10_] = NULL; + _tmp11_ = self->priv->_prev._iter[_tmp10_]; + } + } + } + } + _tmp12_ = self->priv->_curr; + result = _tmp12_ != NULL; + return result; +} + + +static gboolean gee_concurrent_set_sub_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeConcurrentSetSubIterator* self; + gboolean _tmp0_ = FALSE; + GeeConcurrentSetTowerIter _tmp1_; + GeeConcurrentSetTower* _tmp2_; + gboolean _tmp4_; + gboolean is_valid; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_; + gboolean _tmp8_; + gboolean _tmp9_; + self = (GeeConcurrentSetSubIterator*) base; + _tmp1_ = self->priv->_prev; + _tmp2_ = _tmp1_._iter[0]; + if (_tmp2_ != NULL) { + gboolean _tmp3_; + _tmp3_ = self->priv->_removed; + _tmp0_ = !_tmp3_; + } else { + _tmp0_ = FALSE; + } + _tmp4_ = _tmp0_; + is_valid = _tmp4_; + _tmp6_ = is_valid; + if (!_tmp6_) { + _tmp5_ = TRUE; + } else { + GeeConcurrentSetTower* _tmp7_; + _tmp7_ = self->priv->_curr; + _tmp5_ = _tmp7_ != NULL; + } + _tmp8_ = _tmp5_; + _vala_assert (_tmp8_, "!is_valid || _curr != null"); + _tmp9_ = is_valid; + result = _tmp9_; + return result; +} + + +static gboolean gee_concurrent_set_sub_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeConcurrentSetSubIterator* self; + self = (GeeConcurrentSetSubIterator*) base; + result = FALSE; + return result; +} + + +static void gee_concurrent_set_sub_iterator_class_init (GeeConcurrentSetSubIteratorClass * klass) { + gee_concurrent_set_sub_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentSetSubIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_set_sub_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_set_sub_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_set_sub_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SUB_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_concurrent_set_sub_iterator_gee_traversable_get_g_type (GeeConcurrentSetSubIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_concurrent_set_sub_iterator_gee_traversable_get_g_dup_func (GeeConcurrentSetSubIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_concurrent_set_sub_iterator_gee_traversable_get_g_destroy_func (GeeConcurrentSetSubIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_concurrent_set_sub_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_concurrent_set_sub_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_concurrent_set_sub_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_concurrent_set_sub_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_concurrent_set_sub_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_concurrent_set_sub_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_concurrent_set_sub_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_concurrent_set_sub_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->next = (gboolean (*)(GeeIterator*)) gee_concurrent_set_sub_iterator_real_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_concurrent_set_sub_iterator_real_has_next; + iface->get = (gpointer (*)(GeeIterator*)) gee_concurrent_set_sub_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_concurrent_set_sub_iterator_real_remove; + iface->get_valid = gee_concurrent_set_sub_iterator_real_get_valid; + iface->get_read_only = gee_concurrent_set_sub_iterator_real_get_read_only; +} + + +static void gee_concurrent_set_sub_iterator_instance_init (GeeConcurrentSetSubIterator * self) { + self->priv = GEE_CONCURRENT_SET_SUB_ITERATOR_GET_PRIVATE (self); + self->priv->_curr = NULL; + self->priv->_removed = FALSE; +} + + +static void gee_concurrent_set_sub_iterator_finalize (GObject* obj) { + GeeConcurrentSetSubIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIterator); + _gee_concurrent_set_range_unref0 (self->priv->_range); + gee_concurrent_set_tower_iter_destroy (&self->priv->_prev); + _gee_concurrent_set_tower_unref0 (self->priv->_curr); + G_OBJECT_CLASS (gee_concurrent_set_sub_iterator_parent_class)->finalize (obj); +} + + +static GType gee_concurrent_set_sub_iterator_get_type (void) { + static volatile gsize gee_concurrent_set_sub_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_sub_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetSubIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_sub_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSetSubIterator), 0, (GInstanceInitFunc) gee_concurrent_set_sub_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_concurrent_set_sub_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_concurrent_set_sub_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_concurrent_set_sub_iterator_type_id; + gee_concurrent_set_sub_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeConcurrentSetSubIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_concurrent_set_sub_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_concurrent_set_sub_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_concurrent_set_sub_iterator_type_id__volatile, gee_concurrent_set_sub_iterator_type_id); + } + return gee_concurrent_set_sub_iterator_type_id__volatile; +} + + +static void _vala_gee_concurrent_set_sub_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentSetSubIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIterator); + switch (property_id) { + case GEE_CONCURRENT_SET_SUB_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_CONCURRENT_SET_SUB_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_set_sub_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentSetSubIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_SET_TYPE_SUB_ITERATOR, GeeConcurrentSetSubIterator); + switch (property_id) { + case GEE_CONCURRENT_SET_SUB_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_SET_SUB_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_SET_SUB_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GType gee_concurrent_set_range_position_get_type (void) { + static volatile gsize gee_concurrent_set_range_position_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_range_position_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE, "GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE", "before"}, {GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE, "GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE", "inside"}, {GEE_CONCURRENT_SET_RANGE_POSITION_AFTER, "GEE_CONCURRENT_SET_RANGE_POSITION_AFTER", "after"}, {GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY, "GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY", "empty"}, {0, NULL, NULL}}; + GType gee_concurrent_set_range_position_type_id; + gee_concurrent_set_range_position_type_id = g_enum_register_static ("GeeConcurrentSetRangePosition", values); + g_once_init_leave (&gee_concurrent_set_range_position_type_id__volatile, gee_concurrent_set_range_position_type_id); + } + return gee_concurrent_set_range_position_type_id__volatile; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start, gconstpointer end) { + GeeConcurrentSetRange* self = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_; + GeeConcurrentSet* _tmp4_; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_ = 0; + GeeConcurrentSet* _tmp18_; + GeeConcurrentSet* _tmp19_; + g_return_val_if_fail (cset != NULL, NULL); + self = (GeeConcurrentSetRange*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = start; + _tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + _g_destroy_func0 (self->_start); + self->_start = _tmp1_; + _tmp2_ = end; + _tmp3_ = ((_tmp2_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + _g_destroy_func0 (self->_end); + self->_end = _tmp3_; + _tmp4_ = cset; + _tmp5_ = _tmp4_->priv->_cmp; + _tmp5__target = _tmp4_->priv->_cmp_target; + _tmp6_ = start; + _tmp7_ = end; + _tmp8_ = _tmp5_ (_tmp6_, _tmp7_, _tmp5__target); + if (_tmp8_ < 0) { + self->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + { + gint i; + i = 0; + { + gboolean _tmp9_; + _tmp9_ = TRUE; + while (TRUE) { + gboolean _tmp10_; + gint _tmp12_; + gint _tmp13_; + GeeConcurrentSet* _tmp14_; + GeeConcurrentSetTower* _tmp15_; + GeeConcurrentSetTower* _tmp16_; + GeeConcurrentSetTower* _tmp17_; + _tmp10_ = _tmp9_; + if (!_tmp10_) { + gint _tmp11_; + _tmp11_ = i; + i = _tmp11_ + 1; + } + _tmp9_ = FALSE; + _tmp12_ = i; + if (!(_tmp12_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp13_ = i; + _tmp14_ = cset; + _tmp15_ = _tmp14_->priv->_head; + _tmp16_ = _gee_concurrent_set_tower_ref0 (_tmp15_); + _gee_concurrent_set_tower_unref0 (self->_bookmark._iter[_tmp13_]); + self->_bookmark._iter[_tmp13_] = _tmp16_; + _tmp17_ = self->_bookmark._iter[_tmp13_]; + } + } + } + } else { + self->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + _tmp18_ = cset; + _tmp19_ = _g_object_ref0 (_tmp18_); + _g_object_unref0 (self->_set); + self->_set = _tmp19_; + return self; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start, gconstpointer end) { + return gee_concurrent_set_range_construct (GEE_CONCURRENT_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, cset, start, end); +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer end) { + GeeConcurrentSetRange* self = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + GeeConcurrentSet* _tmp11_; + GeeConcurrentSet* _tmp12_; + g_return_val_if_fail (cset != NULL, NULL); + self = (GeeConcurrentSetRange*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = end; + _tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + _g_destroy_func0 (self->_end); + self->_end = _tmp1_; + self->_type = GEE_CONCURRENT_SET_RANGE_TYPE_HEAD; + { + gint i; + i = 0; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + gint _tmp5_; + gint _tmp6_; + GeeConcurrentSet* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetTower* _tmp9_; + GeeConcurrentSetTower* _tmp10_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + gint _tmp4_; + _tmp4_ = i; + i = _tmp4_ + 1; + } + _tmp2_ = FALSE; + _tmp5_ = i; + if (!(_tmp5_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp6_ = i; + _tmp7_ = cset; + _tmp8_ = _tmp7_->priv->_head; + _tmp9_ = _gee_concurrent_set_tower_ref0 (_tmp8_); + _gee_concurrent_set_tower_unref0 (self->_bookmark._iter[_tmp6_]); + self->_bookmark._iter[_tmp6_] = _tmp9_; + _tmp10_ = self->_bookmark._iter[_tmp6_]; + } + } + } + _tmp11_ = cset; + _tmp12_ = _g_object_ref0 (_tmp11_); + _g_object_unref0 (self->_set); + self->_set = _tmp12_; + return self; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer end) { + return gee_concurrent_set_range_construct_head (GEE_CONCURRENT_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, cset, end); +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start) { + GeeConcurrentSetRange* self = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + GeeConcurrentSet* _tmp11_; + GeeConcurrentSet* _tmp12_; + g_return_val_if_fail (cset != NULL, NULL); + self = (GeeConcurrentSetRange*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = start; + _tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + _g_destroy_func0 (self->_start); + self->_start = _tmp1_; + self->_type = GEE_CONCURRENT_SET_RANGE_TYPE_TAIL; + { + gint i; + i = 0; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + gint _tmp5_; + gint _tmp6_; + GeeConcurrentSet* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetTower* _tmp9_; + GeeConcurrentSetTower* _tmp10_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + gint _tmp4_; + _tmp4_ = i; + i = _tmp4_ + 1; + } + _tmp2_ = FALSE; + _tmp5_ = i; + if (!(_tmp5_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp6_ = i; + _tmp7_ = cset; + _tmp8_ = _tmp7_->priv->_head; + _tmp9_ = _gee_concurrent_set_tower_ref0 (_tmp8_); + _gee_concurrent_set_tower_unref0 (self->_bookmark._iter[_tmp6_]); + self->_bookmark._iter[_tmp6_] = _tmp9_; + _tmp10_ = self->_bookmark._iter[_tmp6_]; + } + } + } + _tmp11_ = cset; + _tmp12_ = _g_object_ref0 (_tmp11_); + _g_object_unref0 (self->_set); + self->_set = _tmp12_; + return self; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset, gconstpointer start) { + return gee_concurrent_set_range_construct_tail (GEE_CONCURRENT_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, cset, start); +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_construct_empty (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset) { + GeeConcurrentSetRange* self = NULL; + GeeConcurrentSet* _tmp0_; + GeeConcurrentSet* _tmp1_; + g_return_val_if_fail (cset != NULL, NULL); + self = (GeeConcurrentSetRange*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + self->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + _tmp0_ = cset; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_set); + self->_set = _tmp1_; + return self; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_new_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSet* cset) { + return gee_concurrent_set_range_construct_empty (GEE_CONCURRENT_SET_TYPE_RANGE, g_type, g_dup_func, g_destroy_func, cset); +} + + +static void gee_concurrent_set_range_copy_bookmark (GeeConcurrentSetRange* self, GeeConcurrentSetRange* range) { + g_return_if_fail (self != NULL); + g_return_if_fail (range != NULL); + { + gint i; + i = 0; + { + gboolean _tmp0_; + _tmp0_ = TRUE; + while (TRUE) { + gboolean _tmp1_; + gint _tmp3_; + gint _tmp4_; + GeeConcurrentSetRange* _tmp5_; + gint _tmp6_; + gpointer _tmp7_ = NULL; + GeeConcurrentSetTower* _tmp8_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; + } + _tmp0_ = FALSE; + _tmp3_ = i; + if (!(_tmp3_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp4_ = i; + _tmp5_ = range; + _tmp6_ = i; + _tmp7_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp5_->_bookmark._iter[_tmp6_], (gsize) 0, NULL); + _gee_concurrent_set_tower_unref0 (self->_bookmark._iter[_tmp4_]); + self->_bookmark._iter[_tmp4_] = (GeeConcurrentSetTower*) _tmp7_; + _tmp8_ = self->_bookmark._iter[_tmp4_]; + } + } + } +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_cut_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer start) { + GeeConcurrentSetRange* result = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSet* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetRange* _result_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetRangeType _tmp4_; + GeeConcurrentSetRange* _tmp52_; + GeeConcurrentSetRangeType _tmp53_; + g_return_val_if_fail (from != NULL, NULL); + _tmp0_ = from; + _tmp1_ = _tmp0_->_set; + _tmp2_ = gee_concurrent_set_range_new_empty (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp1_); + _result_ = _tmp2_; + _tmp3_ = from; + _tmp4_ = _tmp3_->_type; + switch (_tmp4_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSet* _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gconstpointer _tmp8_; + GeeConcurrentSetRange* _tmp9_; + gconstpointer _tmp10_; + gint _tmp11_ = 0; + _tmp5_ = from; + _tmp6_ = _tmp5_->_set; + _tmp7_ = _tmp6_->priv->_cmp; + _tmp7__target = _tmp6_->priv->_cmp_target; + _tmp8_ = start; + _tmp9_ = from; + _tmp10_ = _tmp9_->_end; + _tmp11_ = _tmp7_ (_tmp8_, _tmp10_, _tmp7__target); + if (_tmp11_ < 0) { + GeeConcurrentSetRange* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + GeeConcurrentSetRange* _tmp15_; + GeeConcurrentSetRange* _tmp16_; + gconstpointer _tmp17_; + gpointer _tmp18_; + GeeConcurrentSetRange* _tmp19_; + _tmp12_ = _result_; + _tmp13_ = start; + _tmp14_ = ((_tmp13_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _g_destroy_func0 (_tmp12_->_start); + _tmp12_->_start = _tmp14_; + _tmp15_ = _result_; + _tmp16_ = from; + _tmp17_ = _tmp16_->_end; + _tmp18_ = ((_tmp17_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp17_) : ((gpointer) _tmp17_); + _g_destroy_func0 (_tmp15_->_end); + _tmp15_->_end = _tmp18_; + _tmp19_ = _result_; + _tmp19_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + } else { + GeeConcurrentSetRange* _tmp20_; + _tmp20_ = _result_; + _tmp20_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRange* _tmp21_; + GeeConcurrentSetRange* _tmp22_; + GeeConcurrentSet* _tmp23_; + GeeConcurrentSetRange* _tmp24_; + gconstpointer _tmp25_; + gconstpointer _tmp26_; + gconstpointer _tmp27_ = NULL; + gpointer _tmp28_; + GeeConcurrentSetRange* _tmp29_; + _tmp21_ = _result_; + _tmp22_ = from; + _tmp23_ = _tmp22_->_set; + _tmp24_ = from; + _tmp25_ = _tmp24_->_start; + _tmp26_ = start; + _tmp27_ = gee_concurrent_set_max (_tmp23_, _tmp25_, _tmp26_, NULL); + _tmp28_ = ((_tmp27_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp27_) : ((gpointer) _tmp27_); + _g_destroy_func0 (_tmp21_->_start); + _tmp21_->_start = _tmp28_; + _tmp29_ = _result_; + _tmp29_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_TAIL; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetRange* _tmp30_; + GeeConcurrentSet* _tmp31_; + GCompareDataFunc _tmp32_; + void* _tmp32__target; + GeeConcurrentSetRange* _tmp33_; + gconstpointer _tmp34_; + gconstpointer _tmp35_; + gint _tmp36_ = 0; + _tmp30_ = from; + _tmp31_ = _tmp30_->_set; + _tmp32_ = _tmp31_->priv->_cmp; + _tmp32__target = _tmp31_->priv->_cmp_target; + _tmp33_ = from; + _tmp34_ = _tmp33_->_start; + _tmp35_ = start; + _tmp36_ = _tmp32_ (_tmp34_, _tmp35_, _tmp32__target); + if (_tmp36_ < 0) { + GeeConcurrentSetRange* _tmp37_; + GeeConcurrentSetRange* _tmp38_; + GeeConcurrentSet* _tmp39_; + GeeConcurrentSetRange* _tmp40_; + gconstpointer _tmp41_; + gconstpointer _tmp42_; + gconstpointer _tmp43_ = NULL; + gpointer _tmp44_; + GeeConcurrentSetRange* _tmp45_; + GeeConcurrentSetRange* _tmp46_; + gconstpointer _tmp47_; + gpointer _tmp48_; + GeeConcurrentSetRange* _tmp49_; + _tmp37_ = _result_; + _tmp38_ = from; + _tmp39_ = _tmp38_->_set; + _tmp40_ = from; + _tmp41_ = _tmp40_->_start; + _tmp42_ = start; + _tmp43_ = gee_concurrent_set_max (_tmp39_, _tmp41_, _tmp42_, NULL); + _tmp44_ = ((_tmp43_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp43_) : ((gpointer) _tmp43_); + _g_destroy_func0 (_tmp37_->_start); + _tmp37_->_start = _tmp44_; + _tmp45_ = _result_; + _tmp46_ = from; + _tmp47_ = _tmp46_->_end; + _tmp48_ = ((_tmp47_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp47_) : ((gpointer) _tmp47_); + _g_destroy_func0 (_tmp45_->_end); + _tmp45_->_end = _tmp48_; + _tmp49_ = _result_; + _tmp49_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + } else { + GeeConcurrentSetRange* _tmp50_; + _tmp50_ = _result_; + _tmp50_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + GeeConcurrentSetRange* _tmp51_; + _tmp51_ = _result_; + _tmp51_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + break; + } + default: + { + g_assert_not_reached (); + } + } + _tmp52_ = _result_; + _tmp53_ = _tmp52_->_type; + if (_tmp53_ != GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY) { + GeeConcurrentSetRange* _tmp54_; + GeeConcurrentSetRange* _tmp55_; + GeeConcurrentSetRange* _tmp56_; + GeeConcurrentSetRange* _tmp57_; + _tmp54_ = from; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp54_, NULL, NULL); + _tmp55_ = _result_; + _tmp56_ = from; + gee_concurrent_set_range_copy_bookmark (_tmp55_, _tmp56_); + _tmp57_ = _result_; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp57_, NULL, NULL); + } + result = _result_; + return result; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_cut_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer end) { + GeeConcurrentSetRange* result = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSet* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetRange* _result_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetRangeType _tmp4_; + GeeConcurrentSetRange* _tmp52_; + GeeConcurrentSetRangeType _tmp53_; + g_return_val_if_fail (from != NULL, NULL); + _tmp0_ = from; + _tmp1_ = _tmp0_->_set; + _tmp2_ = gee_concurrent_set_range_new_empty (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp1_); + _result_ = _tmp2_; + _tmp3_ = from; + _tmp4_ = _tmp3_->_type; + switch (_tmp4_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + GeeConcurrentSetRange* _tmp5_; + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GeeConcurrentSetRange* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + gconstpointer _tmp11_ = NULL; + gpointer _tmp12_; + GeeConcurrentSetRange* _tmp13_; + _tmp5_ = _result_; + _tmp6_ = from; + _tmp7_ = _tmp6_->_set; + _tmp8_ = from; + _tmp9_ = _tmp8_->_end; + _tmp10_ = end; + _tmp11_ = gee_concurrent_set_min (_tmp7_, _tmp9_, _tmp10_, NULL); + _tmp12_ = ((_tmp11_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_); + _g_destroy_func0 (_tmp5_->_end); + _tmp5_->_end = _tmp12_; + _tmp13_ = _result_; + _tmp13_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_HEAD; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRange* _tmp14_; + GeeConcurrentSet* _tmp15_; + GCompareDataFunc _tmp16_; + void* _tmp16__target; + GeeConcurrentSetRange* _tmp17_; + gconstpointer _tmp18_; + gconstpointer _tmp19_; + gint _tmp20_ = 0; + _tmp14_ = from; + _tmp15_ = _tmp14_->_set; + _tmp16_ = _tmp15_->priv->_cmp; + _tmp16__target = _tmp15_->priv->_cmp_target; + _tmp17_ = from; + _tmp18_ = _tmp17_->_start; + _tmp19_ = end; + _tmp20_ = _tmp16_ (_tmp18_, _tmp19_, _tmp16__target); + if (_tmp20_ < 0) { + GeeConcurrentSetRange* _tmp21_; + GeeConcurrentSetRange* _tmp22_; + gconstpointer _tmp23_; + gpointer _tmp24_; + GeeConcurrentSetRange* _tmp25_; + gconstpointer _tmp26_; + gpointer _tmp27_; + GeeConcurrentSetRange* _tmp28_; + _tmp21_ = _result_; + _tmp22_ = from; + _tmp23_ = _tmp22_->_start; + _tmp24_ = ((_tmp23_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp23_) : ((gpointer) _tmp23_); + _g_destroy_func0 (_tmp21_->_start); + _tmp21_->_start = _tmp24_; + _tmp25_ = _result_; + _tmp26_ = end; + _tmp27_ = ((_tmp26_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp26_) : ((gpointer) _tmp26_); + _g_destroy_func0 (_tmp25_->_end); + _tmp25_->_end = _tmp27_; + _tmp28_ = _result_; + _tmp28_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + } else { + GeeConcurrentSetRange* _tmp29_; + _tmp29_ = _result_; + _tmp29_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetRange* _tmp30_; + GeeConcurrentSet* _tmp31_; + GCompareDataFunc _tmp32_; + void* _tmp32__target; + GeeConcurrentSetRange* _tmp33_; + gconstpointer _tmp34_; + gconstpointer _tmp35_; + gint _tmp36_ = 0; + _tmp30_ = from; + _tmp31_ = _tmp30_->_set; + _tmp32_ = _tmp31_->priv->_cmp; + _tmp32__target = _tmp31_->priv->_cmp_target; + _tmp33_ = from; + _tmp34_ = _tmp33_->_start; + _tmp35_ = end; + _tmp36_ = _tmp32_ (_tmp34_, _tmp35_, _tmp32__target); + if (_tmp36_ < 0) { + GeeConcurrentSetRange* _tmp37_; + GeeConcurrentSetRange* _tmp38_; + gconstpointer _tmp39_; + gpointer _tmp40_; + GeeConcurrentSetRange* _tmp41_; + GeeConcurrentSetRange* _tmp42_; + GeeConcurrentSet* _tmp43_; + GeeConcurrentSetRange* _tmp44_; + gconstpointer _tmp45_; + gconstpointer _tmp46_; + gconstpointer _tmp47_ = NULL; + gpointer _tmp48_; + GeeConcurrentSetRange* _tmp49_; + _tmp37_ = _result_; + _tmp38_ = from; + _tmp39_ = _tmp38_->_start; + _tmp40_ = ((_tmp39_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp39_) : ((gpointer) _tmp39_); + _g_destroy_func0 (_tmp37_->_start); + _tmp37_->_start = _tmp40_; + _tmp41_ = _result_; + _tmp42_ = from; + _tmp43_ = _tmp42_->_set; + _tmp44_ = from; + _tmp45_ = _tmp44_->_end; + _tmp46_ = end; + _tmp47_ = gee_concurrent_set_min (_tmp43_, _tmp45_, _tmp46_, NULL); + _tmp48_ = ((_tmp47_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp47_) : ((gpointer) _tmp47_); + _g_destroy_func0 (_tmp41_->_end); + _tmp41_->_end = _tmp48_; + _tmp49_ = _result_; + _tmp49_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + } else { + GeeConcurrentSetRange* _tmp50_; + _tmp50_ = _result_; + _tmp50_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + GeeConcurrentSetRange* _tmp51_; + _tmp51_ = _result_; + _tmp51_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + break; + } + default: + { + g_assert_not_reached (); + } + } + _tmp52_ = _result_; + _tmp53_ = _tmp52_->_type; + if (_tmp53_ != GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY) { + GeeConcurrentSetRange* _tmp54_; + GeeConcurrentSetRange* _tmp55_; + GeeConcurrentSetRange* _tmp56_; + GeeConcurrentSetRange* _tmp57_; + _tmp54_ = from; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp54_, NULL, NULL); + _tmp55_ = _result_; + _tmp56_ = from; + gee_concurrent_set_range_copy_bookmark (_tmp55_, _tmp56_); + _tmp57_ = _result_; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp57_, NULL, NULL); + } + result = _result_; + return result; +} + + +static GeeConcurrentSetRange* gee_concurrent_set_range_cut (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* from, gconstpointer start, gconstpointer end) { + GeeConcurrentSetRange* result = NULL; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSet* _tmp1_; + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSetRange* _result_; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSetRange* _tmp4_; + GeeConcurrentSetRangeType _tmp5_; + gboolean _tmp31_ = FALSE; + GeeConcurrentSetRange* _tmp32_; + GeeConcurrentSetRangeType _tmp33_; + gboolean _tmp40_; + GeeConcurrentSetRange* _tmp49_; + GeeConcurrentSetRangeType _tmp50_; + g_return_val_if_fail (from != NULL, NULL); + _tmp0_ = from; + _tmp1_ = _tmp0_->_set; + _tmp2_ = gee_concurrent_set_range_new_empty (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp1_); + _result_ = _tmp2_; + _tmp3_ = _result_; + _tmp3_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + _tmp4_ = from; + _tmp5_ = _tmp4_->_type; + switch (_tmp5_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + GeeConcurrentSetRange* _tmp6_; + GeeConcurrentSet* _tmp7_; + GeeConcurrentSetRange* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + gconstpointer _tmp11_ = NULL; + _tmp6_ = from; + _tmp7_ = _tmp6_->_set; + _tmp8_ = from; + _tmp9_ = _tmp8_->_end; + _tmp10_ = end; + _tmp11_ = gee_concurrent_set_min (_tmp7_, _tmp9_, _tmp10_, NULL); + end = _tmp11_; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRange* _tmp12_; + GeeConcurrentSet* _tmp13_; + GeeConcurrentSetRange* _tmp14_; + gconstpointer _tmp15_; + gconstpointer _tmp16_; + gconstpointer _tmp17_ = NULL; + _tmp12_ = from; + _tmp13_ = _tmp12_->_set; + _tmp14_ = from; + _tmp15_ = _tmp14_->_start; + _tmp16_ = start; + _tmp17_ = gee_concurrent_set_max (_tmp13_, _tmp15_, _tmp16_, NULL); + start = _tmp17_; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetRange* _tmp18_; + GeeConcurrentSet* _tmp19_; + GeeConcurrentSetRange* _tmp20_; + gconstpointer _tmp21_; + gconstpointer _tmp22_; + gconstpointer _tmp23_ = NULL; + GeeConcurrentSetRange* _tmp24_; + GeeConcurrentSet* _tmp25_; + GeeConcurrentSetRange* _tmp26_; + gconstpointer _tmp27_; + gconstpointer _tmp28_; + gconstpointer _tmp29_ = NULL; + _tmp18_ = from; + _tmp19_ = _tmp18_->_set; + _tmp20_ = from; + _tmp21_ = _tmp20_->_start; + _tmp22_ = start; + _tmp23_ = gee_concurrent_set_max (_tmp19_, _tmp21_, _tmp22_, NULL); + start = _tmp23_; + _tmp24_ = from; + _tmp25_ = _tmp24_->_set; + _tmp26_ = from; + _tmp27_ = _tmp26_->_end; + _tmp28_ = end; + _tmp29_ = gee_concurrent_set_min (_tmp25_, _tmp27_, _tmp28_, NULL); + end = _tmp29_; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + GeeConcurrentSetRange* _tmp30_; + _tmp30_ = _result_; + _tmp30_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + break; + } + default: + { + g_assert_not_reached (); + } + } + _tmp32_ = _result_; + _tmp33_ = _tmp32_->_type; + if (_tmp33_ != GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY) { + GeeConcurrentSetRange* _tmp34_; + GeeConcurrentSet* _tmp35_; + GCompareDataFunc _tmp36_; + void* _tmp36__target; + gconstpointer _tmp37_; + gconstpointer _tmp38_; + gint _tmp39_ = 0; + _tmp34_ = from; + _tmp35_ = _tmp34_->_set; + _tmp36_ = _tmp35_->priv->_cmp; + _tmp36__target = _tmp35_->priv->_cmp_target; + _tmp37_ = start; + _tmp38_ = end; + _tmp39_ = _tmp36_ (_tmp37_, _tmp38_, _tmp36__target); + _tmp31_ = _tmp39_ < 0; + } else { + _tmp31_ = FALSE; + } + _tmp40_ = _tmp31_; + if (_tmp40_) { + GeeConcurrentSetRange* _tmp41_; + gconstpointer _tmp42_; + gpointer _tmp43_; + GeeConcurrentSetRange* _tmp44_; + gconstpointer _tmp45_; + gpointer _tmp46_; + GeeConcurrentSetRange* _tmp47_; + _tmp41_ = _result_; + _tmp42_ = start; + _tmp43_ = ((_tmp42_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp42_) : ((gpointer) _tmp42_); + _g_destroy_func0 (_tmp41_->_start); + _tmp41_->_start = _tmp43_; + _tmp44_ = _result_; + _tmp45_ = end; + _tmp46_ = ((_tmp45_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp45_) : ((gpointer) _tmp45_); + _g_destroy_func0 (_tmp44_->_end); + _tmp44_->_end = _tmp46_; + _tmp47_ = _result_; + _tmp47_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED; + } else { + GeeConcurrentSetRange* _tmp48_; + _tmp48_ = _result_; + _tmp48_->_type = GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY; + } + _tmp49_ = _result_; + _tmp50_ = _tmp49_->_type; + if (_tmp50_ != GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY) { + GeeConcurrentSetRange* _tmp51_; + GeeConcurrentSetRange* _tmp52_; + GeeConcurrentSetRange* _tmp53_; + GeeConcurrentSetRange* _tmp54_; + _tmp51_ = from; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp51_, NULL, NULL); + _tmp52_ = _result_; + _tmp53_ = from; + gee_concurrent_set_range_copy_bookmark (_tmp52_, _tmp53_); + _tmp54_ = _result_; + gee_concurrent_set_range_improve_bookmark (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp54_, NULL, NULL); + } + result = _result_; + return result; +} + + +static void gee_concurrent_set_range_improve_bookmark (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower** out_curr, GeeConcurrentSetTowerIter* prev) { + GeeConcurrentSetTower* _vala_out_curr = NULL; + GeeConcurrentSetTowerIter _vala_prev = {0}; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRangeType _tmp1_; + gboolean _tmp112_ = FALSE; + gboolean _tmp113_ = FALSE; + gboolean _tmp115_; + gboolean _tmp119_; + g_return_if_fail (range != NULL); + gee_concurrent_set_tower_iter_destroy (&_vala_prev); + memset (&_vala_prev, 0, sizeof (GeeConcurrentSetTowerIter)); + _tmp0_ = range; + _tmp1_ = _tmp0_->_type; + switch (_tmp1_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + if ((&_vala_out_curr) != NULL) { + GeeConcurrentSetRange* _tmp2_; + gpointer _tmp3_ = NULL; + _tmp2_ = range; + _tmp3_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp2_->_bookmark._iter[0], (gsize) 0, NULL); + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = (GeeConcurrentSetTower*) _tmp3_; + if ((&_vala_prev) != NULL) { + GeeConcurrentSetTower* _tmp4_; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTowerIter _tmp6_; + GeeConcurrentSetTower* _tmp7_; + GeeConcurrentSetTower* _tmp8_ = NULL; + _tmp4_ = _vala_out_curr; + _vala_out_curr = NULL; + _gee_concurrent_set_tower_unref0 (_vala_prev._iter[0]); + _vala_prev._iter[0] = _tmp4_; + _tmp5_ = _vala_prev._iter[0]; + _tmp6_ = _vala_prev; + _tmp7_ = _tmp6_._iter[0]; + _tmp8_ = gee_concurrent_set_tower_get_next (_tmp7_, (guint8) 0); + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = _tmp8_; + } else { + GeeConcurrentSetTower* _tmp9_; + GeeConcurrentSetTower* _tmp10_ = NULL; + _tmp9_ = _vala_out_curr; + _tmp10_ = gee_concurrent_set_tower_get_next (_tmp9_, (guint8) 0); + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = _tmp10_; + } + } + if ((&_vala_prev) != NULL) { + { + gint _tmp11_ = 0; + gint _tmp12_; + gint i; + if ((&_vala_out_curr) != NULL) { + _tmp11_ = 1; + } else { + _tmp11_ = 0; + } + _tmp12_ = _tmp11_; + i = _tmp12_; + { + gboolean _tmp13_; + _tmp13_ = TRUE; + while (TRUE) { + gboolean _tmp14_; + gint _tmp16_; + gint _tmp17_; + GeeConcurrentSetRange* _tmp18_; + gint _tmp19_; + gpointer _tmp20_ = NULL; + GeeConcurrentSetTower* _tmp21_; + _tmp14_ = _tmp13_; + if (!_tmp14_) { + gint _tmp15_; + _tmp15_ = i; + i = _tmp15_ + 1; + } + _tmp13_ = FALSE; + _tmp16_ = i; + if (!(_tmp16_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp17_ = i; + _tmp18_ = range; + _tmp19_ = i; + _tmp20_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp18_->_bookmark._iter[_tmp19_], (gsize) 0, NULL); + _gee_concurrent_set_tower_unref0 (_vala_prev._iter[_tmp17_]); + _vala_prev._iter[_tmp17_] = (GeeConcurrentSetTower*) _tmp20_; + _tmp21_ = _vala_prev._iter[_tmp17_]; + } + } + } + } + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = NULL; + break; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetTower* last_best; + last_best = NULL; + { + gint i; + i = GEE_CONCURRENT_SET__MAX_HEIGHT - 1; + { + gboolean _tmp22_; + _tmp22_ = TRUE; + while (TRUE) { + gboolean _tmp23_; + gint _tmp25_; + GeeConcurrentSetRange* _tmp26_; + gint _tmp27_; + gpointer _tmp28_ = NULL; + GeeConcurrentSetTower* curr; + GeeConcurrentSetTower* _tmp29_; + GeeConcurrentSetTower* _tmp30_; + GeeConcurrentSetTower* curr_old; + GeeConcurrentSetTower* _tmp31_; + gint _tmp32_; + gboolean _tmp33_ = FALSE; + gboolean _tmp34_ = FALSE; + GeeConcurrentSetTower* _tmp35_; + gboolean _tmp38_; + gboolean _tmp45_; + GeeConcurrentSetTower* _tmp48_; + GeeConcurrentSetTower* _tmp49_; + GeeConcurrentSetTower* _tmp59_; + gint _tmp60_; + GeeConcurrentSetTower* _tmp61_ = NULL; + GeeConcurrentSetTower* next; + gboolean _tmp62_ = FALSE; + gboolean _tmp64_; + GeeConcurrentSetTower* _tmp111_; + _tmp23_ = _tmp22_; + if (!_tmp23_) { + gint _tmp24_; + _tmp24_ = i; + i = _tmp24_ - 1; + } + _tmp22_ = FALSE; + _tmp25_ = i; + if (!(_tmp25_ >= 0)) { + break; + } + _tmp26_ = range; + _tmp27_ = i; + _tmp28_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp26_->_bookmark._iter[_tmp27_], (gsize) 0, NULL); + curr = (GeeConcurrentSetTower*) _tmp28_; + _tmp29_ = curr; + _tmp30_ = _gee_concurrent_set_tower_ref0 (_tmp29_); + curr_old = _tmp30_; + _tmp31_ = curr; + _vala_assert (_tmp31_ != NULL, "curr != null"); + _tmp32_ = i; + gee_concurrent_set_tower_backtrace (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, &curr, (guint8) _tmp32_); + _tmp35_ = last_best; + if (_tmp35_ != NULL) { + GeeConcurrentSetTower* _tmp36_; + GeeConcurrentSetTower* _tmp37_; + _tmp36_ = last_best; + _tmp37_ = curr; + _tmp34_ = _tmp36_ != _tmp37_; + } else { + _tmp34_ = FALSE; + } + _tmp38_ = _tmp34_; + if (_tmp38_) { + GeeConcurrentSetRange* _tmp39_; + GeeConcurrentSet* _tmp40_; + GCompareDataFunc _tmp41_; + void* _tmp41__target; + GeeConcurrentSetTower* _tmp42_; + GeeConcurrentSetTower* _tmp43_; + gint _tmp44_ = 0; + _tmp39_ = range; + _tmp40_ = _tmp39_->_set; + _tmp41_ = _tmp40_->priv->_cmp; + _tmp41__target = _tmp40_->priv->_cmp_target; + _tmp42_ = curr; + _tmp43_ = last_best; + _tmp44_ = gee_concurrent_set_tower_compare (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp41_, _tmp41__target, _tmp42_, _tmp43_); + _tmp33_ = _tmp44_ < 0; + } else { + _tmp33_ = FALSE; + } + _tmp45_ = _tmp33_; + if (_tmp45_) { + GeeConcurrentSetTower* _tmp46_; + GeeConcurrentSetTower* _tmp47_; + _tmp46_ = last_best; + _tmp47_ = _gee_concurrent_set_tower_ref0 (_tmp46_); + _gee_concurrent_set_tower_unref0 (curr); + curr = _tmp47_; + } + _tmp48_ = curr; + _tmp49_ = curr_old; + if (_tmp48_ != _tmp49_) { + GeeConcurrentSetRange* _tmp50_; + gint _tmp51_; + GeeConcurrentSetTower* _tmp52_; + GeeConcurrentSetTower* _tmp53_; + GeeConcurrentSetTower* _tmp54_; + gboolean _tmp55_ = FALSE; + _tmp50_ = range; + _tmp51_ = i; + _tmp52_ = curr_old; + _tmp53_ = curr; + _tmp54_ = _gee_concurrent_set_tower_ref0 (_tmp53_); + _tmp55_ = gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp50_->_bookmark._iter[_tmp51_], _tmp52_, _tmp54_, (gsize) 0, (gsize) 0, (gsize) 0); + if (!_tmp55_) { + GeeConcurrentSetRange* _tmp56_; + gint _tmp57_; + gpointer _tmp58_ = NULL; + _tmp56_ = range; + _tmp57_ = i; + _tmp58_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp56_->_bookmark._iter[_tmp57_], (gsize) 0, NULL); + _gee_concurrent_set_tower_unref0 (curr); + curr = (GeeConcurrentSetTower*) _tmp58_; + } + } + _tmp59_ = curr; + _tmp60_ = i; + _tmp61_ = gee_concurrent_set_tower_get_next (_tmp59_, (guint8) _tmp60_); + next = _tmp61_; + if ((&_vala_out_curr) != NULL) { + gint _tmp63_; + _tmp63_ = i; + _tmp62_ = _tmp63_ == 0; + } else { + _tmp62_ = FALSE; + } + _tmp64_ = _tmp62_; + if (_tmp64_) { + GeeConcurrentSetTower* _tmp65_; + GeeConcurrentSetTower* _tmp66_; + _tmp65_ = next; + _tmp66_ = _gee_concurrent_set_tower_ref0 (_tmp65_); + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = _tmp66_; + } + while (TRUE) { + gboolean _tmp67_ = FALSE; + GeeConcurrentSetTower* _tmp68_; + gboolean _tmp76_; + GeeConcurrentSetRange* _tmp77_; + GeeConcurrentSet* _tmp78_; + GCompareDataFunc _tmp79_; + void* _tmp79__target; + gint _tmp80_; + gboolean _tmp81_ = FALSE; + gboolean _tmp82_ = FALSE; + gboolean _tmp84_; + gboolean _tmp86_; + GeeConcurrentSetRange* _tmp89_; + GeeConcurrentSet* _tmp90_; + GCompareDataFunc _tmp91_; + void* _tmp91__target; + GeeConcurrentSetTower* _tmp92_; + GeeConcurrentSetRange* _tmp93_; + gconstpointer _tmp94_; + gint _tmp95_ = 0; + _tmp68_ = next; + if (_tmp68_ != NULL) { + GeeConcurrentSetRange* _tmp69_; + GeeConcurrentSet* _tmp70_; + GCompareDataFunc _tmp71_; + void* _tmp71__target; + GeeConcurrentSetTower* _tmp72_; + GeeConcurrentSetRange* _tmp73_; + gconstpointer _tmp74_; + gint _tmp75_ = 0; + _tmp69_ = range; + _tmp70_ = _tmp69_->_set; + _tmp71_ = _tmp70_->priv->_cmp; + _tmp71__target = _tmp70_->priv->_cmp_target; + _tmp72_ = next; + _tmp73_ = range; + _tmp74_ = _tmp73_->_start; + _tmp75_ = gee_concurrent_set_tower_compare_data (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp71_, _tmp71__target, _tmp72_, _tmp74_); + _tmp67_ = _tmp75_ < 0; + } else { + _tmp67_ = FALSE; + } + _tmp76_ = _tmp67_; + if (!_tmp76_) { + break; + } + _tmp77_ = range; + _tmp78_ = _tmp77_->_set; + _tmp79_ = _tmp78_->priv->_cmp; + _tmp79__target = _tmp78_->priv->_cmp_target; + _tmp80_ = i; + gee_concurrent_set_tower_proceed (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp79_, _tmp79__target, &curr, &next, (guint8) _tmp80_, TRUE); + if ((&curr) != NULL) { + gint _tmp83_; + _tmp83_ = i; + _tmp82_ = _tmp83_ == 0; + } else { + _tmp82_ = FALSE; + } + _tmp84_ = _tmp82_; + if (_tmp84_) { + GeeConcurrentSetTower* _tmp85_; + _tmp85_ = next; + _tmp81_ = _tmp85_ != NULL; + } else { + _tmp81_ = FALSE; + } + _tmp86_ = _tmp81_; + if (_tmp86_) { + GeeConcurrentSetTower* _tmp87_; + GeeConcurrentSetTower* _tmp88_; + _tmp87_ = next; + _tmp88_ = _gee_concurrent_set_tower_ref0 (_tmp87_); + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = _tmp88_; + } + _tmp89_ = range; + _tmp90_ = _tmp89_->_set; + _tmp91_ = _tmp90_->priv->_cmp; + _tmp91__target = _tmp90_->priv->_cmp_target; + _tmp92_ = curr; + _tmp93_ = range; + _tmp94_ = _tmp93_->_start; + _tmp95_ = gee_concurrent_set_tower_compare_data (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp91_, _tmp91__target, _tmp92_, _tmp94_); + if (_tmp95_ < 0) { + GeeConcurrentSetRange* _tmp96_; + gint _tmp97_; + GeeConcurrentSetTower* _tmp98_; + GeeConcurrentSetTower* _tmp99_; + GeeConcurrentSetTower* _tmp100_; + gboolean _tmp101_ = FALSE; + GeeConcurrentSetTower* _tmp105_; + GeeConcurrentSetTower* _tmp106_; + _tmp96_ = range; + _tmp97_ = i; + _tmp98_ = curr_old; + _tmp99_ = curr; + _tmp100_ = _gee_concurrent_set_tower_ref0 (_tmp99_); + _tmp101_ = gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp96_->_bookmark._iter[_tmp97_], _tmp98_, _tmp100_, (gsize) 0, (gsize) 0, (gsize) 0); + if (!_tmp101_) { + GeeConcurrentSetRange* _tmp102_; + gint _tmp103_; + gpointer _tmp104_ = NULL; + _tmp102_ = range; + _tmp103_ = i; + _tmp104_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp102_->_bookmark._iter[_tmp103_], (gsize) 0, NULL); + _gee_concurrent_set_tower_unref0 (curr); + curr = (GeeConcurrentSetTower*) _tmp104_; + } + _tmp105_ = curr; + _tmp106_ = _gee_concurrent_set_tower_ref0 (_tmp105_); + _gee_concurrent_set_tower_unref0 (curr_old); + curr_old = _tmp106_; + } else { + break; + } + } + if ((&_vala_prev) != NULL) { + gint _tmp107_; + GeeConcurrentSetTower* _tmp108_; + GeeConcurrentSetTower* _tmp109_; + GeeConcurrentSetTower* _tmp110_; + _tmp107_ = i; + _tmp108_ = curr; + _tmp109_ = _gee_concurrent_set_tower_ref0 (_tmp108_); + _gee_concurrent_set_tower_unref0 (_vala_prev._iter[_tmp107_]); + _vala_prev._iter[_tmp107_] = _tmp109_; + _tmp110_ = _vala_prev._iter[_tmp107_]; + } + _tmp111_ = curr; + curr = NULL; + _gee_concurrent_set_tower_unref0 (last_best); + last_best = _tmp111_; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (curr_old); + _gee_concurrent_set_tower_unref0 (curr); + } + } + } + _gee_concurrent_set_tower_unref0 (last_best); + break; + } + default: + { + g_assert_not_reached (); + } + } + if ((&_vala_out_curr) != NULL) { + GeeConcurrentSetTower* _tmp114_; + _tmp114_ = _vala_out_curr; + _tmp113_ = _tmp114_ != NULL; + } else { + _tmp113_ = FALSE; + } + _tmp115_ = _tmp113_; + if (_tmp115_) { + GeeConcurrentSetRange* _tmp116_; + GeeConcurrentSetTower* _tmp117_; + gboolean _tmp118_ = FALSE; + _tmp116_ = range; + _tmp117_ = _vala_out_curr; + _tmp118_ = gee_concurrent_set_range_beyond (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp116_, _tmp117_); + _tmp112_ = _tmp118_; + } else { + _tmp112_ = FALSE; + } + _tmp119_ = _tmp112_; + if (_tmp119_) { + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + _vala_out_curr = NULL; + } + if (out_curr) { + *out_curr = _vala_out_curr; + } else { + _gee_concurrent_set_tower_unref0 (_vala_out_curr); + } + if (prev) { + *prev = _vala_prev; + } else { + gee_concurrent_set_tower_iter_destroy (&_vala_prev); + } +} + + +static gboolean gee_concurrent_set_range_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** curr, guint8 level) { + gboolean result = FALSE; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRangeType _tmp1_; + g_return_val_if_fail (range != NULL, FALSE); + g_return_val_if_fail (*curr != NULL, FALSE); + _tmp0_ = range; + _tmp1_ = _tmp0_->_type; + switch (_tmp1_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + result = FALSE; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSet* _tmp3_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + guint8 _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp2_ = range; + _tmp3_ = _tmp2_->_set; + _tmp4_ = _tmp3_->priv->_cmp; + _tmp4__target = _tmp3_->priv->_cmp_target; + _tmp5_ = level; + _tmp6_ = gee_concurrent_set_tower_proceed (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp4_, _tmp4__target, prev, curr, _tmp5_, FALSE); + result = _tmp6_; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetTower* _tmp7_; + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetTower* tmp_prev; + GeeConcurrentSetTower* _tmp9_; + GeeConcurrentSetTower* _tmp10_; + GeeConcurrentSetTower* tmp_curr; + GeeConcurrentSetRange* _tmp11_; + GeeConcurrentSet* _tmp12_; + GCompareDataFunc _tmp13_; + void* _tmp13__target; + guint8 _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp7_ = *prev; + _tmp8_ = _gee_concurrent_set_tower_ref0 (_tmp7_); + tmp_prev = _tmp8_; + _tmp9_ = *curr; + _tmp10_ = _gee_concurrent_set_tower_ref0 (_tmp9_); + tmp_curr = _tmp10_; + _tmp11_ = range; + _tmp12_ = _tmp11_->_set; + _tmp13_ = _tmp12_->priv->_cmp; + _tmp13__target = _tmp12_->priv->_cmp_target; + _tmp14_ = level; + _tmp15_ = gee_concurrent_set_tower_proceed (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp13_, _tmp13__target, &tmp_prev, &tmp_curr, _tmp14_, FALSE); + if (!_tmp15_) { + result = FALSE; + _gee_concurrent_set_tower_unref0 (tmp_curr); + _gee_concurrent_set_tower_unref0 (tmp_prev); + return result; + } else { + GeeConcurrentSetRange* _tmp16_; + GeeConcurrentSet* _tmp17_; + GCompareDataFunc _tmp18_; + void* _tmp18__target; + GeeConcurrentSetTower* _tmp19_; + GeeConcurrentSetRange* _tmp20_; + gconstpointer _tmp21_; + gint _tmp22_ = 0; + _tmp16_ = range; + _tmp17_ = _tmp16_->_set; + _tmp18_ = _tmp17_->priv->_cmp; + _tmp18__target = _tmp17_->priv->_cmp_target; + _tmp19_ = tmp_curr; + _tmp20_ = range; + _tmp21_ = _tmp20_->_end; + _tmp22_ = gee_concurrent_set_tower_compare_data (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp18_, _tmp18__target, _tmp19_, _tmp21_); + if (_tmp22_ >= 0) { + result = FALSE; + _gee_concurrent_set_tower_unref0 (tmp_curr); + _gee_concurrent_set_tower_unref0 (tmp_prev); + return result; + } else { + GeeConcurrentSetTower* _tmp23_; + GeeConcurrentSetTower* _tmp24_; + _tmp23_ = tmp_prev; + tmp_prev = NULL; + _gee_concurrent_set_tower_unref0 (*prev); + *prev = _tmp23_; + _tmp24_ = tmp_curr; + tmp_curr = NULL; + _gee_concurrent_set_tower_unref0 (*curr); + *curr = _tmp24_; + result = TRUE; + _gee_concurrent_set_tower_unref0 (tmp_curr); + _gee_concurrent_set_tower_unref0 (tmp_prev); + return result; + } + } + _gee_concurrent_set_tower_unref0 (tmp_curr); + _gee_concurrent_set_tower_unref0 (tmp_prev); + } + default: + { + g_assert_not_reached (); + } + } +} + + +static gboolean gee_concurrent_set_range_inside (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, gconstpointer val) { + gboolean result = FALSE; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRangeType _tmp1_; + g_return_val_if_fail (range != NULL, FALSE); + _tmp0_ = range; + _tmp1_ = _tmp0_->_type; + switch (_tmp1_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSet* _tmp3_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + gconstpointer _tmp5_; + GeeConcurrentSetRange* _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_ = 0; + _tmp2_ = range; + _tmp3_ = _tmp2_->_set; + _tmp4_ = _tmp3_->priv->_cmp; + _tmp4__target = _tmp3_->priv->_cmp_target; + _tmp5_ = val; + _tmp6_ = range; + _tmp7_ = _tmp6_->_end; + _tmp8_ = _tmp4_ (_tmp5_, _tmp7_, _tmp4__target); + result = _tmp8_ < 0; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRange* _tmp9_; + GeeConcurrentSet* _tmp10_; + GCompareDataFunc _tmp11_; + void* _tmp11__target; + gconstpointer _tmp12_; + GeeConcurrentSetRange* _tmp13_; + gconstpointer _tmp14_; + gint _tmp15_ = 0; + _tmp9_ = range; + _tmp10_ = _tmp9_->_set; + _tmp11_ = _tmp10_->priv->_cmp; + _tmp11__target = _tmp10_->priv->_cmp_target; + _tmp12_ = val; + _tmp13_ = range; + _tmp14_ = _tmp13_->_start; + _tmp15_ = _tmp11_ (_tmp12_, _tmp14_, _tmp11__target); + result = _tmp15_ >= 0; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + gboolean _tmp16_ = FALSE; + GeeConcurrentSetRange* _tmp17_; + GeeConcurrentSet* _tmp18_; + GCompareDataFunc _tmp19_; + void* _tmp19__target; + gconstpointer _tmp20_; + GeeConcurrentSetRange* _tmp21_; + gconstpointer _tmp22_; + gint _tmp23_ = 0; + gboolean _tmp31_; + _tmp17_ = range; + _tmp18_ = _tmp17_->_set; + _tmp19_ = _tmp18_->priv->_cmp; + _tmp19__target = _tmp18_->priv->_cmp_target; + _tmp20_ = val; + _tmp21_ = range; + _tmp22_ = _tmp21_->_start; + _tmp23_ = _tmp19_ (_tmp20_, _tmp22_, _tmp19__target); + if (_tmp23_ >= 0) { + GeeConcurrentSetRange* _tmp24_; + GeeConcurrentSet* _tmp25_; + GCompareDataFunc _tmp26_; + void* _tmp26__target; + gconstpointer _tmp27_; + GeeConcurrentSetRange* _tmp28_; + gconstpointer _tmp29_; + gint _tmp30_ = 0; + _tmp24_ = range; + _tmp25_ = _tmp24_->_set; + _tmp26_ = _tmp25_->priv->_cmp; + _tmp26__target = _tmp25_->priv->_cmp_target; + _tmp27_ = val; + _tmp28_ = range; + _tmp29_ = _tmp28_->_end; + _tmp30_ = _tmp26_ (_tmp27_, _tmp29_, _tmp26__target); + _tmp16_ = _tmp30_ < 0; + } else { + _tmp16_ = FALSE; + } + _tmp31_ = _tmp16_; + result = _tmp31_; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + result = FALSE; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static gboolean gee_concurrent_set_range_beyond (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, GeeConcurrentSetTower* tw) { + gboolean result = FALSE; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRangeType _tmp1_; + g_return_val_if_fail (range != NULL, FALSE); + g_return_val_if_fail (tw != NULL, FALSE); + _tmp0_ = range; + _tmp1_ = _tmp0_->_type; + switch (_tmp1_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + result = TRUE; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + result = FALSE; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetRange* _tmp2_; + GeeConcurrentSet* _tmp3_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetRange* _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_ = 0; + _tmp2_ = range; + _tmp3_ = _tmp2_->_set; + _tmp4_ = _tmp3_->priv->_cmp; + _tmp4__target = _tmp3_->priv->_cmp_target; + _tmp5_ = tw; + _tmp6_ = range; + _tmp7_ = _tmp6_->_end; + _tmp8_ = gee_concurrent_set_tower_compare_data (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp4_, _tmp4__target, _tmp5_, _tmp7_); + result = _tmp8_ >= 0; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static gint gee_concurrent_set_range_cmp (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range, gconstpointer val) { + gint result = 0; + GeeConcurrentSetRange* _tmp0_; + GeeConcurrentSetRangeType _tmp1_; + g_return_val_if_fail (range != NULL, 0); + _tmp0_ = range; + _tmp1_ = _tmp0_->_type; + switch (_tmp1_) { + case GEE_CONCURRENT_SET_RANGE_TYPE_HEAD: + { + GeeConcurrentSetRangePosition _tmp2_ = 0; + GeeConcurrentSetRange* _tmp3_; + GeeConcurrentSet* _tmp4_; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeConcurrentSetRange* _tmp7_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + GeeConcurrentSetRangePosition _tmp10_; + _tmp3_ = range; + _tmp4_ = _tmp3_->_set; + _tmp5_ = _tmp4_->priv->_cmp; + _tmp5__target = _tmp4_->priv->_cmp_target; + _tmp6_ = val; + _tmp7_ = range; + _tmp8_ = _tmp7_->_end; + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); + if (_tmp9_ < 0) { + _tmp2_ = GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE; + } else { + _tmp2_ = GEE_CONCURRENT_SET_RANGE_POSITION_AFTER; + } + _tmp10_ = _tmp2_; + result = (gint) _tmp10_; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_TAIL: + { + GeeConcurrentSetRangePosition _tmp11_ = 0; + GeeConcurrentSetRange* _tmp12_; + GeeConcurrentSet* _tmp13_; + GCompareDataFunc _tmp14_; + void* _tmp14__target; + gconstpointer _tmp15_; + GeeConcurrentSetRange* _tmp16_; + gconstpointer _tmp17_; + gint _tmp18_ = 0; + GeeConcurrentSetRangePosition _tmp19_; + _tmp12_ = range; + _tmp13_ = _tmp12_->_set; + _tmp14_ = _tmp13_->priv->_cmp; + _tmp14__target = _tmp13_->priv->_cmp_target; + _tmp15_ = val; + _tmp16_ = range; + _tmp17_ = _tmp16_->_start; + _tmp18_ = _tmp14_ (_tmp15_, _tmp17_, _tmp14__target); + if (_tmp18_ >= 0) { + _tmp11_ = GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE; + } else { + _tmp11_ = GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE; + } + _tmp19_ = _tmp11_; + result = (gint) _tmp19_; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED: + { + GeeConcurrentSetRangePosition _tmp20_ = 0; + GeeConcurrentSetRange* _tmp21_; + GeeConcurrentSet* _tmp22_; + GCompareDataFunc _tmp23_; + void* _tmp23__target; + gconstpointer _tmp24_; + GeeConcurrentSetRange* _tmp25_; + gconstpointer _tmp26_; + gint _tmp27_ = 0; + GeeConcurrentSetRangePosition _tmp37_; + _tmp21_ = range; + _tmp22_ = _tmp21_->_set; + _tmp23_ = _tmp22_->priv->_cmp; + _tmp23__target = _tmp22_->priv->_cmp_target; + _tmp24_ = val; + _tmp25_ = range; + _tmp26_ = _tmp25_->_start; + _tmp27_ = _tmp23_ (_tmp24_, _tmp26_, _tmp23__target); + if (_tmp27_ >= 0) { + GeeConcurrentSetRangePosition _tmp28_ = 0; + GeeConcurrentSetRange* _tmp29_; + GeeConcurrentSet* _tmp30_; + GCompareDataFunc _tmp31_; + void* _tmp31__target; + gconstpointer _tmp32_; + GeeConcurrentSetRange* _tmp33_; + gconstpointer _tmp34_; + gint _tmp35_ = 0; + GeeConcurrentSetRangePosition _tmp36_; + _tmp29_ = range; + _tmp30_ = _tmp29_->_set; + _tmp31_ = _tmp30_->priv->_cmp; + _tmp31__target = _tmp30_->priv->_cmp_target; + _tmp32_ = val; + _tmp33_ = range; + _tmp34_ = _tmp33_->_end; + _tmp35_ = _tmp31_ (_tmp32_, _tmp34_, _tmp31__target); + if (_tmp35_ < 0) { + _tmp28_ = GEE_CONCURRENT_SET_RANGE_POSITION_INSIDE; + } else { + _tmp28_ = GEE_CONCURRENT_SET_RANGE_POSITION_AFTER; + } + _tmp36_ = _tmp28_; + _tmp20_ = _tmp36_; + } else { + _tmp20_ = GEE_CONCURRENT_SET_RANGE_POSITION_BEFORE; + } + _tmp37_ = _tmp20_; + result = (gint) _tmp37_; + return result; + } + case GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY: + { + result = (gint) GEE_CONCURRENT_SET_RANGE_POSITION_EMPTY; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static void gee_concurrent_set_value_range_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void gee_concurrent_set_value_range_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_concurrent_set_range_unref (value->data[0].v_pointer); + } +} + + +static void gee_concurrent_set_value_range_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_concurrent_set_range_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer gee_concurrent_set_value_range_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* gee_concurrent_set_value_range_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeConcurrentSetRange* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_concurrent_set_range_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* gee_concurrent_set_value_range_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeConcurrentSetRange** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_concurrent_set_range_ref (value->data[0].v_pointer); + } + return NULL; +} + + +static GParamSpec* gee_concurrent_set_param_spec_range (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeConcurrentSetParamSpecRange* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_CONCURRENT_SET_TYPE_RANGE), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +static gpointer gee_concurrent_set_value_get_range (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_RANGE), NULL); + return value->data[0].v_pointer; +} + + +static void gee_concurrent_set_value_set_range (GValue* value, gpointer v_object) { + GeeConcurrentSetRange* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_RANGE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_SET_TYPE_RANGE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_concurrent_set_range_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_set_range_unref (old); + } +} + + +static void gee_concurrent_set_value_take_range (GValue* value, gpointer v_object) { + GeeConcurrentSetRange* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_RANGE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_SET_TYPE_RANGE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_set_range_unref (old); + } +} + + +static void gee_concurrent_set_range_class_init (GeeConcurrentSetRangeClass * klass) { + gee_concurrent_set_range_parent_class = g_type_class_peek_parent (klass); + GEE_CONCURRENT_SET_RANGE_CLASS (klass)->finalize = gee_concurrent_set_range_finalize; + g_type_class_add_private (klass, sizeof (GeeConcurrentSetRangePrivate)); +} + + +static void gee_concurrent_set_range_instance_init (GeeConcurrentSetRange * self) { + self->priv = GEE_CONCURRENT_SET_RANGE_GET_PRIVATE (self); + self->ref_count = 1; +} + + +static void gee_concurrent_set_range_finalize (GeeConcurrentSetRange* obj) { + GeeConcurrentSetRange * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_SET_TYPE_RANGE, GeeConcurrentSetRange); + ((self->_start == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->_start = (self->priv->g_destroy_func (self->_start), NULL)); + ((self->_end == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->_end = (self->priv->g_destroy_func (self->_end), NULL)); + gee_concurrent_set_tower_iter_destroy (&self->_bookmark); + _g_object_unref0 (self->_set); +} + + +static GType gee_concurrent_set_range_get_type (void) { + static volatile gsize gee_concurrent_set_range_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_range_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_concurrent_set_value_range_init, gee_concurrent_set_value_range_free_value, gee_concurrent_set_value_range_copy_value, gee_concurrent_set_value_range_peek_pointer, "p", gee_concurrent_set_value_range_collect_value, "p", gee_concurrent_set_value_range_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetRangeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_range_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSetRange), 0, (GInstanceInitFunc) gee_concurrent_set_range_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_concurrent_set_range_type_id; + gee_concurrent_set_range_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeConcurrentSetRange", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_concurrent_set_range_type_id__volatile, gee_concurrent_set_range_type_id); + } + return gee_concurrent_set_range_type_id__volatile; +} + + +static gpointer gee_concurrent_set_range_ref (gpointer instance) { + GeeConcurrentSetRange* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +static void gee_concurrent_set_range_unref (gpointer instance) { + GeeConcurrentSetRange* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_CONCURRENT_SET_RANGE_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +static GeeConcurrentSetTower* gee_concurrent_set_tower_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, guint8 height) { + GeeConcurrentSetTower* self = NULL; + guint8 _tmp0_; + GeeConcurrentSetTowerNode* _tmp1_ = NULL; + gconstpointer _tmp2_; + gpointer _tmp3_; + GeeConcurrentSetTowerNode* _tmp4_; + gint _tmp4__length1; + self = (GeeConcurrentSetTower*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = height; + _tmp1_ = g_new0 (GeeConcurrentSetTowerNode, _tmp0_); + self->_nodes = (g_free (self->_nodes), NULL); + self->_nodes = _tmp1_; + _tmp2_ = data; + _tmp3_ = ((_tmp2_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + _g_destroy_func0 (self->_data); + self->_data = _tmp3_; + self->_height = 0; + _tmp4_ = self->_nodes; + _tmp4__length1 = -1; + g_atomic_pointer_set ((volatile gpointer *) (&_tmp4_[0]._backlink), NULL); + return self; +} + + +static GeeConcurrentSetTower* gee_concurrent_set_tower_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, guint8 height) { + return gee_concurrent_set_tower_construct (GEE_CONCURRENT_SET_TYPE_TOWER, g_type, g_dup_func, g_destroy_func, data, height); +} + + +static GeeConcurrentSetTower* gee_concurrent_set_tower_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeConcurrentSetTower* self = NULL; + GeeConcurrentSetTowerNode* _tmp0_ = NULL; + self = (GeeConcurrentSetTower*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = g_new0 (GeeConcurrentSetTowerNode, GEE_CONCURRENT_SET__MAX_HEIGHT); + self->_nodes = (g_free (self->_nodes), NULL); + self->_nodes = _tmp0_; + self->_height = -1; + return self; +} + + +static GeeConcurrentSetTower* gee_concurrent_set_tower_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + return gee_concurrent_set_tower_construct_head (GEE_CONCURRENT_SET_TYPE_TOWER, g_type, g_dup_func, g_destroy_func); +} + + +static inline gboolean gee_concurrent_set_tower_search (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** next, guint8 to_level, guint8 from_level) { + GeeConcurrentSetTower* _vala_next = NULL; + gboolean result = FALSE; + guint8 _tmp0_; + guint8 _tmp1_; + gboolean res; + g_return_val_if_fail (*prev != NULL, FALSE); + _tmp0_ = from_level; + _tmp1_ = to_level; + _vala_assert (_tmp0_ >= _tmp1_, "from_level >= to_level"); + res = FALSE; + _gee_concurrent_set_tower_unref0 (_vala_next); + _vala_next = NULL; + { + guint8 _tmp2_; + gint i; + _tmp2_ = from_level; + i = (gint) _tmp2_; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + gint _tmp6_; + guint8 _tmp7_; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + gint _tmp10_; + GeeConcurrentSetTower* _tmp11_ = NULL; + gboolean _tmp12_ = FALSE; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = i; + i = _tmp5_ - 1; + } + _tmp3_ = FALSE; + _tmp6_ = i; + _tmp7_ = to_level; + if (!(_tmp6_ >= ((gint) _tmp7_))) { + break; + } + _tmp8_ = cmp; + _tmp8__target = cmp_target; + _tmp9_ = key; + _tmp10_ = i; + _tmp12_ = gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp8_, _tmp8__target, _tmp9_, prev, &_tmp11_, (guint8) _tmp10_); + _gee_concurrent_set_tower_unref0 (_vala_next); + _vala_next = _tmp11_; + res = _tmp12_; + } + } + } + result = res; + if (next) { + *next = _vala_next; + } else { + _gee_concurrent_set_tower_unref0 (_vala_next); + } + return result; +} + + +static inline gboolean gee_concurrent_set_tower_search_from_bookmark (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTowerIter* next, guint8 to_level, guint8 from_level) { + GeeConcurrentSetTowerIter _vala_next = {0}; + gboolean result = FALSE; + guint8 _tmp0_; + guint8 _tmp1_; + gboolean res; + g_return_val_if_fail (prev != NULL, FALSE); + _tmp0_ = from_level; + _tmp1_ = to_level; + _vala_assert (_tmp0_ >= _tmp1_, "from_level >= to_level"); + res = FALSE; + { + guint8 _tmp2_; + gint i; + _tmp2_ = from_level; + i = (gint) _tmp2_; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + gint _tmp6_; + guint8 _tmp7_; + GeeConcurrentSetTowerIter _tmp8_; + gint _tmp9_; + GeeConcurrentSetTower* _tmp10_; + GeeConcurrentSetTower* tmp_prev; + GeeConcurrentSetTower* tmp_next = NULL; + GCompareDataFunc _tmp11_; + void* _tmp11__target; + gconstpointer _tmp12_; + gint _tmp13_; + gint _tmp14_; + GeeConcurrentSetTower* _tmp15_ = NULL; + gboolean _tmp16_ = FALSE; + GeeConcurrentSetTowerIter _tmp20_; + gint _tmp21_; + GeeConcurrentSetTower* _tmp22_; + GeeConcurrentSetTower* _tmp23_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = i; + i = _tmp5_ - 1; + } + _tmp3_ = FALSE; + _tmp6_ = i; + _tmp7_ = to_level; + if (!(_tmp6_ >= ((gint) _tmp7_))) { + break; + } + _tmp8_ = *prev; + _tmp9_ = i; + _tmp10_ = _tmp8_._iter[_tmp9_]; + tmp_prev = _tmp10_; + _tmp11_ = cmp; + _tmp11__target = cmp_target; + _tmp12_ = key; + _tmp13_ = i; + _tmp14_ = i; + _tmp16_ = gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp11_, _tmp11__target, _tmp12_, &(*prev)._iter[_tmp13_], &_tmp15_, (guint8) _tmp14_); + _gee_concurrent_set_tower_unref0 (tmp_next); + tmp_next = _tmp15_; + res = _tmp16_; + if ((&_vala_next) != NULL) { + gint _tmp17_; + GeeConcurrentSetTower* _tmp18_; + GeeConcurrentSetTower* _tmp19_; + _tmp17_ = i; + _tmp18_ = tmp_next; + tmp_next = NULL; + _gee_concurrent_set_tower_unref0 (_vala_next._iter[_tmp17_]); + _vala_next._iter[_tmp17_] = _tmp18_; + _tmp19_ = _vala_next._iter[_tmp17_]; + } + _tmp20_ = *prev; + _tmp21_ = i; + _tmp22_ = _tmp20_._iter[_tmp21_]; + _tmp23_ = tmp_prev; + if (_tmp22_ != _tmp23_) { + gint _tmp24_; + GeeConcurrentSetTowerIter _tmp25_; + gint _tmp26_; + GeeConcurrentSetTower* _tmp27_; + GeeConcurrentSetTower* _tmp28_; + GeeConcurrentSetTower* _tmp29_; + gboolean _tmp30_ = FALSE; + gint _tmp31_; + guint8 _tmp32_; + gboolean _tmp41_; + _tmp24_ = i; + _tmp25_ = *prev; + _tmp26_ = i; + _tmp27_ = _tmp25_._iter[_tmp26_]; + _tmp28_ = _gee_concurrent_set_tower_ref0 (_tmp27_); + _gee_concurrent_set_tower_unref0 ((*prev)._iter[_tmp24_]); + (*prev)._iter[_tmp24_] = _tmp28_; + _tmp29_ = (*prev)._iter[_tmp24_]; + _tmp31_ = i; + _tmp32_ = to_level; + if (_tmp31_ > ((gint) _tmp32_)) { + GCompareDataFunc _tmp33_; + void* _tmp33__target; + GeeConcurrentSetTowerIter _tmp34_; + gint _tmp35_; + GeeConcurrentSetTower* _tmp36_; + GeeConcurrentSetTowerIter _tmp37_; + gint _tmp38_; + GeeConcurrentSetTower* _tmp39_; + gint _tmp40_ = 0; + _tmp33_ = cmp; + _tmp33__target = cmp_target; + _tmp34_ = *prev; + _tmp35_ = i; + _tmp36_ = _tmp34_._iter[_tmp35_ - 1]; + _tmp37_ = *prev; + _tmp38_ = i; + _tmp39_ = _tmp37_._iter[_tmp38_]; + _tmp40_ = gee_concurrent_set_tower_compare (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp33_, _tmp33__target, _tmp36_, _tmp39_); + _tmp30_ = _tmp40_ <= 0; + } else { + _tmp30_ = FALSE; + } + _tmp41_ = _tmp30_; + if (_tmp41_) { + gint _tmp42_; + GeeConcurrentSetTowerIter _tmp43_; + gint _tmp44_; + GeeConcurrentSetTower* _tmp45_; + GeeConcurrentSetTower* _tmp46_; + GeeConcurrentSetTower* _tmp47_; + _tmp42_ = i; + _tmp43_ = *prev; + _tmp44_ = i; + _tmp45_ = _tmp43_._iter[_tmp44_]; + _tmp46_ = _gee_concurrent_set_tower_ref0 (_tmp45_); + _gee_concurrent_set_tower_unref0 ((*prev)._iter[_tmp42_ - 1]); + (*prev)._iter[_tmp42_ - 1] = _tmp46_; + _tmp47_ = (*prev)._iter[_tmp42_ - 1]; + } + } + _gee_concurrent_set_tower_unref0 (tmp_next); + } + } + } + result = res; + if (next) { + *next = _vala_next; + } else { + gee_concurrent_set_tower_iter_destroy (&_vala_next); + } + return result; +} + + +static inline gboolean gee_concurrent_set_tower_search_helper (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, gconstpointer key, GeeConcurrentSetTower** prev, GeeConcurrentSetTower** next, guint8 level) { + GeeConcurrentSetTower* _vala_next = NULL; + gboolean result = FALSE; + GeeConcurrentSetTower* _tmp0_; + guint8 _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + gboolean _tmp15_ = FALSE; + GeeConcurrentSetTower* _tmp16_; + gboolean _tmp22_; + _tmp0_ = *prev; + _tmp1_ = level; + _tmp2_ = gee_concurrent_set_tower_get_next (_tmp0_, _tmp1_); + _gee_concurrent_set_tower_unref0 (_vala_next); + _vala_next = _tmp2_; + while (TRUE) { + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + GeeConcurrentSetTower* _tmp5_; + gboolean _tmp10_; + gboolean _tmp14_; + _tmp5_ = _vala_next; + if (_tmp5_ != NULL) { + GCompareDataFunc _tmp6_; + void* _tmp6__target; + GeeConcurrentSetTower* _tmp7_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + _tmp6_ = cmp; + _tmp6__target = cmp_target; + _tmp7_ = _vala_next; + _tmp8_ = key; + _tmp9_ = gee_concurrent_set_tower_compare_data (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp6_, _tmp6__target, _tmp7_, _tmp8_); + _tmp4_ = _tmp9_ < 0; + } else { + _tmp4_ = FALSE; + } + _tmp10_ = _tmp4_; + if (_tmp10_) { + GCompareDataFunc _tmp11_; + void* _tmp11__target; + guint8 _tmp12_; + gboolean _tmp13_ = FALSE; + _tmp11_ = cmp; + _tmp11__target = cmp_target; + _tmp12_ = level; + _tmp13_ = gee_concurrent_set_tower_proceed (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp11_, _tmp11__target, prev, &_vala_next, _tmp12_, TRUE); + _tmp3_ = _tmp13_; + } else { + _tmp3_ = FALSE; + } + _tmp14_ = _tmp3_; + if (!_tmp14_) { + break; + } + } + _tmp16_ = _vala_next; + if (_tmp16_ != NULL) { + GCompareDataFunc _tmp17_; + void* _tmp17__target; + gconstpointer _tmp18_; + GeeConcurrentSetTower* _tmp19_; + gconstpointer _tmp20_; + gint _tmp21_ = 0; + _tmp17_ = cmp; + _tmp17__target = cmp_target; + _tmp18_ = key; + _tmp19_ = _vala_next; + _tmp20_ = _tmp19_->_data; + _tmp21_ = _tmp17_ (_tmp18_, _tmp20_, _tmp17__target); + _tmp15_ = _tmp21_ == 0; + } else { + _tmp15_ = FALSE; + } + _tmp22_ = _tmp15_; + result = _tmp22_; + if (next) { + *next = _vala_next; + } else { + _gee_concurrent_set_tower_unref0 (_vala_next); + } + return result; +} + + +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_insert (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 chosen_level) { + GeeConcurrentSetTower* result = NULL; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + guint8 _tmp2_; + guint8 _tmp3_; + GeeConcurrentSetTower* _tmp4_ = NULL; + g_return_val_if_fail (prev != NULL, NULL); + _tmp0_ = cmp; + _tmp0__target = cmp_target; + _tmp1_ = key; + _tmp2_ = chosen_level; + _tmp3_ = chosen_level; + _tmp4_ = gee_concurrent_set_tower_insert_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, _tmp0__target, prev, _tmp1_, _tmp2_, _tmp3_); + result = _tmp4_; + return result; +} + + +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_insert_helper (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 chosen_level, guint8 level) { + GeeConcurrentSetTower* result = NULL; + GeeConcurrentSetTower* new_tower = NULL; + GeeConcurrentSetTower* next = NULL; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + guint8 _tmp2_; + guint8 _tmp3_; + GeeConcurrentSetTower* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + guint8 _tmp6_; + GeeConcurrentSetTower* _tmp29_; + GeeConcurrentSetTower* _tmp72_; + GeeConcurrentSetTower* _tmp73_; + GeeConcurrentSetState _tmp74_ = 0; + g_return_val_if_fail (prev != NULL, NULL); + _tmp0_ = cmp; + _tmp0__target = cmp_target; + _tmp1_ = key; + _tmp2_ = level; + _tmp3_ = level; + _tmp5_ = gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, _tmp0__target, _tmp1_, &(*prev)._iter[_tmp2_], &_tmp4_, _tmp3_); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp4_; + if (_tmp5_) { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (new_tower); + return result; + } + _tmp6_ = level; + if (((gint) _tmp6_) > 0) { + GCompareDataFunc _tmp7_; + void* _tmp7__target; + GeeConcurrentSetTowerIter _tmp8_; + guint8 _tmp9_; + GeeConcurrentSetTower* _tmp10_; + GeeConcurrentSetTowerIter _tmp11_; + guint8 _tmp12_; + GeeConcurrentSetTower* _tmp13_; + gint _tmp14_ = 0; + GCompareDataFunc _tmp21_; + void* _tmp21__target; + gconstpointer _tmp22_; + guint8 _tmp23_; + guint8 _tmp24_; + GeeConcurrentSetTower* _tmp25_ = NULL; + _tmp7_ = cmp; + _tmp7__target = cmp_target; + _tmp8_ = *prev; + _tmp9_ = level; + _tmp10_ = _tmp8_._iter[_tmp9_]; + _tmp11_ = *prev; + _tmp12_ = level; + _tmp13_ = _tmp11_._iter[_tmp12_ - 1]; + _tmp14_ = gee_concurrent_set_tower_compare (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp7_, _tmp7__target, _tmp10_, _tmp13_); + if (_tmp14_ >= 0) { + guint8 _tmp15_; + GeeConcurrentSetTowerIter _tmp16_; + guint8 _tmp17_; + GeeConcurrentSetTower* _tmp18_; + GeeConcurrentSetTower* _tmp19_; + GeeConcurrentSetTower* _tmp20_; + _tmp15_ = level; + _tmp16_ = *prev; + _tmp17_ = level; + _tmp18_ = _tmp16_._iter[_tmp17_]; + _tmp19_ = _gee_concurrent_set_tower_ref0 (_tmp18_); + _gee_concurrent_set_tower_unref0 ((*prev)._iter[_tmp15_ - 1]); + (*prev)._iter[_tmp15_ - 1] = _tmp19_; + _tmp20_ = (*prev)._iter[_tmp15_ - 1]; + } + _tmp21_ = cmp; + _tmp21__target = cmp_target; + _tmp22_ = key; + _tmp23_ = chosen_level; + _tmp24_ = level; + _tmp25_ = gee_concurrent_set_tower_insert_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp21_, _tmp21__target, prev, _tmp22_, _tmp23_, (guint8) (_tmp24_ - 1)); + _gee_concurrent_set_tower_unref0 (new_tower); + new_tower = _tmp25_; + } else { + gconstpointer _tmp26_; + guint8 _tmp27_; + GeeConcurrentSetTower* _tmp28_; + _tmp26_ = key; + _tmp27_ = chosen_level; + _tmp28_ = gee_concurrent_set_tower_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp26_, (guint8) (_tmp27_ + 1)); + _gee_concurrent_set_tower_unref0 (new_tower); + new_tower = _tmp28_; + } + _tmp29_ = new_tower; + if (_tmp29_ == NULL) { + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (new_tower); + return result; + } + while (TRUE) { + GeeConcurrentSetState prev_state = 0; + GeeConcurrentSetTowerIter _tmp30_; + guint8 _tmp31_; + GeeConcurrentSetTower* _tmp32_; + guint8 _tmp33_; + GeeConcurrentSetState _tmp34_ = 0; + GeeConcurrentSetTower* _tmp35_ = NULL; + GeeConcurrentSetTower* prev_next; + GeeConcurrentSetState _tmp36_; + GCompareDataFunc _tmp67_; + void* _tmp67__target; + gconstpointer _tmp68_; + guint8 _tmp69_; + guint8 _tmp70_; + gboolean _tmp71_ = FALSE; + _tmp30_ = *prev; + _tmp31_ = level; + _tmp32_ = _tmp30_._iter[_tmp31_]; + _tmp33_ = level; + _tmp35_ = gee_concurrent_set_tower_get_succ (_tmp32_, &_tmp34_, _tmp33_); + prev_state = _tmp34_; + prev_next = _tmp35_; + _tmp36_ = prev_state; + if (_tmp36_ == GEE_CONCURRENT_SET_STATE_FLAGGED) { + GeeConcurrentSetTower* _tmp37_; + GeeConcurrentSetTowerIter _tmp38_; + guint8 _tmp39_; + GeeConcurrentSetTower* _tmp40_; + guint8 _tmp41_; + _tmp37_ = prev_next; + _tmp38_ = *prev; + _tmp39_ = level; + _tmp40_ = _tmp38_._iter[_tmp39_]; + _tmp41_ = level; + gee_concurrent_set_tower_help_flagged (_tmp37_, _tmp40_, _tmp41_); + } else { + GeeConcurrentSetTower* _tmp42_; + GeeConcurrentSetTower* _tmp43_; + guint8 _tmp44_; + GeeConcurrentSetTowerIter _tmp45_; + guint8 _tmp46_; + GeeConcurrentSetTower* _tmp47_; + GeeConcurrentSetTower* _tmp48_; + GeeConcurrentSetTower* _tmp49_; + guint8 _tmp50_; + gboolean _tmp51_ = FALSE; + gboolean _result_; + gboolean _tmp52_; + GeeConcurrentSetTowerIter _tmp53_; + guint8 _tmp54_; + GeeConcurrentSetTower* _tmp55_; + guint8 _tmp56_; + GeeConcurrentSetState _tmp57_ = 0; + GeeConcurrentSetTower* _tmp58_ = NULL; + GeeConcurrentSetState _tmp59_; + guint8 _tmp65_; + guint8 _tmp66_; + _tmp42_ = new_tower; + _tmp43_ = next; + _tmp44_ = level; + gee_concurrent_set_tower_set_succ (_tmp42_, _tmp43_, GEE_CONCURRENT_SET_STATE_NONE, _tmp44_); + _tmp45_ = *prev; + _tmp46_ = level; + _tmp47_ = _tmp45_._iter[_tmp46_]; + _tmp48_ = next; + _tmp49_ = new_tower; + _tmp50_ = level; + _tmp51_ = gee_concurrent_set_tower_compare_and_exchange (_tmp47_, _tmp48_, GEE_CONCURRENT_SET_STATE_NONE, _tmp49_, GEE_CONCURRENT_SET_STATE_NONE, _tmp50_); + _result_ = _tmp51_; + _tmp52_ = _result_; + if (_tmp52_) { + _gee_concurrent_set_tower_unref0 (prev_next); + break; + } + _tmp53_ = *prev; + _tmp54_ = level; + _tmp55_ = _tmp53_._iter[_tmp54_]; + _tmp56_ = level; + _tmp58_ = gee_concurrent_set_tower_get_succ (_tmp55_, &_tmp57_, _tmp56_); + prev_state = _tmp57_; + _gee_concurrent_set_tower_unref0 (prev_next); + prev_next = _tmp58_; + _tmp59_ = prev_state; + if (_tmp59_ == GEE_CONCURRENT_SET_STATE_FLAGGED) { + GeeConcurrentSetTower* _tmp60_; + GeeConcurrentSetTowerIter _tmp61_; + guint8 _tmp62_; + GeeConcurrentSetTower* _tmp63_; + guint8 _tmp64_; + _tmp60_ = prev_next; + _tmp61_ = *prev; + _tmp62_ = level; + _tmp63_ = _tmp61_._iter[_tmp62_]; + _tmp64_ = level; + gee_concurrent_set_tower_help_flagged (_tmp60_, _tmp63_, _tmp64_); + } + _tmp65_ = level; + _tmp66_ = level; + gee_concurrent_set_tower_backtrace (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, &(*prev)._iter[_tmp65_], _tmp66_); + } + _tmp67_ = cmp; + _tmp67__target = cmp_target; + _tmp68_ = key; + _tmp69_ = level; + _tmp70_ = level; + _tmp71_ = gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp67_, _tmp67__target, _tmp68_, &(*prev)._iter[_tmp69_], NULL, _tmp70_); + if (_tmp71_) { + result = NULL; + _gee_concurrent_set_tower_unref0 (prev_next); + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (new_tower); + return result; + } + _gee_concurrent_set_tower_unref0 (prev_next); + } + _tmp72_ = new_tower; + g_atomic_int_inc ((volatile gint *) (&_tmp72_->_height)); + _tmp73_ = new_tower; + _tmp74_ = gee_concurrent_set_tower_get_state (_tmp73_, (guint8) 0); + if (_tmp74_ == GEE_CONCURRENT_SET_STATE_MARKED) { + GCompareDataFunc _tmp75_; + void* _tmp75__target; + guint8 _tmp76_; + GeeConcurrentSetTower* _tmp77_; + guint8 _tmp78_; + _tmp75_ = cmp; + _tmp75__target = cmp_target; + _tmp76_ = level; + _tmp77_ = new_tower; + _tmp78_ = level; + gee_concurrent_set_tower_remove_level (_tmp75_, _tmp75__target, &(*prev)._iter[_tmp76_], _tmp77_, _tmp78_); + result = NULL; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (new_tower); + return result; + } + result = new_tower; + _gee_concurrent_set_tower_unref0 (next); + return result; +} + + +static inline gboolean gee_concurrent_set_tower_remove_key (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, gconstpointer key, guint8 from_level) { + gboolean result = FALSE; + GeeConcurrentSetTower* curr = NULL; + GCompareDataFunc _tmp24_; + void* _tmp24__target; + gconstpointer _tmp25_; + GeeConcurrentSetTower* _tmp26_ = NULL; + gboolean _tmp27_ = FALSE; + g_return_val_if_fail (prev != NULL, FALSE); + { + guint8 _tmp0_; + gint i; + _tmp0_ = from_level; + i = (gint) _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gint _tmp4_; + GeeConcurrentSetTower* next = NULL; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + gint _tmp7_; + gint _tmp8_; + GeeConcurrentSetTower* _tmp9_ = NULL; + GCompareDataFunc _tmp10_; + void* _tmp10__target; + GeeConcurrentSetTowerIter _tmp11_; + gint _tmp12_; + GeeConcurrentSetTower* _tmp13_; + GeeConcurrentSetTowerIter _tmp14_; + gint _tmp15_; + GeeConcurrentSetTower* _tmp16_; + gint _tmp17_ = 0; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + gint _tmp3_; + _tmp3_ = i; + i = _tmp3_ - 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + if (!(_tmp4_ >= 1)) { + break; + } + _tmp5_ = cmp; + _tmp5__target = cmp_target; + _tmp6_ = key; + _tmp7_ = i; + _tmp8_ = i; + gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp5_, _tmp5__target, _tmp6_, &(*prev)._iter[_tmp7_], &_tmp9_, (guint8) _tmp8_); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp9_; + _tmp10_ = cmp; + _tmp10__target = cmp_target; + _tmp11_ = *prev; + _tmp12_ = i; + _tmp13_ = _tmp11_._iter[_tmp12_ - 1]; + _tmp14_ = *prev; + _tmp15_ = i; + _tmp16_ = _tmp14_._iter[_tmp15_]; + _tmp17_ = gee_concurrent_set_tower_compare (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp10_, _tmp10__target, _tmp13_, _tmp16_); + if (_tmp17_ < 0) { + gint _tmp18_; + GeeConcurrentSetTowerIter _tmp19_; + gint _tmp20_; + GeeConcurrentSetTower* _tmp21_; + GeeConcurrentSetTower* _tmp22_; + GeeConcurrentSetTower* _tmp23_; + _tmp18_ = i; + _tmp19_ = *prev; + _tmp20_ = i; + _tmp21_ = _tmp19_._iter[_tmp20_]; + _tmp22_ = _gee_concurrent_set_tower_ref0 (_tmp21_); + _gee_concurrent_set_tower_unref0 ((*prev)._iter[_tmp18_ - 1]); + (*prev)._iter[_tmp18_ - 1] = _tmp22_; + _tmp23_ = (*prev)._iter[_tmp18_ - 1]; + } + _gee_concurrent_set_tower_unref0 (next); + } + } + } + _tmp24_ = cmp; + _tmp24__target = cmp_target; + _tmp25_ = key; + _tmp27_ = gee_concurrent_set_tower_search_helper (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp24_, _tmp24__target, _tmp25_, &(*prev)._iter[0], &_tmp26_, (guint8) 0); + _gee_concurrent_set_tower_unref0 (curr); + curr = _tmp26_; + if (_tmp27_) { + GCompareDataFunc _tmp28_; + void* _tmp28__target; + GeeConcurrentSetTower* _tmp29_; + gboolean _tmp30_ = FALSE; + _tmp28_ = cmp; + _tmp28__target = cmp_target; + _tmp29_ = curr; + _tmp30_ = gee_concurrent_set_tower_remove (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp28_, _tmp28__target, prev, _tmp29_); + result = _tmp30_; + _gee_concurrent_set_tower_unref0 (curr); + return result; + } else { + result = FALSE; + _gee_concurrent_set_tower_unref0 (curr); + return result; + } + _gee_concurrent_set_tower_unref0 (curr); +} + + +static inline gboolean gee_concurrent_set_tower_remove (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTowerIter* prev, GeeConcurrentSetTower* curr) { + gboolean result = FALSE; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GeeConcurrentSetTower* _tmp1_; + gboolean _tmp2_ = FALSE; + gboolean removed; + g_return_val_if_fail (prev != NULL, FALSE); + g_return_val_if_fail (curr != NULL, FALSE); + _tmp0_ = cmp; + _tmp0__target = cmp_target; + _tmp1_ = curr; + _tmp2_ = gee_concurrent_set_tower_remove_level (_tmp0_, _tmp0__target, &(*prev)._iter[0], _tmp1_, (guint8) 0); + removed = _tmp2_; + { + gint i; + i = 1; + { + gboolean _tmp3_; + _tmp3_ = TRUE; + while (TRUE) { + gboolean _tmp4_; + gint _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; + gint _tmp8_; + GeeConcurrentSetTower* _tmp9_; + gint _tmp10_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gint _tmp5_; + _tmp5_ = i; + i = _tmp5_ + 1; + } + _tmp3_ = FALSE; + _tmp6_ = i; + if (!(_tmp6_ < GEE_CONCURRENT_SET__MAX_HEIGHT)) { + break; + } + _tmp7_ = cmp; + _tmp7__target = cmp_target; + _tmp8_ = i; + _tmp9_ = curr; + _tmp10_ = i; + gee_concurrent_set_tower_remove_level (_tmp7_, _tmp7__target, &(*prev)._iter[_tmp8_], _tmp9_, (guint8) _tmp10_); + } + } + } + result = removed; + return result; +} + + +static inline gboolean gee_concurrent_set_tower_remove_level (GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** prev, GeeConcurrentSetTower* curr, guint8 level) { + gboolean result = FALSE; + gboolean status = FALSE; + GeeConcurrentSetTower* _tmp0_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + guint8 _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + gboolean flagged; + gboolean _tmp5_; + g_return_val_if_fail (*prev != NULL, FALSE); + g_return_val_if_fail (curr != NULL, FALSE); + _tmp0_ = curr; + _tmp1_ = cmp; + _tmp1__target = cmp_target; + _tmp2_ = level; + _tmp4_ = gee_concurrent_set_tower_try_flag (_tmp0_, _tmp1_, _tmp1__target, prev, &_tmp3_, _tmp2_); + status = _tmp3_; + flagged = _tmp4_; + _tmp5_ = status; + if (_tmp5_) { + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + guint8 _tmp8_; + _tmp6_ = curr; + _tmp7_ = *prev; + _tmp8_ = level; + gee_concurrent_set_tower_help_flagged (_tmp6_, _tmp7_, _tmp8_); + } + result = flagged; + return result; +} + + +static inline gboolean gee_concurrent_set_tower_proceed (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** arg_prev, GeeConcurrentSetTower** arg_curr, guint8 level, gboolean force) { + gboolean result = FALSE; + GeeConcurrentSetTower* _tmp0_; + GeeConcurrentSetTower* _tmp1_; + GeeConcurrentSetTower* curr; + GeeConcurrentSetTower* _tmp2_; + guint8 _tmp3_; + GeeConcurrentSetTower* _tmp4_ = NULL; + GeeConcurrentSetTower* next; + GeeConcurrentSetTower* _tmp5_; + GeeConcurrentSetTower* _tmp22_; + gboolean success; + gboolean _tmp23_ = FALSE; + gboolean _tmp24_; + gboolean _tmp26_; + g_return_val_if_fail (*arg_curr != NULL, FALSE); + _tmp0_ = *arg_curr; + _tmp1_ = _gee_concurrent_set_tower_ref0 (_tmp0_); + curr = _tmp1_; + _tmp2_ = curr; + _tmp3_ = level; + _tmp4_ = gee_concurrent_set_tower_get_next (_tmp2_, _tmp3_); + next = _tmp4_; + _tmp5_ = next; + if (_tmp5_ != NULL) { + while (TRUE) { + gboolean _tmp6_ = FALSE; + GeeConcurrentSetTower* _tmp7_; + gboolean _tmp10_; + gboolean status = FALSE; + GeeConcurrentSetTower* _tmp11_; + GCompareDataFunc _tmp12_; + void* _tmp12__target; + guint8 _tmp13_; + gboolean _tmp14_ = FALSE; + gboolean _tmp15_; + GeeConcurrentSetTower* _tmp19_; + guint8 _tmp20_; + GeeConcurrentSetTower* _tmp21_ = NULL; + _tmp7_ = next; + if (_tmp7_ != NULL) { + GeeConcurrentSetTower* _tmp8_; + GeeConcurrentSetState _tmp9_ = 0; + _tmp8_ = next; + _tmp9_ = gee_concurrent_set_tower_get_state (_tmp8_, (guint8) 0); + _tmp6_ = _tmp9_ == GEE_CONCURRENT_SET_STATE_MARKED; + } else { + _tmp6_ = FALSE; + } + _tmp10_ = _tmp6_; + if (!_tmp10_) { + break; + } + _tmp11_ = next; + _tmp12_ = cmp; + _tmp12__target = cmp_target; + _tmp13_ = level; + gee_concurrent_set_tower_try_flag (_tmp11_, _tmp12_, _tmp12__target, &curr, &_tmp14_, _tmp13_); + status = _tmp14_; + _tmp15_ = status; + if (_tmp15_) { + GeeConcurrentSetTower* _tmp16_; + GeeConcurrentSetTower* _tmp17_; + guint8 _tmp18_; + _tmp16_ = next; + _tmp17_ = curr; + _tmp18_ = level; + gee_concurrent_set_tower_help_flagged (_tmp16_, _tmp17_, _tmp18_); + } + _tmp19_ = curr; + _tmp20_ = level; + _tmp21_ = gee_concurrent_set_tower_get_next (_tmp19_, _tmp20_); + _gee_concurrent_set_tower_unref0 (next); + next = _tmp21_; + } + } + _tmp22_ = next; + success = _tmp22_ != NULL; + _tmp24_ = success; + if (_tmp24_) { + _tmp23_ = TRUE; + } else { + gboolean _tmp25_; + _tmp25_ = force; + _tmp23_ = _tmp25_; + } + _tmp26_ = _tmp23_; + if (_tmp26_) { + GeeConcurrentSetTower* _tmp27_; + GeeConcurrentSetTower* _tmp28_; + _tmp27_ = curr; + curr = NULL; + _gee_concurrent_set_tower_unref0 (*arg_prev); + *arg_prev = _tmp27_; + _tmp28_ = next; + next = NULL; + _gee_concurrent_set_tower_unref0 (*arg_curr); + *arg_curr = _tmp28_; + } + result = success; + _gee_concurrent_set_tower_unref0 (next); + _gee_concurrent_set_tower_unref0 (curr); + return result; +} + + +static inline void gee_concurrent_set_tower_help_marked (GeeConcurrentSetTower* self, GeeConcurrentSetTower* prev_tower, guint8 level) { + GeeConcurrentSetTower* _tmp0_; + guint8 _tmp1_; + GeeConcurrentSetTower* _tmp2_ = NULL; + GeeConcurrentSetTower* _tmp3_; + guint8 _tmp4_; + g_return_if_fail (self != NULL); + g_return_if_fail (prev_tower != NULL); + _tmp0_ = prev_tower; + _tmp1_ = level; + _tmp2_ = gee_concurrent_set_tower_get_next (self, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = level; + gee_concurrent_set_tower_compare_and_exchange (_tmp0_, self, GEE_CONCURRENT_SET_STATE_FLAGGED, _tmp3_, GEE_CONCURRENT_SET_STATE_NONE, _tmp4_); + _gee_concurrent_set_tower_unref0 (_tmp3_); +} + + +static inline void gee_concurrent_set_tower_help_flagged (GeeConcurrentSetTower* self, GeeConcurrentSetTower* prev, guint8 level) { + GeeConcurrentSetTower* _tmp0_; + guint8 _tmp1_; + guint8 _tmp2_; + GeeConcurrentSetState _tmp3_ = 0; + GeeConcurrentSetTower* _tmp5_; + guint8 _tmp6_; + g_return_if_fail (self != NULL); + g_return_if_fail (prev != NULL); + _tmp0_ = prev; + _tmp1_ = level; + gee_concurrent_set_tower_set_backlink (self, _tmp0_, _tmp1_); + _tmp2_ = level; + _tmp3_ = gee_concurrent_set_tower_get_state (self, _tmp2_); + if (_tmp3_ != GEE_CONCURRENT_SET_STATE_MARKED) { + guint8 _tmp4_; + _tmp4_ = level; + gee_concurrent_set_tower_try_mark (self, _tmp4_); + } + _tmp5_ = prev; + _tmp6_ = level; + gee_concurrent_set_tower_help_marked (self, _tmp5_, _tmp6_); +} + + +static inline void gee_concurrent_set_tower_try_mark (GeeConcurrentSetTower* self, guint8 level) { + g_return_if_fail (self != NULL); + { + gboolean _tmp0_; + _tmp0_ = TRUE; + while (TRUE) { + gboolean _tmp1_; + guint8 _tmp4_; + GeeConcurrentSetTower* _tmp5_ = NULL; + GeeConcurrentSetTower* next_tower; + GeeConcurrentSetTower* _tmp6_; + GeeConcurrentSetTower* _tmp7_; + guint8 _tmp8_; + gboolean _tmp9_ = FALSE; + gboolean _result_; + gboolean _tmp10_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + guint8 _tmp2_; + GeeConcurrentSetState _tmp3_ = 0; + _tmp2_ = level; + _tmp3_ = gee_concurrent_set_tower_get_state (self, _tmp2_); + if (!(_tmp3_ != GEE_CONCURRENT_SET_STATE_MARKED)) { + break; + } + } + _tmp0_ = FALSE; + _tmp4_ = level; + _tmp5_ = gee_concurrent_set_tower_get_next (self, _tmp4_); + next_tower = _tmp5_; + _tmp6_ = next_tower; + _tmp7_ = next_tower; + _tmp8_ = level; + _tmp9_ = gee_concurrent_set_tower_compare_and_exchange (self, _tmp6_, GEE_CONCURRENT_SET_STATE_NONE, _tmp7_, GEE_CONCURRENT_SET_STATE_MARKED, _tmp8_); + _result_ = _tmp9_; + _tmp10_ = _result_; + if (!_tmp10_) { + GeeConcurrentSetState state = 0; + guint8 _tmp11_; + GeeConcurrentSetState _tmp12_ = 0; + GeeConcurrentSetTower* _tmp13_ = NULL; + GeeConcurrentSetState _tmp14_; + _tmp11_ = level; + _tmp13_ = gee_concurrent_set_tower_get_succ (self, &_tmp12_, _tmp11_); + state = _tmp12_; + _gee_concurrent_set_tower_unref0 (next_tower); + next_tower = _tmp13_; + _tmp14_ = state; + if (_tmp14_ == GEE_CONCURRENT_SET_STATE_FLAGGED) { + GeeConcurrentSetTower* _tmp15_; + guint8 _tmp16_; + _tmp15_ = next_tower; + _tmp16_ = level; + gee_concurrent_set_tower_help_flagged (self, _tmp15_, _tmp16_); + } + } + _gee_concurrent_set_tower_unref0 (next_tower); + } + } +} + + +static inline gboolean gee_concurrent_set_tower_try_flag (GeeConcurrentSetTower* self, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower** prev_tower, gboolean* status, guint8 level) { + gboolean _vala_status = FALSE; + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (*prev_tower != NULL, FALSE); + while (TRUE) { + GeeConcurrentSetTower* _tmp0_; + guint8 _tmp1_; + gboolean _tmp2_ = FALSE; + GeeConcurrentSetTower* _tmp3_; + guint8 _tmp4_; + gboolean _tmp5_ = FALSE; + gboolean _result_; + gboolean _tmp6_; + GeeConcurrentSetState result_state = 0; + GeeConcurrentSetTower* _tmp7_; + guint8 _tmp8_; + GeeConcurrentSetState _tmp9_ = 0; + GeeConcurrentSetTower* _tmp10_ = NULL; + GeeConcurrentSetTower* result_tower; + gboolean _tmp11_ = FALSE; + GeeConcurrentSetTower* _tmp12_; + gboolean _tmp14_; + guint8 _tmp15_; + GCompareDataFunc _tmp16_; + void* _tmp16__target; + gconstpointer _tmp17_; + guint8 _tmp18_; + gboolean _tmp19_ = FALSE; + _tmp0_ = *prev_tower; + _tmp1_ = level; + _tmp2_ = gee_concurrent_set_tower_compare_succ (_tmp0_, self, GEE_CONCURRENT_SET_STATE_FLAGGED, _tmp1_); + if (_tmp2_) { + _vala_status = TRUE; + result = FALSE; + if (status) { + *status = _vala_status; + } + return result; + } + _tmp3_ = *prev_tower; + _tmp4_ = level; + _tmp5_ = gee_concurrent_set_tower_compare_and_exchange (_tmp3_, self, GEE_CONCURRENT_SET_STATE_NONE, self, GEE_CONCURRENT_SET_STATE_FLAGGED, _tmp4_); + _result_ = _tmp5_; + _tmp6_ = _result_; + if (_tmp6_) { + _vala_status = TRUE; + result = TRUE; + if (status) { + *status = _vala_status; + } + return result; + } + _tmp7_ = *prev_tower; + _tmp8_ = level; + _tmp10_ = gee_concurrent_set_tower_get_succ (_tmp7_, &_tmp9_, _tmp8_); + result_state = _tmp9_; + result_tower = _tmp10_; + _tmp12_ = result_tower; + if (_tmp12_ == self) { + GeeConcurrentSetState _tmp13_; + _tmp13_ = result_state; + _tmp11_ = _tmp13_ == GEE_CONCURRENT_SET_STATE_FLAGGED; + } else { + _tmp11_ = FALSE; + } + _tmp14_ = _tmp11_; + if (_tmp14_) { + _vala_status = TRUE; + result = FALSE; + _gee_concurrent_set_tower_unref0 (result_tower); + if (status) { + *status = _vala_status; + } + return result; + } + _tmp15_ = level; + gee_concurrent_set_tower_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, prev_tower, _tmp15_); + _tmp16_ = cmp; + _tmp16__target = cmp_target; + _tmp17_ = self->_data; + _tmp18_ = level; + _tmp19_ = gee_concurrent_set_tower_search_helper (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp16_, _tmp16__target, _tmp17_, prev_tower, NULL, _tmp18_); + if (!_tmp19_) { + _vala_status = FALSE; + result = FALSE; + _gee_concurrent_set_tower_unref0 (result_tower); + if (status) { + *status = _vala_status; + } + return result; + } + _gee_concurrent_set_tower_unref0 (result_tower); + } + if (status) { + *status = _vala_status; + } +} + + +static inline void gee_concurrent_set_tower_backtrace (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetTower** curr, guint8 level) { + while (TRUE) { + GeeConcurrentSetTower* _tmp0_; + guint8 _tmp1_; + GeeConcurrentSetState _tmp2_ = 0; + GeeConcurrentSetTower* _tmp3_; + guint8 _tmp4_; + GeeConcurrentSetTower* _tmp5_ = NULL; + _tmp0_ = *curr; + _tmp1_ = level; + _tmp2_ = gee_concurrent_set_tower_get_state (_tmp0_, _tmp1_); + if (!(_tmp2_ == GEE_CONCURRENT_SET_STATE_MARKED)) { + break; + } + _tmp3_ = *curr; + _tmp4_ = level; + _tmp5_ = gee_concurrent_set_tower_get_backlink (_tmp3_, _tmp4_); + _gee_concurrent_set_tower_unref0 (*curr); + *curr = _tmp5_; + } +} + + +static inline gboolean gee_concurrent_set_tower_compare_and_exchange (GeeConcurrentSetTower* self, GeeConcurrentSetTower* old_tower, GeeConcurrentSetState old_state, GeeConcurrentSetTower* new_tower, GeeConcurrentSetState new_state, guint8 level) { + gboolean result = FALSE; + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetTower* _tmp4_; + GeeConcurrentSetState _tmp5_; + GeeConcurrentSetState _tmp6_; + gboolean _tmp7_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = old_tower; + _tmp3_ = new_tower; + _tmp4_ = _gee_concurrent_set_tower_ref0 (_tmp3_); + _tmp5_ = old_state; + _tmp6_ = new_state; + _tmp7_ = gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp0_[_tmp1_]._succ, _tmp2_, _tmp4_, (gsize) 3, (gsize) _tmp5_, (gsize) _tmp6_); + result = _tmp7_; + return result; +} + + +static inline gboolean gee_concurrent_set_tower_compare_succ (GeeConcurrentSetTower* self, GeeConcurrentSetTower* next, GeeConcurrentSetState state, guint8 level) { + gboolean result = FALSE; + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + void* _tmp2_ = NULL; + gsize cur; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetState _tmp4_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = g_atomic_pointer_get ((volatile gpointer *) (&_tmp0_[_tmp1_]._succ)); + cur = (gsize) _tmp2_; + _tmp3_ = next; + _tmp4_ = state; + result = cur == (((gsize) _tmp3_) | ((gsize) _tmp4_)); + return result; +} + + +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_next (GeeConcurrentSetTower* self, guint8 level) { + GeeConcurrentSetTower* result = NULL; + guint8 _tmp0_; + GeeConcurrentSetTower* _tmp1_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = level; + _tmp1_ = gee_concurrent_set_tower_get_succ (self, NULL, _tmp0_); + result = _tmp1_; + return result; +} + + +static inline GeeConcurrentSetState gee_concurrent_set_tower_get_state (GeeConcurrentSetTower* self, guint8 level) { + GeeConcurrentSetState result = 0; + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + void* _tmp2_ = NULL; + g_return_val_if_fail (self != NULL, 0); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = g_atomic_pointer_get ((volatile gpointer *) (&_tmp0_[_tmp1_]._succ)); + result = (GeeConcurrentSetState) (((gsize) _tmp2_) & 3); + return result; +} + + +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_succ (GeeConcurrentSetTower* self, GeeConcurrentSetState* state, guint8 level) { + GeeConcurrentSetState _vala_state = 0; + GeeConcurrentSetTower* result = NULL; + gsize rstate = 0UL; + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + gsize _tmp2_ = 0UL; + gpointer _tmp3_ = NULL; + GeeConcurrentSetTower* succ; + GeeConcurrentSetTower* _tmp4_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp3_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp0_[_tmp1_]._succ, (gsize) 3, &_tmp2_); + rstate = _tmp2_; + succ = (GeeConcurrentSetTower*) _tmp3_; + _vala_state = (GeeConcurrentSetState) rstate; + _tmp4_ = succ; + succ = NULL; + result = _tmp4_; + _gee_concurrent_set_tower_unref0 (succ); + if (state) { + *state = _vala_state; + } + return result; +} + + +static inline void gee_concurrent_set_tower_set_succ (GeeConcurrentSetTower* self, GeeConcurrentSetTower* next, GeeConcurrentSetState state, guint8 level) { + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* _tmp3_; + GeeConcurrentSetState _tmp4_; + g_return_if_fail (self != NULL); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = next; + _tmp3_ = _gee_concurrent_set_tower_ref0 (_tmp2_); + _tmp4_ = state; + gee_hazard_pointer_set_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp0_[_tmp1_]._succ, _tmp3_, (gsize) 3, (gsize) _tmp4_); +} + + +static inline GeeConcurrentSetTower* gee_concurrent_set_tower_get_backlink (GeeConcurrentSetTower* self, guint8 level) { + GeeConcurrentSetTower* result = NULL; + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + gpointer _tmp2_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp0_[_tmp1_]._backlink, (gsize) 0, NULL); + result = (GeeConcurrentSetTower*) _tmp2_; + return result; +} + + +static inline void gee_concurrent_set_tower_set_backlink (GeeConcurrentSetTower* self, GeeConcurrentSetTower* backlink, guint8 level) { + GeeConcurrentSetTowerNode* _tmp0_; + gint _tmp0__length1; + guint8 _tmp1_; + GeeConcurrentSetTower* _tmp2_; + GeeConcurrentSetTower* _tmp3_; + g_return_if_fail (self != NULL); + _tmp0_ = self->_nodes; + _tmp0__length1 = -1; + _tmp1_ = level; + _tmp2_ = backlink; + _tmp3_ = _gee_concurrent_set_tower_ref0 (_tmp2_); + gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_SET_TYPE_TOWER, (GBoxedCopyFunc) gee_concurrent_set_tower_ref, gee_concurrent_set_tower_unref, &_tmp0_[_tmp1_]._backlink, NULL, _tmp3_, (gsize) 0, (gsize) 0, (gsize) 0); +} + + +static inline gint gee_concurrent_set_tower_get_height (GeeConcurrentSetTower* self) { + gint result = 0; + gint _tmp0_ = 0; + gint height; + gint _tmp1_ = 0; + gint _tmp2_; + gint _tmp4_; + g_return_val_if_fail (self != NULL, 0); + _tmp0_ = g_atomic_int_get ((volatile gint *) (&self->_height)); + height = _tmp0_; + _tmp2_ = height; + if (_tmp2_ != (-1)) { + gint _tmp3_; + _tmp3_ = height; + _tmp1_ = _tmp3_; + } else { + _tmp1_ = GEE_CONCURRENT_SET__MAX_HEIGHT; + } + _tmp4_ = _tmp1_; + result = _tmp4_; + return result; +} + + +static inline gboolean gee_concurrent_set_tower_is_head (GeeConcurrentSetTower* self) { + gboolean result = FALSE; + gint _tmp0_ = 0; + gint height; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = g_atomic_int_get ((volatile gint *) (&self->_height)); + height = _tmp0_; + result = height == (-1); + return result; +} + + +static inline gint gee_concurrent_set_tower_compare (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower* a, GeeConcurrentSetTower* b) { + gint result = 0; + GeeConcurrentSetTower* _tmp0_; + gint _tmp1_ = 0; + gboolean ah; + GeeConcurrentSetTower* _tmp2_; + gint _tmp3_ = 0; + gboolean bh; + gint _tmp4_ = 0; + gboolean _tmp5_; + gint _tmp18_; + g_return_val_if_fail (a != NULL, 0); + g_return_val_if_fail (b != NULL, 0); + _tmp0_ = a; + _tmp1_ = g_atomic_int_get ((volatile gint *) (&_tmp0_->_height)); + ah = _tmp1_ == (-1); + _tmp2_ = b; + _tmp3_ = g_atomic_int_get ((volatile gint *) (&_tmp2_->_height)); + bh = _tmp3_ == (-1); + _tmp5_ = ah; + if (_tmp5_) { + gint _tmp6_ = 0; + gboolean _tmp7_; + gint _tmp8_; + _tmp7_ = bh; + if (_tmp7_) { + _tmp6_ = 0; + } else { + _tmp6_ = -1; + } + _tmp8_ = _tmp6_; + _tmp4_ = _tmp8_; + } else { + gint _tmp9_ = 0; + gboolean _tmp10_; + gint _tmp17_; + _tmp10_ = bh; + if (_tmp10_) { + _tmp9_ = 1; + } else { + GCompareDataFunc _tmp11_; + void* _tmp11__target; + GeeConcurrentSetTower* _tmp12_; + gconstpointer _tmp13_; + GeeConcurrentSetTower* _tmp14_; + gconstpointer _tmp15_; + gint _tmp16_ = 0; + _tmp11_ = cmp; + _tmp11__target = cmp_target; + _tmp12_ = a; + _tmp13_ = _tmp12_->_data; + _tmp14_ = b; + _tmp15_ = _tmp14_->_data; + _tmp16_ = _tmp11_ (_tmp13_, _tmp15_, _tmp11__target); + _tmp9_ = _tmp16_; + } + _tmp17_ = _tmp9_; + _tmp4_ = _tmp17_; + } + _tmp18_ = _tmp4_; + result = _tmp18_; + return result; +} + + +static inline gint gee_concurrent_set_tower_compare_data (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc cmp, void* cmp_target, GeeConcurrentSetTower* a, gconstpointer b) { + gint result = 0; + GeeConcurrentSetTower* _tmp0_; + gint _tmp1_ = 0; + gboolean ah; + gint _tmp2_ = 0; + gboolean _tmp3_; + g_return_val_if_fail (a != NULL, 0); + _tmp0_ = a; + _tmp1_ = g_atomic_int_get ((volatile gint *) (&_tmp0_->_height)); + ah = _tmp1_ == (-1); + _tmp3_ = ah; + if (_tmp3_) { + _tmp2_ = -1; + } else { + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GeeConcurrentSetTower* _tmp5_; + gconstpointer _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_ = 0; + _tmp4_ = cmp; + _tmp4__target = cmp_target; + _tmp5_ = a; + _tmp6_ = _tmp5_->_data; + _tmp7_ = b; + _tmp8_ = _tmp4_ (_tmp6_, _tmp7_, _tmp4__target); + _tmp2_ = _tmp8_; + } + result = _tmp2_; + return result; +} + + +static void gee_concurrent_set_value_tower_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void gee_concurrent_set_value_tower_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_concurrent_set_tower_unref (value->data[0].v_pointer); + } +} + + +static void gee_concurrent_set_value_tower_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_concurrent_set_tower_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer gee_concurrent_set_value_tower_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* gee_concurrent_set_value_tower_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeConcurrentSetTower* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_concurrent_set_tower_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* gee_concurrent_set_value_tower_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeConcurrentSetTower** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_concurrent_set_tower_ref (value->data[0].v_pointer); + } + return NULL; +} + + +static GParamSpec* gee_concurrent_set_param_spec_tower (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeConcurrentSetParamSpecTower* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_CONCURRENT_SET_TYPE_TOWER), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +static gpointer gee_concurrent_set_value_get_tower (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_TOWER), NULL); + return value->data[0].v_pointer; +} + + +static void gee_concurrent_set_value_set_tower (GValue* value, gpointer v_object) { + GeeConcurrentSetTower* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_TOWER)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_SET_TYPE_TOWER)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_concurrent_set_tower_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_set_tower_unref (old); + } +} + + +static void gee_concurrent_set_value_take_tower (GValue* value, gpointer v_object) { + GeeConcurrentSetTower* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_SET_TYPE_TOWER)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_SET_TYPE_TOWER)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_concurrent_set_tower_unref (old); + } +} + + +static void gee_concurrent_set_tower_class_init (GeeConcurrentSetTowerClass * klass) { + gee_concurrent_set_tower_parent_class = g_type_class_peek_parent (klass); + GEE_CONCURRENT_SET_TOWER_CLASS (klass)->finalize = gee_concurrent_set_tower_finalize; + g_type_class_add_private (klass, sizeof (GeeConcurrentSetTowerPrivate)); +} + + +static void gee_concurrent_set_tower_instance_init (GeeConcurrentSetTower * self) { + self->priv = GEE_CONCURRENT_SET_TOWER_GET_PRIVATE (self); + self->ref_count = 1; +} + + +static void gee_concurrent_set_tower_finalize (GeeConcurrentSetTower* obj) { + GeeConcurrentSetTower * self; + gint _tmp0_ = 0; + gint height; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_SET_TYPE_TOWER, GeeConcurrentSetTower); + _tmp0_ = gee_concurrent_set_tower_get_height (self); + height = _tmp0_; + { + guint8 i; + i = (guint8) 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + guint8 _tmp4_; + gint _tmp5_; + guint8 _tmp6_; + guint8 _tmp7_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + guint8 _tmp3_; + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp1_ = FALSE; + _tmp4_ = i; + _tmp5_ = height; + if (!(((gint) _tmp4_) < _tmp5_)) { + break; + } + _tmp6_ = i; + gee_concurrent_set_tower_set_succ (self, NULL, GEE_CONCURRENT_SET_STATE_NONE, _tmp6_); + _tmp7_ = i; + gee_concurrent_set_tower_set_backlink (self, NULL, _tmp7_); + } + } + } + self->_nodes = (g_free (self->_nodes), NULL); + self->_nodes = NULL; + self->_nodes = (g_free (self->_nodes), NULL); + ((self->_data == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->_data = (self->priv->g_destroy_func (self->_data), NULL)); +} + + +static GType gee_concurrent_set_tower_get_type (void) { + static volatile gsize gee_concurrent_set_tower_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_tower_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_concurrent_set_value_tower_init, gee_concurrent_set_value_tower_free_value, gee_concurrent_set_value_tower_copy_value, gee_concurrent_set_value_tower_peek_pointer, "p", gee_concurrent_set_value_tower_collect_value, "p", gee_concurrent_set_value_tower_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetTowerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_tower_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSetTower), 0, (GInstanceInitFunc) gee_concurrent_set_tower_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_concurrent_set_tower_type_id; + gee_concurrent_set_tower_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeConcurrentSetTower", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_concurrent_set_tower_type_id__volatile, gee_concurrent_set_tower_type_id); + } + return gee_concurrent_set_tower_type_id__volatile; +} + + +static gpointer gee_concurrent_set_tower_ref (gpointer instance) { + GeeConcurrentSetTower* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +static void gee_concurrent_set_tower_unref (gpointer instance) { + GeeConcurrentSetTower* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_CONCURRENT_SET_TOWER_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +static GeeConcurrentSetTowerNode* gee_concurrent_set_tower_node_dup (const GeeConcurrentSetTowerNode* self) { + GeeConcurrentSetTowerNode* dup; + dup = g_new0 (GeeConcurrentSetTowerNode, 1); + memcpy (dup, self, sizeof (GeeConcurrentSetTowerNode)); + return dup; +} + + +static void gee_concurrent_set_tower_node_free (GeeConcurrentSetTowerNode* self) { + g_free (self); +} + + +static GType gee_concurrent_set_tower_node_get_type (void) { + static volatile gsize gee_concurrent_set_tower_node_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_tower_node_type_id__volatile)) { + GType gee_concurrent_set_tower_node_type_id; + gee_concurrent_set_tower_node_type_id = g_boxed_type_register_static ("GeeConcurrentSetTowerNode", (GBoxedCopyFunc) gee_concurrent_set_tower_node_dup, (GBoxedFreeFunc) gee_concurrent_set_tower_node_free); + g_once_init_leave (&gee_concurrent_set_tower_node_type_id__volatile, gee_concurrent_set_tower_node_type_id); + } + return gee_concurrent_set_tower_node_type_id__volatile; +} + + +static void _vala_array_copy2 (GeeConcurrentSetTower** self, GeeConcurrentSetTower** dest) { + int i; + for (i = 0; i < 31; i++) { + GeeConcurrentSetTower* _tmp0_; + _tmp0_ = _gee_concurrent_set_tower_ref0 (self[i]); + dest[i] = _tmp0_; + } +} + + +static void gee_concurrent_set_tower_iter_copy (const GeeConcurrentSetTowerIter* self, GeeConcurrentSetTowerIter* dest) { + GeeConcurrentSetTower* _tmp0_[31]; + gint _tmp0__length1; + _vala_array_copy2 ((*self)._iter, _tmp0_); + _vala_array_destroy ((*dest)._iter, 31, (GDestroyNotify) gee_concurrent_set_tower_unref); + memcpy ((*dest)._iter, _tmp0_, 31 * sizeof (GeeConcurrentSetTower*)); +} + + +static void gee_concurrent_set_tower_iter_destroy (GeeConcurrentSetTowerIter* self) { + _vala_array_destroy ((*self)._iter, 31, (GDestroyNotify) gee_concurrent_set_tower_unref); +} + + +static GeeConcurrentSetTowerIter* gee_concurrent_set_tower_iter_dup (const GeeConcurrentSetTowerIter* self) { + GeeConcurrentSetTowerIter* dup; + dup = g_new0 (GeeConcurrentSetTowerIter, 1); + gee_concurrent_set_tower_iter_copy (self, dup); + return dup; +} + + +static void gee_concurrent_set_tower_iter_free (GeeConcurrentSetTowerIter* self) { + gee_concurrent_set_tower_iter_destroy (self); + g_free (self); +} + + +static GType gee_concurrent_set_tower_iter_get_type (void) { + static volatile gsize gee_concurrent_set_tower_iter_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_tower_iter_type_id__volatile)) { + GType gee_concurrent_set_tower_iter_type_id; + gee_concurrent_set_tower_iter_type_id = g_boxed_type_register_static ("GeeConcurrentSetTowerIter", (GBoxedCopyFunc) gee_concurrent_set_tower_iter_dup, (GBoxedFreeFunc) gee_concurrent_set_tower_iter_free); + g_once_init_leave (&gee_concurrent_set_tower_iter_type_id__volatile, gee_concurrent_set_tower_iter_type_id); + } + return gee_concurrent_set_tower_iter_type_id__volatile; +} + + +static void gee_concurrent_set_class_init (GeeConcurrentSetClass * klass) { + GPrivate* _tmp0_; + gee_concurrent_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeConcurrentSetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_concurrent_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_concurrent_set_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_concurrent_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_concurrent_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_concurrent_set_real_clear; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_concurrent_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_concurrent_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_concurrent_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_concurrent_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_concurrent_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_concurrent_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_concurrent_set_real_ceil; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_concurrent_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_concurrent_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_concurrent_set_real_sub_set; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_concurrent_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_concurrent_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_concurrent_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + _tmp0_ = g_private_new (__gee_concurrent_set_rand_lambda37__gdestroy_notify); + gee_concurrent_set_rand = _tmp0_; +} + + +static void gee_concurrent_set_instance_init (GeeConcurrentSet * self) { + GeeConcurrentSetTower* _tmp0_; + self->priv = GEE_CONCURRENT_SET_GET_PRIVATE (self); + self->priv->_size = 0; + _tmp0_ = gee_concurrent_set_tower_new_head (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func); + self->priv->_head = _tmp0_; +} + + +static void gee_concurrent_set_finalize (GObject* obj) { + GeeConcurrentSet * self; + GeeHazardPointerContext* _tmp0_; + GeeHazardPointerContext* ctx; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet); + _tmp0_ = gee_hazard_pointer_context_new (NULL); + ctx = _tmp0_; + _gee_concurrent_set_tower_unref0 (self->priv->_head); + self->priv->_head = NULL; + _gee_hazard_pointer_context_free0 (ctx); + _gee_concurrent_set_tower_unref0 (self->priv->_head); + (self->priv->_cmp_target_destroy_notify == NULL) ? NULL : (self->priv->_cmp_target_destroy_notify (self->priv->_cmp_target), NULL); + self->priv->_cmp = NULL; + self->priv->_cmp_target = NULL; + self->priv->_cmp_target_destroy_notify = NULL; + G_OBJECT_CLASS (gee_concurrent_set_parent_class)->finalize (obj); +} + + +/** + * A skip-linked list. This implementation is based on + * [[http://www.cse.yorku.ca/~ruppert/Mikhail.pdf|Mikhail Fomitchev Master Thesis]]. + * + * Many threads are allowed to operate on the same structure as well as modification + * of structure during iteration is allowed. However the change may not be immidiatly + * visible to other threads. + */ +GType gee_concurrent_set_get_type (void) { + static volatile gsize gee_concurrent_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_concurrent_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentSet), 0, (GInstanceInitFunc) gee_concurrent_set_instance_init, NULL }; + GType gee_concurrent_set_type_id; + gee_concurrent_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SORTED_SET, "GeeConcurrentSet", &g_define_type_info, 0); + g_once_init_leave (&gee_concurrent_set_type_id__volatile, gee_concurrent_set_type_id); + } + return gee_concurrent_set_type_id__volatile; +} + + +static void _vala_gee_concurrent_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeConcurrentSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet); + switch (property_id) { + case GEE_CONCURRENT_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_CONCURRENT_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_concurrent_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeConcurrentSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet); + switch (property_id) { + case GEE_CONCURRENT_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_CONCURRENT_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_CONCURRENT_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/gee/concurrentset.vala b/gee/concurrentset.vala new file mode 100644 index 0000000..c0d3d75 --- /dev/null +++ b/gee/concurrentset.vala @@ -0,0 +1,1362 @@ +/* concurrentset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * A skip-linked list. This implementation is based on + * [[http://www.cse.yorku.ca/~ruppert/Mikhail.pdf|Mikhail Fomitchev Master Thesis]]. + * + * Many threads are allowed to operate on the same structure as well as modification + * of structure during iteration is allowed. However the change may not be immidiatly + * visible to other threads. + */ +public class Gee.ConcurrentSet : AbstractSortedSet { + public ConcurrentSet (owned CompareDataFunc? compare_func = null) { + if (compare_func == null) { + compare_func = Functions.get_compare_func_for (typeof (G)); + } + _cmp = compare_func; + } + + ~ConcurrentSet () { + HazardPointer.Context ctx = new HazardPointer.Context (); + _head = null; + } + + public override int size { get { return GLib.AtomicInt.get (ref _size); } } + + public override bool read_only { get { return false; } } + + public override Gee.Iterator iterator () { + return new Iterator (this, _head); + } + + public override bool contains (G key) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _head; + return Tower.search (_cmp, key, ref prev, null); + } + + public override bool add (G key) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Rand *rnd = rand.get (); + if (rnd == null) { + rand.set (rnd = new Rand ()); + } + uint32 rand_int = rnd->int_range (0, int32.MAX); + uint8 height = 1 + (uint8)GLib.Bit.nth_lsf (~rand_int, -1); + TowerIter prev = TowerIter(); + prev._iter[height - 1] = _head; + if (Tower.search (_cmp, key, ref prev._iter[height - 1], null, height - 1)) { + return false; + } + for (int i = height - 2; i >= 0; i--) { + prev._iter[i] = prev._iter[height - 1]; + } + Tower? result = Tower.insert (_cmp, ref prev, key, height - 1); + if (result != null) { + GLib.AtomicInt.inc (ref _size); + } + return result != null; + } + + public override bool remove (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + TowerIter prev = TowerIter(); + for (int i = 0; i < _MAX_HEIGHT; i++) { + prev._iter[i] = _head; + } + bool result = Tower.remove_key (_cmp, ref prev, item); + if (result) { + GLib.AtomicInt.dec_and_test (ref _size); + } + return result; + } + + public override void clear () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? first; + while ((first = _head.get_next (0)) != null) { + remove (first._data); + } + } + + public override G first () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? prev = null; + Tower curr = _head; + if (Tower.proceed (_cmp, ref prev, ref curr, 0)) { + return curr._data; + } else { + return null; + } + } + + public override G last () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? prev = null; + Tower curr = _head; + bool found = false; + for (int i = _MAX_HEIGHT; i >= 0; i--) { + while (Tower.proceed (_cmp, ref prev, ref curr, 0)) { + found = true; + } + } + if (!found) { + return null; + } + return curr._data; + } + + public override Gee.Iterator? iterator_at (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + TowerIter prev = TowerIter (); + TowerIter curr; + for (int i = 0; i < _MAX_HEIGHT; i++) { + prev._iter[i] = _head; + } + if (!Tower.search_from_bookmark (_cmp, element, ref prev, out curr)) { + return null; + } + return new Iterator.point_at (this, ref prev, curr._iter[0]); + } + + public override G? lower (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _head; + Tower.search (_cmp, element, ref prev); + if (prev == _head) { + return null; + } + return prev._data; + } + + public override G? higher (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _head; + Tower? next; + if (Tower.search (_cmp, element, ref prev, out next)) { + if (!Tower.proceed (_cmp, ref prev, ref next, 0)) { + return null; + } + } + if (next == null) { + return null; + } + return next._data; + } + + public override G? floor (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _head; + Tower? next; + if (Tower.search (_cmp, element, ref prev, out next)) { + return next._data; + } else if (prev != _head) { + return prev._data; + } else { + return null; + } + } + + public override G? ceil (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _head; + Tower? next; + Tower.search (_cmp, element, ref prev, out next); + if (next == null) { + return null; + } + return next._data; + } + + public override SortedSet head_set (G before) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (new Range.head (this, before)); + } + + public override SortedSet tail_set (G after) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (new Range.tail (this, after)); + } + public override SortedSet sub_set (G from, G to) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (new Range (this, from, to)); + } + + private unowned G max (G a, G b, out bool changed = null) { + changed = _cmp (a, b) < 0; + return changed ? b : a; + } + + private unowned G min (G a, G b, out bool changed = null) { + changed = _cmp (a, b) > 0; + return changed ? b : a; + } + +#if DEBUG + public void dump () { + for (int i = _MAX_HEIGHT - 1; i >= 0; i--) { + bool printed = false; + Tower? curr = _head; + State state; + while ((curr = curr.get_succ (out state, (uint8)i)) != null) { + if (!printed) { + stderr.printf("Level %d\n", i); + printed = true; + } + stderr.printf(" Node %p%s - %s\n", curr, state == State.NONE ? "" : state == State.MARKED ? " (MARKED)" : " (FLAGGED)", (string)curr._data); + assert (curr._height > i); + } + } + } +#endif + + private int _size = 0; + private Tower _head = new Tower.head (); + private CompareDataFunc? _cmp; + private static const int _MAX_HEIGHT = 31; + private static Private rand = new Private((ptr) => { + Rand *rnd = (Rand *)ptr; + delete rnd; + }); + + private class Iterator : Object, Traversable, Gee.Iterator { + public Iterator (ConcurrentSet cset, Tower head) { + _curr = head; + _set = cset; + assert (_curr != null); + } + + public Iterator.point_at (ConcurrentSet cset, ref TowerIter prev, Tower curr) { + _curr = curr; + _set = cset; + _prev = prev; + assert (_curr != null); + } + + public new bool foreach (ForallFunc f) { + assert (_curr != null); + HazardPointer.Context ctx = new HazardPointer.Context (); + if (_prev._iter[0] != null && !_removed) { + if (!f (_curr._data)) { + assert (_curr != null); + return false; + } + } + Tower new_prev = _prev._iter[0]; + Tower? new_curr = _curr; + while (Tower.proceed (_set._cmp, ref new_prev, ref new_curr, 0)) { + assert (_curr != null); + if (!_removed) { + //FIXME: Help mark/delete on the way + _prev._iter[0] = new_prev; + int prev_height = _prev._iter[0].get_height(); + for (int i = 1; i < prev_height; i++) { + _prev._iter[i] = _prev._iter[0]; + } + } + _curr = new_curr; + _removed = false; + if (!f (_curr._data)) { + assert (_curr != null); + return false; + } + } + assert (_curr != null); + return true; + } + + public bool next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? new_prev = _prev._iter[0]; + Tower? new_curr = _curr; + bool success = Tower.proceed (_set._cmp, ref new_prev, ref new_curr, 0); + if (success) { + if (!_removed) { + //FIXME: Help mark/delete on the way + _prev._iter[0] = (owned)new_prev; + int prev_height = _prev._iter[0].get_height(); + for (int i = 1; i < prev_height; i++) { + _prev._iter[i] = _prev._iter[0]; + } + } + _curr = (owned)new_curr; + _removed = false; + } + assert (_curr != null); + return success; + } + + public bool has_next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower prev = _prev._iter[0]; + Tower? curr = _curr; + return Tower.proceed (_set._cmp, ref prev, ref curr, 0); + } + + public new G get () { + assert (valid); + return _curr._data; + } + + public void remove () { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); + if (Tower.remove (_set._cmp, ref _prev, _curr)) { + AtomicInt.dec_and_test (ref _set._size); + } + _removed = true; + } + + public bool valid { get { return _prev._iter[0] != null && !_removed; } } + + public bool read_only { get { return true; } } + + private bool _removed = false; + private ConcurrentSet _set; + private TowerIter _prev; + private Tower _curr; + } + + private class SubSet : AbstractSortedSet { + public override int size { + get { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? curr; + Range.improve_bookmark (_range, out curr); + if (curr != null) { + int acc = 1; + Tower? prev = HazardPointer.get_pointer> (&_range._bookmark._iter[0]); + while (Range.proceed (_range, ref prev, ref curr, 0)) { + acc++; + } + return acc; + } else { + return 0; + } + } + } + + public bool is_empty { + get { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? curr; + Range.improve_bookmark (_range, out curr); + return curr != null; + } + } + + public override bool read_only { get { return false; } } + + public SubSet (Range range) { + _range = range; + } + + public override Gee.Iterator iterator () { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubIterator (_range); + } + + public override bool contains (G item) { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (!Range.inside (_range, item)) { + return false; + } + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + return Tower.search_from_bookmark (_range._set._cmp, item, ref prev); + } + + public override bool add (G key) { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (!Range.inside (_range, key)) { + return false; + } + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + Rand *rnd = ConcurrentSet.rand.get (); + if (rnd == null) { + rand.set (rnd = new Rand ()); + } + uint32 rand_int = rnd->int_range (0, int32.MAX); + uint8 height = 1 + (uint8)GLib.Bit.nth_lsf (~rand_int, -1); + if (Tower.search_from_bookmark (_range._set._cmp, key, ref prev, null, height - 1)) { + return false; + } + for (int i = height - 2; i >= 0; i--) { + prev._iter[i] = prev._iter[height - 1]; + } + Tower? result = Tower.insert (_range._set._cmp, ref prev, key, height - 1); + if (result != null) { + GLib.AtomicInt.inc (ref _range._set._size); + } + return result != null; + } + + public override bool remove (G key) { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (!Range.inside (_range, key)) { + return false; + } + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + // FIXME: Use full bookmark + bool result = Tower.remove_key (_range._set._cmp, ref prev, key); + if (result) { + GLib.AtomicInt.dec_and_test (ref _range._set._size); + } + return result; + } + + public override void clear () { + HazardPointer.Context ctx = new HazardPointer.Context (); + TowerIter prev; + Tower? first; + Range.improve_bookmark (_range, out first, out prev); + while (first != null) { + Tower.remove (_range._set._cmp, ref prev, first); + Range.improve_bookmark (_range, out first, out prev); + } + } + + public override G? first () { + HazardPointer.Context ctx = new HazardPointer.Context (); + Tower? first; + Range.improve_bookmark (_range, out first); + if (first == null) { + return null; + } + return first._data; + } + + public override G? last () { + HazardPointer.Context ctx = new HazardPointer.Context (); + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + Tower? curr = null; + for (int i = _MAX_HEIGHT - 1; i >= 0; i--) { + if (curr == null) { + curr = prev._iter[i].get_next ((uint8)i); + if (curr == null || !Range.inside (_range, curr._data)) { + curr = null; + continue; + } + } + bool improved = false; + while (Range.proceed (_range, ref prev._iter[i], ref curr, (uint8)i)) { + improved = true; + } + if (improved && i > 0) { + prev._iter[i - 1] = prev._iter[i]; + } + } + if (curr == null) { + return null; + } + return curr._data; + } + + public override Gee.Iterator? iterator_at (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (!Range.inside (_range, element)) { + return null; + } + TowerIter prev; + TowerIter next; + Range.improve_bookmark (_range, null, out prev); + if (!Tower.search_from_bookmark (_range._set._cmp, element, ref prev, out next)) { + return null; + } + return new SubIterator.point_at (_range, ref prev, next._iter[0]); + } + + public override G? lower (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + switch (Range.cmp (_range, element)) { + case Range.Position.BEFORE: + case Range.Position.EMPTY: + return null; + case Range.Position.INSIDE: + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + Tower.search_from_bookmark (_range._set._cmp, element, ref prev); + if (prev._iter[0] == _range._set._head || !Range.inside (_range, prev._iter[0]._data)) { + return null; + } + return prev._iter[0]._data; + case Range.Position.AFTER: + return last (); + default: + assert_not_reached (); + } + } + + public override G? higher (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + switch (Range.cmp (_range, element)) { + case Range.Position.BEFORE: + return first (); + case Range.Position.INSIDE: + TowerIter prev; + TowerIter curr; + Range.improve_bookmark (_range, null, out prev); + if (Tower.search_from_bookmark (_range._set._cmp, element, ref prev, out curr)) { + if (!Tower.proceed (_range._set._cmp, ref prev._iter[0], ref curr._iter[0], 0)) { + return null; + } + } + if (curr._iter[0] == null || !Range.inside(_range, curr._iter[0]._data)) { + return null; + } + return curr._iter[0]._data; + case Range.Position.AFTER: + case Range.Position.EMPTY: + return null; + default: + assert_not_reached (); + } + } + + public override G? floor (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + switch (Range.cmp (_range, element)) { + case Range.Position.BEFORE: + case Range.Position.EMPTY: + return null; + case Range.Position.INSIDE: + TowerIter curr; + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + if (!Tower.search_from_bookmark (_range._set._cmp, element, ref prev, out curr)) { + curr._iter[0] = (owned)prev._iter[0]; + } + if (curr._iter[0] == null || curr._iter[0].is_head () || !Range.inside(_range, curr._iter[0]._data)) { + return null; + } + return curr._iter[0]._data; + case Range.Position.AFTER: + return last (); + default: + assert_not_reached (); + } + } + + public override G? ceil (G element) { + HazardPointer.Context ctx = new HazardPointer.Context (); + switch (Range.cmp (_range, element)) { + case Range.Position.BEFORE: + return first (); + case Range.Position.INSIDE: + TowerIter curr; + TowerIter prev; + Range.improve_bookmark (_range, null, out prev); + Tower.search_from_bookmark (_range._set._cmp, element, ref prev, out curr); + if (curr._iter[0] == null || !Range.inside(_range, curr._iter[0]._data)) { + return null; + } + return curr._iter[0]._data; + case Range.Position.AFTER: + case Range.Position.EMPTY: + return null; + default: + assert_not_reached (); + } + } + + public override SortedSet head_set (G before) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (Range.cut_tail (_range, before)); + } + + public override SortedSet tail_set (G after) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (Range.cut_head (_range, after)); + } + + public override SortedSet sub_set (G from, G to) { + HazardPointer.Context ctx = new HazardPointer.Context (); + return new SubSet (Range.cut (_range, from, to)); + } + + private Range _range; + } + + private class SubIterator : Object, Traversable, Gee.Iterator { + public SubIterator (Range range) { + Range.improve_bookmark (range); + _range = range; + } + + public SubIterator.point_at (Range range, ref TowerIter prev, owned Tower curr) { + Range.improve_bookmark (range); + _range = range; + _prev = prev; + _curr = curr; + } + + public new bool foreach (ForallFunc f) { + assert (_curr != null); + HazardPointer.Context ctx = new HazardPointer.Context (); + if (!begin ()) { + return true; + } + if (_prev._iter[0] != null && !_removed) { + if (!f (_curr._data)) { + assert (_curr != null); + return false; + } + } + Tower new_prev = _prev._iter[0]; + Tower? new_curr = _curr; + while (Range.proceed (_range, ref new_prev, ref new_curr, 0)) { + assert (_curr != null); + if (!f (_curr._data)) { + assert (_curr != null); + return false; + } + if (!_removed) { + //FIXME: Help mark/delete on the way + _prev._iter[0] = (owned)new_prev; + int prev_height = _prev._iter[0].get_height(); + for (int i = 1; i < prev_height; i++) { + _prev._iter[i] = _prev._iter[0]; + } + } + _curr = (owned)new_curr; + _removed = false; + } + assert (_curr != null); + return true; + } + + public bool next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (_prev._iter[0] == null) { + return begin (); + } else { + Tower new_prev = _prev._iter[0]; + Tower new_curr = _curr; + if (Range.proceed (_range, ref new_prev, ref new_curr, 0)) { + if (!_removed) { + //FIXME: Help mark/delete on the way + _prev._iter[0] = (owned)new_prev; + int prev_height = _prev._iter[0].get_height(); + for (int i = 1; i < prev_height; i++) { + _prev._iter[i] = _prev._iter[0]; + } + } + _curr = (owned)new_curr; + _removed = false; + return true; + } else { + return false; + } + } + } + + public bool has_next () { + HazardPointer.Context ctx = new HazardPointer.Context (); + if (_prev._iter[0] == null) { + Tower next; + Range.improve_bookmark (_range, out next); + if (next != null && Range.beyond (_range, next)) { + next = null; + } + return next != null; + } else { + Tower new_prev = _prev._iter[0]; + Tower new_curr = _curr; + return Range.proceed (_range, ref new_prev, ref new_curr, 0); + } + } + + public new G get () { + assert (valid); + return _curr._data; + } + + public void remove () { + HazardPointer.Context ctx = new HazardPointer.Context (); + assert (valid); + if (Tower.remove (_range._set._cmp, ref _prev, _curr)) { + AtomicInt.dec_and_test (ref _range._set._size); + } + _removed = true; + } + + public bool valid { + get { + bool is_valid = _prev._iter[0] != null && !_removed; + assert (!is_valid || _curr != null); + return is_valid; + } + } + + public bool read_only { get { return false; } } + + private bool begin () { + if (_prev._iter[0] != null) { + return true; + } + Range.improve_bookmark (_range, out _curr, out _prev); + if (_curr == null) { + for (int i = 0; i < _MAX_HEIGHT; i++) { + _prev._iter[i] = null; + } + } + return _curr != null; + } + + private Range _range; + private TowerIter _prev; + private Tower? _curr = null; + private bool _removed = false; + } + + private class Range { + public G? _start; + public G? _end; + public RangeType _type; + public TowerIter _bookmark; + public ConcurrentSet _set; + + public Range (ConcurrentSet cset, G start, G end) { + _start = start; + _end = end; + if (cset._cmp(start, end) < 0) { + _type = RangeType.BOUNDED; + for (int i = 0; i < _MAX_HEIGHT; i++) { + _bookmark._iter[i] = cset._head; + } + } else { + _type = RangeType.EMPTY; + } + _set = cset; + } + + public Range.head (ConcurrentSet cset, G end) { + _end = end; + _type = RangeType.HEAD; + for (int i = 0; i < _MAX_HEIGHT; i++) { + _bookmark._iter[i] = cset._head; + } + _set = cset; + } + + public Range.tail (ConcurrentSet cset, G start) { + _start = start; + _type = RangeType.TAIL; + for (int i = 0; i < _MAX_HEIGHT; i++) { + _bookmark._iter[i] = cset._head; + } + _set = cset; + } + + public Range.empty (ConcurrentSet cset) { + _type = RangeType.EMPTY; + _set = cset; + } + + private void copy_bookmark (Range range) { + for (int i = 0; i < _MAX_HEIGHT; i++) { + _bookmark._iter[i] = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + } + } + + public static Range cut_head (Range from, G start) { + Range result = new Range.empty (from._set); + switch (from._type) { + case RangeType.HEAD: + if (from._set._cmp (start, from._end) < 0) { + result._start = start; + result._end = from._end; + result._type = RangeType.BOUNDED; + } else { + result._type = RangeType.EMPTY; + } + break; + case RangeType.TAIL: + result._start = from._set.max (from._start, start); + result._type = RangeType.TAIL; + break; + case RangeType.BOUNDED: + if (from._set._cmp (from._start, start) < 0) { + result._start = from._set.max (from._start, start); + result._end = from._end; + result._type = RangeType.BOUNDED; + } else { + result._type = RangeType.EMPTY; + } + break; + case RangeType.EMPTY: + result._type = RangeType.EMPTY; + break; + default: + assert_not_reached (); + } + if (result._type != RangeType.EMPTY) { + improve_bookmark (from); + result.copy_bookmark (from); + improve_bookmark (result); + } + return result; + } + + public static Range cut_tail (Range from, G end) { + Range result = new Range.empty (from._set); + switch (from._type) { + case RangeType.HEAD: + result._end = from._set.min (from._end, end); + result._type = RangeType.HEAD; + break; + case RangeType.TAIL: + if (from._set._cmp (from._start, end) < 0) { + result._start = from._start; + result._end = end; + result._type = RangeType.BOUNDED; + } else { + result._type = RangeType.EMPTY; + } + break; + case RangeType.BOUNDED: + if (from._set._cmp (from._start, end) < 0) { + result._start = from._start; + result._end = from._set.min (from._end, end); + result._type = RangeType.BOUNDED; + } else { + result._type = RangeType.EMPTY; + } + break; + case RangeType.EMPTY: + result._type = RangeType.EMPTY; + break; + default: + assert_not_reached (); + } + if (result._type != RangeType.EMPTY) { + improve_bookmark (from); + result.copy_bookmark (from); + improve_bookmark (result); + } + return result; + } + + public static Range cut (Range from, G start, G end) { + Range result = new Range.empty (from._set); + result._type = RangeType.BOUNDED; + switch (from._type) { + case RangeType.HEAD: + end = from._set.min (from._end, end); + break; + case RangeType.TAIL: + start = from._set.max (from._start, start); + break; + case RangeType.BOUNDED: + start = from._set.max (from._start, start); + end = from._set.min (from._end, end); + break; + case RangeType.EMPTY: + result._type = RangeType.EMPTY; + break; + default: + assert_not_reached (); + } + if (result._type != RangeType.EMPTY && from._set._cmp (start, end) < 0) { + result._start = start; + result._end = end; + result._type = RangeType.BOUNDED; + } else { + result._type = RangeType.EMPTY; + } + if (result._type != RangeType.EMPTY) { + improve_bookmark (from); + result.copy_bookmark (from); + improve_bookmark (result); + } + return result; + } + + public static void improve_bookmark (Range range, out Tower? out_curr = null, out TowerIter prev = null) { + prev = TowerIter(); + switch (range._type) { + case RangeType.HEAD: + if (&out_curr != null) { + out_curr = HazardPointer.get_pointer> (&range._bookmark._iter[0]); + if (&prev != null) { + prev._iter[0] = (owned)out_curr; + out_curr = prev._iter[0].get_next (0); + } else { + out_curr = out_curr.get_next (0); + } + } + if (&prev != null) { + for (int i = &out_curr != null ? 1 : 0; i < _MAX_HEIGHT; i++) { + prev._iter[i] = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + } + } + break; + case RangeType.EMPTY: + out_curr = null; + break; + case RangeType.TAIL: + case RangeType.BOUNDED: + Tower? last_best = null; + for (int i = _MAX_HEIGHT - 1; i >= 0; i--) { + Tower curr = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + Tower curr_old = curr; + assert (curr != null); + Tower.backtrace (ref curr, (uint8)i); + if (last_best != null && last_best != curr && Tower.compare (range._set._cmp, curr, last_best) < 0) { + curr = last_best; + } + if (curr != curr_old) { + if (!HazardPointer.compare_and_exchange_pointer> (&range._bookmark._iter[i], curr_old, curr)) { + curr = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + } + } + Tower next = curr.get_next ((uint8)i); + if (&out_curr != null && i == 0) { + out_curr = next; + } + while (next != null && Tower.compare_data (range._set._cmp, next, range._start) < 0) { + Tower.proceed (range._set._cmp, ref curr, ref next, (uint8)i, true); + if (&curr != null && i == 0 && next != null) { + out_curr = next; + } + if (Tower.compare_data (range._set._cmp, curr, range._start) < 0) { + if (!HazardPointer.compare_and_exchange_pointer> (&range._bookmark._iter[i], curr_old, curr)) { + curr = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + } + curr_old = curr; + } else { + break; + } + } + if (&prev != null) { + prev._iter[i] = curr; + } + last_best = (owned)curr; + } + break; + default: + assert_not_reached (); + } + if (&out_curr != null && out_curr != null && Range.beyond (range, out_curr)) { + out_curr = null; + } +#if DEBUG + stderr.printf("Bookmark after:\n"); + for (int i = _MAX_HEIGHT - 1; i >= 0; i--) { + stderr.printf(" Level %d:\n", i); + Tower? t = HazardPointer.get_pointer> (&range._bookmark._iter[i]); + assert (t == null || t.get_height () > i); + while (t != null) { + stderr.printf(" %s\n", t.is_head () ? "<>" : t._data); + t = t.get_next ((uint8)i); + assert (t == null || t.get_height () > i); + } + } +#endif + } + + public static bool proceed (Range range, ref Tower? prev, ref Tower curr, uint8 level) { + switch (range._type) { + case RangeType.EMPTY: + return false; + case RangeType.TAIL: + return Tower.proceed (range._set._cmp, ref prev, ref curr, level); + case RangeType.HEAD: + case RangeType.BOUNDED: + Tower? tmp_prev = prev; + Tower? tmp_curr = curr; + if (!Tower.proceed (range._set._cmp, ref tmp_prev, ref tmp_curr, level)) { + return false; + } else if (Tower.compare_data (range._set._cmp, tmp_curr, range._end) >= 0) { + return false; + } else { + prev = (owned)tmp_prev; + curr = (owned)tmp_curr; + return true; + } + default: + assert_not_reached (); + } + } + + public static bool inside (Range range, G val) { + switch (range._type) { + case RangeType.HEAD: + return range._set._cmp (val, range._end) < 0; + case RangeType.TAIL: + return range._set._cmp (val, range._start) >= 0; + case RangeType.BOUNDED: + return range._set._cmp (val, range._start) >= 0 && range._set._cmp (val, range._end) < 0; + case RangeType.EMPTY: + return false; + default: + assert_not_reached (); + } + } + + public static bool beyond (Range range, Tower tw) { + switch (range._type) { + case RangeType.EMPTY: + return true; + case RangeType.TAIL: + return false; + case RangeType.HEAD: + case RangeType.BOUNDED: + return Tower.compare_data (range._set._cmp, tw, range._end) >= 0; + default: + assert_not_reached (); + } + } + + public static int cmp (Range range, G val) { + switch (range._type) { + case RangeType.HEAD: + return range._set._cmp (val, range._end) < 0 ? Position.INSIDE : Position.AFTER; + case RangeType.TAIL: + return range._set._cmp (val, range._start) >= 0 ? Position.INSIDE : Position.BEFORE; + case RangeType.BOUNDED: + return range._set._cmp (val, range._start) >= 0 ? (range._set._cmp (val, range._end) < 0 ? Position.INSIDE : Position.AFTER) : Position.BEFORE; + case RangeType.EMPTY: + return Position.EMPTY; + default: + assert_not_reached (); + } + } + + enum Position { + BEFORE = -1, + INSIDE = 0, + AFTER = 1, + EMPTY + } + } + + public enum RangeType { + HEAD, + TAIL, + BOUNDED, + EMPTY + } + + private class Tower { + public inline Tower (G data, uint8 height) { + _nodes = new TowerNode[height]; + _data = data; + _height = 0; + AtomicPointer.set (&_nodes[0]._backlink, null); // FIXME: This should be memory barrier + } + + public inline Tower.head () { + _nodes = new TowerNode[_MAX_HEIGHT]; + _height = -1; +#if DEBUG + _data = (G)"<>"; +#endif + } + + inline ~Tower () { + int height = get_height(); + for (uint8 i = 0; i < height; i++) { + set_succ (null, State.NONE, i); + set_backlink (null, i); + } + _nodes = null; + } + + public static inline bool search (CompareDataFunc? cmp, G key, ref Tower prev, out Tower? next = null, uint8 to_level = 0, uint8 from_level = (uint8)_MAX_HEIGHT - 1) { + assert (from_level >= to_level); + bool res = false; + next = null; + for (int i = from_level; i >= to_level; i--) { + res = search_helper (cmp, key, ref prev, out next, (uint8)i); + } + return res; + } + + public static inline bool search_from_bookmark (CompareDataFunc? cmp, G key, ref TowerIter prev, out TowerIter next = null, uint8 to_level = 0, uint8 from_level = (uint8)_MAX_HEIGHT - 1) { + assert (from_level >= to_level); + bool res = false; + for (int i = from_level; i >= to_level; i--) { + unowned Tower tmp_prev = prev._iter[i]; // Should be treated as NULL-like value + Tower tmp_next; + res = search_helper (cmp, key, ref prev._iter[i], out tmp_next, (uint8)i); + if (&next != null) { + next._iter[i] = (owned)tmp_next; + } + if (prev._iter[i] != tmp_prev) { + prev._iter[i] = prev._iter[i]; + if (i > to_level && compare (cmp, prev._iter[i - 1], prev._iter[i]) <= 0) { + prev._iter[i - 1] = prev._iter[i]; + } + } + } + return res; + } + + private static inline bool search_helper (CompareDataFunc? cmp, G key, ref Tower? prev, out Tower? next, uint8 level) { + next = prev.get_next (level); + while (next != null && compare_data (cmp, next, key) < 0 && proceed (cmp, ref prev, ref next, level, true)); + return next != null && cmp(key, next._data) == 0; + } + + public static inline Tower? insert (CompareDataFunc? cmp, ref TowerIter prev, G key, uint8 chosen_level) { + return insert_helper (cmp, ref prev, key, chosen_level, chosen_level); + } + + private static inline Tower? insert_helper (CompareDataFunc? cmp, ref TowerIter prev, G key, uint8 chosen_level, uint8 level) { + Tower? new_tower; + Tower? next; + if (search_helper (cmp, key, ref prev._iter[level], out next, level)) { + return null; + } + if (level > 0) { + if (compare (cmp, prev._iter[level], prev._iter[level - 1]) >= 0) { + prev._iter[level - 1] = prev._iter[level]; + } + new_tower = insert_helper (cmp, ref prev, key, chosen_level, level - 1); + } else { + new_tower = new Tower (key, chosen_level + 1); + } + if (new_tower == null) { + return null; + } + while (true) { + State prev_state; + Tower? prev_next = prev._iter[level].get_succ (out prev_state, level); + if (prev_state == State.FLAGGED) { + prev_next.help_flagged (prev._iter[level], level); + } else { + new_tower.set_succ (next, State.NONE, level); + bool result = prev._iter[level].compare_and_exchange (next, State.NONE, new_tower, State.NONE, level); + if (result) + break; + prev_next = prev._iter[level].get_succ (out prev_state, level); + if (prev_state == State.FLAGGED) { + prev_next.help_flagged (prev._iter[level], level); + } + backtrace (ref prev._iter[level], level); + } + if (search_helper (cmp, key, ref prev._iter[level], null, level)) { + return null; + } + } + GLib.AtomicInt.inc (ref new_tower._height); + if (new_tower.get_state (0) == State.MARKED) { + remove_level (cmp, ref prev._iter[level], new_tower, level); + return null; + } + return new_tower; + } + + public static inline bool remove_key (CompareDataFunc? cmp, ref TowerIter prev, G key, uint8 from_level = (uint8)_MAX_HEIGHT - 1) { + for (int i = from_level; i >= 1; i--) { + Tower next; + search_helper (cmp, key, ref prev._iter[i], out next, (uint8)i); + if (compare (cmp, prev._iter[i - 1], prev._iter[i]) < 0) { + prev._iter[i - 1] = prev._iter[i]; + } + } + Tower? curr; + if (search_helper (cmp, key, ref prev._iter[0], out curr, 0)) { + return remove (cmp, ref prev, curr); + } else { + return false; + } + } + + public static inline bool remove (CompareDataFunc? cmp, ref TowerIter prev, Tower curr) { + bool removed = remove_level (cmp, ref prev._iter[0], curr, 0); + for (int i = 1; i < _MAX_HEIGHT; i++) { + remove_level (cmp, ref prev._iter[i], curr, (uint8)i); + } + return removed; + } + + private static inline bool remove_level (CompareDataFunc? cmp, ref Tower prev, Tower curr, uint8 level) { + bool status; + bool flagged = curr.try_flag (cmp, ref prev, out status, level); + if (status) { + curr.help_flagged (prev, level); + } + return flagged; + } + + public static inline bool proceed (CompareDataFunc? cmp, ref Tower? arg_prev, ref Tower arg_curr, uint8 level, bool force = false) { + Tower curr = arg_curr; + Tower? next = curr.get_next (level); + if (next != null) { + while (next != null && next.get_state (0) == State.MARKED) { + bool status; + next.try_flag (cmp, ref curr, out status, level); + if (status) { + next.help_flagged (curr, level); + } + next = curr.get_next (level); + } + } + bool success = next != null; + if (success || force) { + arg_prev = (owned)curr; + arg_curr = (owned)next; + } + return success; + } + + public inline void help_marked (Tower prev_tower, uint8 level) { + prev_tower.compare_and_exchange (this, State.FLAGGED, get_next (level), State.NONE, level); + } + + public inline void help_flagged (Tower prev, uint8 level) { + set_backlink (prev, level); + if (get_state (level) != State.MARKED) + try_mark (level); + help_marked (prev, level); + } + + public inline void try_mark (uint8 level) { + do { + Tower? next_tower = get_next (level); + bool result = compare_and_exchange (next_tower, State.NONE, next_tower, State.MARKED, level); + if (!result) { + State state; + next_tower = get_succ (out state, level); + if (state == State.FLAGGED) + help_flagged (next_tower, level); + } + } while (get_state (level) != State.MARKED); + } + + public inline bool try_flag (CompareDataFunc? cmp, ref Tower prev_tower, out bool status, uint8 level) { + while (true) { + if (prev_tower.compare_succ (this, State.FLAGGED, level)) { + status = true; + return false; + } + bool result = prev_tower.compare_and_exchange (this, State.NONE, this, State.FLAGGED, level); + if (result) { + status = true; + return true; + } + State result_state; + Tower? result_tower = prev_tower.get_succ (out result_state, level); + if (result_tower == this && result_state == State.FLAGGED) { + status = true; + return false; + } + backtrace (ref prev_tower, level); + if (!search_helper (cmp, _data, ref prev_tower, null, level)) { + status = false; + return false; + } + } + } + + public static inline void backtrace (ref Tower? curr, uint8 level) { + while (curr.get_state (level) == State.MARKED) + curr = curr.get_backlink (level); + } + + public inline bool compare_and_exchange (Tower? old_tower, State old_state, Tower? new_tower, State new_state, uint8 level) { + return HazardPointer.compare_and_exchange_pointer?> (&_nodes[level]._succ, old_tower, new_tower, 3, (size_t)old_state, (size_t)new_state); + } + + public inline bool compare_succ (Tower? next, State state, uint8 level) { + size_t cur = (size_t)AtomicPointer.get (&_nodes[level]._succ); + return cur == ((size_t)next | (size_t)state); + } + + public inline Tower? get_next (uint8 level) { + return get_succ (null, level); + } + + public inline State get_state (uint8 level) { + return (State)((size_t)AtomicPointer.get (&_nodes[level]._succ) & 3); + } + + public inline Tower? get_succ (out State state, uint8 level) { + size_t rstate; + Tower? succ = HazardPointer.get_pointer> (&_nodes[level]._succ, 3, out rstate); + state = (State)rstate; + return (owned)succ; + } + + public inline void set_succ (Tower? next, State state, uint8 level) { + HazardPointer.set_pointer> (&_nodes[level]._succ, next, 3, (size_t)state); + } + + public inline Tower? get_backlink (uint8 level) { + return HazardPointer.get_pointer> (&_nodes[level]._backlink); + } + + public inline void set_backlink (Tower? backlink, uint8 level) { + HazardPointer.compare_and_exchange_pointer?> (&_nodes[level]._backlink, null, backlink); + } + + public inline int get_height () { + int height = GLib.AtomicInt.get (ref _height); + return height != -1 ? height : _MAX_HEIGHT; + } + + public inline bool is_head () { + int height = GLib.AtomicInt.get (ref _height); + return height == -1; + } + + public inline static int compare (CompareDataFunc? cmp, Tower a, Tower b) { + bool ah = GLib.AtomicInt.get (ref a._height) == -1; + bool bh = GLib.AtomicInt.get (ref b._height) == -1; + return ah ? (bh ? 0 : -1) : (bh ? 1 : cmp(a._data, b._data)); + } + + public inline static int compare_data (CompareDataFunc? cmp, Tower a, G b) { + bool ah = GLib.AtomicInt.get (ref a._height) == -1; + return ah ? -1 : cmp(a._data, b); + } + + [NoArrayLength] + public TowerNode[] _nodes; + public G _data; + public int _height; + } + + private struct TowerNode { + public Tower *_succ; + public Tower *_backlink; + } + + private struct TowerIter { + [NoArrayLength] + public Tower? _iter[31 /*_MAX_HEIGHT*/]; + } + + + private enum State { + NONE = 0, + MARKED = 1, + FLAGGED = 2 + } +} + diff --git a/gee/deque.c b/gee/deque.c index 7fe46d8..3da22a3 100644 --- a/gee/deque.c +++ b/gee/deque.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -67,23 +87,55 @@ typedef struct _GeeQueueIface GeeQueueIface; typedef struct _GeeDeque GeeDeque; typedef struct _GeeDequeIface GeeDequeIface; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -95,11 +147,15 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -111,6 +167,9 @@ struct _GeeQueueIface { struct _GeeDequeIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeDeque* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeDeque* self); + GDestroyNotify (*get_g_destroy_func) (GeeDeque* self); gboolean (*offer_head) (GeeDeque* self, gconstpointer element); gpointer (*peek_head) (GeeDeque* self); gpointer (*poll_head) (GeeDeque* self); @@ -123,7 +182,16 @@ struct _GeeDequeIface { +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_queue_get_type (void) G_GNUC_CONST; diff --git a/gee/deque.vala b/gee/deque.vala index ad5d50e..b28c15a 100644 --- a/gee/deque.vala +++ b/gee/deque.vala @@ -46,6 +46,7 @@ * || peek an element || {@link peek_head} || * || pop an element || {@link poll_head} || */ +[GenericAccessors] public interface Gee.Deque : Queue { /** * Offers the specified element to the head of this deque. diff --git a/gee/functions.c b/gee/functions.c index b1bcded..0e24184 100644 --- a/gee/functions.c +++ b/gee/functions.c @@ -30,6 +30,14 @@ #include +#define GEE_TYPE_HASHABLE (gee_hashable_get_type ()) +#define GEE_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASHABLE, GeeHashable)) +#define GEE_IS_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASHABLE)) +#define GEE_HASHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_HASHABLE, GeeHashableIface)) + +typedef struct _GeeHashable GeeHashable; +typedef struct _GeeHashableIface GeeHashableIface; + #define GEE_TYPE_COMPARABLE (gee_comparable_get_type ()) #define GEE_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COMPARABLE, GeeComparable)) #define GEE_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COMPARABLE)) @@ -38,19 +46,49 @@ typedef struct _GeeComparable GeeComparable; typedef struct _GeeComparableIface GeeComparableIface; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeHashableIface { + GTypeInterface parent_iface; + guint (*hash) (GeeHashable* self); + gboolean (*equal_to) (GeeHashable* self, gconstpointer object); +}; + struct _GeeComparableIface { GTypeInterface parent_iface; gint (*compare_to) (GeeComparable* self, gconstpointer object); }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); -GEqualFunc gee_functions_get_equal_func_for (GType t); -GHashFunc gee_functions_get_hash_func_for (GType t); -GCompareFunc gee_functions_get_compare_func_for (GType t); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static gboolean ___lambda21_ (gconstpointer a, gconstpointer b); +static gboolean ____lambda21__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self); +GType gee_hashable_get_type (void) G_GNUC_CONST; +static gboolean ____lambda22_ (gconstpointer a, gconstpointer b); +gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object); +static gboolean _____lambda22__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self); GType gee_comparable_get_type (void) G_GNUC_CONST; +static gboolean _____lambda23_ (gconstpointer a, gconstpointer b); gint gee_comparable_compare_to (GeeComparable* self, gconstpointer object); -gint gee_direct_compare (void* _val1, void* _val2); +static gboolean ______lambda23__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self); +static gboolean _____lambda24_ (gconstpointer a, gconstpointer b); +static gboolean ______lambda24__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static guint ___lambda18_ (gconstpointer a); +static guint ____lambda18__gee_hash_data_func (gconstpointer v, gpointer self); +static guint ____lambda19_ (gconstpointer a); +guint gee_hashable_hash (GeeHashable* self); +static guint _____lambda19__gee_hash_data_func (gconstpointer v, gpointer self); +static guint ____lambda20_ (gconstpointer a); +static guint _____lambda20__gee_hash_data_func (gconstpointer v, gpointer self); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static gint ___lambda25_ (gconstpointer a, gconstpointer b); +static gint ____lambda25__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self); +static gint ____lambda26_ (gconstpointer a, gconstpointer b); +static gint _____lambda26__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self); +static gint ____lambda27_ (gconstpointer _val1, gconstpointer _val2); +static gint _____lambda27__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self); /** @@ -60,20 +98,228 @@ gint gee_direct_compare (void* _val1, void* _val2); * * @return the equality testing function corresponding to the given type. */ -GEqualFunc gee_functions_get_equal_func_for (GType t) { - GEqualFunc result = NULL; +static gboolean ___lambda21_ (gconstpointer a, gconstpointer b) { + gboolean result = FALSE; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + _tmp0_ = a; + _tmp1_ = b; + if (_tmp0_ == _tmp1_) { + result = TRUE; + return result; + } else { + gboolean _tmp2_ = FALSE; + gconstpointer _tmp3_; + gboolean _tmp5_; + _tmp3_ = a; + if (_tmp3_ == NULL) { + _tmp2_ = TRUE; + } else { + gconstpointer _tmp4_; + _tmp4_ = b; + _tmp2_ = _tmp4_ == NULL; + } + _tmp5_ = _tmp2_; + if (_tmp5_) { + result = FALSE; + return result; + } else { + GEqualFunc _tmp6_; + gconstpointer _tmp7_; + gconstpointer _tmp8_; + gboolean _tmp9_ = FALSE; + _tmp6_ = g_str_equal; + _tmp7_ = a; + _tmp8_ = b; + _tmp9_ = _tmp6_ ((const gchar*) _tmp7_, (const gchar*) _tmp8_); + result = _tmp9_; + return result; + } + } +} + + +static gboolean ____lambda21__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gboolean result; + result = ___lambda21_ (a, b); + return result; +} + + +static gboolean ____lambda22_ (gconstpointer a, gconstpointer b) { + gboolean result = FALSE; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + _tmp0_ = a; + _tmp1_ = b; + if (_tmp0_ == _tmp1_) { + result = TRUE; + return result; + } else { + gboolean _tmp2_ = FALSE; + gconstpointer _tmp3_; + gboolean _tmp5_; + _tmp3_ = a; + if (_tmp3_ == NULL) { + _tmp2_ = TRUE; + } else { + gconstpointer _tmp4_; + _tmp4_ = b; + _tmp2_ = _tmp4_ == NULL; + } + _tmp5_ = _tmp2_; + if (_tmp5_) { + result = FALSE; + return result; + } else { + gconstpointer _tmp6_; + gconstpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp6_ = a; + _tmp7_ = b; + _tmp8_ = gee_hashable_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_HASHABLE, GeeHashable), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_HASHABLE, GeeHashable)); + result = _tmp8_; + return result; + } + } +} + + +static gboolean _____lambda22__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gboolean result; + result = ____lambda22_ (a, b); + return result; +} + + +static gboolean _____lambda23_ (gconstpointer a, gconstpointer b) { + gboolean result = FALSE; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + _tmp0_ = a; + _tmp1_ = b; + if (_tmp0_ == _tmp1_) { + result = TRUE; + return result; + } else { + gboolean _tmp2_ = FALSE; + gconstpointer _tmp3_; + gboolean _tmp5_; + _tmp3_ = a; + if (_tmp3_ == NULL) { + _tmp2_ = TRUE; + } else { + gconstpointer _tmp4_; + _tmp4_ = b; + _tmp2_ = _tmp4_ == NULL; + } + _tmp5_ = _tmp2_; + if (_tmp5_) { + result = FALSE; + return result; + } else { + gconstpointer _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_ = 0; + _tmp6_ = a; + _tmp7_ = b; + _tmp8_ = gee_comparable_compare_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COMPARABLE, GeeComparable), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COMPARABLE, GeeComparable)); + result = _tmp8_ == 0; + return result; + } + } +} + + +static gboolean ______lambda23__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gboolean result; + result = _____lambda23_ (a, b); + return result; +} + + +static gboolean _____lambda24_ (gconstpointer a, gconstpointer b) { + gboolean result = FALSE; + GEqualFunc _tmp0_; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp0_ = g_direct_equal; + _tmp1_ = a; + _tmp2_ = b; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_); + result = _tmp3_; + return result; +} + + +static gboolean ______lambda24__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gboolean result; + result = _____lambda24_ (a, b); + return result; +} + + +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) { + GeeEqualDataFunc result = NULL; GType _tmp0_; _tmp0_ = t; if (_tmp0_ == G_TYPE_STRING) { - GEqualFunc _tmp1_; - _tmp1_ = g_str_equal; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + _tmp1_ = ____lambda21__gee_equal_data_func; + _tmp1__target = NULL; + _tmp1__target_destroy_notify = NULL; + *result_target = _tmp1__target; + *result_target_destroy_notify = _tmp1__target_destroy_notify; result = _tmp1_; return result; } else { - GEqualFunc _tmp2_; - _tmp2_ = g_direct_equal; - result = _tmp2_; - return result; + GType _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp2_ = t; + _tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_HASHABLE); + if (_tmp3_) { + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GDestroyNotify _tmp4__target_destroy_notify; + _tmp4_ = _____lambda22__gee_equal_data_func; + _tmp4__target = NULL; + _tmp4__target_destroy_notify = NULL; + *result_target = _tmp4__target; + *result_target_destroy_notify = _tmp4__target_destroy_notify; + result = _tmp4_; + return result; + } else { + GType _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = t; + _tmp6_ = g_type_is_a (_tmp5_, GEE_TYPE_COMPARABLE); + if (_tmp6_) { + GeeEqualDataFunc _tmp7_; + void* _tmp7__target; + GDestroyNotify _tmp7__target_destroy_notify; + _tmp7_ = ______lambda23__gee_equal_data_func; + _tmp7__target = NULL; + _tmp7__target_destroy_notify = NULL; + *result_target = _tmp7__target; + *result_target_destroy_notify = _tmp7__target_destroy_notify; + result = _tmp7_; + return result; + } else { + GeeEqualDataFunc _tmp8_; + void* _tmp8__target; + GDestroyNotify _tmp8__target_destroy_notify; + _tmp8_ = ______lambda24__gee_equal_data_func; + _tmp8__target = NULL; + _tmp8__target_destroy_notify = NULL; + *result_target = _tmp8__target; + *result_target_destroy_notify = _tmp8__target_destroy_notify; + result = _tmp8_; + return result; + } + } } } @@ -85,50 +331,119 @@ GEqualFunc gee_functions_get_equal_func_for (GType t) { * * @return the hash function corresponding to the given type. */ -GHashFunc gee_functions_get_hash_func_for (GType t) { - GHashFunc result = NULL; - GType _tmp0_; - _tmp0_ = t; - if (_tmp0_ == G_TYPE_STRING) { +static guint ___lambda18_ (gconstpointer a) { + guint result = 0U; + gconstpointer _tmp0_; + _tmp0_ = a; + if (_tmp0_ == NULL) { + result = (guint) 0xdeadbeefLL; + return result; + } else { GHashFunc _tmp1_; + gconstpointer _tmp2_; + guint _tmp3_ = 0U; _tmp1_ = g_str_hash; - result = _tmp1_; + _tmp2_ = a; + _tmp3_ = _tmp1_ ((const gchar*) _tmp2_); + result = _tmp3_; + return result; + } +} + + +static guint ____lambda18__gee_hash_data_func (gconstpointer v, gpointer self) { + guint result; + result = ___lambda18_ (v); + return result; +} + + +static guint ____lambda19_ (gconstpointer a) { + guint result = 0U; + gconstpointer _tmp0_; + _tmp0_ = a; + if (_tmp0_ == NULL) { + result = (guint) 0xdeadbeefLL; return result; } else { - GHashFunc _tmp2_; - _tmp2_ = g_direct_hash; + gconstpointer _tmp1_; + guint _tmp2_ = 0U; + _tmp1_ = a; + _tmp2_ = gee_hashable_hash (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_HASHABLE, GeeHashable)); result = _tmp2_; return result; } } -/** - * Get a comparator function for a given type. - * - * @param t the type which to get a comparator function for. - * - * @return the comparator function corresponding to the given type. - */ -GCompareFunc gee_functions_get_compare_func_for (GType t) { - GCompareFunc result = NULL; +static guint _____lambda19__gee_hash_data_func (gconstpointer v, gpointer self) { + guint result; + result = ____lambda19_ (v); + return result; +} + + +static guint ____lambda20_ (gconstpointer a) { + guint result = 0U; + GHashFunc _tmp0_; + gconstpointer _tmp1_; + guint _tmp2_ = 0U; + _tmp0_ = g_direct_hash; + _tmp1_ = a; + _tmp2_ = _tmp0_ (_tmp1_); + result = _tmp2_; + return result; +} + + +static guint _____lambda20__gee_hash_data_func (gconstpointer v, gpointer self) { + guint result; + result = ____lambda20_ (v); + return result; +} + + +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) { + GeeHashDataFunc result = NULL; GType _tmp0_; _tmp0_ = t; if (_tmp0_ == G_TYPE_STRING) { - GCompareFunc _tmp1_; - _tmp1_ = g_strcmp0; - result = (GCompareFunc) _tmp1_; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + _tmp1_ = ____lambda18__gee_hash_data_func; + _tmp1__target = NULL; + _tmp1__target_destroy_notify = NULL; + *result_target = _tmp1__target; + *result_target_destroy_notify = _tmp1__target_destroy_notify; + result = _tmp1_; return result; } else { GType _tmp2_; gboolean _tmp3_ = FALSE; _tmp2_ = t; - _tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_COMPARABLE); + _tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_HASHABLE); if (_tmp3_) { - result = (GCompareFunc) gee_comparable_compare_to; + GeeHashDataFunc _tmp4_; + void* _tmp4__target; + GDestroyNotify _tmp4__target_destroy_notify; + _tmp4_ = _____lambda19__gee_hash_data_func; + _tmp4__target = NULL; + _tmp4__target_destroy_notify = NULL; + *result_target = _tmp4__target; + *result_target_destroy_notify = _tmp4__target_destroy_notify; + result = _tmp4_; return result; } else { - result = (GCompareFunc) gee_direct_compare; + GeeHashDataFunc _tmp5_; + void* _tmp5__target; + GDestroyNotify _tmp5__target_destroy_notify; + _tmp5_ = _____lambda20__gee_hash_data_func; + _tmp5__target = NULL; + _tmp5__target_destroy_notify = NULL; + *result_target = _tmp5__target; + *result_target_destroy_notify = _tmp5__target_destroy_notify; + result = _tmp5_; return result; } } @@ -136,21 +451,105 @@ GCompareFunc gee_functions_get_compare_func_for (GType t) { /** - * Compares two arbitrary elements together. - * - * The comparison is done on pointers and not on values behind. + * Get a comparator function for a given type. * - * @param _val1 the first value to compare. - * @param _val2 the second value to compare. + * @param t the type which to get a comparator function for. * - * @return a negative value if _val1 is lesser than _val2, a positive value - * if _val1 is greater then _val2 and zero if both are equal. + * @return the comparator function corresponding to the given type. */ -gint gee_direct_compare (void* _val1, void* _val2) { +static gint ___lambda25_ (gconstpointer a, gconstpointer b) { gint result = 0; - void* _tmp0_; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + _tmp0_ = a; + _tmp1_ = b; + if (_tmp0_ == _tmp1_) { + result = 0; + return result; + } else { + gconstpointer _tmp2_; + _tmp2_ = a; + if (_tmp2_ == NULL) { + result = -1; + return result; + } else { + gconstpointer _tmp3_; + _tmp3_ = b; + if (_tmp3_ == NULL) { + result = 1; + return result; + } else { + GCompareFunc _tmp4_; + gconstpointer _tmp5_; + gconstpointer _tmp6_; + gint _tmp7_ = 0; + _tmp4_ = g_strcmp0; + _tmp5_ = a; + _tmp6_ = b; + _tmp7_ = _tmp4_ ((const gchar*) _tmp5_, (const gchar*) _tmp6_); + result = _tmp7_; + return result; + } + } + } +} + + +static gint ____lambda25__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gint result; + result = ___lambda25_ (a, b); + return result; +} + + +static gint ____lambda26_ (gconstpointer a, gconstpointer b) { + gint result = 0; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + _tmp0_ = a; + _tmp1_ = b; + if (_tmp0_ == _tmp1_) { + result = 0; + return result; + } else { + gconstpointer _tmp2_; + _tmp2_ = a; + if (_tmp2_ == NULL) { + result = -1; + return result; + } else { + gconstpointer _tmp3_; + _tmp3_ = b; + if (_tmp3_ == NULL) { + result = 1; + return result; + } else { + gconstpointer _tmp4_; + gconstpointer _tmp5_; + gint _tmp6_ = 0; + _tmp4_ = a; + _tmp5_ = b; + _tmp6_ = gee_comparable_compare_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COMPARABLE, GeeComparable), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COMPARABLE, GeeComparable)); + result = _tmp6_; + return result; + } + } + } +} + + +static gint _____lambda26__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gint result; + result = ____lambda26_ (a, b); + return result; +} + + +static gint ____lambda27_ (gconstpointer _val1, gconstpointer _val2) { + gint result = 0; + gconstpointer _tmp0_; glong val1; - void* _tmp1_; + gconstpointer _tmp1_; glong val2; glong _tmp2_; glong _tmp3_; @@ -179,4 +578,58 @@ gint gee_direct_compare (void* _val1, void* _val2) { } +static gint _____lambda27__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gint result; + result = ____lambda27_ (a, b); + return result; +} + + +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) { + GCompareDataFunc result = NULL; + GType _tmp0_; + _tmp0_ = t; + if (_tmp0_ == G_TYPE_STRING) { + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + _tmp1_ = ____lambda25__gcompare_data_func; + _tmp1__target = NULL; + _tmp1__target_destroy_notify = NULL; + *result_target = _tmp1__target; + *result_target_destroy_notify = _tmp1__target_destroy_notify; + result = _tmp1_; + return result; + } else { + GType _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp2_ = t; + _tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_COMPARABLE); + if (_tmp3_) { + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GDestroyNotify _tmp4__target_destroy_notify; + _tmp4_ = _____lambda26__gcompare_data_func; + _tmp4__target = NULL; + _tmp4__target_destroy_notify = NULL; + *result_target = _tmp4__target; + *result_target_destroy_notify = _tmp4__target_destroy_notify; + result = _tmp4_; + return result; + } else { + GCompareDataFunc _tmp5_; + void* _tmp5__target; + GDestroyNotify _tmp5__target_destroy_notify; + _tmp5_ = _____lambda27__gcompare_data_func; + _tmp5__target = NULL; + _tmp5__target_destroy_notify = NULL; + *result_target = _tmp5__target; + *result_target_destroy_notify = _tmp5__target_destroy_notify; + result = _tmp5_; + return result; + } + } +} + + diff --git a/gee/functions.vala b/gee/functions.vala index 8067172..0a72832 100644 --- a/gee/functions.vala +++ b/gee/functions.vala @@ -46,11 +46,35 @@ namespace Gee { * * @return the equality testing function corresponding to the given type. */ - public static EqualFunc get_equal_func_for (Type t) { + public static EqualDataFunc get_equal_func_for (Type t) { if (t == typeof (string)) { - return str_equal; + return (a, b) => { + if (a == b) + return true; + else if (a == null || b == null) + return false; + else + return str_equal ((string) a, (string) b); + }; + } else if (t.is_a (typeof (Hashable))) { + return (a, b) => { + if (a == b) + return true; + else if (a == null || b == null) + return false; + else + return ((Hashable) a).equal_to ((Hashable) b); + }; + } else if (t.is_a (typeof (Comparable))) { + return (a, b) => { + if (a == b) + return true; + else if (a == null || b == null) + return false; + else + return ((Comparable) a).compare_to ((Comparable) b) == 0;}; } else { - return direct_equal; + return (a, b) => {return direct_equal (a, b);}; } } @@ -61,11 +85,23 @@ namespace Gee { * * @return the hash function corresponding to the given type. */ - public static HashFunc get_hash_func_for (Type t) { + public static HashDataFunc get_hash_func_for (Type t) { if (t == typeof (string)) { - return str_hash; + return (a) => { + if (a == null) + return (uint)0xdeadbeef; + else + return str_hash ((string) a); + }; + } else if (t.is_a (typeof (Hashable))) { + return (a) => { + if (a == null) + return (uint)0xdeadbeef; + else + return ((Hashable) a).hash(); + }; } else { - return direct_hash; + return (a) => {return direct_hash (a);}; } } @@ -76,36 +112,41 @@ namespace Gee { * * @return the comparator function corresponding to the given type. */ - public static CompareFunc get_compare_func_for (Type t) { + public static CompareDataFunc get_compare_func_for (Type t) { if (t == typeof (string)) { - return (CompareFunc) strcmp; + return (a, b) => { + if (a == b) + return 0; + else if (a == null) + return -1; + else if (b == null) + return 1; + else + return strcmp((string) a, (string) b); + }; } else if (t.is_a (typeof (Comparable))) { - return (CompareFunc) Comparable.compare_to; + return (a, b) => { + if (a == b) + return 0; + else if (a == null) + return -1; + else if (b == null) + return 1; + else + return ((Comparable) a).compare_to ((Comparable) b); + }; } else { - return (CompareFunc) direct_compare; + return (_val1, _val2) => { + long val1 = (long)_val1, val2 = (long)_val2; + if (val1 > val2) { + return 1; + } else if (val1 == val2) { + return 0; + } else { + return -1; + } + }; } } } - - /** - * Compares two arbitrary elements together. - * - * The comparison is done on pointers and not on values behind. - * - * @param _val1 the first value to compare. - * @param _val2 the second value to compare. - * - * @return a negative value if _val1 is lesser than _val2, a positive value - * if _val1 is greater then _val2 and zero if both are equal. - */ - public static int direct_compare (void* _val1, void* _val2) { - long val1 = (long)_val1, val2 = (long)_val2; - if (val1 > val2) { - return 1; - } else if (val1 == val2) { - return 0; - } else { - return -1; - } - } } diff --git a/gee/gee-0.8.vapi b/gee/gee-0.8.vapi new file mode 100644 index 0000000..e550390 --- /dev/null +++ b/gee/gee-0.8.vapi @@ -0,0 +1,724 @@ +/* gee-0.8.vapi generated by valac 0.18.0, do not modify. */ + +[CCode (gir_namespace = "Gee", gir_version = "0.8")] +namespace Gee { + namespace Functions { + [CCode (cheader_filename = "gee.h")] + public static GLib.CompareDataFunc get_compare_func_for (GLib.Type t); + [CCode (cheader_filename = "gee.h")] + public static Gee.EqualDataFunc get_equal_func_for (GLib.Type t); + [CCode (cheader_filename = "gee.h")] + public static Gee.HashDataFunc get_hash_func_for (GLib.Type t); + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractBidirList : Gee.AbstractList, Gee.BidirList { + public AbstractBidirList (); + public abstract Gee.BidirListIterator bidir_list_iterator (); + public virtual Gee.BidirList read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractBidirSortedMap : Gee.AbstractSortedMap, Gee.BidirSortedMap { + public AbstractBidirSortedMap (); + public abstract Gee.BidirMapIterator bidir_map_iterator (); + public virtual Gee.BidirSortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractBidirSortedSet : Gee.AbstractSortedSet, Gee.BidirSortedSet { + public AbstractBidirSortedSet (); + public abstract Gee.BidirIterator bidir_iterator (); + public virtual Gee.BidirSortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractCollection : GLib.Object, Gee.Traversable, Gee.Iterable, Gee.Collection { + public AbstractCollection (); + public abstract bool add (G item); + public abstract void clear (); + public abstract bool contains (G item); + public virtual bool @foreach (Gee.ForallFunc f); + public abstract Gee.Iterator iterator (); + public abstract bool remove (G item); + public abstract bool read_only { get; } + public virtual Gee.Collection read_only_view { owned get; } + public abstract int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractList : Gee.AbstractCollection, Gee.List { + public AbstractList (); + public abstract new G @get (int index); + public abstract int index_of (G item); + public abstract void insert (int index, G item); + public abstract Gee.ListIterator list_iterator (); + public abstract G remove_at (int index); + public abstract new void @set (int index, G item); + public abstract Gee.List? slice (int start, int stop); + public virtual Gee.List read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractMap : GLib.Object, Gee.Traversable>, Gee.Iterable>, Gee.Map { + public AbstractMap (); + public abstract void clear (); + public virtual bool @foreach (Gee.ForallFunc> f); + public abstract new V @get (K key); + public abstract bool has (K key, V value); + public abstract bool has_key (K key); + public abstract Gee.MapIterator map_iterator (); + public abstract new void @set (K key, V value); + public virtual Gee.Iterator stream (owned Gee.StreamFunc,A> f); + public abstract bool unset (K key, out V value = null); + public abstract Gee.Set> entries { owned get; } + public abstract Gee.Set keys { owned get; } + public abstract bool read_only { get; } + public virtual Gee.Map read_only_view { owned get; } + public abstract int size { get; } + public abstract Gee.Collection values { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractMultiMap : GLib.Object, Gee.MultiMap { + protected Gee.Map> _storage_map; + public AbstractMultiMap (Gee.Map> storage_map); + protected abstract Gee.MultiSet create_multi_key_set (); + protected abstract Gee.Collection create_value_storage (); + protected abstract Gee.EqualDataFunc get_value_equal_func (); + public virtual Gee.MultiMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractMultiSet : Gee.AbstractCollection, Gee.MultiSet { + protected Gee.Map _storage_map; + public AbstractMultiSet (Gee.Map storage_map); + public override bool add (G item); + public override void clear (); + public override bool contains (G item); + public override Gee.Iterator iterator (); + public override bool remove (G item); + public override bool read_only { get; } + public virtual Gee.MultiSet read_only_view { owned get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractQueue : Gee.AbstractCollection, Gee.Queue { + public AbstractQueue (); + public abstract G peek (); + public abstract G poll (); + public abstract int capacity { get; } + public abstract bool is_full { get; } + public abstract int remaining_capacity { get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractSet : Gee.AbstractCollection, Gee.Set { + public AbstractSet (); + public virtual Gee.Set read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractSortedMap : Gee.AbstractMap, Gee.SortedMap { + public AbstractSortedMap (); + public abstract Gee.SortedMap head_map (K before); + public abstract Gee.SortedMap sub_map (K before, K after); + public abstract Gee.SortedMap tail_map (K after); + public abstract Gee.SortedSet> ascending_entries { owned get; } + public abstract Gee.SortedSet ascending_keys { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public abstract class AbstractSortedSet : Gee.AbstractSet, Gee.SortedSet { + public AbstractSortedSet (); + public abstract G ceil (G element); + public abstract G first (); + public abstract G floor (G element); + public abstract Gee.SortedSet head_set (G before); + public abstract G higher (G element); + public abstract Gee.Iterator? iterator_at (G element); + public abstract G last (); + public abstract G lower (G element); + public abstract Gee.SortedSet sub_set (G from, G to); + public abstract Gee.SortedSet tail_set (G after); + public virtual Gee.SortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public class ArrayList : Gee.AbstractBidirList { + public ArrayList (owned Gee.EqualDataFunc? equal_func = null); + public override bool add (G item); + public bool add_all (Gee.Collection collection); + public override Gee.BidirListIterator bidir_list_iterator (); + public override void clear (); + public override bool contains (G item); + public override bool @foreach (Gee.ForallFunc f); + public override G @get (int index); + public override int index_of (G item); + public override void insert (int index, G item); + public override Gee.Iterator iterator (); + public override Gee.ListIterator list_iterator (); + public override bool remove (G item); + public override G remove_at (int index); + public override void @set (int index, G item); + public override Gee.List? slice (int start, int stop); + public ArrayList.wrap (owned G[] items, owned Gee.EqualDataFunc? equal_func = null); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class ArrayQueue : Gee.AbstractQueue, Gee.Deque { + public ArrayQueue (owned Gee.EqualDataFunc? equal_func = null); + public override bool add (G element); + public override void clear (); + public override bool contains (G item); + public override Gee.Iterator iterator (); + public override G peek (); + public override G poll (); + public override bool remove (G item); + public override int capacity { get; } + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public bool is_empty { get; } + public override bool is_full { get; } + public override bool read_only { get; } + public override int remaining_capacity { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class ConcurrentList : Gee.AbstractList { + public ConcurrentList (owned Gee.EqualDataFunc? equal_func = null); + public override bool add (G item); + public override void clear (); + public override bool contains (G item); + public override G @get (int index); + public override int index_of (G item); + public override void insert (int index, G item); + public override Gee.Iterator iterator (); + public override Gee.ListIterator list_iterator (); + public override bool remove (G item); + public override G remove_at (int index); + public override void @set (int index, G item); + public override Gee.List? slice (int start, int end); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public bool is_empty { get; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class ConcurrentSet : Gee.AbstractSortedSet { + public enum RangeType { + HEAD, + TAIL, + BOUNDED, + EMPTY + } + public ConcurrentSet (owned GLib.CompareDataFunc? compare_func = null); + public override bool add (G key); + public override G ceil (G element); + public override void clear (); + public override bool contains (G key); + public override G first (); + public override G floor (G element); + public override Gee.SortedSet head_set (G before); + public override G higher (G element); + public override Gee.Iterator iterator (); + public override Gee.Iterator? iterator_at (G element); + public override G last (); + public override G lower (G element); + public override bool remove (G item); + public override Gee.SortedSet sub_set (G from, G to); + public override Gee.SortedSet tail_set (G after); + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class HashMap : Gee.AbstractMap { + public HashMap (owned Gee.HashDataFunc? key_hash_func = null, owned Gee.EqualDataFunc? key_equal_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + public override void clear (); + public override V @get (K key); + public override bool has (K key, V value); + public override bool has_key (K key); + public override Gee.MapIterator map_iterator (); + public override void @set (K key, V value); + public override bool unset (K key, out V value = null); + public override Gee.Set> entries { owned get; } + [CCode (notify = false)] + public Gee.EqualDataFunc key_equal_func { get; private set; } + [CCode (notify = false)] + public Gee.HashDataFunc key_hash_func { get; private set; } + public override Gee.Set keys { owned get; } + public override bool read_only { get; } + public override int size { get; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + public override Gee.Collection values { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public class HashMultiMap : Gee.AbstractMultiMap { + public HashMultiMap (owned Gee.HashDataFunc? key_hash_func = null, owned Gee.EqualDataFunc? key_equal_func = null, owned Gee.HashDataFunc? value_hash_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + protected override Gee.MultiSet create_multi_key_set (); + protected override Gee.Collection create_value_storage (); + protected override Gee.EqualDataFunc get_value_equal_func (); + public Gee.EqualDataFunc key_equal_func { get; } + public Gee.HashDataFunc key_hash_func { get; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + [CCode (notify = false)] + public Gee.HashDataFunc value_hash_func { get; private set; } + } + [CCode (cheader_filename = "gee.h")] + public class HashMultiSet : Gee.AbstractMultiSet { + public HashMultiSet (Gee.HashDataFunc? hash_func = null, Gee.EqualDataFunc? equal_func = null); + public Gee.EqualDataFunc equal_func { get; } + public Gee.HashDataFunc hash_func { get; } + } + [CCode (cheader_filename = "gee.h")] + public class HashSet : Gee.AbstractSet { + public HashSet (owned Gee.HashDataFunc? hash_func = null, owned Gee.EqualDataFunc? equal_func = null); + public override bool add (G key); + public override void clear (); + public override bool contains (G key); + public override Gee.Iterator iterator (); + public override bool remove (G key); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + [CCode (notify = false)] + public Gee.HashDataFunc hash_func { get; private set; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + [Compact] + public class HazardPointer { + [Compact] + public class Context { + public Context (Gee.HazardPointer.Policy? policy = null); + public void free_all (); + public void release (); + public void try_free (); + public void try_release (); + } + public enum Policy { + DEFAULT, + THREAD_EXIT, + TRY_FREE, + FREE, + TRY_RELEASE, + RELEASE; + public bool is_concrete (); + public bool is_blocking (); + public bool is_safe (); + public Gee.HazardPointer.Policy to_concrete (); + } + public enum ReleasePolicy { + HELPER_THREAD, + MAIN_LOOP; + } + public delegate void DestroyNotify (void* ptr); + public HazardPointer (G* ptr); + public static bool compare_and_exchange_pointer (G** aptr, G old_ptr, owned G _new_ptr, size_t mask = 0, size_t old_mask = 0, size_t new_mask = 0); + public static Gee.HazardPointer? exchange_hazard_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null); + public static G exchange_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null); + public new unowned G @get (bool other_thread = false); + public static Gee.HazardPointer? get_hazard_pointer (G** aptr, size_t mask = 0, out size_t mask_out = null); + public static G get_pointer (G** aptr, size_t mask = 0, out size_t mask_out = null); + public void release (owned Gee.HazardPointer.DestroyNotify notify); + public static void set_default_policy (Gee.HazardPointer.Policy policy); + public static void set_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0); + public static bool set_release_policy (Gee.HazardPointer.ReleasePolicy policy); + public static void set_thread_exit_policy (Gee.HazardPointer.Policy policy); + } + [CCode (cheader_filename = "gee.h")] + public class Lazy { + public Lazy (owned Gee.LazyFunc func); + public void eval (); + public Lazy.from_value (G item); + public new G @get (); + public G value { get; } + } + [CCode (cheader_filename = "gee.h")] + public class LinkedList : Gee.AbstractBidirList, Gee.Queue, Gee.Deque { + public LinkedList (owned Gee.EqualDataFunc? equal_func = null); + public override bool add (G item); + public override Gee.BidirListIterator bidir_list_iterator (); + public override void clear (); + public override bool contains (G item); + public G first (); + public override bool @foreach (Gee.ForallFunc f); + public override G @get (int index); + public override int index_of (G item); + public override void insert (int index, G item); + public override Gee.Iterator iterator (); + public G last (); + public override Gee.ListIterator list_iterator (); + public override bool remove (G item); + public override G remove_at (int index); + public override void @set (int index, G item); + public override Gee.List? slice (int start, int stop); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class PriorityQueue : Gee.AbstractQueue { + public PriorityQueue (owned GLib.CompareDataFunc? compare_func = null); + public override bool add (G item); + public override void clear (); + public override bool contains (G item); + public int drain (Gee.Collection recipient, int amount = -1); + public override Gee.Iterator iterator (); + public bool offer (G element); + public override G peek (); + public override G poll (); + public override bool remove (G item); + public override int capacity { get; } + [CCode (notify = false)] + public GLib.CompareDataFunc compare_func { get; private set; } + public override bool is_full { get; } + public override bool read_only { get; } + public override int remaining_capacity { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public class TreeMap : Gee.AbstractBidirSortedMap { + public TreeMap (owned GLib.CompareDataFunc? key_compare_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + public override Gee.BidirMapIterator bidir_map_iterator (); + public override void clear (); + public override V @get (K key); + public override bool has (K key, V value); + public override bool has_key (K key); + public override Gee.SortedMap head_map (K before); + public override Gee.MapIterator map_iterator (); + public override void @set (K key, V value); + public override Gee.SortedMap sub_map (K after, K before); + public override Gee.SortedMap tail_map (K after); + public override bool unset (K key, out V value = null); + public override Gee.SortedSet> ascending_entries { owned get; } + public override Gee.SortedSet ascending_keys { owned get; } + public override Gee.Set> entries { owned get; } + [CCode (notify = false)] + public GLib.CompareDataFunc key_compare_func { get; private set; } + public override Gee.Set keys { owned get; } + public override bool read_only { get; } + public override int size { get; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + public override Gee.Collection values { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public class TreeMultiMap : Gee.AbstractMultiMap { + public TreeMultiMap (owned GLib.CompareDataFunc? key_compare_func = null, owned GLib.CompareDataFunc? value_compare_func = null); + protected override Gee.MultiSet create_multi_key_set (); + protected override Gee.Collection create_value_storage (); + protected override Gee.EqualDataFunc get_value_equal_func (); + public GLib.CompareDataFunc key_compare_func { get; } + [CCode (notify = false)] + public GLib.CompareDataFunc value_compare_func { get; private set; } + } + [CCode (cheader_filename = "gee.h")] + public class TreeMultiSet : Gee.AbstractMultiSet { + public TreeMultiSet (owned GLib.CompareDataFunc? compare_func = null); + public GLib.CompareDataFunc compare_func { get; } + } + [CCode (cheader_filename = "gee.h")] + public class TreeSet : Gee.AbstractBidirSortedSet { + public TreeSet (owned GLib.CompareDataFunc? compare_func = null); + public override bool add (G item); + public override Gee.BidirIterator bidir_iterator (); + public override G ceil (G item); + public override void clear (); + public override bool contains (G item); + public override G first (); + public override G floor (G item); + public override Gee.SortedSet head_set (G before); + public override G higher (G item); + public override Gee.Iterator iterator (); + public override Gee.Iterator? iterator_at (G item); + public override G last (); + public override G lower (G item); + public override bool remove (G item); + public override Gee.SortedSet sub_set (G after, G before); + public override Gee.SortedSet tail_set (G after); + [CCode (notify = false)] + public GLib.CompareDataFunc compare_func { get; private set; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirIterator : Gee.Iterator { + public abstract bool first (); + public abstract bool has_previous (); + public abstract bool last (); + public abstract bool previous (); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirList : Gee.List { + public abstract new Gee.BidirListIterator bidir_list_iterator (); + public abstract Gee.BidirList read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirListIterator : Gee.BidirIterator, Gee.ListIterator { + public abstract void insert (G item); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirMapIterator : Gee.MapIterator { + public abstract bool first (); + public abstract bool has_previous (); + public abstract bool last (); + public abstract bool previous (); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirSortedMap : Gee.SortedMap { + public abstract Gee.BidirMapIterator bidir_map_iterator (); + public static Gee.BidirSortedMap empty (); + public abstract Gee.BidirSortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface BidirSortedSet : Gee.SortedSet { + public abstract Gee.BidirIterator bidir_iterator (); + public static Gee.BidirSortedSet empty (); + public abstract Gee.BidirSortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Collection : Gee.Iterable { + public abstract bool add (G item); + public virtual bool add_all (Gee.Collection collection); + public bool add_all_array (G[] array); + public abstract void clear (); + public abstract bool contains (G item); + public virtual bool contains_all (Gee.Collection collection); + public bool contains_all_array (G[] array); + public static Gee.Collection empty (); + public abstract bool remove (G item); + public virtual bool remove_all (Gee.Collection collection); + public bool remove_all_array (G[] array); + public virtual bool retain_all (Gee.Collection collection); + public virtual G[] to_array (); + public virtual bool is_empty { get; } + public abstract bool read_only { get; } + public abstract Gee.Collection read_only_view { owned get; } + public abstract int size { get; } + } + [CCode (cheader_filename = "gee.h")] + public interface Comparable : GLib.Object { + public abstract int compare_to (G object); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Deque : Gee.Queue { + public abstract int drain_head (Gee.Collection recipient, int amount = -1); + public abstract int drain_tail (Gee.Collection recipient, int amount = -1); + public abstract bool offer_head (G element); + public abstract bool offer_tail (G element); + public abstract G peek_head (); + public abstract G peek_tail (); + public abstract G poll_head (); + public abstract G poll_tail (); + } + [CCode (cheader_filename = "gee.h")] + public interface Hashable : GLib.Object { + public abstract bool equal_to (G object); + public abstract uint hash (); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Iterable : GLib.Object, Gee.Traversable { + public abstract Gee.Iterator iterator (); + } + [CCode (cheader_filename = "gee.h")] + public interface Iterator : GLib.Object, Gee.Traversable { + public static Gee.Iterator concat (Gee.Iterator> iters); + public abstract G @get (); + public abstract bool has_next (); + public abstract bool next (); + public abstract void remove (); + public static Gee.Iterator unfold (owned Gee.UnfoldFunc f, owned Gee.Lazy? current = null); + public abstract bool read_only { get; } + public abstract bool valid { get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface List : Gee.Collection { + public static Gee.List empty (); + public virtual G first (); + public abstract G @get (int index); + public abstract int index_of (G item); + public abstract void insert (int index, G item); + public virtual void insert_all (int index, Gee.Collection collection); + public virtual G last (); + public abstract new Gee.ListIterator list_iterator (); + public abstract G remove_at (int index); + public abstract void @set (int index, G item); + public abstract Gee.List? slice (int start, int stop); + public virtual void sort (owned GLib.CompareDataFunc? compare_func = null); + public abstract Gee.List read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public interface ListIterator : Gee.Iterator { + public abstract void add (G item); + public abstract int index (); + public abstract void @set (G item); + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Map : GLib.Object, Gee.Iterable> { + public abstract class Entry : GLib.Object { + public Entry (); + public abstract K key { get; } + public abstract bool read_only { get; } + public abstract V value { get; set; } + } + public abstract void clear (); + [Deprecated (replacement = "Map.has_key")] + public bool contains (K key); + [Deprecated (replacement = "Map.has_all")] + public bool contains_all (Gee.Map map); + public static Gee.Map empty (); + public abstract V @get (K key); + public abstract bool has (K key, V value); + public virtual bool has_all (Gee.Map map); + public abstract bool has_key (K key); + public abstract Gee.MapIterator map_iterator (); + [Deprecated (replacement = "Map.unset")] + public bool remove (K key, out V value = null); + [Deprecated (replacement = "Map.unset_all")] + public bool remove_all (Gee.Map map); + public abstract void @set (K key, V value); + public virtual void set_all (Gee.Map map); + public abstract bool unset (K key, out V value = null); + public virtual bool unset_all (Gee.Map map); + public abstract Gee.Set> entries { owned get; } + public virtual bool is_empty { get; } + public GLib.Type key_type { get; } + public abstract Gee.Set keys { owned get; } + public abstract bool read_only { get; } + public abstract Gee.Map read_only_view { owned get; } + public abstract int size { get; } + public GLib.Type value_type { get; } + public abstract Gee.Collection values { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface MapIterator : GLib.Object { + public virtual A fold (Gee.FoldMapFunc f, owned A seed); + public virtual new bool @foreach (Gee.ForallMapFunc f); + public abstract K get_key (); + public abstract V get_value (); + public abstract bool has_next (); + public abstract bool next (); + public abstract void set_value (V value); + public abstract void unset (); + public abstract bool mutable { get; } + public abstract bool read_only { get; } + public abstract bool valid { get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface MultiMap : GLib.Object { + public abstract void clear (); + public abstract bool contains (K key); + public abstract Gee.Collection @get (K key); + public abstract Gee.MultiSet get_all_keys (); + public abstract Gee.Set get_keys (); + public abstract Gee.Collection get_values (); + public abstract Gee.MapIterator map_iterator (); + public abstract bool remove (K key, V value); + public abstract bool remove_all (K key); + public abstract void @set (K key, V value); + public GLib.Type key_type { get; } + public abstract bool read_only { get; } + public virtual Gee.MultiMap read_only_view { owned get; } + public abstract int size { get; } + public GLib.Type value_type { get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface MultiSet : Gee.Collection { + public abstract int count (G item); + public static Gee.Set empty (); + public virtual Gee.MultiSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Queue : Gee.Collection { + public const int UNBOUNDED_CAPACITY; + public virtual int drain (Gee.Collection recipient, int amount = -1); + public virtual bool offer (G element); + public abstract G peek (); + public abstract G poll (); + public abstract int capacity { get; } + public abstract bool is_full { get; } + public abstract int remaining_capacity { get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Set : Gee.Collection { + public static Gee.Set empty (); + public abstract Gee.Set read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + public interface SortedMap : Gee.Map { + public static Gee.Map empty (); + public abstract Gee.SortedMap head_map (K before); + public abstract Gee.SortedMap sub_map (K before, K after); + public abstract Gee.SortedMap tail_map (K after); + public abstract Gee.SortedSet> ascending_entries { owned get; } + public abstract Gee.SortedSet ascending_keys { owned get; } + public abstract Gee.SortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface SortedSet : Gee.Set { + public abstract G ceil (G element); + public static Gee.SortedSet empty (); + public abstract G first (); + public abstract G floor (G element); + public abstract Gee.SortedSet head_set (G before); + public abstract G higher (G element); + public abstract Gee.Iterator? iterator_at (G element); + public abstract G last (); + public abstract G lower (G element); + public abstract Gee.SortedSet sub_set (G from, G to); + public abstract Gee.SortedSet tail_set (G after); + public abstract Gee.SortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee.h")] + [GenericAccessors] + public interface Traversable : GLib.Object { + public enum Stream { + YIELD, + CONTINUE, + END + } + public virtual Gee.Iterator chop (int offset, int length = -1); + public virtual Gee.Iterator filter (owned Gee.Predicate pred); + public virtual A fold (Gee.FoldFunc f, owned A seed); + public abstract new bool @foreach (Gee.ForallFunc f); + public virtual Gee.Iterator map (Gee.MapFunc f); + public virtual Gee.Iterator scan (Gee.FoldFunc f, owned A seed); + public virtual Gee.Iterator stream (owned Gee.StreamFunc f); + public virtual GLib.Type element_type { get; } + } + [CCode (cheader_filename = "gee.h")] + public delegate bool EqualDataFunc (T a, T b); + [CCode (cheader_filename = "gee.h")] + public delegate A FoldFunc (owned G g, owned A a); + [CCode (cheader_filename = "gee.h")] + public delegate A FoldMapFunc (K k, V v, owned A a); + [CCode (cheader_filename = "gee.h")] + public delegate bool ForallFunc (owned G g); + [CCode (cheader_filename = "gee.h")] + public delegate bool ForallMapFunc (K k, V v); + [CCode (cheader_filename = "gee.h")] + public delegate uint HashDataFunc (T v); + [CCode (cheader_filename = "gee.h")] + public delegate G LazyFunc (); + [CCode (cheader_filename = "gee.h")] + public delegate A MapFunc (owned G g); + [CCode (cheader_filename = "gee.h")] + public delegate bool Predicate (G g); + [CCode (cheader_filename = "gee.h")] + public delegate Gee.Traversable.Stream StreamFunc (Gee.Traversable.Stream state, owned Gee.Lazy? g, out Gee.Lazy? lazy); + [CCode (cheader_filename = "gee.h")] + public delegate Gee.Lazy? UnfoldFunc (); +} diff --git a/gee/gee-1.0.vapi b/gee/gee-1.0.vapi deleted file mode 100644 index 4240448..0000000 --- a/gee/gee-1.0.vapi +++ /dev/null @@ -1,414 +0,0 @@ -/* gee-1.0.vapi generated by valac 0.18.0, do not modify. */ - -[CCode (gir_namespace = "Gee", gir_version = "1.0")] -namespace Gee { - namespace Functions { - [CCode (cheader_filename = "gee.h")] - public static GLib.CompareFunc get_compare_func_for (GLib.Type t); - [CCode (cheader_filename = "gee.h")] - public static GLib.EqualFunc get_equal_func_for (GLib.Type t); - [CCode (cheader_filename = "gee.h")] - public static GLib.HashFunc get_hash_func_for (GLib.Type t); - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractCollection : GLib.Object, Gee.Iterable, Gee.Collection { - public AbstractCollection (); - public abstract bool add (G item); - public virtual bool add_all (Gee.Collection collection); - public abstract void clear (); - public abstract bool contains (G item); - public virtual bool contains_all (Gee.Collection collection); - public abstract Gee.Iterator iterator (); - public abstract bool remove (G item); - public virtual bool remove_all (Gee.Collection collection); - public virtual bool retain_all (Gee.Collection collection); - public virtual G[] to_array (); - public virtual bool is_empty { get; } - public virtual Gee.Collection read_only_view { owned get; } - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractList : Gee.AbstractCollection, Gee.List { - public AbstractList (); - public virtual G first (); - public abstract new G @get (int index); - public abstract int index_of (G item); - public abstract void insert (int index, G item); - public virtual void insert_all (int index, Gee.Collection collection); - public virtual G last (); - public abstract Gee.ListIterator list_iterator (); - public abstract G remove_at (int index); - public abstract new void @set (int index, G item); - public abstract Gee.List? slice (int start, int stop); - public virtual Gee.List read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMap : GLib.Object, Gee.Iterable>, Gee.Map { - public AbstractMap (); - public abstract void clear (); - public abstract new V @get (K key); - public abstract bool has (K key, V value); - public virtual bool has_all (Gee.Map map); - public abstract bool has_key (K key); - public abstract Gee.MapIterator map_iterator (); - public abstract new void @set (K key, V value); - public virtual void set_all (Gee.Map map); - public abstract bool unset (K key, out V value = null); - public virtual bool unset_all (Gee.Map map); - public abstract Gee.Set> entries { owned get; } - public virtual bool is_empty { get; } - public abstract Gee.Set keys { owned get; } - public virtual Gee.Map read_only_view { owned get; } - public abstract int size { get; } - public abstract Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMultiMap : GLib.Object, Gee.MultiMap { - protected Gee.Map> _storage_map; - public AbstractMultiMap (Gee.Map> storage_map); - protected abstract Gee.MultiSet create_multi_key_set (); - protected abstract Gee.Collection create_value_storage (); - protected abstract GLib.EqualFunc get_value_equal_func (); - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMultiSet : Gee.AbstractCollection, Gee.MultiSet { - protected Gee.Map _storage_map; - public AbstractMultiSet (Gee.Map storage_map); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override Gee.Iterator iterator (); - public override bool remove (G item); - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractQueue : Gee.AbstractCollection, Gee.Queue { - public AbstractQueue (); - public abstract int drain (Gee.Collection recipient, int amount = -1); - public abstract bool offer (G element); - public abstract G peek (); - public abstract G poll (); - public abstract int capacity { get; } - public abstract bool is_full { get; } - public abstract int remaining_capacity { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractSet : Gee.AbstractCollection, Gee.Set { - public AbstractSet (); - public virtual Gee.Set read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class ArrayList : Gee.AbstractList { - public ArrayList (GLib.EqualFunc? equal_func = null); - public override bool add (G item); - public override bool add_all (Gee.Collection collection); - public override void clear (); - public override bool contains (G item); - public override G @get (int index); - public override int index_of (G item); - public override void insert (int index, G item); - public override Gee.Iterator iterator (); - public override Gee.ListIterator list_iterator (); - public override bool remove (G item); - public override G remove_at (int index); - public override void @set (int index, G item); - public override Gee.List? slice (int start, int stop); - public void sort_with_data (GLib.CompareDataFunc compare); - public GLib.EqualFunc equal_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMap : Gee.AbstractMap { - public HashMap (GLib.HashFunc? key_hash_func = null, GLib.EqualFunc? key_equal_func = null, GLib.EqualFunc? value_equal_func = null); - public override void clear (); - public override V @get (K key); - public override bool has (K key, V value); - public override bool has_key (K key); - public override Gee.MapIterator map_iterator (); - public override void @set (K key, V value); - public override bool unset (K key, out V value = null); - public override Gee.Set> entries { owned get; } - public GLib.EqualFunc key_equal_func { get; private set; } - public GLib.HashFunc key_hash_func { get; private set; } - public override Gee.Set keys { owned get; } - public override int size { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public override Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMultiMap : Gee.AbstractMultiMap { - public HashMultiMap (GLib.HashFunc? key_hash_func = null, GLib.EqualFunc? key_equal_func = null, GLib.HashFunc? value_hash_func = null, GLib.EqualFunc? value_equal_func = null); - protected override Gee.MultiSet create_multi_key_set (); - protected override Gee.Collection create_value_storage (); - protected override GLib.EqualFunc get_value_equal_func (); - public GLib.EqualFunc key_equal_func { get; } - public GLib.HashFunc key_hash_func { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public GLib.HashFunc value_hash_func { get; private set; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMultiSet : Gee.AbstractMultiSet { - public HashMultiSet (GLib.HashFunc? hash_func = null, GLib.EqualFunc? equal_func = null); - public GLib.EqualFunc equal_func { get; } - public GLib.HashFunc hash_func { get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashSet : Gee.AbstractSet { - public HashSet (GLib.HashFunc? hash_func = null, GLib.EqualFunc? equal_func = null); - public override bool add (G key); - public override void clear (); - public override bool contains (G key); - public override Gee.Iterator iterator (); - public override bool remove (G key); - public GLib.EqualFunc equal_func { get; private set; } - public GLib.HashFunc hash_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class LinkedList : Gee.AbstractList, Gee.Queue, Gee.Deque { - public LinkedList (GLib.EqualFunc? equal_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override G first (); - public override G @get (int index); - public override int index_of (G item); - public override void insert (int index, G item); - public override Gee.Iterator iterator (); - public override G last (); - public override Gee.ListIterator list_iterator (); - public override bool remove (G item); - public override G remove_at (int index); - public override void @set (int index, G item); - public override Gee.List? slice (int start, int stop); - public GLib.EqualFunc equal_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class PriorityQueue : Gee.AbstractQueue { - public PriorityQueue (GLib.CompareFunc? compare_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override int drain (Gee.Collection recipient, int amount = -1); - public override Gee.Iterator iterator (); - public override bool offer (G element); - public override G peek (); - public override G poll (); - public override bool remove (G item); - public override int capacity { get; } - public GLib.CompareFunc compare_func { get; private set; } - public override bool is_full { get; } - public override int remaining_capacity { get; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMap : Gee.AbstractMap { - public TreeMap (GLib.CompareFunc? key_compare_func = null, GLib.EqualFunc? value_equal_func = null); - public override void clear (); - public override V @get (K key); - public override bool has (K key, V value); - public override bool has_key (K key); - public override Gee.MapIterator map_iterator (); - public override void @set (K key, V value); - public override bool unset (K key, out V value = null); - public override Gee.Set> entries { owned get; } - public GLib.CompareFunc key_compare_func { get; private set; } - public override Gee.Set keys { owned get; } - public override int size { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public override Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMultiMap : Gee.AbstractMultiMap { - public TreeMultiMap (GLib.CompareFunc? key_compare_func = null, GLib.CompareFunc? value_compare_func = null); - protected override Gee.MultiSet create_multi_key_set (); - protected override Gee.Collection create_value_storage (); - protected override GLib.EqualFunc get_value_equal_func (); - public GLib.CompareFunc key_compare_func { get; } - public GLib.CompareFunc value_compare_func { get; private set; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMultiSet : Gee.AbstractMultiSet { - public TreeMultiSet (GLib.CompareFunc? compare_func = null); - public GLib.CompareFunc compare_func { get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeSet : Gee.AbstractSet, Gee.SortedSet { - public TreeSet (GLib.CompareFunc? compare_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override Gee.Iterator iterator (); - public override bool remove (G item); - public GLib.CompareFunc compare_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface BidirIterator : Gee.Iterator { - public abstract bool has_previous (); - public abstract bool last (); - public abstract bool previous (); - } - [CCode (cheader_filename = "gee.h")] - public interface Collection : Gee.Iterable { - public abstract bool add (G item); - public abstract bool add_all (Gee.Collection collection); - public abstract void clear (); - public abstract bool contains (G item); - public abstract bool contains_all (Gee.Collection collection); - public static Gee.Collection empty (); - public abstract bool remove (G item); - public abstract bool remove_all (Gee.Collection collection); - public abstract bool retain_all (Gee.Collection collection); - public abstract G[] to_array (); - public abstract bool is_empty { get; } - public abstract Gee.Collection read_only_view { owned get; } - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Comparable : GLib.Object { - public abstract int compare_to (G object); - } - [CCode (cheader_filename = "gee.h")] - public interface Deque : Gee.Queue { - public abstract int drain_head (Gee.Collection recipient, int amount = -1); - public abstract int drain_tail (Gee.Collection recipient, int amount = -1); - public abstract bool offer_head (G element); - public abstract bool offer_tail (G element); - public abstract G peek_head (); - public abstract G peek_tail (); - public abstract G poll_head (); - public abstract G poll_tail (); - } - [CCode (cheader_filename = "gee.h")] - public interface Iterable : GLib.Object { - public abstract Gee.Iterator iterator (); - public abstract GLib.Type element_type { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Iterator : GLib.Object { - public abstract bool first (); - public abstract G @get (); - public abstract bool has_next (); - public abstract bool next (); - public abstract void remove (); - } - [CCode (cheader_filename = "gee.h")] - public interface List : Gee.Collection { - public static Gee.List empty (); - public abstract G first (); - public abstract G @get (int index); - public abstract int index_of (G item); - public abstract void insert (int index, G item); - public abstract void insert_all (int index, Gee.Collection collection); - public abstract G last (); - public abstract new Gee.ListIterator list_iterator (); - public abstract G remove_at (int index); - public abstract void @set (int index, G item); - public abstract Gee.List? slice (int start, int stop); - public abstract void sort (GLib.CompareFunc? compare_func = null); - public abstract Gee.List read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface ListIterator : Gee.BidirIterator { - public abstract void add (G item); - public abstract int index (); - public abstract void insert (G item); - public abstract void @set (G item); - } - [CCode (cheader_filename = "gee.h")] - public interface Map : GLib.Object, Gee.Iterable> { - public abstract class Entry : GLib.Object { - public Entry (); - public abstract K key { get; } - public abstract V value { get; set; } - } - public abstract void clear (); - [Deprecated] - public abstract bool contains (K key); - [Deprecated] - public abstract bool contains_all (Gee.Map map); - public static Gee.Map empty (); - public abstract V @get (K key); - public abstract bool has (K key, V value); - public abstract bool has_all (Gee.Map map); - public abstract bool has_key (K key); - public abstract Gee.MapIterator map_iterator (); - [Deprecated] - public abstract bool remove (K key, out V value = null); - [Deprecated] - public abstract bool remove_all (Gee.Map map); - public abstract void @set (K key, V value); - public abstract void set_all (Gee.Map map); - public abstract bool unset (K key, out V value = null); - public abstract bool unset_all (Gee.Map map); - public abstract Gee.Set> entries { owned get; } - public abstract bool is_empty { get; } - public abstract GLib.Type key_type { get; } - public abstract Gee.Set keys { owned get; } - public abstract Gee.Map read_only_view { owned get; } - public abstract int size { get; } - public abstract GLib.Type value_type { get; } - public abstract Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface MapIterator : GLib.Object { - public abstract bool first (); - public abstract K get_key (); - public abstract V get_value (); - public abstract bool has_next (); - public abstract bool next (); - public abstract void set_value (V value); - public abstract void unset (); - } - [CCode (cheader_filename = "gee.h")] - public interface MultiMap : GLib.Object { - public abstract void clear (); - public abstract bool contains (K key); - public abstract Gee.Collection @get (K key); - public abstract Gee.MultiSet get_all_keys (); - public abstract Gee.Set get_keys (); - public abstract Gee.Collection get_values (); - public abstract bool remove (K key, V value); - public abstract bool remove_all (K key); - public abstract void @set (K key, V value); - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface MultiSet : Gee.Collection { - public abstract int count (G item); - } - [CCode (cheader_filename = "gee.h")] - public interface Queue : Gee.Collection { - public const int UNBOUNDED_CAPACITY; - public abstract int drain (Gee.Collection recipient, int amount = -1); - public abstract bool offer (G element); - public abstract G peek (); - public abstract G poll (); - public abstract int capacity { get; } - public abstract bool is_full { get; } - public abstract int remaining_capacity { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Set : Gee.Collection { - public static Gee.Set empty (); - public abstract Gee.Set read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface SortedSet : Gee.Set { - public abstract Gee.BidirIterator bidir_iterator (); - public abstract G ceil (G element); - public abstract G first (); - public abstract G floor (G element); - public abstract Gee.SortedSet head_set (G before); - public abstract G higher (G element); - public abstract Gee.BidirIterator? iterator_at (G element); - public abstract G last (); - public abstract G lower (G element); - public abstract Gee.SortedSet sub_set (G from, G to); - public abstract Gee.SortedSet tail_set (G after); - } - [CCode (cheader_filename = "gee.h")] - public static int direct_compare (void* _val1, void* _val2); -} diff --git a/gee/gee-internals-0.8.vapi b/gee/gee-internals-0.8.vapi new file mode 100644 index 0000000..31cfd51 --- /dev/null +++ b/gee/gee-internals-0.8.vapi @@ -0,0 +1,971 @@ +/* gee-internals-0.8.vapi generated by valac 0.18.0, do not modify. */ + +[CCode (gir_namespace = "Gee", gir_version = "0.8")] +namespace Gee { + namespace Functions { + [CCode (cheader_filename = "gee-internals.h")] + public static Gee.EqualDataFunc get_equal_func_for (GLib.Type t); + [CCode (cheader_filename = "gee-internals.h")] + public static Gee.HashDataFunc get_hash_func_for (GLib.Type t); + [CCode (cheader_filename = "gee-internals.h")] + public static GLib.CompareDataFunc get_compare_func_for (GLib.Type t); + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractBidirList : Gee.AbstractList, Gee.BidirList { + public abstract Gee.BidirListIterator bidir_list_iterator (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractBidirList (); + public virtual Gee.BidirList read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractBidirSortedSet : Gee.AbstractSortedSet, Gee.BidirSortedSet { + public abstract Gee.BidirIterator bidir_iterator (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractBidirSortedSet (); + public virtual Gee.BidirSortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractBidirSortedMap : Gee.AbstractSortedMap, Gee.BidirSortedMap { + public abstract Gee.BidirMapIterator bidir_map_iterator (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractBidirSortedMap (); + public virtual Gee.BidirSortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractCollection : GLib.Object, Gee.Traversable, Gee.Iterable, Gee.Collection { + public abstract bool contains (G item); + public abstract bool add (G item); + public abstract bool remove (G item); + public abstract void clear (); + public abstract Gee.Iterator iterator (); + public virtual bool @foreach (Gee.ForallFunc f); + internal virtual void reserved0 (); + internal virtual void reserved1 (); + internal virtual void reserved2 (); + internal virtual void reserved3 (); + internal virtual void reserved4 (); + internal virtual void reserved5 (); + internal virtual void reserved6 (); + internal virtual void reserved7 (); + internal virtual void reserved8 (); + internal virtual void reserved9 (); + public AbstractCollection (); + public abstract int size { get; } + public abstract bool read_only { get; } + public virtual Gee.Collection read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractList : Gee.AbstractCollection, Gee.List { + public abstract Gee.ListIterator list_iterator (); + public abstract new G @get (int index); + public abstract new void @set (int index, G item); + public abstract int index_of (G item); + public abstract void insert (int index, G item); + public abstract G remove_at (int index); + public abstract Gee.List? slice (int start, int stop); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractList (); + public virtual Gee.List read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractMap : GLib.Object, Gee.Traversable>, Gee.Iterable>, Gee.Map { + public abstract bool has_key (K key); + public abstract bool has (K key, V value); + public abstract new V @get (K key); + public abstract new void @set (K key, V value); + public abstract bool unset (K key, out V value = null); + public abstract Gee.MapIterator map_iterator (); + public abstract void clear (); + public virtual bool @foreach (Gee.ForallFunc> f); + public virtual Gee.Iterator stream (owned Gee.StreamFunc,A> f); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractMap (); + public abstract int size { get; } + public abstract bool read_only { get; } + public abstract Gee.Set keys { owned get; } + public abstract Gee.Collection values { owned get; } + public abstract Gee.Set> entries { owned get; } + public virtual Gee.Map read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractMultiMap : GLib.Object, Gee.MultiMap { + protected Gee.Map> _storage_map; + public AbstractMultiMap (Gee.Map> storage_map); + protected abstract Gee.Collection create_value_storage (); + protected abstract Gee.MultiSet create_multi_key_set (); + protected abstract Gee.EqualDataFunc get_value_equal_func (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + public virtual Gee.MultiMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractMultiSet : Gee.AbstractCollection, Gee.MultiSet { + protected Gee.Map _storage_map; + public AbstractMultiSet (Gee.Map storage_map); + public override bool contains (G item); + public override Gee.Iterator iterator (); + public override bool add (G item); + public override bool remove (G item); + public override void clear (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + public override int size { get; } + public override bool read_only { get; } + public virtual Gee.MultiSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractQueue : Gee.AbstractCollection, Gee.Queue { + public abstract G peek (); + public abstract G poll (); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractQueue (); + public abstract int capacity { get; } + public abstract int remaining_capacity { get; } + public abstract bool is_full { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractSet : Gee.AbstractCollection, Gee.Set { + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractSet (); + public virtual Gee.Set read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractSortedMap : Gee.AbstractMap, Gee.SortedMap { + public abstract Gee.SortedMap head_map (K before); + public abstract Gee.SortedMap tail_map (K after); + public abstract Gee.SortedMap sub_map (K before, K after); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractSortedMap (); + public abstract Gee.SortedSet ascending_keys { owned get; } + public abstract Gee.SortedSet> ascending_entries { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public abstract class AbstractSortedSet : Gee.AbstractSet, Gee.SortedSet { + public abstract G first (); + public abstract G last (); + public abstract Gee.Iterator? iterator_at (G element); + public abstract G lower (G element); + public abstract G higher (G element); + public abstract G floor (G element); + public abstract G ceil (G element); + public abstract Gee.SortedSet head_set (G before); + public abstract Gee.SortedSet tail_set (G after); + public abstract Gee.SortedSet sub_set (G from, G to); + internal virtual new void reserved0 (); + internal virtual new void reserved1 (); + internal virtual new void reserved2 (); + internal virtual new void reserved3 (); + internal virtual new void reserved4 (); + internal virtual new void reserved5 (); + internal virtual new void reserved6 (); + internal virtual new void reserved7 (); + internal virtual new void reserved8 (); + internal virtual new void reserved9 (); + public AbstractSortedSet (); + public virtual Gee.SortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class ArrayList : Gee.AbstractBidirList { + internal G[] _items; + internal int _size; + public ArrayList (owned Gee.EqualDataFunc? equal_func = null); + public ArrayList.wrap (owned G[] items, owned Gee.EqualDataFunc? equal_func = null); + public override bool @foreach (Gee.ForallFunc f); + public override Gee.Iterator iterator (); + public override Gee.ListIterator list_iterator (); + public override Gee.BidirListIterator bidir_list_iterator (); + public override bool contains (G item); + public override int index_of (G item); + public override G @get (int index); + public override void @set (int index, G item); + public override bool add (G item); + public override void insert (int index, G item); + public override bool remove (G item); + public override G remove_at (int index); + public override void clear (); + public override Gee.List? slice (int start, int stop); + public bool add_all (Gee.Collection collection); + public override int size { get; } + public override bool read_only { get; } + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class ArrayQueue : Gee.AbstractQueue, Gee.Deque { + public ArrayQueue (owned Gee.EqualDataFunc? equal_func = null); + public override Gee.Iterator iterator (); + public override bool add (G element); + public override bool contains (G item); + public override bool remove (G item); + public override void clear (); + public override G peek (); + public override G poll (); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public override int size { get; } + public bool is_empty { get; } + public override bool read_only { get; } + public override int capacity { get; } + public override int remaining_capacity { get; } + public override bool is_full { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class ConcurrentList : Gee.AbstractList { + public ConcurrentList (owned Gee.EqualDataFunc? equal_func = null); + public override bool contains (G item); + public override bool add (G item); + public override bool remove (G item); + public override void clear (); + public override Gee.Iterator iterator (); + public override Gee.ListIterator list_iterator (); + public override G @get (int index); + public override void @set (int index, G item); + public override int index_of (G item); + public override void insert (int index, G item); + public override G remove_at (int index); + public override Gee.List? slice (int start, int end); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public override bool read_only { get; } + public override int size { get; } + public bool is_empty { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class ConcurrentSet : Gee.AbstractSortedSet { + public enum RangeType { + HEAD, + TAIL, + BOUNDED, + EMPTY + } + public ConcurrentSet (owned GLib.CompareDataFunc? compare_func = null); + public override Gee.Iterator iterator (); + public override bool contains (G key); + public override bool add (G key); + public override bool remove (G item); + public override void clear (); + public override G first (); + public override G last (); + public override Gee.Iterator? iterator_at (G element); + public override G lower (G element); + public override G higher (G element); + public override G floor (G element); + public override G ceil (G element); + public override Gee.SortedSet head_set (G before); + public override Gee.SortedSet tail_set (G after); + public override Gee.SortedSet sub_set (G from, G to); + public override int size { get; } + public override bool read_only { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class HashMap : Gee.AbstractMap { + public HashMap (owned Gee.HashDataFunc? key_hash_func = null, owned Gee.EqualDataFunc? key_equal_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + public override bool has_key (K key); + public override bool has (K key, V value); + public override V @get (K key); + public override void @set (K key, V value); + public override bool unset (K key, out V value = null); + public override void clear (); + public override Gee.MapIterator map_iterator (); + public override int size { get; } + public override bool read_only { get; } + public override Gee.Set keys { owned get; } + public override Gee.Collection values { owned get; } + public override Gee.Set> entries { owned get; } + [CCode (notify = false)] + public Gee.HashDataFunc key_hash_func { get; private set; } + [CCode (notify = false)] + public Gee.EqualDataFunc key_equal_func { get; private set; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class HashMultiMap : Gee.AbstractMultiMap { + public HashMultiMap (owned Gee.HashDataFunc? key_hash_func = null, owned Gee.EqualDataFunc? key_equal_func = null, owned Gee.HashDataFunc? value_hash_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + protected override Gee.Collection create_value_storage (); + protected override Gee.MultiSet create_multi_key_set (); + protected override Gee.EqualDataFunc get_value_equal_func (); + public Gee.HashDataFunc key_hash_func { get; } + public Gee.EqualDataFunc key_equal_func { get; } + [CCode (notify = false)] + public Gee.HashDataFunc value_hash_func { get; private set; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class HashMultiSet : Gee.AbstractMultiSet { + public HashMultiSet (Gee.HashDataFunc? hash_func = null, Gee.EqualDataFunc? equal_func = null); + public Gee.HashDataFunc hash_func { get; } + public Gee.EqualDataFunc equal_func { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class HashSet : Gee.AbstractSet { + public HashSet (owned Gee.HashDataFunc? hash_func = null, owned Gee.EqualDataFunc? equal_func = null); + public override bool contains (G key); + public override Gee.Iterator iterator (); + public override bool add (G key); + public override bool remove (G key); + public override void clear (); + public override int size { get; } + public override bool read_only { get; } + [CCode (notify = false)] + public Gee.HashDataFunc hash_func { get; private set; } + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + [Compact] + public class HazardPointer { + [Compact] + public class Context { + internal Gee.HazardPointer.Context* _parent; + internal Gee.ArrayList _to_free; + internal Gee.HazardPointer.Policy? _policy; + internal static GLib.StaticPrivate _current_context; + internal static GLib.StaticPrivate _root_context; + public Context (Gee.HazardPointer.Policy? policy = null); + public void try_free (); + public void free_all (); + public void try_release (); + public void release (); + internal void release_ptr (void* ptr, owned Gee.HazardPointer.DestroyNotify notify); + internal static Gee.HazardPointer.Context* get_current_context (); + } + [Compact] + internal class FreeNode { + public void* pointer; + public Gee.HazardPointer.DestroyNotify destroy_notify; + public FreeNode (); + } + [Compact] + internal class Node { + public Gee.HazardPointer.Node* _next; + public int _active; + public void* _hazard; + public Node (); + public void release (); + public bool is_active (); + public bool activate (); + public void @set (void* ptr); + public void* @get (bool safe = true); + public unowned Gee.HazardPointer.Node? get_next (); + public void set_next (Gee.HazardPointer.Node* next); + } + public enum Policy { + DEFAULT, + THREAD_EXIT, + TRY_FREE, + FREE, + TRY_RELEASE, + RELEASE; + public bool is_concrete (); + public bool is_blocking (); + public bool is_safe (); + public Gee.HazardPointer.Policy to_concrete (); + internal Gee.ArrayList? perform (owned Gee.ArrayList to_free); + } + public enum ReleasePolicy { + HELPER_THREAD, + MAIN_LOOP; + internal static void ensure_start (); + } + public delegate void DestroyNotify (void* ptr); + internal weak Gee.HazardPointer.Node _node; + internal static Gee.HazardPointer.Node* _head; + internal static int _default_policy; + internal static int _thread_exit_policy; + internal static int release_policy; + internal static Gee.Queue> _queue; + internal static GLib.StaticMutex _queue_mutex; + internal static Gee.ArrayList _global_to_free; + public HazardPointer (G* ptr); + internal HazardPointer.from_node (Gee.HazardPointer.Node node); + public static Gee.HazardPointer? get_hazard_pointer (G** aptr, size_t mask = 0, out size_t mask_out = null); + public static G get_pointer (G** aptr, size_t mask = 0, out size_t mask_out = null); + public static Gee.HazardPointer? exchange_hazard_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null); + public static void set_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0); + public static G exchange_pointer (G** aptr, owned G new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null); + public static bool compare_and_exchange_pointer (G** aptr, G old_ptr, owned G _new_ptr, size_t mask = 0, size_t old_mask = 0, size_t new_mask = 0); + public new unowned G @get (bool other_thread = false); + public void release (owned Gee.HazardPointer.DestroyNotify notify); + public static void set_default_policy (Gee.HazardPointer.Policy policy); + public static void set_thread_exit_policy (Gee.HazardPointer.Policy policy); + public static bool set_release_policy (Gee.HazardPointer.ReleasePolicy policy); + internal static unowned Gee.HazardPointer.Node acquire (); + internal static bool try_free (Gee.ArrayList to_free); + internal static unowned Gee.HazardPointer.Node? get_head (); + internal static Gee.HazardPointer.DestroyNotify get_destroy_notify (); + } + [CCode (cheader_filename = "gee-internals.h")] + public class Lazy { + public Lazy (owned Gee.LazyFunc func); + public Lazy.from_value (G item); + public void eval (); + public new G @get (); + public G value { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class LinkedList : Gee.AbstractBidirList, Gee.Queue, Gee.Deque { + public LinkedList (owned Gee.EqualDataFunc? equal_func = null); + public override bool @foreach (Gee.ForallFunc f); + public override Gee.Iterator iterator (); + public override Gee.ListIterator list_iterator (); + public override Gee.BidirListIterator bidir_list_iterator (); + public override bool contains (G item); + public override bool add (G item); + public override bool remove (G item); + public override void clear (); + public override G @get (int index); + public override void @set (int index, G item); + public override int index_of (G item); + public override void insert (int index, G item); + public override G remove_at (int index); + public override Gee.List? slice (int start, int stop); + public G first (); + public G last (); + [CCode (notify = false)] + public Gee.EqualDataFunc equal_func { get; private set; } + public override int size { get; } + public override bool read_only { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class PriorityQueue : Gee.AbstractQueue { + public PriorityQueue (owned GLib.CompareDataFunc? compare_func = null); + public bool offer (G element); + public override G peek (); + public override G poll (); + public int drain (Gee.Collection recipient, int amount = -1); + public override bool contains (G item); + public override bool add (G item); + public override bool remove (G item); + public override void clear (); + public override Gee.Iterator iterator (); + [CCode (notify = false)] + public GLib.CompareDataFunc compare_func { get; private set; } + public override int capacity { get; } + public override int remaining_capacity { get; } + public override bool is_full { get; } + public override bool read_only { get; } + public override int size { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyBidirList : Gee.ReadOnlyList, Gee.BidirList { + public ReadOnlyBidirList (Gee.BidirList list); + public virtual Gee.BidirList read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyBidirSortedSet : Gee.ReadOnlySortedSet, Gee.BidirSortedSet { + protected class BidirIterator : Gee.ReadOnlyCollection.Iterator, Gee.BidirIterator { + public BidirIterator (Gee.BidirIterator iterator); + } + public ReadOnlyBidirSortedSet (Gee.BidirSortedSet @set); + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyBidirSortedMap : Gee.ReadOnlySortedMap, Gee.BidirSortedMap { + protected class BidirMapIterator : Gee.ReadOnlyMap.MapIterator, Gee.BidirMapIterator { + public BidirMapIterator (Gee.BidirMapIterator iterator); + } + public ReadOnlyBidirSortedMap (Gee.BidirSortedMap map); + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyCollection : GLib.Object, Gee.Traversable, Gee.Iterable, Gee.Collection { + protected class Iterator : GLib.Object, Gee.Traversable, Gee.Iterator { + protected Gee.Iterator _iter; + public Iterator (Gee.Iterator iterator); + } + protected Gee.Collection _collection; + public ReadOnlyCollection (Gee.Collection collection); + public virtual Gee.Collection read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyList : Gee.ReadOnlyCollection, Gee.List { + protected class Iterator : Gee.ReadOnlyCollection.Iterator, Gee.ListIterator { + public Iterator (Gee.ListIterator iterator); + } + public ReadOnlyList (Gee.List list); + public virtual Gee.List read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyMap : GLib.Object, Gee.Traversable>, Gee.Iterable>, Gee.Map { + internal class MapIterator : GLib.Object, Gee.MapIterator { + protected Gee.MapIterator _iter; + public MapIterator (Gee.MapIterator iterator); + } + protected Gee.Map _map; + public ReadOnlyMap (Gee.Map map); + public bool contains (K key); + public bool remove (K key, out V value = null); + public bool remove_all (Gee.Map map); + public bool contains_all (Gee.Map map); + public virtual Gee.Map read_only_view { owned get; } + public GLib.Type key_type { get; } + public GLib.Type value_type { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyMultiMap : GLib.Object, Gee.MultiMap { + public ReadOnlyMultiMap (Gee.MultiMap multimap); + public virtual Gee.MultiMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlyMultiSet : Gee.ReadOnlyCollection, Gee.MultiSet { + public ReadOnlyMultiSet (Gee.MultiSet multiset); + public virtual Gee.MultiSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlySet : Gee.ReadOnlyCollection, Gee.Set { + public ReadOnlySet (Gee.Set @set); + public virtual Gee.Set read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlySortedMap : Gee.ReadOnlyMap, Gee.SortedMap { + public ReadOnlySortedMap (Gee.Map map); + } + [CCode (cheader_filename = "gee-internals.h")] + internal class ReadOnlySortedSet : Gee.ReadOnlySet, Gee.SortedSet { + public ReadOnlySortedSet (Gee.SortedSet @set); + } + [CCode (cheader_filename = "gee-internals.h")] + internal class TimSort : GLib.Object { + public static void sort (Gee.List list, GLib.CompareDataFunc compare); + public TimSort (); + } + [CCode (cheader_filename = "gee-internals.h")] + public class TreeMap : Gee.AbstractBidirSortedMap { + public TreeMap (owned GLib.CompareDataFunc? key_compare_func = null, owned Gee.EqualDataFunc? value_equal_func = null); + public override bool has_key (K key); + public override bool has (K key, V value); + public override V @get (K key); + public override void @set (K key, V value); + public override bool unset (K key, out V value = null); + public override void clear (); + public override Gee.SortedMap head_map (K before); + public override Gee.SortedMap tail_map (K after); + public override Gee.SortedMap sub_map (K after, K before); + public override Gee.MapIterator map_iterator (); + public override Gee.BidirMapIterator bidir_map_iterator (); + public override int size { get; } + public override bool read_only { get; } + public override Gee.Set keys { owned get; } + public override Gee.Collection values { owned get; } + public override Gee.Set> entries { owned get; } + [CCode (notify = false)] + public GLib.CompareDataFunc key_compare_func { get; private set; } + [CCode (notify = false)] + public Gee.EqualDataFunc value_equal_func { get; private set; } + public override Gee.SortedSet ascending_keys { owned get; } + public override Gee.SortedSet> ascending_entries { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class TreeMultiMap : Gee.AbstractMultiMap { + public TreeMultiMap (owned GLib.CompareDataFunc? key_compare_func = null, owned GLib.CompareDataFunc? value_compare_func = null); + protected override Gee.Collection create_value_storage (); + protected override Gee.MultiSet create_multi_key_set (); + protected override Gee.EqualDataFunc get_value_equal_func (); + public GLib.CompareDataFunc key_compare_func { get; } + [CCode (notify = false)] + public GLib.CompareDataFunc value_compare_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class TreeMultiSet : Gee.AbstractMultiSet { + public TreeMultiSet (owned GLib.CompareDataFunc? compare_func = null); + public GLib.CompareDataFunc compare_func { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public class TreeSet : Gee.AbstractBidirSortedSet { + public TreeSet (owned GLib.CompareDataFunc? compare_func = null); + public override bool contains (G item); + public override bool add (G item); + public override bool remove (G item); + public override void clear (); + public override Gee.Iterator iterator (); + public override Gee.BidirIterator bidir_iterator (); + public override G first (); + public override G last (); + public override Gee.SortedSet head_set (G before); + public override Gee.SortedSet tail_set (G after); + public override Gee.SortedSet sub_set (G after, G before); + public override Gee.Iterator? iterator_at (G item); + public override G lower (G item); + public override G higher (G item); + public override G floor (G item); + public override G ceil (G item); + public override int size { get; } + public override bool read_only { get; } + [CCode (notify = false)] + public GLib.CompareDataFunc compare_func { get; private set; } + } + [CCode (cheader_filename = "gee-internals.h")] + internal class UnfoldIterator : GLib.Object, Gee.Traversable, Gee.Iterator { + public UnfoldIterator (owned Gee.UnfoldFunc func, owned Gee.Lazy? current = null); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirIterator : Gee.Iterator { + public abstract bool previous (); + public abstract bool has_previous (); + public abstract bool first (); + public abstract bool last (); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirList : Gee.List { + public abstract new Gee.BidirListIterator bidir_list_iterator (); + public abstract Gee.BidirList read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirListIterator : Gee.BidirIterator, Gee.ListIterator { + public abstract void insert (G item); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirMapIterator : Gee.MapIterator { + public abstract bool previous (); + public abstract bool has_previous (); + public abstract bool first (); + public abstract bool last (); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirSortedSet : Gee.SortedSet { + public abstract Gee.BidirIterator bidir_iterator (); + public static Gee.BidirSortedSet empty (); + public abstract Gee.BidirSortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface BidirSortedMap : Gee.SortedMap { + public abstract Gee.BidirMapIterator bidir_map_iterator (); + public static Gee.BidirSortedMap empty (); + public abstract Gee.BidirSortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Collection : Gee.Iterable { + public abstract bool contains (G item); + public abstract bool add (G item); + public abstract bool remove (G item); + public abstract void clear (); + public virtual bool add_all (Gee.Collection collection); + public virtual bool contains_all (Gee.Collection collection); + public virtual bool remove_all (Gee.Collection collection); + public virtual bool retain_all (Gee.Collection collection); + public virtual G[] to_array (); + public bool add_all_array (G[] array); + public bool contains_all_array (G[] array); + public bool remove_all_array (G[] array); + public static Gee.Collection empty (); + public abstract int size { get; } + public virtual bool is_empty { get; } + public abstract bool read_only { get; } + public abstract Gee.Collection read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public interface Comparable : GLib.Object { + public abstract int compare_to (G object); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Deque : Gee.Queue { + public abstract bool offer_head (G element); + public abstract G peek_head (); + public abstract G poll_head (); + public abstract int drain_head (Gee.Collection recipient, int amount = -1); + public abstract bool offer_tail (G element); + public abstract G peek_tail (); + public abstract G poll_tail (); + public abstract int drain_tail (Gee.Collection recipient, int amount = -1); + } + [CCode (cheader_filename = "gee-internals.h")] + public interface Hashable : GLib.Object { + public abstract uint hash (); + public abstract bool equal_to (G object); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Iterable : GLib.Object, Gee.Traversable { + public abstract Gee.Iterator iterator (); + } + [CCode (cheader_filename = "gee-internals.h")] + public interface Iterator : GLib.Object, Gee.Traversable { + public abstract bool next (); + public abstract bool has_next (); + public abstract G @get (); + public abstract void remove (); + public static Gee.Iterator unfold (owned Gee.UnfoldFunc f, owned Gee.Lazy? current = null); + public static Gee.Iterator concat (Gee.Iterator> iters); + public abstract bool valid { get; } + public abstract bool read_only { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface List : Gee.Collection { + public abstract new Gee.ListIterator list_iterator (); + public abstract G @get (int index); + public abstract void @set (int index, G item); + public abstract int index_of (G item); + public abstract void insert (int index, G item); + public abstract G remove_at (int index); + public abstract Gee.List? slice (int start, int stop); + public virtual G first (); + public virtual G last (); + public virtual void insert_all (int index, Gee.Collection collection); + public virtual void sort (owned GLib.CompareDataFunc? compare_func = null); + public static Gee.List empty (); + public abstract Gee.List read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public interface ListIterator : Gee.Iterator { + public abstract void @set (G item); + public abstract void add (G item); + public abstract int index (); + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Map : GLib.Object, Gee.Iterable> { + public abstract class Entry : GLib.Object { + public Entry (); + public abstract K key { get; } + public abstract V value { get; set; } + public abstract bool read_only { get; } + } + public abstract bool has_key (K key); + [Deprecated (replacement = "Map.has_key")] + public bool contains (K key); + public abstract bool has (K key, V value); + public abstract V @get (K key); + public abstract void @set (K key, V value); + public abstract bool unset (K key, out V value = null); + [Deprecated (replacement = "Map.unset")] + public bool remove (K key, out V value = null); + public abstract void clear (); + public abstract Gee.MapIterator map_iterator (); + public virtual void set_all (Gee.Map map); + public virtual bool unset_all (Gee.Map map); + [Deprecated (replacement = "Map.unset_all")] + public bool remove_all (Gee.Map map); + public virtual bool has_all (Gee.Map map); + [Deprecated (replacement = "Map.has_all")] + public bool contains_all (Gee.Map map); + public static Gee.Map empty (); + public abstract int size { get; } + public virtual bool is_empty { get; } + public abstract bool read_only { get; } + public abstract Gee.Set keys { owned get; } + public abstract Gee.Collection values { owned get; } + public abstract Gee.Set> entries { owned get; } + public abstract Gee.Map read_only_view { owned get; } + public GLib.Type key_type { get; } + public GLib.Type value_type { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface MapIterator : GLib.Object { + public abstract bool next (); + public abstract bool has_next (); + public abstract K get_key (); + public abstract V get_value (); + public abstract void set_value (V value); + public abstract void unset (); + public virtual A fold (Gee.FoldMapFunc f, owned A seed); + public virtual new bool @foreach (Gee.ForallMapFunc f); + public abstract bool valid { get; } + public abstract bool mutable { get; } + public abstract bool read_only { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface MultiMap : GLib.Object { + public abstract Gee.Set get_keys (); + public abstract Gee.MultiSet get_all_keys (); + public abstract Gee.Collection get_values (); + public abstract bool contains (K key); + public abstract Gee.Collection @get (K key); + public abstract void @set (K key, V value); + public abstract bool remove (K key, V value); + public abstract bool remove_all (K key); + public abstract void clear (); + public abstract Gee.MapIterator map_iterator (); + public abstract int size { get; } + public abstract bool read_only { get; } + public GLib.Type key_type { get; } + public GLib.Type value_type { get; } + public virtual Gee.MultiMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface MultiSet : Gee.Collection { + public abstract int count (G item); + public static Gee.Set empty (); + public virtual Gee.MultiSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Queue : Gee.Collection { + public const int UNBOUNDED_CAPACITY; + public virtual bool offer (G element); + public abstract G peek (); + public abstract G poll (); + public virtual int drain (Gee.Collection recipient, int amount = -1); + public abstract int capacity { get; } + public abstract int remaining_capacity { get; } + public abstract bool is_full { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Set : Gee.Collection { + public static Gee.Set empty (); + public abstract Gee.Set read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public interface SortedMap : Gee.Map { + public abstract Gee.SortedMap head_map (K before); + public abstract Gee.SortedMap tail_map (K after); + public abstract Gee.SortedMap sub_map (K before, K after); + public static Gee.Map empty (); + public abstract Gee.SortedSet ascending_keys { owned get; } + public abstract Gee.SortedSet> ascending_entries { owned get; } + public abstract Gee.SortedMap read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface SortedSet : Gee.Set { + public abstract G first (); + public abstract G last (); + public abstract Gee.Iterator? iterator_at (G element); + public abstract G lower (G element); + public abstract G higher (G element); + public abstract G floor (G element); + public abstract G ceil (G element); + public abstract Gee.SortedSet head_set (G before); + public abstract Gee.SortedSet tail_set (G after); + public abstract Gee.SortedSet sub_set (G from, G to); + public static Gee.SortedSet empty (); + public abstract Gee.SortedSet read_only_view { owned get; } + } + [CCode (cheader_filename = "gee-internals.h")] + [GenericAccessors] + public interface Traversable : GLib.Object { + public enum Stream { + YIELD, + CONTINUE, + END + } + public abstract new bool @foreach (Gee.ForallFunc f); + public virtual Gee.Iterator stream (owned Gee.StreamFunc f); + public virtual A fold (Gee.FoldFunc f, owned A seed); + public virtual Gee.Iterator map (Gee.MapFunc f); + public virtual Gee.Iterator scan (Gee.FoldFunc f, owned A seed); + public virtual Gee.Iterator filter (owned Gee.Predicate pred); + public virtual Gee.Iterator chop (int offset, int length = -1); + public virtual GLib.Type element_type { get; } + } + [CCode (cheader_filename = "gee-internals.h")] + public delegate uint HashDataFunc (T v); + [CCode (cheader_filename = "gee-internals.h")] + public delegate bool EqualDataFunc (T a, T b); + [CCode (cheader_filename = "gee-internals.h")] + public delegate G LazyFunc (); + [CCode (cheader_filename = "gee-internals.h")] + public delegate A FoldMapFunc (K k, V v, owned A a); + [CCode (cheader_filename = "gee-internals.h")] + public delegate bool ForallMapFunc (K k, V v); + [CCode (cheader_filename = "gee-internals.h")] + public delegate A FoldFunc (owned G g, owned A a); + [CCode (cheader_filename = "gee-internals.h")] + public delegate bool ForallFunc (owned G g); + [CCode (cheader_filename = "gee-internals.h")] + public delegate Gee.Lazy? UnfoldFunc (); + [CCode (cheader_filename = "gee-internals.h")] + public delegate Gee.Traversable.Stream StreamFunc (Gee.Traversable.Stream state, owned Gee.Lazy? g, out Gee.Lazy? lazy); + [CCode (cheader_filename = "gee-internals.h")] + public delegate A MapFunc (owned G g); + [CCode (cheader_filename = "gee-internals.h")] + public delegate bool Predicate (G g); +} diff --git a/gee/gee-internals.h b/gee/gee-internals.h new file mode 100644 index 0000000..2731b80 --- /dev/null +++ b/gee/gee-internals.h @@ -0,0 +1,2315 @@ +/* gee-internals.h generated by valac 0.18.0, the Vala compiler, do not modify */ + + +#ifndef __GEE_INTERNALS_H__ +#define __GEE_INTERNALS_H__ + +#include +#include + +G_BEGIN_DECLS + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; +typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; + +#define GEE_TYPE_LIST (gee_list_get_type ()) +#define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList)) +#define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST)) +#define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface)) + +typedef struct _GeeList GeeList; +typedef struct _GeeListIface GeeListIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ()) +#define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList)) +#define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) +#define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) + +typedef struct _GeeAbstractList GeeAbstractList; +typedef struct _GeeAbstractListClass GeeAbstractListClass; +typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; + +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; +typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) +#define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) +#define GEE_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) +#define GEE_IS_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_IS_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_ABSTRACT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) + +typedef struct _GeeAbstractMap GeeAbstractMap; +typedef struct _GeeAbstractMapClass GeeAbstractMapClass; +typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; +typedef struct _GeeAbstractSortedMapPrivate GeeAbstractSortedMapPrivate; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; +typedef struct _GeeAbstractBidirSortedMapPrivate GeeAbstractBidirSortedMapPrivate; + +#define GEE_TYPE_MULTI_MAP (gee_multi_map_get_type ()) +#define GEE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMap)) +#define GEE_IS_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_MAP)) +#define GEE_MULTI_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMapIface)) + +typedef struct _GeeMultiMap GeeMultiMap; +typedef struct _GeeMultiMapIface GeeMultiMapIface; + +#define GEE_TYPE_MULTI_SET (gee_multi_set_get_type ()) +#define GEE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_SET, GeeMultiSet)) +#define GEE_IS_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_SET)) +#define GEE_MULTI_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_SET, GeeMultiSetIface)) + +typedef struct _GeeMultiSet GeeMultiSet; +typedef struct _GeeMultiSetIface GeeMultiSetIface; + +#define GEE_TYPE_ABSTRACT_MULTI_MAP (gee_abstract_multi_map_get_type ()) +#define GEE_ABSTRACT_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap)) +#define GEE_ABSTRACT_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapClass)) +#define GEE_IS_ABSTRACT_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP)) +#define GEE_IS_ABSTRACT_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MULTI_MAP)) +#define GEE_ABSTRACT_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapClass)) + +typedef struct _GeeAbstractMultiMap GeeAbstractMultiMap; +typedef struct _GeeAbstractMultiMapClass GeeAbstractMultiMapClass; +typedef struct _GeeAbstractMultiMapPrivate GeeAbstractMultiMapPrivate; + +#define GEE_TYPE_ABSTRACT_MULTI_SET (gee_abstract_multi_set_get_type ()) +#define GEE_ABSTRACT_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MULTI_SET, GeeAbstractMultiSet)) +#define GEE_ABSTRACT_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MULTI_SET, GeeAbstractMultiSetClass)) +#define GEE_IS_ABSTRACT_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MULTI_SET)) +#define GEE_IS_ABSTRACT_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MULTI_SET)) +#define GEE_ABSTRACT_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MULTI_SET, GeeAbstractMultiSetClass)) + +typedef struct _GeeAbstractMultiSet GeeAbstractMultiSet; +typedef struct _GeeAbstractMultiSetClass GeeAbstractMultiSetClass; +typedef struct _GeeAbstractMultiSetPrivate GeeAbstractMultiSetPrivate; + +#define GEE_TYPE_QUEUE (gee_queue_get_type ()) +#define GEE_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_QUEUE, GeeQueue)) +#define GEE_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_QUEUE)) +#define GEE_QUEUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_QUEUE, GeeQueueIface)) + +typedef struct _GeeQueue GeeQueue; +typedef struct _GeeQueueIface GeeQueueIface; + +#define GEE_TYPE_ABSTRACT_QUEUE (gee_abstract_queue_get_type ()) +#define GEE_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueue)) +#define GEE_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass)) +#define GEE_IS_ABSTRACT_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_QUEUE)) +#define GEE_IS_ABSTRACT_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_QUEUE)) +#define GEE_ABSTRACT_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_QUEUE, GeeAbstractQueueClass)) + +typedef struct _GeeAbstractQueue GeeAbstractQueue; +typedef struct _GeeAbstractQueueClass GeeAbstractQueueClass; +typedef struct _GeeAbstractQueuePrivate GeeAbstractQueuePrivate; + +#define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) +#define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) +#define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) +#define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST)) +#define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST)) +#define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) + +typedef struct _GeeArrayList GeeArrayList; +typedef struct _GeeArrayListClass GeeArrayListClass; +typedef struct _GeeArrayListPrivate GeeArrayListPrivate; + +#define GEE_TYPE_DEQUE (gee_deque_get_type ()) +#define GEE_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_DEQUE, GeeDeque)) +#define GEE_IS_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_DEQUE)) +#define GEE_DEQUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_DEQUE, GeeDequeIface)) + +typedef struct _GeeDeque GeeDeque; +typedef struct _GeeDequeIface GeeDequeIface; + +#define GEE_TYPE_ARRAY_QUEUE (gee_array_queue_get_type ()) +#define GEE_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue)) +#define GEE_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) +#define GEE_IS_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_IS_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_ARRAY_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) + +typedef struct _GeeArrayQueue GeeArrayQueue; +typedef struct _GeeArrayQueueClass GeeArrayQueueClass; +typedef struct _GeeArrayQueuePrivate GeeArrayQueuePrivate; + +#define GEE_TYPE_COMPARABLE (gee_comparable_get_type ()) +#define GEE_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COMPARABLE, GeeComparable)) +#define GEE_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COMPARABLE)) +#define GEE_COMPARABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COMPARABLE, GeeComparableIface)) + +typedef struct _GeeComparable GeeComparable; +typedef struct _GeeComparableIface GeeComparableIface; + +#define GEE_TYPE_CONCURRENT_LIST (gee_concurrent_list_get_type ()) +#define GEE_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList)) +#define GEE_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) +#define GEE_IS_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_IS_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_CONCURRENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) + +typedef struct _GeeConcurrentList GeeConcurrentList; +typedef struct _GeeConcurrentListClass GeeConcurrentListClass; +typedef struct _GeeConcurrentListPrivate GeeConcurrentListPrivate; + +#define GEE_TYPE_CONCURRENT_SET (gee_concurrent_set_get_type ()) +#define GEE_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet)) +#define GEE_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) +#define GEE_IS_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_SET)) +#define GEE_IS_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_SET)) +#define GEE_CONCURRENT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) + +typedef struct _GeeConcurrentSet GeeConcurrentSet; +typedef struct _GeeConcurrentSetClass GeeConcurrentSetClass; +typedef struct _GeeConcurrentSetPrivate GeeConcurrentSetPrivate; + +#define GEE_CONCURRENT_SET_TYPE_RANGE_TYPE (gee_concurrent_set_range_type_get_type ()) + +#define GEE_TYPE_HASHABLE (gee_hashable_get_type ()) +#define GEE_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASHABLE, GeeHashable)) +#define GEE_IS_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASHABLE)) +#define GEE_HASHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_HASHABLE, GeeHashableIface)) + +typedef struct _GeeHashable GeeHashable; +typedef struct _GeeHashableIface GeeHashableIface; + +#define GEE_TYPE_HASH_MAP (gee_hash_map_get_type ()) +#define GEE_HASH_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_MAP, GeeHashMap)) +#define GEE_HASH_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_MAP, GeeHashMapClass)) +#define GEE_IS_HASH_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_MAP)) +#define GEE_IS_HASH_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_MAP)) +#define GEE_HASH_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_MAP, GeeHashMapClass)) + +typedef struct _GeeHashMap GeeHashMap; +typedef struct _GeeHashMapClass GeeHashMapClass; +typedef struct _GeeHashMapPrivate GeeHashMapPrivate; + +#define GEE_TYPE_HASH_MULTI_MAP (gee_hash_multi_map_get_type ()) +#define GEE_HASH_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMap)) +#define GEE_HASH_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMapClass)) +#define GEE_IS_HASH_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_MULTI_MAP)) +#define GEE_IS_HASH_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_MULTI_MAP)) +#define GEE_HASH_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMapClass)) + +typedef struct _GeeHashMultiMap GeeHashMultiMap; +typedef struct _GeeHashMultiMapClass GeeHashMultiMapClass; +typedef struct _GeeHashMultiMapPrivate GeeHashMultiMapPrivate; + +#define GEE_TYPE_HASH_MULTI_SET (gee_hash_multi_set_get_type ()) +#define GEE_HASH_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_MULTI_SET, GeeHashMultiSet)) +#define GEE_HASH_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_MULTI_SET, GeeHashMultiSetClass)) +#define GEE_IS_HASH_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_MULTI_SET)) +#define GEE_IS_HASH_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_MULTI_SET)) +#define GEE_HASH_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_MULTI_SET, GeeHashMultiSetClass)) + +typedef struct _GeeHashMultiSet GeeHashMultiSet; +typedef struct _GeeHashMultiSetClass GeeHashMultiSetClass; +typedef struct _GeeHashMultiSetPrivate GeeHashMultiSetPrivate; + +#define GEE_TYPE_HASH_SET (gee_hash_set_get_type ()) +#define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet)) +#define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass)) +#define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET)) +#define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET)) +#define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass)) + +typedef struct _GeeHashSet GeeHashSet; +typedef struct _GeeHashSetClass GeeHashSetClass; +typedef struct _GeeHashSetPrivate GeeHashSetPrivate; +typedef struct _GeeHazardPointer GeeHazardPointer; +typedef struct _GeeHazardPointerNode GeeHazardPointerNode; + +#define GEE_HAZARD_POINTER_TYPE_POLICY (gee_hazard_pointer_policy_get_type ()) +typedef struct _GeeHazardPointerFreeNode GeeHazardPointerFreeNode; + +#define GEE_HAZARD_POINTER_TYPE_RELEASE_POLICY (gee_hazard_pointer_release_policy_get_type ()) +typedef struct _GeeHazardPointerContext GeeHazardPointerContext; +typedef struct _GeeLazyPrivate GeeLazyPrivate; + +#define GEE_TYPE_LINKED_LIST (gee_linked_list_get_type ()) +#define GEE_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedList)) +#define GEE_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LINKED_LIST, GeeLinkedListClass)) +#define GEE_IS_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LINKED_LIST)) +#define GEE_IS_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LINKED_LIST)) +#define GEE_LINKED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedListClass)) + +typedef struct _GeeLinkedList GeeLinkedList; +typedef struct _GeeLinkedListClass GeeLinkedListClass; +typedef struct _GeeLinkedListPrivate GeeLinkedListPrivate; +typedef struct _GeeMapEntryPrivate GeeMapEntryPrivate; + +#define GEE_TYPE_PRIORITY_QUEUE (gee_priority_queue_get_type ()) +#define GEE_PRIORITY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue)) +#define GEE_PRIORITY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueueClass)) +#define GEE_IS_PRIORITY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_PRIORITY_QUEUE)) +#define GEE_IS_PRIORITY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_PRIORITY_QUEUE)) +#define GEE_PRIORITY_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueueClass)) + +typedef struct _GeePriorityQueue GeePriorityQueue; +typedef struct _GeePriorityQueueClass GeePriorityQueueClass; +typedef struct _GeePriorityQueuePrivate GeePriorityQueuePrivate; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; + +#define GEE_TYPE_READ_ONLY_LIST (gee_read_only_list_get_type ()) +#define GEE_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyList)) +#define GEE_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) +#define GEE_IS_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_IS_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_READ_ONLY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) + +typedef struct _GeeReadOnlyList GeeReadOnlyList; +typedef struct _GeeReadOnlyListClass GeeReadOnlyListClass; +typedef struct _GeeReadOnlyListPrivate GeeReadOnlyListPrivate; + +#define GEE_TYPE_READ_ONLY_BIDIR_LIST (gee_read_only_bidir_list_get_type ()) +#define GEE_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirList)) +#define GEE_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) +#define GEE_IS_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_IS_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_READ_ONLY_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) + +typedef struct _GeeReadOnlyBidirList GeeReadOnlyBidirList; +typedef struct _GeeReadOnlyBidirListClass GeeReadOnlyBidirListClass; +typedef struct _GeeReadOnlyBidirListPrivate GeeReadOnlyBidirListPrivate; + +#define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ()) +#define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet)) +#define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) +#define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET)) +#define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET)) +#define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) + +typedef struct _GeeReadOnlySet GeeReadOnlySet; +typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; +typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate; + +#define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ()) +#define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet)) +#define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) +#define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) + +typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet; +typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass; +typedef struct _GeeReadOnlySortedSetPrivate GeeReadOnlySortedSetPrivate; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET (gee_read_only_bidir_sorted_set_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSet)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) + +typedef struct _GeeReadOnlyBidirSortedSet GeeReadOnlyBidirSortedSet; +typedef struct _GeeReadOnlyBidirSortedSetClass GeeReadOnlyBidirSortedSetClass; +typedef struct _GeeReadOnlyBidirSortedSetPrivate GeeReadOnlyBidirSortedSetPrivate; + +#define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ()) +#define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) + +typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator; +typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass; +typedef struct _GeeReadOnlyCollectionIteratorPrivate GeeReadOnlyCollectionIteratorPrivate; + +#define GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR (gee_read_only_bidir_sorted_set_bidir_iterator_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIterator)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIteratorClass)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_IS_BIDIR_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIteratorClass)) + +typedef struct _GeeReadOnlyBidirSortedSetBidirIterator GeeReadOnlyBidirSortedSetBidirIterator; +typedef struct _GeeReadOnlyBidirSortedSetBidirIteratorClass GeeReadOnlyBidirSortedSetBidirIteratorClass; +typedef struct _GeeReadOnlyBidirSortedSetBidirIteratorPrivate GeeReadOnlyBidirSortedSetBidirIteratorPrivate; + +#define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ()) +#define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap)) +#define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) +#define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) + +typedef struct _GeeReadOnlyMap GeeReadOnlyMap; +typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; +typedef struct _GeeReadOnlyMapPrivate GeeReadOnlyMapPrivate; + +#define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ()) +#define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap)) +#define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) +#define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) + +typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap; +typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass; +typedef struct _GeeReadOnlySortedMapPrivate GeeReadOnlySortedMapPrivate; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP (gee_read_only_bidir_sorted_map_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMap)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) + +typedef struct _GeeReadOnlyBidirSortedMap GeeReadOnlyBidirSortedMap; +typedef struct _GeeReadOnlyBidirSortedMapClass GeeReadOnlyBidirSortedMapClass; +typedef struct _GeeReadOnlyBidirSortedMapPrivate GeeReadOnlyBidirSortedMapPrivate; + +#define GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR (gee_read_only_map_map_iterator_get_type ()) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIterator)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) + +typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator; +typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass; +typedef struct _GeeReadOnlyMapMapIteratorPrivate GeeReadOnlyMapMapIteratorPrivate; + +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR (gee_read_only_bidir_sorted_map_bidir_map_iterator_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIterator)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIteratorClass)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_IS_BIDIR_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIteratorClass)) + +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIterator GeeReadOnlyBidirSortedMapBidirMapIterator; +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIteratorClass GeeReadOnlyBidirSortedMapBidirMapIteratorClass; +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate; + +#define GEE_READ_ONLY_LIST_TYPE_ITERATOR (gee_read_only_list_iterator_get_type ()) +#define GEE_READ_ONLY_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIterator)) +#define GEE_READ_ONLY_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIteratorClass)) +#define GEE_READ_ONLY_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIteratorClass)) + +typedef struct _GeeReadOnlyListIterator GeeReadOnlyListIterator; +typedef struct _GeeReadOnlyListIteratorClass GeeReadOnlyListIteratorClass; +typedef struct _GeeReadOnlyListIteratorPrivate GeeReadOnlyListIteratorPrivate; + +#define GEE_TYPE_READ_ONLY_MULTI_MAP (gee_read_only_multi_map_get_type ()) +#define GEE_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap)) +#define GEE_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) +#define GEE_IS_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_IS_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_READ_ONLY_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) + +typedef struct _GeeReadOnlyMultiMap GeeReadOnlyMultiMap; +typedef struct _GeeReadOnlyMultiMapClass GeeReadOnlyMultiMapClass; +typedef struct _GeeReadOnlyMultiMapPrivate GeeReadOnlyMultiMapPrivate; + +#define GEE_TYPE_READ_ONLY_MULTI_SET (gee_read_only_multi_set_get_type ()) +#define GEE_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet)) +#define GEE_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) +#define GEE_IS_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_IS_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_READ_ONLY_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) + +typedef struct _GeeReadOnlyMultiSet GeeReadOnlyMultiSet; +typedef struct _GeeReadOnlyMultiSetClass GeeReadOnlyMultiSetClass; +typedef struct _GeeReadOnlyMultiSetPrivate GeeReadOnlyMultiSetPrivate; + +#define GEE_TYPE_TIM_SORT (gee_tim_sort_get_type ()) +#define GEE_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TIM_SORT, GeeTimSort)) +#define GEE_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TIM_SORT, GeeTimSortClass)) +#define GEE_IS_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TIM_SORT)) +#define GEE_IS_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TIM_SORT)) +#define GEE_TIM_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TIM_SORT, GeeTimSortClass)) + +typedef struct _GeeTimSort GeeTimSort; +typedef struct _GeeTimSortClass GeeTimSortClass; +typedef struct _GeeTimSortPrivate GeeTimSortPrivate; + +#define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) +#define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) +#define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) +#define GEE_IS_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_MAP)) +#define GEE_IS_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_MAP)) +#define GEE_TREE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) + +typedef struct _GeeTreeMap GeeTreeMap; +typedef struct _GeeTreeMapClass GeeTreeMapClass; +typedef struct _GeeTreeMapPrivate GeeTreeMapPrivate; + +#define GEE_TYPE_TREE_MULTI_MAP (gee_tree_multi_map_get_type ()) +#define GEE_TREE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMap)) +#define GEE_TREE_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMapClass)) +#define GEE_IS_TREE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_MULTI_MAP)) +#define GEE_IS_TREE_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_MULTI_MAP)) +#define GEE_TREE_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMapClass)) + +typedef struct _GeeTreeMultiMap GeeTreeMultiMap; +typedef struct _GeeTreeMultiMapClass GeeTreeMultiMapClass; +typedef struct _GeeTreeMultiMapPrivate GeeTreeMultiMapPrivate; + +#define GEE_TYPE_TREE_MULTI_SET (gee_tree_multi_set_get_type ()) +#define GEE_TREE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MULTI_SET, GeeTreeMultiSet)) +#define GEE_TREE_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MULTI_SET, GeeTreeMultiSetClass)) +#define GEE_IS_TREE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_MULTI_SET)) +#define GEE_IS_TREE_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_MULTI_SET)) +#define GEE_TREE_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_MULTI_SET, GeeTreeMultiSetClass)) + +typedef struct _GeeTreeMultiSet GeeTreeMultiSet; +typedef struct _GeeTreeMultiSetClass GeeTreeMultiSetClass; +typedef struct _GeeTreeMultiSetPrivate GeeTreeMultiSetPrivate; + +#define GEE_TYPE_TREE_SET (gee_tree_set_get_type ()) +#define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet)) +#define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass)) +#define GEE_IS_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_SET)) +#define GEE_IS_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_SET)) +#define GEE_TREE_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_SET, GeeTreeSetClass)) + +typedef struct _GeeTreeSet GeeTreeSet; +typedef struct _GeeTreeSetClass GeeTreeSetClass; +typedef struct _GeeTreeSetPrivate GeeTreeSetPrivate; + +#define GEE_TYPE_UNFOLD_ITERATOR (gee_unfold_iterator_get_type ()) +#define GEE_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator)) +#define GEE_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) +#define GEE_IS_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_IS_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_UNFOLD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) + +typedef struct _GeeUnfoldIterator GeeUnfoldIterator; +typedef struct _GeeUnfoldIteratorClass GeeUnfoldIteratorClass; +typedef struct _GeeUnfoldIteratorPrivate GeeUnfoldIteratorPrivate; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeAbstractCollection { + GObject parent_instance; + GeeAbstractCollectionPrivate * priv; +}; + +struct _GeeAbstractCollectionClass { + GObjectClass parent_class; + gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); + gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); + void (*clear) (GeeAbstractCollection* self); + GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); + gint (*get_size) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); + GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); + GeeListIterator* (*list_iterator) (GeeList* self); + gpointer (*get) (GeeList* self, gint index); + void (*set) (GeeList* self, gint index, gconstpointer item); + gint (*index_of) (GeeList* self, gconstpointer item); + void (*insert) (GeeList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeList* self, gint index); + GeeList* (*slice) (GeeList* self, gint start, gint stop); + gpointer (*first) (GeeList* self); + gpointer (*last) (GeeList* self); + void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); + GeeList* (*get_read_only_view) (GeeList* self); +}; + +struct _GeeAbstractList { + GeeAbstractCollection parent_instance; + GeeAbstractListPrivate * priv; +}; + +struct _GeeAbstractListClass { + GeeAbstractCollectionClass parent_class; + GeeListIterator* (*list_iterator) (GeeAbstractList* self); + gpointer (*get) (GeeAbstractList* self, gint index); + void (*set) (GeeAbstractList* self, gint index, gconstpointer item); + gint (*index_of) (GeeAbstractList* self, gconstpointer item); + void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeAbstractList* self, gint index); + GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); + GeeList* (*get_read_only_view) (GeeAbstractList* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { + GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeAbstractSet { + GeeAbstractCollection parent_instance; + GeeAbstractSetPrivate * priv; +}; + +struct _GeeAbstractSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); + GeeSet* (*get_read_only_view) (GeeAbstractSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeAbstractSortedSet { + GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSet { + GeeAbstractSortedSet parent_instance; + GeeAbstractBidirSortedSetPrivate * priv; +}; + +struct _GeeAbstractBidirSortedSetClass { + GeeAbstractSortedSetClass parent_class; + GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self); + void (*reserved0) (GeeAbstractBidirSortedSet* self); + void (*reserved1) (GeeAbstractBidirSortedSet* self); + void (*reserved2) (GeeAbstractBidirSortedSet* self); + void (*reserved3) (GeeAbstractBidirSortedSet* self); + void (*reserved4) (GeeAbstractBidirSortedSet* self); + void (*reserved5) (GeeAbstractBidirSortedSet* self); + void (*reserved6) (GeeAbstractBidirSortedSet* self); + void (*reserved7) (GeeAbstractBidirSortedSet* self); + void (*reserved8) (GeeAbstractBidirSortedSet* self); + void (*reserved9) (GeeAbstractBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeAbstractMap { + GObject parent_instance; + GeeAbstractMapPrivate * priv; +}; + +struct _GeeAbstractMapClass { + GObjectClass parent_class; + gboolean (*has_key) (GeeAbstractMap* self, gconstpointer key); + gboolean (*has) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeAbstractMap* self, gconstpointer key); + void (*set) (GeeAbstractMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); + GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); + void (*clear) (GeeAbstractMap* self); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); + gint (*get_size) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); + GeeSet* (*get_keys) (GeeAbstractMap* self); + GeeCollection* (*get_values) (GeeAbstractMap* self); + GeeSet* (*get_entries) (GeeAbstractMap* self); + GeeMap* (*get_read_only_view) (GeeAbstractMap* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeAbstractSortedMap { + GeeAbstractMap parent_instance; + GeeAbstractSortedMapPrivate * priv; +}; + +struct _GeeAbstractSortedMapClass { + GeeAbstractMapClass parent_class; + GeeSortedMap* (*head_map) (GeeAbstractSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeAbstractSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); + void (*reserved0) (GeeAbstractSortedMap* self); + void (*reserved1) (GeeAbstractSortedMap* self); + void (*reserved2) (GeeAbstractSortedMap* self); + void (*reserved3) (GeeAbstractSortedMap* self); + void (*reserved4) (GeeAbstractSortedMap* self); + void (*reserved5) (GeeAbstractSortedMap* self); + void (*reserved6) (GeeAbstractSortedMap* self); + void (*reserved7) (GeeAbstractSortedMap* self); + void (*reserved8) (GeeAbstractSortedMap* self); + void (*reserved9) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_keys) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeAbstractSortedMap* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +struct _GeeAbstractBidirSortedMap { + GeeAbstractSortedMap parent_instance; + GeeAbstractBidirSortedMapPrivate * priv; +}; + +struct _GeeAbstractBidirSortedMapClass { + GeeAbstractSortedMapClass parent_class; + GeeBidirMapIterator* (*bidir_map_iterator) (GeeAbstractBidirSortedMap* self); + void (*reserved0) (GeeAbstractBidirSortedMap* self); + void (*reserved1) (GeeAbstractBidirSortedMap* self); + void (*reserved2) (GeeAbstractBidirSortedMap* self); + void (*reserved3) (GeeAbstractBidirSortedMap* self); + void (*reserved4) (GeeAbstractBidirSortedMap* self); + void (*reserved5) (GeeAbstractBidirSortedMap* self); + void (*reserved6) (GeeAbstractBidirSortedMap* self); + void (*reserved7) (GeeAbstractBidirSortedMap* self); + void (*reserved8) (GeeAbstractBidirSortedMap* self); + void (*reserved9) (GeeAbstractBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeAbstractBidirSortedMap* self); +}; + +struct _GeeMultiSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); + gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +struct _GeeMultiMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); + GeeSet* (*get_keys) (GeeMultiMap* self); + GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); + GeeCollection* (*get_values) (GeeMultiMap* self); + gboolean (*contains) (GeeMultiMap* self, gconstpointer key); + GeeCollection* (*get) (GeeMultiMap* self, gconstpointer key); + void (*set) (GeeMultiMap* self, gconstpointer key, gconstpointer value); + gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); + gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); + void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); + gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); +}; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeAbstractMultiMap { + GObject parent_instance; + GeeAbstractMultiMapPrivate * priv; + GeeMap* _storage_map; +}; + +struct _GeeAbstractMultiMapClass { + GObjectClass parent_class; + GeeCollection* (*create_value_storage) (GeeAbstractMultiMap* self); + GeeMultiSet* (*create_multi_key_set) (GeeAbstractMultiMap* self); + GeeEqualDataFunc (*get_value_equal_func) (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); + void (*reserved0) (GeeAbstractMultiMap* self); + void (*reserved1) (GeeAbstractMultiMap* self); + void (*reserved2) (GeeAbstractMultiMap* self); + void (*reserved3) (GeeAbstractMultiMap* self); + void (*reserved4) (GeeAbstractMultiMap* self); + void (*reserved5) (GeeAbstractMultiMap* self); + void (*reserved6) (GeeAbstractMultiMap* self); + void (*reserved7) (GeeAbstractMultiMap* self); + void (*reserved8) (GeeAbstractMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeAbstractMultiMap* self); +}; + +struct _GeeAbstractMultiSet { + GeeAbstractCollection parent_instance; + GeeAbstractMultiSetPrivate * priv; + GeeMap* _storage_map; +}; + +struct _GeeAbstractMultiSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractMultiSet* self); + void (*reserved1) (GeeAbstractMultiSet* self); + void (*reserved2) (GeeAbstractMultiSet* self); + void (*reserved3) (GeeAbstractMultiSet* self); + void (*reserved4) (GeeAbstractMultiSet* self); + void (*reserved5) (GeeAbstractMultiSet* self); + void (*reserved6) (GeeAbstractMultiSet* self); + void (*reserved7) (GeeAbstractMultiSet* self); + void (*reserved8) (GeeAbstractMultiSet* self); + GeeMultiSet* (*get_read_only_view) (GeeAbstractMultiSet* self); +}; + +struct _GeeQueueIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); + gboolean (*offer) (GeeQueue* self, gconstpointer element); + gpointer (*peek) (GeeQueue* self); + gpointer (*poll) (GeeQueue* self); + gint (*drain) (GeeQueue* self, GeeCollection* recipient, gint amount); + gint (*get_capacity) (GeeQueue* self); + gint (*get_remaining_capacity) (GeeQueue* self); + gboolean (*get_is_full) (GeeQueue* self); +}; + +struct _GeeAbstractQueue { + GeeAbstractCollection parent_instance; + GeeAbstractQueuePrivate * priv; +}; + +struct _GeeAbstractQueueClass { + GeeAbstractCollectionClass parent_class; + gpointer (*peek) (GeeAbstractQueue* self); + gpointer (*poll) (GeeAbstractQueue* self); + void (*reserved0) (GeeAbstractQueue* self); + void (*reserved1) (GeeAbstractQueue* self); + void (*reserved2) (GeeAbstractQueue* self); + void (*reserved3) (GeeAbstractQueue* self); + void (*reserved4) (GeeAbstractQueue* self); + void (*reserved5) (GeeAbstractQueue* self); + void (*reserved6) (GeeAbstractQueue* self); + void (*reserved7) (GeeAbstractQueue* self); + void (*reserved8) (GeeAbstractQueue* self); + void (*reserved9) (GeeAbstractQueue* self); + gint (*get_capacity) (GeeAbstractQueue* self); + gint (*get_remaining_capacity) (GeeAbstractQueue* self); + gboolean (*get_is_full) (GeeAbstractQueue* self); +}; + +struct _GeeArrayList { + GeeAbstractBidirList parent_instance; + GeeArrayListPrivate * priv; + gpointer* _items; + gint _items_length1; + gint __items_size_; + gint _size; +}; + +struct _GeeArrayListClass { + GeeAbstractBidirListClass parent_class; +}; + +struct _GeeDequeIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeDeque* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeDeque* self); + GDestroyNotify (*get_g_destroy_func) (GeeDeque* self); + gboolean (*offer_head) (GeeDeque* self, gconstpointer element); + gpointer (*peek_head) (GeeDeque* self); + gpointer (*poll_head) (GeeDeque* self); + gint (*drain_head) (GeeDeque* self, GeeCollection* recipient, gint amount); + gboolean (*offer_tail) (GeeDeque* self, gconstpointer element); + gpointer (*peek_tail) (GeeDeque* self); + gpointer (*poll_tail) (GeeDeque* self); + gint (*drain_tail) (GeeDeque* self, GeeCollection* recipient, gint amount); +}; + +struct _GeeArrayQueue { + GeeAbstractQueue parent_instance; + GeeArrayQueuePrivate * priv; +}; + +struct _GeeArrayQueueClass { + GeeAbstractQueueClass parent_class; +}; + +struct _GeeComparableIface { + GTypeInterface parent_iface; + gint (*compare_to) (GeeComparable* self, gconstpointer object); +}; + +struct _GeeConcurrentList { + GeeAbstractList parent_instance; + GeeConcurrentListPrivate * priv; +}; + +struct _GeeConcurrentListClass { + GeeAbstractListClass parent_class; +}; + +struct _GeeConcurrentSet { + GeeAbstractSortedSet parent_instance; + GeeConcurrentSetPrivate * priv; +}; + +struct _GeeConcurrentSetClass { + GeeAbstractSortedSetClass parent_class; +}; + +typedef enum { + GEE_CONCURRENT_SET_RANGE_TYPE_HEAD, + GEE_CONCURRENT_SET_RANGE_TYPE_TAIL, + GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED, + GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY +} GeeConcurrentSetRangeType; + +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +struct _GeeHashableIface { + GTypeInterface parent_iface; + guint (*hash) (GeeHashable* self); + gboolean (*equal_to) (GeeHashable* self, gconstpointer object); +}; + +struct _GeeHashMap { + GeeAbstractMap parent_instance; + GeeHashMapPrivate * priv; +}; + +struct _GeeHashMapClass { + GeeAbstractMapClass parent_class; +}; + +struct _GeeHashMultiMap { + GeeAbstractMultiMap parent_instance; + GeeHashMultiMapPrivate * priv; +}; + +struct _GeeHashMultiMapClass { + GeeAbstractMultiMapClass parent_class; +}; + +struct _GeeHashMultiSet { + GeeAbstractMultiSet parent_instance; + GeeHashMultiSetPrivate * priv; +}; + +struct _GeeHashMultiSetClass { + GeeAbstractMultiSetClass parent_class; +}; + +struct _GeeHashSet { + GeeAbstractSet parent_instance; + GeeHashSetPrivate * priv; +}; + +struct _GeeHashSetClass { + GeeAbstractSetClass parent_class; +}; + +struct _GeeHazardPointer { + GeeHazardPointerNode* _node; +}; + +typedef enum { + GEE_HAZARD_POINTER_POLICY_DEFAULT, + GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, + GEE_HAZARD_POINTER_POLICY_TRY_FREE, + GEE_HAZARD_POINTER_POLICY_FREE, + GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, + GEE_HAZARD_POINTER_POLICY_RELEASE +} GeeHazardPointerPolicy; + +typedef enum { + GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD, + GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP +} GeeHazardPointerReleasePolicy; + +typedef void (*GeeHazardPointerDestroyNotify) (void* ptr, void* user_data); +struct _GeeHazardPointerContext { + GeeHazardPointerContext* _parent; + GeeArrayList* _to_free; + GeeHazardPointerPolicy* _policy; +}; + +struct _GeeHazardPointerFreeNode { + void* pointer; + GeeHazardPointerDestroyNotify destroy_notify; + gpointer destroy_notify_target; + GDestroyNotify destroy_notify_target_destroy_notify; +}; + +struct _GeeHazardPointerNode { + GeeHazardPointerNode* _next; + gint _active; + void* _hazard; +}; + +typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data); +typedef gpointer (*GeeLazyFunc) (void* user_data); +struct _GeeLazy { + GTypeInstance parent_instance; + volatile int ref_count; + GeeLazyPrivate * priv; +}; + +struct _GeeLazyClass { + GTypeClass parent_class; + void (*finalize) (GeeLazy *self); +}; + +struct _GeeLinkedList { + GeeAbstractBidirList parent_instance; + GeeLinkedListPrivate * priv; +}; + +struct _GeeLinkedListClass { + GeeAbstractBidirListClass parent_class; +}; + +struct _GeeMapEntry { + GObject parent_instance; + GeeMapEntryPrivate * priv; +}; + +struct _GeeMapEntryClass { + GObjectClass parent_class; + gconstpointer (*get_key) (GeeMapEntry* self); + gconstpointer (*get_value) (GeeMapEntry* self); + void (*set_value) (GeeMapEntry* self, gconstpointer value); + gboolean (*get_read_only) (GeeMapEntry* self); +}; + +struct _GeePriorityQueue { + GeeAbstractQueue parent_instance; + GeePriorityQueuePrivate * priv; +}; + +struct _GeePriorityQueueClass { + GeeAbstractQueueClass parent_class; +}; + +struct _GeeReadOnlyCollection { + GObject parent_instance; + GeeReadOnlyCollectionPrivate * priv; + GeeCollection* _collection; +}; + +struct _GeeReadOnlyCollectionClass { + GObjectClass parent_class; + GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); +}; + +struct _GeeReadOnlyList { + GeeReadOnlyCollection parent_instance; + GeeReadOnlyListPrivate * priv; +}; + +struct _GeeReadOnlyListClass { + GeeReadOnlyCollectionClass parent_class; + GeeList* (*get_read_only_view) (GeeReadOnlyList* self); +}; + +struct _GeeReadOnlyBidirList { + GeeReadOnlyList parent_instance; + GeeReadOnlyBidirListPrivate * priv; +}; + +struct _GeeReadOnlyBidirListClass { + GeeReadOnlyListClass parent_class; + GeeBidirList* (*get_read_only_view) (GeeReadOnlyBidirList* self); +}; + +struct _GeeReadOnlySet { + GeeReadOnlyCollection parent_instance; + GeeReadOnlySetPrivate * priv; +}; + +struct _GeeReadOnlySetClass { + GeeReadOnlyCollectionClass parent_class; + GeeSet* (*get_read_only_view) (GeeReadOnlySet* self); +}; + +struct _GeeReadOnlySortedSet { + GeeReadOnlySet parent_instance; + GeeReadOnlySortedSetPrivate * priv; +}; + +struct _GeeReadOnlySortedSetClass { + GeeReadOnlySetClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedSet { + GeeReadOnlySortedSet parent_instance; + GeeReadOnlyBidirSortedSetPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedSetClass { + GeeReadOnlySortedSetClass parent_class; +}; + +struct _GeeReadOnlyCollectionIterator { + GObject parent_instance; + GeeReadOnlyCollectionIteratorPrivate * priv; + GeeIterator* _iter; +}; + +struct _GeeReadOnlyCollectionIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedSetBidirIterator { + GeeReadOnlyCollectionIterator parent_instance; + GeeReadOnlyBidirSortedSetBidirIteratorPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedSetBidirIteratorClass { + GeeReadOnlyCollectionIteratorClass parent_class; +}; + +struct _GeeReadOnlyMap { + GObject parent_instance; + GeeReadOnlyMapPrivate * priv; + GeeMap* _map; +}; + +struct _GeeReadOnlyMapClass { + GObjectClass parent_class; + GeeMap* (*get_read_only_view) (GeeReadOnlyMap* self); +}; + +struct _GeeReadOnlySortedMap { + GeeReadOnlyMap parent_instance; + GeeReadOnlySortedMapPrivate * priv; +}; + +struct _GeeReadOnlySortedMapClass { + GeeReadOnlyMapClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedMap { + GeeReadOnlySortedMap parent_instance; + GeeReadOnlyBidirSortedMapPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedMapClass { + GeeReadOnlySortedMapClass parent_class; +}; + +struct _GeeReadOnlyMapMapIterator { + GObject parent_instance; + GeeReadOnlyMapMapIteratorPrivate * priv; + GeeMapIterator* _iter; +}; + +struct _GeeReadOnlyMapMapIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedMapBidirMapIterator { + GeeReadOnlyMapMapIterator parent_instance; + GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedMapBidirMapIteratorClass { + GeeReadOnlyMapMapIteratorClass parent_class; +}; + +struct _GeeReadOnlyListIterator { + GeeReadOnlyCollectionIterator parent_instance; + GeeReadOnlyListIteratorPrivate * priv; +}; + +struct _GeeReadOnlyListIteratorClass { + GeeReadOnlyCollectionIteratorClass parent_class; +}; + +struct _GeeReadOnlyMultiMap { + GObject parent_instance; + GeeReadOnlyMultiMapPrivate * priv; +}; + +struct _GeeReadOnlyMultiMapClass { + GObjectClass parent_class; + GeeMultiMap* (*get_read_only_view) (GeeReadOnlyMultiMap* self); +}; + +struct _GeeReadOnlyMultiSet { + GeeReadOnlyCollection parent_instance; + GeeReadOnlyMultiSetPrivate * priv; +}; + +struct _GeeReadOnlyMultiSetClass { + GeeReadOnlyCollectionClass parent_class; + GeeMultiSet* (*get_read_only_view) (GeeReadOnlyMultiSet* self); +}; + +struct _GeeTimSort { + GObject parent_instance; + GeeTimSortPrivate * priv; +}; + +struct _GeeTimSortClass { + GObjectClass parent_class; +}; + +struct _GeeTreeMap { + GeeAbstractBidirSortedMap parent_instance; + GeeTreeMapPrivate * priv; +}; + +struct _GeeTreeMapClass { + GeeAbstractBidirSortedMapClass parent_class; +}; + +struct _GeeTreeMultiMap { + GeeAbstractMultiMap parent_instance; + GeeTreeMultiMapPrivate * priv; +}; + +struct _GeeTreeMultiMapClass { + GeeAbstractMultiMapClass parent_class; +}; + +struct _GeeTreeMultiSet { + GeeAbstractMultiSet parent_instance; + GeeTreeMultiSetPrivate * priv; +}; + +struct _GeeTreeMultiSetClass { + GeeAbstractMultiSetClass parent_class; +}; + +struct _GeeTreeSet { + GeeAbstractBidirSortedSet parent_instance; + GeeTreeSetPrivate * priv; +}; + +struct _GeeTreeSetClass { + GeeAbstractBidirSortedSetClass parent_class; +}; + +struct _GeeUnfoldIterator { + GObject parent_instance; + GeeUnfoldIteratorPrivate * priv; +}; + +struct _GeeUnfoldIteratorClass { + GObjectClass parent_class; +}; + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; +GeeBidirListIterator* gee_abstract_bidir_list_bidir_list_iterator (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved0 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved1 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved2 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved3 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved4 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved5 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved6 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved7 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved8 (GeeAbstractBidirList* self); +void gee_abstract_bidir_list_reserved9 (GeeAbstractBidirList* self); +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirList* gee_abstract_bidir_list_get_read_only_view (GeeAbstractBidirList* self); +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GeeBidirIterator* gee_abstract_bidir_sorted_set_bidir_iterator (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved0 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved1 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved2 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved3 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved4 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved5 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved6 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved7 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved8 (GeeAbstractBidirSortedSet* self); +void gee_abstract_bidir_sorted_set_reserved9 (GeeAbstractBidirSortedSet* self); +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self); +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GeeBidirMapIterator* gee_abstract_bidir_sorted_map_bidir_map_iterator (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved0 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved1 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved2 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved3 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved4 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved5 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved6 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved7 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved8 (GeeAbstractBidirSortedMap* self); +void gee_abstract_bidir_sorted_map_reserved9 (GeeAbstractBidirSortedMap* self); +GeeAbstractBidirSortedMap* gee_abstract_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self); +gboolean gee_abstract_collection_contains (GeeAbstractCollection* self, gconstpointer item); +gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); +gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpointer item); +void gee_abstract_collection_clear (GeeAbstractCollection* self); +GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); +void gee_abstract_collection_reserved0 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved1 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved2 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved3 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved4 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved5 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved6 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved7 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved8 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved9 (GeeAbstractCollection* self); +GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); +GeeCollection* gee_abstract_collection_get_read_only_view (GeeAbstractCollection* self); +GeeListIterator* gee_abstract_list_list_iterator (GeeAbstractList* self); +gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); +void gee_abstract_list_set (GeeAbstractList* self, gint index, gconstpointer item); +gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item); +void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item); +gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index); +GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop); +void gee_abstract_list_reserved0 (GeeAbstractList* self); +void gee_abstract_list_reserved1 (GeeAbstractList* self); +void gee_abstract_list_reserved2 (GeeAbstractList* self); +void gee_abstract_list_reserved3 (GeeAbstractList* self); +void gee_abstract_list_reserved4 (GeeAbstractList* self); +void gee_abstract_list_reserved5 (GeeAbstractList* self); +void gee_abstract_list_reserved6 (GeeAbstractList* self); +void gee_abstract_list_reserved7 (GeeAbstractList* self); +void gee_abstract_list_reserved8 (GeeAbstractList* self); +void gee_abstract_list_reserved9 (GeeAbstractList* self); +GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self); +gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); +gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); +gpointer gee_abstract_map_get (GeeAbstractMap* self, gconstpointer key); +void gee_abstract_map_set (GeeAbstractMap* self, gconstpointer key, gconstpointer value); +gboolean gee_abstract_map_unset (GeeAbstractMap* self, gconstpointer key, gpointer* value); +GeeMapIterator* gee_abstract_map_map_iterator (GeeAbstractMap* self); +void gee_abstract_map_clear (GeeAbstractMap* self); +gboolean gee_abstract_map_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_abstract_map_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +void gee_abstract_map_reserved0 (GeeAbstractMap* self); +void gee_abstract_map_reserved1 (GeeAbstractMap* self); +void gee_abstract_map_reserved2 (GeeAbstractMap* self); +void gee_abstract_map_reserved3 (GeeAbstractMap* self); +void gee_abstract_map_reserved4 (GeeAbstractMap* self); +void gee_abstract_map_reserved5 (GeeAbstractMap* self); +void gee_abstract_map_reserved6 (GeeAbstractMap* self); +void gee_abstract_map_reserved7 (GeeAbstractMap* self); +void gee_abstract_map_reserved8 (GeeAbstractMap* self); +void gee_abstract_map_reserved9 (GeeAbstractMap* self); +GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +gint gee_abstract_map_get_size (GeeAbstractMap* self); +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self); +GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); +GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); +GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); +GeeMap* gee_abstract_map_get_read_only_view (GeeAbstractMap* self); +GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_multi_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_multi_map_get_type (void) G_GNUC_CONST; +GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* storage_map); +GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self); +GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self); +GeeEqualDataFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); +void gee_abstract_multi_map_reserved0 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved1 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved2 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved3 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved4 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved5 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved6 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved7 (GeeAbstractMultiMap* self); +void gee_abstract_multi_map_reserved8 (GeeAbstractMultiMap* self); +GeeMultiMap* gee_abstract_multi_map_get_read_only_view (GeeAbstractMultiMap* self); +GType gee_abstract_multi_set_get_type (void) G_GNUC_CONST; +GeeAbstractMultiSet* gee_abstract_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMap* storage_map); +void gee_abstract_multi_set_reserved0 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved1 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved2 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved3 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved4 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved5 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved6 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved7 (GeeAbstractMultiSet* self); +void gee_abstract_multi_set_reserved8 (GeeAbstractMultiSet* self); +GeeMultiSet* gee_abstract_multi_set_get_read_only_view (GeeAbstractMultiSet* self); +GType gee_queue_get_type (void) G_GNUC_CONST; +GType gee_abstract_queue_get_type (void) G_GNUC_CONST; +gpointer gee_abstract_queue_peek (GeeAbstractQueue* self); +gpointer gee_abstract_queue_poll (GeeAbstractQueue* self); +void gee_abstract_queue_reserved0 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved1 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved2 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved3 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved4 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved5 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved6 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved7 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved8 (GeeAbstractQueue* self); +void gee_abstract_queue_reserved9 (GeeAbstractQueue* self); +GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self); +gint gee_abstract_queue_get_remaining_capacity (GeeAbstractQueue* self); +gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self); +void gee_abstract_set_reserved0 (GeeAbstractSet* self); +void gee_abstract_set_reserved1 (GeeAbstractSet* self); +void gee_abstract_set_reserved2 (GeeAbstractSet* self); +void gee_abstract_set_reserved3 (GeeAbstractSet* self); +void gee_abstract_set_reserved4 (GeeAbstractSet* self); +void gee_abstract_set_reserved5 (GeeAbstractSet* self); +void gee_abstract_set_reserved6 (GeeAbstractSet* self); +void gee_abstract_set_reserved7 (GeeAbstractSet* self); +void gee_abstract_set_reserved8 (GeeAbstractSet* self); +void gee_abstract_set_reserved9 (GeeAbstractSet* self); +GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self); +GeeSortedMap* gee_abstract_sorted_map_head_map (GeeAbstractSortedMap* self, gconstpointer before); +GeeSortedMap* gee_abstract_sorted_map_tail_map (GeeAbstractSortedMap* self, gconstpointer after); +GeeSortedMap* gee_abstract_sorted_map_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); +void gee_abstract_sorted_map_reserved0 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved1 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved2 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved3 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved4 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved5 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved6 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved7 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved8 (GeeAbstractSortedMap* self); +void gee_abstract_sorted_map_reserved9 (GeeAbstractSortedMap* self); +GeeAbstractSortedMap* gee_abstract_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_keys (GeeAbstractSortedMap* self); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_entries (GeeAbstractSortedMap* self); +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +GeeIterator* gee_abstract_sorted_set_iterator_at (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element); +GeeSortedSet* gee_abstract_sorted_set_head_set (GeeAbstractSortedSet* self, gconstpointer before); +GeeSortedSet* gee_abstract_sorted_set_tail_set (GeeAbstractSortedSet* self, gconstpointer after); +GeeSortedSet* gee_abstract_sorted_set_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); +void gee_abstract_sorted_set_reserved0 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved1 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved2 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved3 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved4 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved5 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved6 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved7 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved8 (GeeAbstractSortedSet* self); +void gee_abstract_sorted_set_reserved9 (GeeAbstractSortedSet* self); +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSortedSet* gee_abstract_sorted_set_get_read_only_view (GeeAbstractSortedSet* self); +GType gee_array_list_get_type (void) G_GNUC_CONST; +GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection); +GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target); +GType gee_deque_get_type (void) G_GNUC_CONST; +GType gee_array_queue_get_type (void) G_GNUC_CONST; +GeeArrayQueue* gee_array_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayQueue* gee_array_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeEqualDataFunc gee_array_queue_get_equal_func (GeeArrayQueue* self, gpointer* result_target); +gboolean gee_array_queue_get_is_empty (GeeArrayQueue* self); +gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); +gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); +gboolean gee_bidir_iterator_last (GeeBidirIterator* self); +GeeBidirListIterator* gee_bidir_list_bidir_list_iterator (GeeBidirList* self); +GeeBidirList* gee_bidir_list_get_read_only_view (GeeBidirList* self); +void gee_bidir_list_iterator_insert (GeeBidirListIterator* self, gconstpointer item); +gboolean gee_bidir_map_iterator_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_has_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_first (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_last (GeeBidirMapIterator* self); +GeeBidirIterator* gee_bidir_sorted_set_bidir_iterator (GeeBidirSortedSet* self); +GeeBidirSortedSet* gee_bidir_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirSortedSet* gee_bidir_sorted_set_get_read_only_view (GeeBidirSortedSet* self); +GeeBidirMapIterator* gee_bidir_sorted_map_bidir_map_iterator (GeeBidirSortedMap* self); +GeeBidirSortedMap* gee_bidir_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeBidirSortedMap* gee_bidir_sorted_map_get_read_only_view (GeeBidirSortedMap* self); +gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); +gboolean gee_collection_add (GeeCollection* self, gconstpointer item); +gboolean gee_collection_remove (GeeCollection* self, gconstpointer item); +void gee_collection_clear (GeeCollection* self); +gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection); +gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection); +gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection); +gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection); +gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1); +gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1); +GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +gint gee_collection_get_size (GeeCollection* self); +gboolean gee_collection_get_is_empty (GeeCollection* self); +gboolean gee_collection_get_read_only (GeeCollection* self); +GeeCollection* gee_collection_get_read_only_view (GeeCollection* self); +GType gee_comparable_get_type (void) G_GNUC_CONST; +gint gee_comparable_compare_to (GeeComparable* self, gconstpointer object); +GType gee_concurrent_list_get_type (void) G_GNUC_CONST; +GeeConcurrentList* gee_concurrent_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeConcurrentList* gee_concurrent_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeEqualDataFunc gee_concurrent_list_get_equal_func (GeeConcurrentList* self, gpointer* result_target); +gboolean gee_concurrent_list_get_is_empty (GeeConcurrentList* self); +GType gee_concurrent_set_get_type (void) G_GNUC_CONST; +GType gee_concurrent_set_range_type_get_type (void) G_GNUC_CONST; +GeeConcurrentSet* gee_concurrent_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeConcurrentSet* gee_concurrent_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +gboolean gee_deque_offer_head (GeeDeque* self, gconstpointer element); +gpointer gee_deque_peek_head (GeeDeque* self); +gpointer gee_deque_poll_head (GeeDeque* self); +gint gee_deque_drain_head (GeeDeque* self, GeeCollection* recipient, gint amount); +gboolean gee_deque_offer_tail (GeeDeque* self, gconstpointer element); +gpointer gee_deque_peek_tail (GeeDeque* self); +gpointer gee_deque_poll_tail (GeeDeque* self); +gint gee_deque_drain_tail (GeeDeque* self, GeeCollection* recipient, gint amount); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GType gee_hashable_get_type (void) G_GNUC_CONST; +guint gee_hashable_hash (GeeHashable* self); +gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object); +GType gee_hash_map_get_type (void) G_GNUC_CONST; +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_value_equal_func (GeeHashMap* self, gpointer* result_target); +GType gee_hash_multi_map_get_type (void) G_GNUC_CONST; +GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self, gpointer* result_target); +GeeHashDataFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self, gpointer* result_target); +GType gee_hash_multi_set_get_type (void) G_GNUC_CONST; +GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashDataFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self, gpointer* result_target); +GType gee_hash_set_get_type (void) G_GNUC_CONST; +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target); +void gee_hazard_pointer_free (GeeHazardPointer* self); +void gee_hazard_pointer_node_free (GeeHazardPointerNode* self); +GType gee_hazard_pointer_policy_get_type (void) G_GNUC_CONST; +gboolean gee_hazard_pointer_policy_is_concrete (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_blocking (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_safe (GeeHazardPointerPolicy self); +GeeHazardPointerPolicy gee_hazard_pointer_policy_to_concrete (GeeHazardPointerPolicy self); +void gee_hazard_pointer_free_node_free (GeeHazardPointerFreeNode* self); +GeeArrayList* gee_hazard_pointer_policy_perform (GeeHazardPointerPolicy self, GeeArrayList* to_free); +void gee_hazard_pointer_release_policy_ensure_start (void); +GType gee_hazard_pointer_release_policy_get_type (void) G_GNUC_CONST; +extern GeeHazardPointerNode* gee_hazard_pointer__head; +extern gint gee_hazard_pointer__default_policy; +extern gint gee_hazard_pointer__thread_exit_policy; +extern gint gee_hazard_pointer_release_policy; +extern GeeQueue* gee_hazard_pointer__queue; +extern GStaticMutex gee_hazard_pointer__queue_mutex; +extern GeeArrayList* gee_hazard_pointer__global_to_free; +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointer* gee_hazard_pointer_new_from_node (GeeHazardPointerNode* node); +GeeHazardPointer* gee_hazard_pointer_new_from_node (GeeHazardPointerNode* node); +GeeHazardPointer* gee_hazard_pointer_get_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +GeeHazardPointer* gee_hazard_pointer_exchange_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask); +gpointer gee_hazard_pointer_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask); +gconstpointer gee_hazard_pointer_get (GeeHazardPointer* self, gboolean other_thread); +void gee_hazard_pointer_release (GeeHazardPointer* self, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify); +void gee_hazard_pointer_set_default_policy (GeeHazardPointerPolicy policy); +void gee_hazard_pointer_set_thread_exit_policy (GeeHazardPointerPolicy policy); +gboolean gee_hazard_pointer_set_release_policy (GeeHazardPointerReleasePolicy policy); +GeeHazardPointerNode* gee_hazard_pointer_acquire (void); +gboolean gee_hazard_pointer_try_free (GeeArrayList* to_free); +GeeHazardPointerNode* gee_hazard_pointer_get_head (void); +GeeHazardPointerDestroyNotify gee_hazard_pointer_get_destroy_notify (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, void** result_target, GDestroyNotify* result_target_destroy_notify); +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self); +extern GStaticPrivate gee_hazard_pointer_context__current_context; +extern GStaticPrivate gee_hazard_pointer_context__root_context; +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +void gee_hazard_pointer_context_try_free (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_free_all (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_try_release (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_release (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_release_ptr (GeeHazardPointerContext* self, void* ptr, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify); +GeeHazardPointerContext* gee_hazard_pointer_context_get_current_context (void); +GeeHazardPointerFreeNode* gee_hazard_pointer_free_node_new (void); +GeeHazardPointerFreeNode* gee_hazard_pointer_free_node_new (void); +GeeHazardPointerNode* gee_hazard_pointer_node_new (void); +GeeHazardPointerNode* gee_hazard_pointer_node_new (void); +void gee_hazard_pointer_node_release (GeeHazardPointerNode* self); +gboolean gee_hazard_pointer_node_is_active (GeeHazardPointerNode* self); +gboolean gee_hazard_pointer_node_activate (GeeHazardPointerNode* self); +void gee_hazard_pointer_node_set (GeeHazardPointerNode* self, void* ptr); +void* gee_hazard_pointer_node_get (GeeHazardPointerNode* self, gboolean safe); +GeeHazardPointerNode* gee_hazard_pointer_node_get_next (GeeHazardPointerNode* self); +void gee_hazard_pointer_node_set_next (GeeHazardPointerNode* self, GeeHazardPointerNode* next); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gboolean gee_iterator_next (GeeIterator* self); +gboolean gee_iterator_has_next (GeeIterator* self); +gpointer gee_iterator_get (GeeIterator* self); +void gee_iterator_remove (GeeIterator* self); +GeeIterator* gee_iterator_unfold (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeUnfoldFunc f, void* f_target, GDestroyNotify f_target_destroy_notify, GeeLazy* current); +GeeIterator* gee_iterator_concat (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iters); +gboolean gee_iterator_get_valid (GeeIterator* self); +gboolean gee_iterator_get_read_only (GeeIterator* self); +GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +void gee_lazy_eval (GeeLazy* self); +gpointer gee_lazy_get (GeeLazy* self); +gconstpointer gee_lazy_get_value (GeeLazy* self); +GType gee_linked_list_get_type (void) G_GNUC_CONST; +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +gpointer gee_linked_list_first (GeeLinkedList* self); +gpointer gee_linked_list_last (GeeLinkedList* self); +GeeEqualDataFunc gee_linked_list_get_equal_func (GeeLinkedList* self, gpointer* result_target); +GeeListIterator* gee_list_list_iterator (GeeList* self); +gpointer gee_list_get (GeeList* self, gint index); +void gee_list_set (GeeList* self, gint index, gconstpointer item); +gint gee_list_index_of (GeeList* self, gconstpointer item); +void gee_list_insert (GeeList* self, gint index, gconstpointer item); +gpointer gee_list_remove_at (GeeList* self, gint index); +GeeList* gee_list_slice (GeeList* self, gint start, gint stop); +gpointer gee_list_first (GeeList* self); +gpointer gee_list_last (GeeList* self); +void gee_list_insert_all (GeeList* self, gint index, GeeCollection* collection); +void gee_list_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeList* gee_list_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeList* gee_list_get_read_only_view (GeeList* self); +void gee_list_iterator_set (GeeListIterator* self, gconstpointer item); +void gee_list_iterator_add (GeeListIterator* self, gconstpointer item); +gint gee_list_iterator_index (GeeListIterator* self); +gboolean gee_map_has_key (GeeMap* self, gconstpointer key); +gboolean gee_map_contains (GeeMap* self, gconstpointer key) G_GNUC_DEPRECATED; +gboolean gee_map_has (GeeMap* self, gconstpointer key, gconstpointer value); +gpointer gee_map_get (GeeMap* self, gconstpointer key); +void gee_map_set (GeeMap* self, gconstpointer key, gconstpointer value); +gboolean gee_map_unset (GeeMap* self, gconstpointer key, gpointer* value); +gboolean gee_map_remove (GeeMap* self, gconstpointer key, gpointer* value) G_GNUC_DEPRECATED; +void gee_map_clear (GeeMap* self); +GeeMapIterator* gee_map_map_iterator (GeeMap* self); +void gee_map_set_all (GeeMap* self, GeeMap* map); +gboolean gee_map_unset_all (GeeMap* self, GeeMap* map); +gboolean gee_map_remove_all (GeeMap* self, GeeMap* map) G_GNUC_DEPRECATED; +gboolean gee_map_has_all (GeeMap* self, GeeMap* map); +gboolean gee_map_contains_all (GeeMap* self, GeeMap* map) G_GNUC_DEPRECATED; +GeeMap* gee_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +gint gee_map_get_size (GeeMap* self); +gboolean gee_map_get_is_empty (GeeMap* self); +gboolean gee_map_get_read_only (GeeMap* self); +GeeSet* gee_map_get_keys (GeeMap* self); +GeeCollection* gee_map_get_values (GeeMap* self); +GeeSet* gee_map_get_entries (GeeMap* self); +GeeMap* gee_map_get_read_only_view (GeeMap* self); +GType gee_map_get_key_type (GeeMap* self); +GType gee_map_get_value_type (GeeMap* self); +GeeMapEntry* gee_map_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +gconstpointer gee_map_entry_get_key (GeeMapEntry* self); +gconstpointer gee_map_entry_get_value (GeeMapEntry* self); +void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value); +gboolean gee_map_entry_get_read_only (GeeMapEntry* self); +gboolean gee_map_iterator_next (GeeMapIterator* self); +gboolean gee_map_iterator_has_next (GeeMapIterator* self); +gpointer gee_map_iterator_get_key (GeeMapIterator* self); +gpointer gee_map_iterator_get_value (GeeMapIterator* self); +void gee_map_iterator_set_value (GeeMapIterator* self, gconstpointer value); +void gee_map_iterator_unset (GeeMapIterator* self); +gpointer gee_map_iterator_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); +gboolean gee_map_iterator_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); +gboolean gee_map_iterator_get_read_only (GeeMapIterator* self); +GeeSet* gee_multi_map_get_keys (GeeMultiMap* self); +GeeMultiSet* gee_multi_map_get_all_keys (GeeMultiMap* self); +GeeCollection* gee_multi_map_get_values (GeeMultiMap* self); +gboolean gee_multi_map_contains (GeeMultiMap* self, gconstpointer key); +GeeCollection* gee_multi_map_get (GeeMultiMap* self, gconstpointer key); +void gee_multi_map_set (GeeMultiMap* self, gconstpointer key, gconstpointer value); +gboolean gee_multi_map_remove (GeeMultiMap* self, gconstpointer key, gconstpointer value); +gboolean gee_multi_map_remove_all (GeeMultiMap* self, gconstpointer key); +void gee_multi_map_clear (GeeMultiMap* self); +GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self); +gint gee_multi_map_get_size (GeeMultiMap* self); +gboolean gee_multi_map_get_read_only (GeeMultiMap* self); +GType gee_multi_map_get_key_type (GeeMultiMap* self); +GType gee_multi_map_get_value_type (GeeMultiMap* self); +GeeMultiMap* gee_multi_map_get_read_only_view (GeeMultiMap* self); +gint gee_multi_set_count (GeeMultiSet* self, gconstpointer item); +GeeSet* gee_multi_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeMultiSet* gee_multi_set_get_read_only_view (GeeMultiSet* self); +GType gee_priority_queue_get_type (void) G_GNUC_CONST; +GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element); +gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount); +GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target); +gboolean gee_queue_offer (GeeQueue* self, gconstpointer element); +gpointer gee_queue_peek (GeeQueue* self); +gpointer gee_queue_poll (GeeQueue* self); +gint gee_queue_drain (GeeQueue* self, GeeCollection* recipient, gint amount); +#define GEE_QUEUE_UNBOUNDED_CAPACITY (-1) +gint gee_queue_get_capacity (GeeQueue* self); +gint gee_queue_get_remaining_capacity (GeeQueue* self); +gboolean gee_queue_get_is_full (GeeQueue* self); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_list_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_list_get_type (void) G_GNUC_CONST; +GeeReadOnlyBidirList* gee_read_only_bidir_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GeeReadOnlyBidirList* gee_read_only_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GeeBidirList* gee_read_only_bidir_list_get_read_only_view (GeeReadOnlyBidirList* self); +GType gee_read_only_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_set_bidir_iterator_get_type (void) G_GNUC_CONST; +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator); +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator); +GType gee_read_only_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GType gee_read_only_map_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_map_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator); +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator); +GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); +GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); +GeeCollection* gee_read_only_collection_get_read_only_view (GeeReadOnlyCollection* self); +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +GeeReadOnlyList* gee_read_only_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list); +GeeReadOnlyList* gee_read_only_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list); +GeeList* gee_read_only_list_get_read_only_view (GeeReadOnlyList* self); +GType gee_read_only_list_iterator_get_type (void) G_GNUC_CONST; +GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GeeReadOnlyMap* gee_read_only_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlyMap* gee_read_only_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +gboolean gee_read_only_map_contains (GeeReadOnlyMap* self, gconstpointer key); +gboolean gee_read_only_map_remove (GeeReadOnlyMap* self, gconstpointer key, gpointer* value); +gboolean gee_read_only_map_remove_all (GeeReadOnlyMap* self, GeeMap* map); +gboolean gee_read_only_map_contains_all (GeeReadOnlyMap* self, GeeMap* map); +GeeMap* gee_read_only_map_get_read_only_view (GeeReadOnlyMap* self); +GType gee_read_only_map_get_key_type (GeeReadOnlyMap* self); +GType gee_read_only_map_get_value_type (GeeReadOnlyMap* self); +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +GType gee_read_only_multi_map_get_type (void) G_GNUC_CONST; +GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GeeReadOnlyMultiMap* gee_read_only_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GeeMultiMap* gee_read_only_multi_map_get_read_only_view (GeeReadOnlyMultiMap* self); +GType gee_read_only_multi_set_get_type (void) G_GNUC_CONST; +GeeReadOnlyMultiSet* gee_read_only_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeReadOnlyMultiSet* gee_read_only_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeMultiSet* gee_read_only_multi_set_get_read_only_view (GeeReadOnlyMultiSet* self); +GeeReadOnlySet* gee_read_only_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set); +GeeReadOnlySet* gee_read_only_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set); +GeeSet* gee_read_only_set_get_read_only_view (GeeReadOnlySet* self); +GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSet* gee_set_get_read_only_view (GeeSet* self); +GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self, gconstpointer before); +GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self, gconstpointer after); +GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self, gconstpointer before, gconstpointer after); +GeeMap* gee_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self); +GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self); +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self); +gpointer gee_sorted_set_first (GeeSortedSet* self); +gpointer gee_sorted_set_last (GeeSortedSet* self); +GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); +gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element); +gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element); +gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element); +gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element); +GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self, gconstpointer before); +GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self, gconstpointer after); +GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gconstpointer to); +GeeSortedSet* gee_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); +GType gee_tim_sort_get_type (void) G_GNUC_CONST; +void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); +GeeTimSort* gee_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeTimSort* gee_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); +GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length); +GType gee_traversable_get_element_type (GeeTraversable* self); +GType gee_tree_map_get_type (void) G_GNUC_CONST; +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target); +GeeEqualDataFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self, gpointer* result_target); +GType gee_tree_multi_map_get_type (void) G_GNUC_CONST; +GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self, gpointer* result_target); +GCompareDataFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self, gpointer* result_target); +GType gee_tree_multi_set_get_type (void) G_GNUC_CONST; +GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self, gpointer* result_target); +GType gee_tree_set_get_type (void) G_GNUC_CONST; +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target); +GType gee_unfold_iterator_get_type (void) G_GNUC_CONST; +GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); +GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); + + +G_END_DECLS + +#endif diff --git a/gee/gee.h b/gee/gee.h index b1b93e6..e74729b 100644 --- a/gee/gee.h +++ b/gee/gee.h @@ -10,13 +10,25 @@ G_BEGIN_DECLS -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -26,6 +38,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -53,14 +73,6 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -80,6 +92,98 @@ typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; +typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -96,14 +200,6 @@ typedef struct _GeeMapIface GeeMapIface; typedef struct _GeeMapIterator GeeMapIterator; typedef struct _GeeMapIteratorIface GeeMapIteratorIface; -#define GEE_TYPE_SET (gee_set_get_type ()) -#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) -#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) -#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) - -typedef struct _GeeSet GeeSet; -typedef struct _GeeSetIface GeeSetIface; - #define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) #define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) #define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) @@ -125,6 +221,52 @@ typedef struct _GeeAbstractMap GeeAbstractMap; typedef struct _GeeAbstractMapClass GeeAbstractMapClass; typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; +typedef struct _GeeAbstractSortedMapPrivate GeeAbstractSortedMapPrivate; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; +typedef struct _GeeAbstractBidirSortedMapPrivate GeeAbstractBidirSortedMapPrivate; + #define GEE_TYPE_MULTI_MAP (gee_multi_map_get_type ()) #define GEE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMap)) #define GEE_IS_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_MAP)) @@ -182,17 +324,6 @@ typedef struct _GeeAbstractQueue GeeAbstractQueue; typedef struct _GeeAbstractQueueClass GeeAbstractQueueClass; typedef struct _GeeAbstractQueuePrivate GeeAbstractQueuePrivate; -#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) -#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) -#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) -#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) -#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) -#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) - -typedef struct _GeeAbstractSet GeeAbstractSet; -typedef struct _GeeAbstractSetClass GeeAbstractSetClass; -typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; - #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) @@ -204,6 +335,25 @@ typedef struct _GeeArrayList GeeArrayList; typedef struct _GeeArrayListClass GeeArrayListClass; typedef struct _GeeArrayListPrivate GeeArrayListPrivate; +#define GEE_TYPE_DEQUE (gee_deque_get_type ()) +#define GEE_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_DEQUE, GeeDeque)) +#define GEE_IS_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_DEQUE)) +#define GEE_DEQUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_DEQUE, GeeDequeIface)) + +typedef struct _GeeDeque GeeDeque; +typedef struct _GeeDequeIface GeeDequeIface; + +#define GEE_TYPE_ARRAY_QUEUE (gee_array_queue_get_type ()) +#define GEE_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueue)) +#define GEE_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) +#define GEE_IS_ARRAY_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_IS_ARRAY_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_QUEUE)) +#define GEE_ARRAY_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_QUEUE, GeeArrayQueueClass)) + +typedef struct _GeeArrayQueue GeeArrayQueue; +typedef struct _GeeArrayQueueClass GeeArrayQueueClass; +typedef struct _GeeArrayQueuePrivate GeeArrayQueuePrivate; + #define GEE_TYPE_COMPARABLE (gee_comparable_get_type ()) #define GEE_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COMPARABLE, GeeComparable)) #define GEE_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COMPARABLE)) @@ -212,13 +362,37 @@ typedef struct _GeeArrayListPrivate GeeArrayListPrivate; typedef struct _GeeComparable GeeComparable; typedef struct _GeeComparableIface GeeComparableIface; -#define GEE_TYPE_DEQUE (gee_deque_get_type ()) -#define GEE_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_DEQUE, GeeDeque)) -#define GEE_IS_DEQUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_DEQUE)) -#define GEE_DEQUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_DEQUE, GeeDequeIface)) +#define GEE_TYPE_CONCURRENT_LIST (gee_concurrent_list_get_type ()) +#define GEE_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList)) +#define GEE_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) +#define GEE_IS_CONCURRENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_IS_CONCURRENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_LIST)) +#define GEE_CONCURRENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_LIST, GeeConcurrentListClass)) -typedef struct _GeeDeque GeeDeque; -typedef struct _GeeDequeIface GeeDequeIface; +typedef struct _GeeConcurrentList GeeConcurrentList; +typedef struct _GeeConcurrentListClass GeeConcurrentListClass; +typedef struct _GeeConcurrentListPrivate GeeConcurrentListPrivate; + +#define GEE_TYPE_CONCURRENT_SET (gee_concurrent_set_get_type ()) +#define GEE_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSet)) +#define GEE_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) +#define GEE_IS_CONCURRENT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_CONCURRENT_SET)) +#define GEE_IS_CONCURRENT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_CONCURRENT_SET)) +#define GEE_CONCURRENT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_CONCURRENT_SET, GeeConcurrentSetClass)) + +typedef struct _GeeConcurrentSet GeeConcurrentSet; +typedef struct _GeeConcurrentSetClass GeeConcurrentSetClass; +typedef struct _GeeConcurrentSetPrivate GeeConcurrentSetPrivate; + +#define GEE_CONCURRENT_SET_TYPE_RANGE_TYPE (gee_concurrent_set_range_type_get_type ()) + +#define GEE_TYPE_HASHABLE (gee_hashable_get_type ()) +#define GEE_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASHABLE, GeeHashable)) +#define GEE_IS_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASHABLE)) +#define GEE_HASHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_HASHABLE, GeeHashableIface)) + +typedef struct _GeeHashable GeeHashable; +typedef struct _GeeHashableIface GeeHashableIface; #define GEE_TYPE_HASH_MAP (gee_hash_map_get_type ()) #define GEE_HASH_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_MAP, GeeHashMap)) @@ -263,6 +437,15 @@ typedef struct _GeeHashMultiSetPrivate GeeHashMultiSetPrivate; typedef struct _GeeHashSet GeeHashSet; typedef struct _GeeHashSetClass GeeHashSetClass; typedef struct _GeeHashSetPrivate GeeHashSetPrivate; +typedef struct _GeeHazardPointer GeeHazardPointer; +typedef struct _GeeHazardPointerNode GeeHazardPointerNode; + +#define GEE_HAZARD_POINTER_TYPE_POLICY (gee_hazard_pointer_policy_get_type ()) + +#define GEE_HAZARD_POINTER_TYPE_RELEASE_POLICY (gee_hazard_pointer_release_policy_get_type ()) +typedef struct _GeeHazardPointerContext GeeHazardPointerContext; +typedef struct _GeeHazardPointerFreeNode GeeHazardPointerFreeNode; +typedef struct _GeeLazyPrivate GeeLazyPrivate; #define GEE_TYPE_LINKED_LIST (gee_linked_list_get_type ()) #define GEE_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedList)) @@ -287,14 +470,6 @@ typedef struct _GeePriorityQueue GeePriorityQueue; typedef struct _GeePriorityQueueClass GeePriorityQueueClass; typedef struct _GeePriorityQueuePrivate GeePriorityQueuePrivate; -#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) -#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) -#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) -#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) - -typedef struct _GeeSortedSet GeeSortedSet; -typedef struct _GeeSortedSetIface GeeSortedSetIface; - #define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) #define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) #define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) @@ -339,23 +514,55 @@ typedef struct _GeeTreeSet GeeTreeSet; typedef struct _GeeTreeSetClass GeeTreeSetClass; typedef struct _GeeTreeSetPrivate GeeTreeSetPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -367,6 +574,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -381,34 +589,35 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -419,7 +628,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -437,52 +646,222 @@ struct _GeeAbstractListClass { void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); gpointer (*remove_at) (GeeAbstractList* self, gint index); GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); - gpointer (*first) (GeeAbstractList* self); - gpointer (*last) (GeeAbstractList* self); - void (*insert_all) (GeeAbstractList* self, gint index, GeeCollection* collection); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); GeeList* (*get_read_only_view) (GeeAbstractList* self); }; +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { + GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeAbstractSet { + GeeAbstractCollection parent_instance; + GeeAbstractSetPrivate * priv; +}; + +struct _GeeAbstractSetClass { + GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); + GeeSet* (*get_read_only_view) (GeeAbstractSet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeAbstractSortedSet { + GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSet { + GeeAbstractSortedSet parent_instance; + GeeAbstractBidirSortedSetPrivate * priv; +}; + +struct _GeeAbstractBidirSortedSetClass { + GeeAbstractSortedSetClass parent_class; + GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self); + void (*reserved0) (GeeAbstractBidirSortedSet* self); + void (*reserved1) (GeeAbstractBidirSortedSet* self); + void (*reserved2) (GeeAbstractBidirSortedSet* self); + void (*reserved3) (GeeAbstractBidirSortedSet* self); + void (*reserved4) (GeeAbstractBidirSortedSet* self); + void (*reserved5) (GeeAbstractBidirSortedSet* self); + void (*reserved6) (GeeAbstractBidirSortedSet* self); + void (*reserved7) (GeeAbstractBidirSortedSet* self); + void (*reserved8) (GeeAbstractBidirSortedSet* self); + void (*reserved9) (GeeAbstractBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); -}; - -struct _GeeSetIface { - GTypeInterface parent_iface; - GeeSet* (*get_read_only_view) (GeeSet* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMap { @@ -499,24 +878,124 @@ struct _GeeAbstractMapClass { gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); void (*clear) (GeeAbstractMap* self); - void (*set_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*unset_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*has_all) (GeeAbstractMap* self, GeeMap* map); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); gint (*get_size) (GeeAbstractMap* self); - gboolean (*get_is_empty) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); GeeSet* (*get_keys) (GeeAbstractMap* self); GeeCollection* (*get_values) (GeeAbstractMap* self); GeeSet* (*get_entries) (GeeAbstractMap* self); GeeMap* (*get_read_only_view) (GeeAbstractMap* self); }; +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeAbstractSortedMap { + GeeAbstractMap parent_instance; + GeeAbstractSortedMapPrivate * priv; +}; + +struct _GeeAbstractSortedMapClass { + GeeAbstractMapClass parent_class; + GeeSortedMap* (*head_map) (GeeAbstractSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeAbstractSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); + void (*reserved0) (GeeAbstractSortedMap* self); + void (*reserved1) (GeeAbstractSortedMap* self); + void (*reserved2) (GeeAbstractSortedMap* self); + void (*reserved3) (GeeAbstractSortedMap* self); + void (*reserved4) (GeeAbstractSortedMap* self); + void (*reserved5) (GeeAbstractSortedMap* self); + void (*reserved6) (GeeAbstractSortedMap* self); + void (*reserved7) (GeeAbstractSortedMap* self); + void (*reserved8) (GeeAbstractSortedMap* self); + void (*reserved9) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_keys) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeAbstractSortedMap* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +struct _GeeAbstractBidirSortedMap { + GeeAbstractSortedMap parent_instance; + GeeAbstractBidirSortedMapPrivate * priv; +}; + +struct _GeeAbstractBidirSortedMapClass { + GeeAbstractSortedMapClass parent_class; + GeeBidirMapIterator* (*bidir_map_iterator) (GeeAbstractBidirSortedMap* self); + void (*reserved0) (GeeAbstractBidirSortedMap* self); + void (*reserved1) (GeeAbstractBidirSortedMap* self); + void (*reserved2) (GeeAbstractBidirSortedMap* self); + void (*reserved3) (GeeAbstractBidirSortedMap* self); + void (*reserved4) (GeeAbstractBidirSortedMap* self); + void (*reserved5) (GeeAbstractBidirSortedMap* self); + void (*reserved6) (GeeAbstractBidirSortedMap* self); + void (*reserved7) (GeeAbstractBidirSortedMap* self); + void (*reserved8) (GeeAbstractBidirSortedMap* self); + void (*reserved9) (GeeAbstractBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeAbstractBidirSortedMap* self); +}; + struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); }; struct _GeeMultiMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); GeeSet* (*get_keys) (GeeMultiMap* self); GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); GeeCollection* (*get_values) (GeeMultiMap* self); @@ -526,9 +1005,13 @@ struct _GeeMultiMapIface { gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeAbstractMultiMap { GObject parent_instance; GeeAbstractMultiMapPrivate * priv; @@ -539,7 +1022,17 @@ struct _GeeAbstractMultiMapClass { GObjectClass parent_class; GeeCollection* (*create_value_storage) (GeeAbstractMultiMap* self); GeeMultiSet* (*create_multi_key_set) (GeeAbstractMultiMap* self); - GEqualFunc (*get_value_equal_func) (GeeAbstractMultiMap* self); + GeeEqualDataFunc (*get_value_equal_func) (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); + void (*reserved0) (GeeAbstractMultiMap* self); + void (*reserved1) (GeeAbstractMultiMap* self); + void (*reserved2) (GeeAbstractMultiMap* self); + void (*reserved3) (GeeAbstractMultiMap* self); + void (*reserved4) (GeeAbstractMultiMap* self); + void (*reserved5) (GeeAbstractMultiMap* self); + void (*reserved6) (GeeAbstractMultiMap* self); + void (*reserved7) (GeeAbstractMultiMap* self); + void (*reserved8) (GeeAbstractMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeAbstractMultiMap* self); }; struct _GeeAbstractMultiSet { @@ -550,10 +1043,23 @@ struct _GeeAbstractMultiSet { struct _GeeAbstractMultiSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractMultiSet* self); + void (*reserved1) (GeeAbstractMultiSet* self); + void (*reserved2) (GeeAbstractMultiSet* self); + void (*reserved3) (GeeAbstractMultiSet* self); + void (*reserved4) (GeeAbstractMultiSet* self); + void (*reserved5) (GeeAbstractMultiSet* self); + void (*reserved6) (GeeAbstractMultiSet* self); + void (*reserved7) (GeeAbstractMultiSet* self); + void (*reserved8) (GeeAbstractMultiSet* self); + GeeMultiSet* (*get_read_only_view) (GeeAbstractMultiSet* self); }; struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -570,27 +1076,25 @@ struct _GeeAbstractQueue { struct _GeeAbstractQueueClass { GeeAbstractCollectionClass parent_class; - gboolean (*offer) (GeeAbstractQueue* self, gconstpointer element); gpointer (*peek) (GeeAbstractQueue* self); gpointer (*poll) (GeeAbstractQueue* self); - gint (*drain) (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); + void (*reserved0) (GeeAbstractQueue* self); + void (*reserved1) (GeeAbstractQueue* self); + void (*reserved2) (GeeAbstractQueue* self); + void (*reserved3) (GeeAbstractQueue* self); + void (*reserved4) (GeeAbstractQueue* self); + void (*reserved5) (GeeAbstractQueue* self); + void (*reserved6) (GeeAbstractQueue* self); + void (*reserved7) (GeeAbstractQueue* self); + void (*reserved8) (GeeAbstractQueue* self); + void (*reserved9) (GeeAbstractQueue* self); gint (*get_capacity) (GeeAbstractQueue* self); gint (*get_remaining_capacity) (GeeAbstractQueue* self); gboolean (*get_is_full) (GeeAbstractQueue* self); }; -struct _GeeAbstractSet { - GeeAbstractCollection parent_instance; - GeeAbstractSetPrivate * priv; -}; - -struct _GeeAbstractSetClass { - GeeAbstractCollectionClass parent_class; - GeeSet* (*get_read_only_view) (GeeAbstractSet* self); -}; - struct _GeeArrayList { - GeeAbstractList parent_instance; + GeeAbstractBidirList parent_instance; GeeArrayListPrivate * priv; gpointer* _items; gint _items_length1; @@ -599,16 +1103,14 @@ struct _GeeArrayList { }; struct _GeeArrayListClass { - GeeAbstractListClass parent_class; -}; - -struct _GeeComparableIface { - GTypeInterface parent_iface; - gint (*compare_to) (GeeComparable* self, gconstpointer object); + GeeAbstractBidirListClass parent_class; }; struct _GeeDequeIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeDeque* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeDeque* self); + GDestroyNotify (*get_g_destroy_func) (GeeDeque* self); gboolean (*offer_head) (GeeDeque* self, gconstpointer element); gpointer (*peek_head) (GeeDeque* self); gpointer (*poll_head) (GeeDeque* self); @@ -619,6 +1121,52 @@ struct _GeeDequeIface { gint (*drain_tail) (GeeDeque* self, GeeCollection* recipient, gint amount); }; +struct _GeeArrayQueue { + GeeAbstractQueue parent_instance; + GeeArrayQueuePrivate * priv; +}; + +struct _GeeArrayQueueClass { + GeeAbstractQueueClass parent_class; +}; + +struct _GeeComparableIface { + GTypeInterface parent_iface; + gint (*compare_to) (GeeComparable* self, gconstpointer object); +}; + +struct _GeeConcurrentList { + GeeAbstractList parent_instance; + GeeConcurrentListPrivate * priv; +}; + +struct _GeeConcurrentListClass { + GeeAbstractListClass parent_class; +}; + +struct _GeeConcurrentSet { + GeeAbstractSortedSet parent_instance; + GeeConcurrentSetPrivate * priv; +}; + +struct _GeeConcurrentSetClass { + GeeAbstractSortedSetClass parent_class; +}; + +typedef enum { + GEE_CONCURRENT_SET_RANGE_TYPE_HEAD, + GEE_CONCURRENT_SET_RANGE_TYPE_TAIL, + GEE_CONCURRENT_SET_RANGE_TYPE_BOUNDED, + GEE_CONCURRENT_SET_RANGE_TYPE_EMPTY +} GeeConcurrentSetRangeType; + +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +struct _GeeHashableIface { + GTypeInterface parent_iface; + guint (*hash) (GeeHashable* self); + gboolean (*equal_to) (GeeHashable* self, gconstpointer object); +}; + struct _GeeHashMap { GeeAbstractMap parent_instance; GeeHashMapPrivate * priv; @@ -655,13 +1203,51 @@ struct _GeeHashSetClass { GeeAbstractSetClass parent_class; }; +struct _GeeHazardPointer { + GeeHazardPointerNode* _node; +}; + +typedef enum { + GEE_HAZARD_POINTER_POLICY_DEFAULT, + GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, + GEE_HAZARD_POINTER_POLICY_TRY_FREE, + GEE_HAZARD_POINTER_POLICY_FREE, + GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, + GEE_HAZARD_POINTER_POLICY_RELEASE +} GeeHazardPointerPolicy; + +typedef enum { + GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD, + GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP +} GeeHazardPointerReleasePolicy; + +typedef void (*GeeHazardPointerDestroyNotify) (void* ptr, void* user_data); +struct _GeeHazardPointerContext { + GeeHazardPointerContext* _parent; + GeeArrayList* _to_free; + GeeHazardPointerPolicy* _policy; +}; + +typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data); +typedef gpointer (*GeeLazyFunc) (void* user_data); +struct _GeeLazy { + GTypeInstance parent_instance; + volatile int ref_count; + GeeLazyPrivate * priv; +}; + +struct _GeeLazyClass { + GTypeClass parent_class; + void (*finalize) (GeeLazy *self); +}; + struct _GeeLinkedList { - GeeAbstractList parent_instance; + GeeAbstractBidirList parent_instance; GeeLinkedListPrivate * priv; }; struct _GeeLinkedListClass { - GeeAbstractListClass parent_class; + GeeAbstractBidirListClass parent_class; }; struct _GeeMapEntry { @@ -674,6 +1260,7 @@ struct _GeeMapEntryClass { gconstpointer (*get_key) (GeeMapEntry* self); gconstpointer (*get_value) (GeeMapEntry* self); void (*set_value) (GeeMapEntry* self, gconstpointer value); + gboolean (*get_read_only) (GeeMapEntry* self); }; struct _GeePriorityQueue { @@ -685,28 +1272,13 @@ struct _GeePriorityQueueClass { GeeAbstractQueueClass parent_class; }; -struct _GeeSortedSetIface { - GTypeInterface parent_iface; - gpointer (*first) (GeeSortedSet* self); - gpointer (*last) (GeeSortedSet* self); - GeeBidirIterator* (*bidir_iterator) (GeeSortedSet* self); - GeeBidirIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); - gpointer (*lower) (GeeSortedSet* self, gconstpointer element); - gpointer (*higher) (GeeSortedSet* self, gconstpointer element); - gpointer (*floor) (GeeSortedSet* self, gconstpointer element); - gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); - GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); - GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); - GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); -}; - struct _GeeTreeMap { - GeeAbstractMap parent_instance; + GeeAbstractBidirSortedMap parent_instance; GeeTreeMapPrivate * priv; }; struct _GeeTreeMapClass { - GeeAbstractMapClass parent_class; + GeeAbstractBidirSortedMapClass parent_class; }; struct _GeeTreeMultiMap { @@ -728,37 +1300,69 @@ struct _GeeTreeMultiSetClass { }; struct _GeeTreeSet { - GeeAbstractSet parent_instance; + GeeAbstractBidirSortedSet parent_instance; GeeTreeSetPrivate * priv; }; struct _GeeTreeSetClass { - GeeAbstractSetClass parent_class; + GeeAbstractBidirSortedSetClass parent_class; }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; +GeeBidirListIterator* gee_abstract_bidir_list_bidir_list_iterator (GeeAbstractBidirList* self); +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirList* gee_abstract_bidir_list_get_read_only_view (GeeAbstractBidirList* self); +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GeeBidirIterator* gee_abstract_bidir_sorted_set_bidir_iterator (GeeAbstractBidirSortedSet* self); +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self); +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GeeBidirMapIterator* gee_abstract_bidir_sorted_map_bidir_map_iterator (GeeAbstractBidirSortedMap* self); +GeeAbstractBidirSortedMap* gee_abstract_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self); gboolean gee_abstract_collection_contains (GeeAbstractCollection* self, gconstpointer item); gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpointer item); void gee_abstract_collection_clear (GeeAbstractCollection* self); -gpointer* gee_abstract_collection_to_array (GeeAbstractCollection* self, int* result_length1); -gboolean gee_abstract_collection_add_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_contains_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_remove_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_retain_all (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); GeeCollection* gee_abstract_collection_get_read_only_view (GeeAbstractCollection* self); -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; -GType gee_list_iterator_get_type (void) G_GNUC_CONST; -GType gee_list_get_type (void) G_GNUC_CONST; -GType gee_abstract_list_get_type (void) G_GNUC_CONST; GeeListIterator* gee_abstract_list_list_iterator (GeeAbstractList* self); gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); void gee_abstract_list_set (GeeAbstractList* self, gint index, gconstpointer item); @@ -766,16 +1370,8 @@ gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item); void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item); gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index); GeeList* gee_abstract_list_slice (GeeAbstractList* self, gint start, gint stop); -gpointer gee_abstract_list_first (GeeAbstractList* self); -gpointer gee_abstract_list_last (GeeAbstractList* self); -void gee_abstract_list_insert_all (GeeAbstractList* self, gint index, GeeCollection* collection); GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self); -GType gee_map_iterator_get_type (void) G_GNUC_CONST; -GType gee_set_get_type (void) G_GNUC_CONST; -GType gee_map_entry_get_type (void) G_GNUC_CONST; -GType gee_map_get_type (void) G_GNUC_CONST; -GType gee_abstract_map_get_type (void) G_GNUC_CONST; gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); gpointer gee_abstract_map_get (GeeAbstractMap* self, gconstpointer key); @@ -783,12 +1379,11 @@ void gee_abstract_map_set (GeeAbstractMap* self, gconstpointer key, gconstpointe gboolean gee_abstract_map_unset (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* gee_abstract_map_map_iterator (GeeAbstractMap* self); void gee_abstract_map_clear (GeeAbstractMap* self); -void gee_abstract_map_set_all (GeeAbstractMap* self, GeeMap* map); -gboolean gee_abstract_map_unset_all (GeeAbstractMap* self, GeeMap* map); -gboolean gee_abstract_map_has_all (GeeAbstractMap* self, GeeMap* map); +gboolean gee_abstract_map_foreach (GeeAbstractMap* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_abstract_map_stream (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); gint gee_abstract_map_get_size (GeeAbstractMap* self); -gboolean gee_abstract_map_get_is_empty (GeeAbstractMap* self); +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); @@ -799,30 +1394,69 @@ GType gee_abstract_multi_map_get_type (void) G_GNUC_CONST; GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* storage_map); GeeCollection* gee_abstract_multi_map_create_value_storage (GeeAbstractMultiMap* self); GeeMultiSet* gee_abstract_multi_map_create_multi_key_set (GeeAbstractMultiMap* self); -GEqualFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self); +GeeEqualDataFunc gee_abstract_multi_map_get_value_equal_func (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeMultiMap* gee_abstract_multi_map_get_read_only_view (GeeAbstractMultiMap* self); GType gee_abstract_multi_set_get_type (void) G_GNUC_CONST; GeeAbstractMultiSet* gee_abstract_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMap* storage_map); +GeeMultiSet* gee_abstract_multi_set_get_read_only_view (GeeAbstractMultiSet* self); GType gee_queue_get_type (void) G_GNUC_CONST; GType gee_abstract_queue_get_type (void) G_GNUC_CONST; -gboolean gee_abstract_queue_offer (GeeAbstractQueue* self, gconstpointer element); gpointer gee_abstract_queue_peek (GeeAbstractQueue* self); gpointer gee_abstract_queue_poll (GeeAbstractQueue* self); -gint gee_abstract_queue_drain (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self); gint gee_abstract_queue_get_remaining_capacity (GeeAbstractQueue* self); gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self); -GType gee_abstract_set_get_type (void) G_GNUC_CONST; GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self); +GeeSortedMap* gee_abstract_sorted_map_head_map (GeeAbstractSortedMap* self, gconstpointer before); +GeeSortedMap* gee_abstract_sorted_map_tail_map (GeeAbstractSortedMap* self, gconstpointer after); +GeeSortedMap* gee_abstract_sorted_map_sub_map (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); +GeeAbstractSortedMap* gee_abstract_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_keys (GeeAbstractSortedMap* self); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_entries (GeeAbstractSortedMap* self); +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +GeeIterator* gee_abstract_sorted_set_iterator_at (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element); +gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element); +GeeSortedSet* gee_abstract_sorted_set_head_set (GeeAbstractSortedSet* self, gconstpointer before); +GeeSortedSet* gee_abstract_sorted_set_tail_set (GeeAbstractSortedSet* self, gconstpointer after); +GeeSortedSet* gee_abstract_sorted_set_sub_set (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); +GeeAbstractSortedSet* gee_abstract_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSortedSet* gee_abstract_sorted_set_get_read_only_view (GeeAbstractSortedSet* self); GType gee_array_list_get_type (void) G_GNUC_CONST; -GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -void gee_array_list_sort_with_data (GeeArrayList* self, GCompareDataFunc compare, void* compare_target); -GEqualFunc gee_array_list_get_equal_func (GeeArrayList* self); +GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection); +GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target); +GType gee_deque_get_type (void) G_GNUC_CONST; +GType gee_array_queue_get_type (void) G_GNUC_CONST; +GeeArrayQueue* gee_array_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayQueue* gee_array_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeEqualDataFunc gee_array_queue_get_equal_func (GeeArrayQueue* self, gpointer* result_target); +gboolean gee_array_queue_get_is_empty (GeeArrayQueue* self); gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); gboolean gee_bidir_iterator_last (GeeBidirIterator* self); +GeeBidirListIterator* gee_bidir_list_bidir_list_iterator (GeeBidirList* self); +GeeBidirList* gee_bidir_list_get_read_only_view (GeeBidirList* self); +void gee_bidir_list_iterator_insert (GeeBidirListIterator* self, gconstpointer item); +gboolean gee_bidir_map_iterator_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_has_previous (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_first (GeeBidirMapIterator* self); +gboolean gee_bidir_map_iterator_last (GeeBidirMapIterator* self); +GeeBidirIterator* gee_bidir_sorted_set_bidir_iterator (GeeBidirSortedSet* self); +GeeBidirSortedSet* gee_bidir_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeBidirSortedSet* gee_bidir_sorted_set_get_read_only_view (GeeBidirSortedSet* self); +GeeBidirMapIterator* gee_bidir_sorted_map_bidir_map_iterator (GeeBidirSortedMap* self); +GeeBidirSortedMap* gee_bidir_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeBidirSortedMap* gee_bidir_sorted_map_get_read_only_view (GeeBidirSortedMap* self); gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); gboolean gee_collection_add (GeeCollection* self, gconstpointer item); gboolean gee_collection_remove (GeeCollection* self, gconstpointer item); @@ -832,13 +1466,25 @@ gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collec gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection); gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection); gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1); +gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1); +gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1); GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_collection_get_size (GeeCollection* self); gboolean gee_collection_get_is_empty (GeeCollection* self); +gboolean gee_collection_get_read_only (GeeCollection* self); GeeCollection* gee_collection_get_read_only_view (GeeCollection* self); GType gee_comparable_get_type (void) G_GNUC_CONST; gint gee_comparable_compare_to (GeeComparable* self, gconstpointer object); -GType gee_deque_get_type (void) G_GNUC_CONST; +GType gee_concurrent_list_get_type (void) G_GNUC_CONST; +GeeConcurrentList* gee_concurrent_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeConcurrentList* gee_concurrent_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeEqualDataFunc gee_concurrent_list_get_equal_func (GeeConcurrentList* self, gpointer* result_target); +gboolean gee_concurrent_list_get_is_empty (GeeConcurrentList* self); +GType gee_concurrent_set_get_type (void) G_GNUC_CONST; +GType gee_concurrent_set_range_type_get_type (void) G_GNUC_CONST; +GeeConcurrentSet* gee_concurrent_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeConcurrentSet* gee_concurrent_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); gboolean gee_deque_offer_head (GeeDeque* self, gconstpointer element); gpointer gee_deque_peek_head (GeeDeque* self); gpointer gee_deque_poll_head (GeeDeque* self); @@ -847,44 +1493,86 @@ gboolean gee_deque_offer_tail (GeeDeque* self, gconstpointer element); gpointer gee_deque_peek_tail (GeeDeque* self); gpointer gee_deque_poll_tail (GeeDeque* self); gint gee_deque_drain_tail (GeeDeque* self, GeeCollection* recipient, gint amount); -GEqualFunc gee_functions_get_equal_func_for (GType t); -GHashFunc gee_functions_get_hash_func_for (GType t); -GCompareFunc gee_functions_get_compare_func_for (GType t); -gint gee_direct_compare (void* _val1, void* _val2); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GType gee_hashable_get_type (void) G_GNUC_CONST; +guint gee_hashable_hash (GeeHashable* self); +gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object); GType gee_hash_map_get_type (void) G_GNUC_CONST; -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GHashFunc gee_hash_map_get_key_hash_func (GeeHashMap* self); -GEqualFunc gee_hash_map_get_key_equal_func (GeeHashMap* self); -GEqualFunc gee_hash_map_get_value_equal_func (GeeHashMap* self); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_value_equal_func (GeeHashMap* self, gpointer* result_target); GType gee_hash_multi_map_get_type (void) G_GNUC_CONST; -GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func); -GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func); -GHashFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self); -GEqualFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self); -GHashFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self); -GEqualFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self); +GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self, gpointer* result_target); +GeeHashDataFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self, gpointer* result_target); GType gee_hash_multi_set_get_type (void) G_GNUC_CONST; -GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GHashFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self); -GEqualFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self); +GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashDataFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self, gpointer* result_target); GType gee_hash_set_get_type (void) G_GNUC_CONST; -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GHashFunc gee_hash_set_get_hash_func (GeeHashSet* self); -GEqualFunc gee_hash_set_get_equal_func (GeeHashSet* self); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target); +void gee_hazard_pointer_free (GeeHazardPointer* self); +void gee_hazard_pointer_node_free (GeeHazardPointerNode* self); +GType gee_hazard_pointer_policy_get_type (void) G_GNUC_CONST; +gboolean gee_hazard_pointer_policy_is_concrete (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_blocking (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_safe (GeeHazardPointerPolicy self); +GeeHazardPointerPolicy gee_hazard_pointer_policy_to_concrete (GeeHazardPointerPolicy self); +GType gee_hazard_pointer_release_policy_get_type (void) G_GNUC_CONST; +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointer* gee_hazard_pointer_get_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +GeeHazardPointer* gee_hazard_pointer_exchange_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask); +gpointer gee_hazard_pointer_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask); +gconstpointer gee_hazard_pointer_get (GeeHazardPointer* self, gboolean other_thread); +void gee_hazard_pointer_release (GeeHazardPointer* self, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify); +void gee_hazard_pointer_set_default_policy (GeeHazardPointerPolicy policy); +void gee_hazard_pointer_set_thread_exit_policy (GeeHazardPointerPolicy policy); +gboolean gee_hazard_pointer_set_release_policy (GeeHazardPointerReleasePolicy policy); +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self); +void gee_hazard_pointer_free_node_free (GeeHazardPointerFreeNode* self); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +void gee_hazard_pointer_context_try_free (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_free_all (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_try_release (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_release (GeeHazardPointerContext* self); GeeIterator* gee_iterable_iterator (GeeIterable* self); -GType gee_iterable_get_element_type (GeeIterable* self); gboolean gee_iterator_next (GeeIterator* self); gboolean gee_iterator_has_next (GeeIterator* self); -gboolean gee_iterator_first (GeeIterator* self); gpointer gee_iterator_get (GeeIterator* self); void gee_iterator_remove (GeeIterator* self); +GeeIterator* gee_iterator_unfold (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeUnfoldFunc f, void* f_target, GDestroyNotify f_target_destroy_notify, GeeLazy* current); +GeeIterator* gee_iterator_concat (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iters); +gboolean gee_iterator_get_valid (GeeIterator* self); +gboolean gee_iterator_get_read_only (GeeIterator* self); +GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +void gee_lazy_eval (GeeLazy* self); +gpointer gee_lazy_get (GeeLazy* self); +gconstpointer gee_lazy_get_value (GeeLazy* self); GType gee_linked_list_get_type (void) G_GNUC_CONST; -GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GEqualFunc gee_linked_list_get_equal_func (GeeLinkedList* self); +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +gpointer gee_linked_list_first (GeeLinkedList* self); +gpointer gee_linked_list_last (GeeLinkedList* self); +GeeEqualDataFunc gee_linked_list_get_equal_func (GeeLinkedList* self, gpointer* result_target); GeeListIterator* gee_list_list_iterator (GeeList* self); gpointer gee_list_get (GeeList* self, gint index); void gee_list_set (GeeList* self, gint index, gconstpointer item); @@ -895,11 +1583,10 @@ GeeList* gee_list_slice (GeeList* self, gint start, gint stop); gpointer gee_list_first (GeeList* self); gpointer gee_list_last (GeeList* self); void gee_list_insert_all (GeeList* self, gint index, GeeCollection* collection); -void gee_list_sort (GeeList* self, GCompareFunc compare_func); +void gee_list_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* gee_list_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeList* gee_list_get_read_only_view (GeeList* self); void gee_list_iterator_set (GeeListIterator* self, gconstpointer item); -void gee_list_iterator_insert (GeeListIterator* self, gconstpointer item); void gee_list_iterator_add (GeeListIterator* self, gconstpointer item); gint gee_list_iterator_index (GeeListIterator* self); gboolean gee_map_has_key (GeeMap* self, gconstpointer key); @@ -919,6 +1606,7 @@ gboolean gee_map_contains_all (GeeMap* self, GeeMap* map) G_GNUC_DEPRECATED; GeeMap* gee_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); gint gee_map_get_size (GeeMap* self); gboolean gee_map_get_is_empty (GeeMap* self); +gboolean gee_map_get_read_only (GeeMap* self); GeeSet* gee_map_get_keys (GeeMap* self); GeeCollection* gee_map_get_values (GeeMap* self); GeeSet* gee_map_get_entries (GeeMap* self); @@ -929,13 +1617,18 @@ GeeMapEntry* gee_map_entry_construct (GType object_type, GType k_type, GBoxedCop gconstpointer gee_map_entry_get_key (GeeMapEntry* self); gconstpointer gee_map_entry_get_value (GeeMapEntry* self); void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value); +gboolean gee_map_entry_get_read_only (GeeMapEntry* self); gboolean gee_map_iterator_next (GeeMapIterator* self); gboolean gee_map_iterator_has_next (GeeMapIterator* self); -gboolean gee_map_iterator_first (GeeMapIterator* self); gpointer gee_map_iterator_get_key (GeeMapIterator* self); gpointer gee_map_iterator_get_value (GeeMapIterator* self); void gee_map_iterator_set_value (GeeMapIterator* self, gconstpointer value); void gee_map_iterator_unset (GeeMapIterator* self); +gpointer gee_map_iterator_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); +gboolean gee_map_iterator_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); +gboolean gee_map_iterator_get_read_only (GeeMapIterator* self); GeeSet* gee_multi_map_get_keys (GeeMultiMap* self); GeeMultiSet* gee_multi_map_get_all_keys (GeeMultiMap* self); GeeCollection* gee_multi_map_get_values (GeeMultiMap* self); @@ -945,12 +1638,21 @@ void gee_multi_map_set (GeeMultiMap* self, gconstpointer key, gconstpointer valu gboolean gee_multi_map_remove (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean gee_multi_map_remove_all (GeeMultiMap* self, gconstpointer key); void gee_multi_map_clear (GeeMultiMap* self); +GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self); gint gee_multi_map_get_size (GeeMultiMap* self); +gboolean gee_multi_map_get_read_only (GeeMultiMap* self); +GType gee_multi_map_get_key_type (GeeMultiMap* self); +GType gee_multi_map_get_value_type (GeeMultiMap* self); +GeeMultiMap* gee_multi_map_get_read_only_view (GeeMultiMap* self); gint gee_multi_set_count (GeeMultiSet* self, gconstpointer item); +GeeSet* gee_multi_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeMultiSet* gee_multi_set_get_read_only_view (GeeMultiSet* self); GType gee_priority_queue_get_type (void) G_GNUC_CONST; -GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GCompareFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self); +GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element); +gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount); +GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target); gboolean gee_queue_offer (GeeQueue* self, gconstpointer element); gpointer gee_queue_peek (GeeQueue* self); gpointer gee_queue_poll (GeeQueue* self); @@ -961,11 +1663,16 @@ gint gee_queue_get_remaining_capacity (GeeQueue* self); gboolean gee_queue_get_is_full (GeeQueue* self); GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeSet* gee_set_get_read_only_view (GeeSet* self); -GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self, gconstpointer before); +GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self, gconstpointer after); +GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self, gconstpointer before, gconstpointer after); +GeeMap* gee_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self); +GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self); +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self); gpointer gee_sorted_set_first (GeeSortedSet* self); gpointer gee_sorted_set_last (GeeSortedSet* self); -GeeBidirIterator* gee_sorted_set_bidir_iterator (GeeSortedSet* self); -GeeBidirIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); +GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element); @@ -973,24 +1680,34 @@ gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element); GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self, gconstpointer before); GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self, gconstpointer after); GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gconstpointer to); +GeeSortedSet* gee_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); +GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length); +GType gee_traversable_get_element_type (GeeTraversable* self); GType gee_tree_map_get_type (void) G_GNUC_CONST; -GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GCompareFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self); -GEqualFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target); +GeeEqualDataFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self, gpointer* result_target); GType gee_tree_multi_map_get_type (void) G_GNUC_CONST; -GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func); -GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func); -GCompareFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self); -GCompareFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self); +GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self, gpointer* result_target); +GCompareDataFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self, gpointer* result_target); GType gee_tree_multi_set_get_type (void) G_GNUC_CONST; -GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GCompareFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self); +GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self, gpointer* result_target); GType gee_tree_set_get_type (void) G_GNUC_CONST; -GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GCompareFunc gee_tree_set_get_compare_func (GeeTreeSet* self); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target); G_END_DECLS diff --git a/gee/gee.vala.stamp b/gee/gee.vala.stamp deleted file mode 100644 index e69de29..0000000 diff --git a/gee/hashable.c b/gee/hashable.c new file mode 100644 index 0000000..9e25224 --- /dev/null +++ b/gee/hashable.c @@ -0,0 +1,101 @@ +/* hashable.c generated by valac 0.18.0, the Vala compiler + * generated from hashable.vala, do not modify */ + +/* hashable.vala + * + * Copyright (C) 2010 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_HASHABLE (gee_hashable_get_type ()) +#define GEE_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASHABLE, GeeHashable)) +#define GEE_IS_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASHABLE)) +#define GEE_HASHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_HASHABLE, GeeHashableIface)) + +typedef struct _GeeHashable GeeHashable; +typedef struct _GeeHashableIface GeeHashableIface; + +struct _GeeHashableIface { + GTypeInterface parent_iface; + guint (*hash) (GeeHashable* self); + gboolean (*equal_to) (GeeHashable* self, gconstpointer object); +}; + + + +GType gee_hashable_get_type (void) G_GNUC_CONST; +guint gee_hashable_hash (GeeHashable* self); +gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object); + + +/** + * Computes hash for an objects. Two hashes of equal objects have to be + * equal. Hash have to not change during lifetime of object. + * + * @return hash of an object + */ +guint gee_hashable_hash (GeeHashable* self) { + g_return_val_if_fail (self != NULL, 0U); + return GEE_HASHABLE_GET_INTERFACE (self)->hash (self); +} + + +/** + * Compares this object with the specifed object. + * + * @return true if objects are equal + */ +gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_HASHABLE_GET_INTERFACE (self)->equal_to (self, object); +} + + +static void gee_hashable_base_init (GeeHashableIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + } +} + + +/** + * This interface defines a hash function amongs instances of each class + * implementing it. + * + * @see Comparable + */ +GType gee_hashable_get_type (void) { + static volatile gsize gee_hashable_type_id__volatile = 0; + if (g_once_init_enter (&gee_hashable_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeHashableIface), (GBaseInitFunc) gee_hashable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_hashable_type_id; + gee_hashable_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeHashable", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_hashable_type_id, G_TYPE_OBJECT); + g_once_init_leave (&gee_hashable_type_id__volatile, gee_hashable_type_id); + } + return gee_hashable_type_id__volatile; +} + + + diff --git a/gee/hashable.vala b/gee/hashable.vala new file mode 100644 index 0000000..8a2c785 --- /dev/null +++ b/gee/hashable.vala @@ -0,0 +1,44 @@ +/* hashable.vala + * + * Copyright (C) 2010 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * This interface defines a hash function amongs instances of each class + * implementing it. + * + * @see Comparable + */ +public interface Gee.Hashable : Object { + /** + * Computes hash for an objects. Two hashes of equal objects have to be + * equal. Hash have to not change during lifetime of object. + * + * @return hash of an object + */ + public abstract uint hash (); + + /** + * Compares this object with the specifed object. + * + * @return true if objects are equal + */ + public abstract bool equal_to (G object); +} diff --git a/gee/hashmap.c b/gee/hashmap.c index 2f853a6..ce69e3a 100644 --- a/gee/hashmap.c +++ b/gee/hashmap.c @@ -29,13 +29,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -45,6 +57,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -235,34 +255,78 @@ typedef struct _GeeHashMapValueIteratorPrivate GeeHashMapValueIteratorPrivate; typedef struct _GeeHashMapEntryIteratorPrivate GeeHashMapEntryIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -274,38 +338,43 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMap { @@ -322,11 +391,20 @@ struct _GeeAbstractMapClass { gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); void (*clear) (GeeAbstractMap* self); - void (*set_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*unset_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*has_all) (GeeAbstractMap* self, GeeMap* map); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); gint (*get_size) (GeeAbstractMap* self); - gboolean (*get_is_empty) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); GeeSet* (*get_keys) (GeeAbstractMap* self); GeeCollection* (*get_values) (GeeAbstractMap* self); GeeSet* (*get_entries) (GeeAbstractMap* self); @@ -342,6 +420,8 @@ struct _GeeHashMapClass { GeeAbstractMapClass parent_class; }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeHashMapPrivate { GType k_type; GBoxedCopyFunc k_dup_func; @@ -349,9 +429,15 @@ struct _GeeHashMapPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - GHashFunc _key_hash_func; - GEqualFunc _key_equal_func; - GEqualFunc _value_equal_func; + GeeHashDataFunc _key_hash_func; + gpointer _key_hash_func_target; + GDestroyNotify _key_hash_func_target_destroy_notify; + GeeEqualDataFunc _key_equal_func; + gpointer _key_equal_func_target; + GDestroyNotify _key_equal_func_target_destroy_notify; + GeeEqualDataFunc _value_equal_func; + gpointer _value_equal_func_target; + GDestroyNotify _value_equal_func_target_destroy_notify; gint _array_size; gint _nnodes; GeeHashMapNode** _nodes; @@ -381,6 +467,7 @@ struct _GeeMapEntryClass { gconstpointer (*get_key) (GeeMapEntry* self); gconstpointer (*get_value) (GeeMapEntry* self); void (*set_value) (GeeMapEntry* self, gconstpointer value); + gboolean (*get_read_only) (GeeMapEntry* self); }; struct _GeeHashMapEntry { @@ -413,14 +500,20 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; @@ -431,6 +524,16 @@ struct _GeeAbstractSet { struct _GeeAbstractSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); GeeSet* (*get_read_only_view) (GeeAbstractSet* self); }; @@ -495,6 +598,7 @@ struct _GeeHashMapNodeIterator { GObject parent_instance; GeeHashMapNodeIteratorPrivate * priv; GeeHashMap* _map; + gint _index; GeeHashMapNode* _node; GeeHashMapNode* _next; gint _stamp; @@ -502,6 +606,7 @@ struct _GeeHashMapNodeIterator { struct _GeeHashMapNodeIteratorClass { GObjectClass parent_class; + gboolean (*get_read_only) (GeeHashMapNodeIterator* self); }; struct _GeeHashMapNodeIteratorPrivate { @@ -511,7 +616,6 @@ struct _GeeHashMapNodeIteratorPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - gint _index; }; struct _GeeHashMapKeyIterator { @@ -594,15 +698,27 @@ static gpointer gee_hash_map_value_collection_parent_class = NULL; static gpointer gee_hash_map_entry_set_parent_class = NULL; static gpointer gee_hash_map_node_iterator_parent_class = NULL; static gpointer gee_hash_map_key_iterator_parent_class = NULL; +static GeeTraversableIface* gee_hash_map_key_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_hash_map_key_iterator_gee_iterator_parent_iface = NULL; static gpointer gee_hash_map_map_iterator_parent_class = NULL; static GeeMapIteratorIface* gee_hash_map_map_iterator_gee_map_iterator_parent_iface = NULL; static gpointer gee_hash_map_value_iterator_parent_class = NULL; +static GeeTraversableIface* gee_hash_map_value_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_hash_map_value_iterator_gee_iterator_parent_iface = NULL; static gpointer gee_hash_map_entry_iterator_parent_class = NULL; +static GeeTraversableIface* gee_hash_map_entry_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_hash_map_entry_iterator_gee_iterator_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; @@ -622,30 +738,28 @@ enum { GEE_HASH_MAP_V_DUP_FUNC, GEE_HASH_MAP_V_DESTROY_FUNC, GEE_HASH_MAP_SIZE, + GEE_HASH_MAP_READ_ONLY, GEE_HASH_MAP_KEYS, GEE_HASH_MAP_VALUES, - GEE_HASH_MAP_ENTRIES, - GEE_HASH_MAP_KEY_HASH_FUNC, - GEE_HASH_MAP_KEY_EQUAL_FUNC, - GEE_HASH_MAP_VALUE_EQUAL_FUNC + GEE_HASH_MAP_ENTRIES }; void gee_abstract_map_clear (GeeAbstractMap* self); #define GEE_HASH_MAP_MIN_SIZE 11 #define GEE_HASH_MAP_MAX_SIZE 13845163 -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); -GHashFunc gee_functions_get_hash_func_for (GType t); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_hash_map_set_key_hash_func (GeeHashMap* self, GHashFunc value); -static void gee_hash_map_set_key_equal_func (GeeHashMap* self, GEqualFunc value); -static void gee_hash_map_set_value_equal_func (GeeHashMap* self, GEqualFunc value); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_hash_map_set_key_hash_func (GeeHashMap* self, GeeHashDataFunc value, gpointer value_target); +static void gee_hash_map_set_key_equal_func (GeeHashMap* self, GeeEqualDataFunc value, gpointer value_target); +static void gee_hash_map_set_value_equal_func (GeeHashMap* self, GeeEqualDataFunc value, gpointer value_target); static GeeHashMapNode** gee_hash_map_lookup_node (GeeHashMap* self, gconstpointer key); -GHashFunc gee_hash_map_get_key_hash_func (GeeHashMap* self); -GEqualFunc gee_hash_map_get_key_equal_func (GeeHashMap* self); +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target); static gboolean gee_hash_map_real_has_key (GeeAbstractMap* base, gconstpointer key); static gboolean gee_hash_map_real_has (GeeAbstractMap* base, gconstpointer key, gconstpointer value); -GEqualFunc gee_hash_map_get_value_equal_func (GeeHashMap* self); +GeeEqualDataFunc gee_hash_map_get_value_equal_func (GeeHashMap* self, gpointer* result_target); static gpointer gee_hash_map_real_get (GeeAbstractMap* base, gconstpointer key); static void gee_hash_map_real_set (GeeAbstractMap* base, gconstpointer key, gconstpointer value); static GeeHashMapNode* gee_hash_map_node_new (gpointer k, gpointer v, guint hash); @@ -682,7 +796,8 @@ enum { GEE_HASH_MAP_ENTRY_V_DUP_FUNC, GEE_HASH_MAP_ENTRY_V_DESTROY_FUNC, GEE_HASH_MAP_ENTRY_KEY, - GEE_HASH_MAP_ENTRY_VALUE + GEE_HASH_MAP_ENTRY_VALUE, + GEE_HASH_MAP_ENTRY_READ_ONLY }; static GeeMapEntry* gee_hash_map_entry_entry_for (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashMapNode* node); static GeeHashMapEntry* gee_hash_map_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashMapNode* node); @@ -691,6 +806,7 @@ GeeMapEntry* gee_map_entry_construct (GType object_type, GType k_type, GBoxedCop static void gee_hash_map_entry_finalize (GObject* obj); gconstpointer gee_map_entry_get_key (GeeMapEntry* self); gconstpointer gee_map_entry_get_value (GeeMapEntry* self); +gboolean gee_map_entry_get_read_only (GeeMapEntry* self); static void _vala_gee_hash_map_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value); static void _vala_gee_hash_map_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -703,7 +819,8 @@ enum { GEE_HASH_MAP_KEY_SET_V_TYPE, GEE_HASH_MAP_KEY_SET_V_DUP_FUNC, GEE_HASH_MAP_KEY_SET_V_DESTROY_FUNC, - GEE_HASH_MAP_KEY_SET_SIZE + GEE_HASH_MAP_KEY_SET_SIZE, + GEE_HASH_MAP_KEY_SET_READ_ONLY }; GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static GeeIterator* gee_hash_map_key_set_real_iterator (GeeAbstractCollection* base); @@ -715,12 +832,13 @@ static void gee_hash_map_key_set_real_clear (GeeAbstractCollection* base); static gboolean gee_hash_map_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key); static gboolean gee_hash_map_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key); gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); -static gboolean gee_hash_map_key_set_real_add_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_hash_map_key_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_hash_map_key_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection); +static gboolean gee_hash_map_key_set_add_all (GeeHashMapKeySet* self, GeeCollection* collection); +static gboolean gee_hash_map_key_set_remove_all (GeeHashMapKeySet* self, GeeCollection* collection); +static gboolean gee_hash_map_key_set_retain_all (GeeHashMapKeySet* self, GeeCollection* collection); gint gee_abstract_map_get_size (GeeAbstractMap* self); static void gee_hash_map_key_set_finalize (GObject* obj); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_hash_map_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_HASH_MAP_VALUE_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_HASH_MAP_TYPE_VALUE_COLLECTION, GeeHashMapValueCollectionPrivate)) @@ -732,7 +850,8 @@ enum { GEE_HASH_MAP_VALUE_COLLECTION_V_TYPE, GEE_HASH_MAP_VALUE_COLLECTION_V_DUP_FUNC, GEE_HASH_MAP_VALUE_COLLECTION_V_DESTROY_FUNC, - GEE_HASH_MAP_VALUE_COLLECTION_SIZE + GEE_HASH_MAP_VALUE_COLLECTION_SIZE, + GEE_HASH_MAP_VALUE_COLLECTION_READ_ONLY }; GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static GeeIterator* gee_hash_map_value_collection_real_iterator (GeeAbstractCollection* base); @@ -746,9 +865,9 @@ static gboolean gee_hash_map_value_collection_real_contains (GeeAbstractCollecti GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); gboolean gee_iterator_next (GeeIterator* self); gpointer gee_iterator_get (GeeIterator* self); -static gboolean gee_hash_map_value_collection_real_add_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_hash_map_value_collection_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_hash_map_value_collection_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection); +static gboolean gee_hash_map_value_collection_add_all (GeeHashMapValueCollection* self, GeeCollection* collection); +static gboolean gee_hash_map_value_collection_remove_all (GeeHashMapValueCollection* self, GeeCollection* collection); +static gboolean gee_hash_map_value_collection_retain_all (GeeHashMapValueCollection* self, GeeCollection* collection); static void gee_hash_map_value_collection_finalize (GObject* obj); static void _vala_gee_hash_map_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -761,7 +880,8 @@ enum { GEE_HASH_MAP_ENTRY_SET_V_TYPE, GEE_HASH_MAP_ENTRY_SET_V_DUP_FUNC, GEE_HASH_MAP_ENTRY_SET_V_DESTROY_FUNC, - GEE_HASH_MAP_ENTRY_SET_SIZE + GEE_HASH_MAP_ENTRY_SET_SIZE, + GEE_HASH_MAP_ENTRY_SET_READ_ONLY }; static GeeIterator* gee_hash_map_entry_set_real_iterator (GeeAbstractCollection* base); static GeeHashMapEntryIterator* gee_hash_map_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashMap* map); @@ -772,9 +892,9 @@ static void gee_hash_map_entry_set_real_clear (GeeAbstractCollection* base); static gboolean gee_hash_map_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry); static gboolean gee_hash_map_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry); gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); -static gboolean gee_hash_map_entry_set_real_add_all (GeeAbstractCollection* base, GeeCollection* entries); -static gboolean gee_hash_map_entry_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* entries); -static gboolean gee_hash_map_entry_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* entries); +static gboolean gee_hash_map_entry_set_add_all (GeeHashMapEntrySet* self, GeeCollection* entries); +static gboolean gee_hash_map_entry_set_remove_all (GeeHashMapEntrySet* self, GeeCollection* entries); +static gboolean gee_hash_map_entry_set_retain_all (GeeHashMapEntrySet* self, GeeCollection* entries); static void gee_hash_map_entry_set_finalize (GObject* obj); static void _vala_gee_hash_map_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -786,12 +906,15 @@ enum { GEE_HASH_MAP_NODE_ITERATOR_K_DESTROY_FUNC, GEE_HASH_MAP_NODE_ITERATOR_V_TYPE, GEE_HASH_MAP_NODE_ITERATOR_V_DUP_FUNC, - GEE_HASH_MAP_NODE_ITERATOR_V_DESTROY_FUNC + GEE_HASH_MAP_NODE_ITERATOR_V_DESTROY_FUNC, + GEE_HASH_MAP_NODE_ITERATOR_READ_ONLY, + GEE_HASH_MAP_NODE_ITERATOR_VALID }; static GeeHashMapNodeIterator* gee_hash_map_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashMap* map); static gboolean gee_hash_map_node_iterator_next (GeeHashMapNodeIterator* self); static gboolean gee_hash_map_node_iterator_has_next (GeeHashMapNodeIterator* self); -static gboolean gee_hash_map_node_iterator_first (GeeHashMapNodeIterator* self); +static gboolean gee_hash_map_node_iterator_get_read_only (GeeHashMapNodeIterator* self); +static gboolean gee_hash_map_node_iterator_get_valid (GeeHashMapNodeIterator* self); static void gee_hash_map_node_iterator_finalize (GObject* obj); static void _vala_gee_hash_map_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -807,6 +930,7 @@ enum { }; static gpointer gee_hash_map_key_iterator_real_get (GeeIterator* base); static void gee_hash_map_key_iterator_real_remove (GeeIterator* base); +static gboolean gee_hash_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_hash_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_HASH_MAP_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_HASH_MAP_TYPE_MAP_ITERATOR, GeeHashMapMapIteratorPrivate)) @@ -817,15 +941,17 @@ enum { GEE_HASH_MAP_MAP_ITERATOR_K_DESTROY_FUNC, GEE_HASH_MAP_MAP_ITERATOR_V_TYPE, GEE_HASH_MAP_MAP_ITERATOR_V_DUP_FUNC, - GEE_HASH_MAP_MAP_ITERATOR_V_DESTROY_FUNC + GEE_HASH_MAP_MAP_ITERATOR_V_DESTROY_FUNC, + GEE_HASH_MAP_MAP_ITERATOR_MUTABLE, + GEE_HASH_MAP_MAP_ITERATOR_READ_ONLY }; static gpointer gee_hash_map_map_iterator_real_get_key (GeeMapIterator* base); static void gee_hash_map_map_iterator_real_unset (GeeMapIterator* base); gboolean gee_map_iterator_has_next (GeeMapIterator* self); -gboolean gee_abstract_map_unset (GeeAbstractMap* self, gconstpointer key, gpointer* value); static gpointer gee_hash_map_map_iterator_real_get_value (GeeMapIterator* base); static void gee_hash_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value); void gee_abstract_map_set (GeeAbstractMap* self, gconstpointer key, gconstpointer value); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); static void _vala_gee_hash_map_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_HASH_MAP_VALUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_HASH_MAP_TYPE_VALUE_ITERATOR, GeeHashMapValueIteratorPrivate)) @@ -840,6 +966,7 @@ enum { }; static gpointer gee_hash_map_value_iterator_real_get (GeeIterator* base); static void gee_hash_map_value_iterator_real_remove (GeeIterator* base); +static gboolean gee_hash_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_hash_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_HASH_MAP_ENTRY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_HASH_MAP_TYPE_ENTRY_ITERATOR, GeeHashMapEntryIteratorPrivate)) @@ -854,9 +981,11 @@ enum { }; static GeeMapEntry* gee_hash_map_entry_iterator_real_get (GeeIterator* base); static void gee_hash_map_entry_iterator_real_remove (GeeIterator* base); +static gboolean gee_hash_map_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_hash_map_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_map_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_hash_map_finalize (GObject* obj); +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); @@ -876,16 +1005,22 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify * @param key_equal_func an optional key equality testing function * @param value_equal_func an optional value equality testing function */ -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func) { +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { GeeHashMap * self = NULL; - GHashFunc _tmp0_; - GEqualFunc _tmp2_; - GEqualFunc _tmp4_; - GHashFunc _tmp6_; - GEqualFunc _tmp7_; - GEqualFunc _tmp8_; - gint _tmp9_; - GeeHashMapNode** _tmp10_ = NULL; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp8_; + void* _tmp8__target; + GeeHashDataFunc _tmp12_; + void* _tmp12__target; + GeeEqualDataFunc _tmp13_; + void* _tmp13__target; + GeeEqualDataFunc _tmp14_; + void* _tmp14__target; + gint _tmp15_; + GeeHashMapNode** _tmp16_ = NULL; self = (GeeHashMap*) gee_abstract_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; @@ -894,49 +1029,93 @@ GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyF self->priv->v_dup_func = v_dup_func; self->priv->v_destroy_func = v_destroy_func; _tmp0_ = key_hash_func; + _tmp0__target = key_hash_func_target; if (_tmp0_ == NULL) { - GHashFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_hash_func_for (k_type); - key_hash_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeHashDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_hash_func_for (k_type, &_tmp1_, &_tmp2_); + (key_hash_func_target_destroy_notify == NULL) ? NULL : (key_hash_func_target_destroy_notify (key_hash_func_target), NULL); + key_hash_func = NULL; + key_hash_func_target = NULL; + key_hash_func_target_destroy_notify = NULL; + key_hash_func = _tmp3_; + key_hash_func_target = _tmp1_; + key_hash_func_target_destroy_notify = _tmp2_; } - _tmp2_ = key_equal_func; - if (_tmp2_ == NULL) { - GEqualFunc _tmp3_ = NULL; - _tmp3_ = gee_functions_get_equal_func_for (k_type); - key_equal_func = _tmp3_; - } - _tmp4_ = value_equal_func; + _tmp4_ = key_equal_func; + _tmp4__target = key_equal_func_target; if (_tmp4_ == NULL) { - GEqualFunc _tmp5_ = NULL; - _tmp5_ = gee_functions_get_equal_func_for (v_type); - value_equal_func = _tmp5_; + void* _tmp5_ = NULL; + GDestroyNotify _tmp6_ = NULL; + GeeEqualDataFunc _tmp7_ = NULL; + _tmp7_ = gee_functions_get_equal_func_for (k_type, &_tmp5_, &_tmp6_); + (key_equal_func_target_destroy_notify == NULL) ? NULL : (key_equal_func_target_destroy_notify (key_equal_func_target), NULL); + key_equal_func = NULL; + key_equal_func_target = NULL; + key_equal_func_target_destroy_notify = NULL; + key_equal_func = _tmp7_; + key_equal_func_target = _tmp5_; + key_equal_func_target_destroy_notify = _tmp6_; } - _tmp6_ = key_hash_func; - gee_hash_map_set_key_hash_func (self, _tmp6_); - _tmp7_ = key_equal_func; - gee_hash_map_set_key_equal_func (self, _tmp7_); _tmp8_ = value_equal_func; - gee_hash_map_set_value_equal_func (self, _tmp8_); + _tmp8__target = value_equal_func_target; + if (_tmp8_ == NULL) { + void* _tmp9_ = NULL; + GDestroyNotify _tmp10_ = NULL; + GeeEqualDataFunc _tmp11_ = NULL; + _tmp11_ = gee_functions_get_equal_func_for (v_type, &_tmp9_, &_tmp10_); + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; + value_equal_func = _tmp11_; + value_equal_func_target = _tmp9_; + value_equal_func_target_destroy_notify = _tmp10_; + } + _tmp12_ = key_hash_func; + _tmp12__target = key_hash_func_target; + gee_hash_map_set_key_hash_func (self, _tmp12_, _tmp12__target); + _tmp13_ = key_equal_func; + _tmp13__target = key_equal_func_target; + gee_hash_map_set_key_equal_func (self, _tmp13_, _tmp13__target); + _tmp14_ = value_equal_func; + _tmp14__target = value_equal_func_target; + gee_hash_map_set_value_equal_func (self, _tmp14_, _tmp14__target); self->priv->_array_size = GEE_HASH_MAP_MIN_SIZE; - _tmp9_ = self->priv->_array_size; - _tmp10_ = g_new0 (GeeHashMapNode*, _tmp9_ + 1); + _tmp15_ = self->priv->_array_size; + _tmp16_ = g_new0 (GeeHashMapNode*, _tmp15_ + 1); self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_map_node_free), NULL); - self->priv->_nodes = _tmp10_; - self->priv->_nodes_length1 = _tmp9_; + self->priv->_nodes = _tmp16_; + self->priv->_nodes_length1 = _tmp15_; self->priv->__nodes_size_ = self->priv->_nodes_length1; + (key_hash_func_target_destroy_notify == NULL) ? NULL : (key_hash_func_target_destroy_notify (key_hash_func_target), NULL); + key_hash_func = NULL; + key_hash_func_target = NULL; + key_hash_func_target_destroy_notify = NULL; + (key_equal_func_target_destroy_notify == NULL) ? NULL : (key_equal_func_target_destroy_notify (key_equal_func_target), NULL); + key_equal_func = NULL; + key_equal_func_target = NULL; + key_equal_func_target_destroy_notify = NULL; + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; return self; } -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func) { - return gee_hash_map_construct (GEE_TYPE_HASH_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_hash_func, key_equal_func, value_equal_func); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { + return gee_hash_map_construct (GEE_TYPE_HASH_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_hash_func, key_hash_func_target, key_hash_func_target_destroy_notify, key_equal_func, key_equal_func_target, key_equal_func_target_destroy_notify, value_equal_func, value_equal_func_target, value_equal_func_target_destroy_notify); } static GeeHashMapNode** gee_hash_map_lookup_node (GeeHashMap* self, gconstpointer key) { GeeHashMapNode** result = NULL; - GHashFunc _tmp0_; - GHashFunc _tmp1_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; gconstpointer _tmp2_; guint _tmp3_ = 0U; guint hash_value; @@ -947,10 +1126,11 @@ static GeeHashMapNode** gee_hash_map_lookup_node (GeeHashMap* self, gconstpointe GeeHashMapNode** node; GeeHashMapNode** _tmp22_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = gee_hash_map_get_key_hash_func (self); + _tmp0_ = gee_hash_map_get_key_hash_func (self, &_tmp0__target); _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; _tmp2_ = key; - _tmp3_ = _tmp1_ (_tmp2_); + _tmp3_ = _tmp1_ (_tmp2_, _tmp1__target); hash_value = _tmp3_; _tmp4_ = self->priv->_nodes; _tmp4__length1 = self->priv->_nodes_length1; @@ -975,18 +1155,21 @@ static GeeHashMapNode** gee_hash_map_lookup_node (GeeHashMap* self, gconstpointe if (_tmp10_ != _tmp12_) { _tmp9_ = TRUE; } else { - GEqualFunc _tmp13_; - GEqualFunc _tmp14_; + GeeEqualDataFunc _tmp13_; + void* _tmp13__target; + GeeEqualDataFunc _tmp14_; + void* _tmp14__target; GeeHashMapNode** _tmp15_; gconstpointer _tmp16_; gconstpointer _tmp17_; gboolean _tmp18_ = FALSE; - _tmp13_ = gee_hash_map_get_key_equal_func (self); + _tmp13_ = gee_hash_map_get_key_equal_func (self, &_tmp13__target); _tmp14_ = _tmp13_; + _tmp14__target = _tmp13__target; _tmp15_ = node; _tmp16_ = (*_tmp15_)->key; _tmp17_ = key; - _tmp18_ = _tmp14_ (_tmp16_, _tmp17_); + _tmp18_ = _tmp14_ (_tmp16_, _tmp17_, _tmp14__target); _tmp9_ = !_tmp18_; } _tmp19_ = _tmp9_; @@ -1043,18 +1226,21 @@ static gboolean gee_hash_map_real_has (GeeAbstractMap* base, gconstpointer key, node = _tmp1_; _tmp3_ = node; if ((*_tmp3_) != NULL) { - GEqualFunc _tmp4_; - GEqualFunc _tmp5_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; GeeHashMapNode** _tmp6_; gconstpointer _tmp7_; gconstpointer _tmp8_; gboolean _tmp9_ = FALSE; - _tmp4_ = gee_hash_map_get_value_equal_func (self); + _tmp4_ = gee_hash_map_get_value_equal_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = node; _tmp7_ = (*_tmp6_)->value; _tmp8_ = value; - _tmp9_ = _tmp5_ (_tmp7_, _tmp8_); + _tmp9_ = _tmp5_ (_tmp7_, _tmp8_, _tmp5__target); _tmp2_ = _tmp9_; } else { _tmp2_ = FALSE; @@ -1121,8 +1307,10 @@ static void gee_hash_map_real_set (GeeAbstractMap* base, gconstpointer key, gcon (((*_tmp3_)->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : ((*_tmp3_)->value = (self->priv->v_destroy_func ((*_tmp3_)->value), NULL)); (*_tmp3_)->value = _tmp5_; } else { - GHashFunc _tmp6_; - GHashFunc _tmp7_; + GeeHashDataFunc _tmp6_; + void* _tmp6__target; + GeeHashDataFunc _tmp7_; + void* _tmp7__target; gconstpointer _tmp8_; guint _tmp9_ = 0U; guint hash_value; @@ -1135,10 +1323,11 @@ static void gee_hash_map_real_set (GeeAbstractMap* base, gconstpointer key, gcon GeeHashMapNode* _tmp16_; GeeHashMapNode* _tmp17_; gint _tmp18_; - _tmp6_ = gee_hash_map_get_key_hash_func (self); + _tmp6_ = gee_hash_map_get_key_hash_func (self, &_tmp6__target); _tmp7_ = _tmp6_; + _tmp7__target = _tmp6__target; _tmp8_ = key; - _tmp9_ = _tmp7_ (_tmp8_); + _tmp9_ = _tmp7_ (_tmp8_, _tmp7__target); hash_value = _tmp9_; _tmp10_ = node; _tmp11_ = key; @@ -1296,6 +1485,8 @@ static inline gboolean gee_hash_map_unset_helper (GeeHashMap* self, gconstpointe GeeHashMapNode** _tmp3_; GeeHashMapNode* _tmp4_; GeeHashMapNode* next; + GeeHashMapNode** _tmp5_; + gpointer _tmp6_; GeeHashMapNode** _tmp7_; GeeHashMapNode** _tmp8_; GeeHashMapNode** _tmp9_; @@ -1308,15 +1499,11 @@ static inline gboolean gee_hash_map_unset_helper (GeeHashMap* self, gconstpointe _tmp4_ = (*_tmp3_)->next; (*_tmp3_)->next = NULL; next = _tmp4_; - if ((&_vala_value) != NULL) { - GeeHashMapNode** _tmp5_; - gpointer _tmp6_; - _tmp5_ = node; - _tmp6_ = (*_tmp5_)->value; - (*_tmp5_)->value = NULL; - ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); - _vala_value = _tmp6_; - } + _tmp5_ = node; + _tmp6_ = (*_tmp5_)->value; + (*_tmp5_)->value = NULL; + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = _tmp6_; _tmp7_ = node; (((*_tmp7_)->key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : ((*_tmp7_)->key = (self->priv->k_destroy_func ((*_tmp7_)->key), NULL)); (*_tmp7_)->key = NULL; @@ -1547,6 +1734,15 @@ static gint gee_hash_map_real_get_size (GeeAbstractMap* base) { } +static gboolean gee_hash_map_real_get_read_only (GeeAbstractMap* base) { + gboolean result; + GeeHashMap* self; + self = (GeeHashMap*) base; + result = FALSE; + return result; +} + + static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } @@ -1639,60 +1835,102 @@ static GeeSet* gee_hash_map_real_get_entries (GeeAbstractMap* base) { } -GHashFunc gee_hash_map_get_key_hash_func (GeeHashMap* self) { - GHashFunc result; - GHashFunc _tmp0_; +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target) { + GeeHashDataFunc result; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_key_hash_func; - result = _tmp0_; + _tmp0__target = self->priv->_key_hash_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_map_set_key_hash_func (GeeHashMap* self, GHashFunc value) { - GHashFunc _tmp0_; +static void gee_hash_map_set_key_hash_func (GeeHashMap* self, GeeHashDataFunc value, gpointer value_target) { + GeeHashDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_key_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_hash_func_target_destroy_notify (self->priv->_key_hash_func_target), NULL); + self->priv->_key_hash_func = NULL; + self->priv->_key_hash_func_target = NULL; + self->priv->_key_hash_func_target_destroy_notify = NULL; self->priv->_key_hash_func = _tmp0_; - g_object_notify ((GObject *) self, "key-hash-func"); + self->priv->_key_hash_func_target = _tmp0__target; + self->priv->_key_hash_func_target_destroy_notify = NULL; } -GEqualFunc gee_hash_map_get_key_equal_func (GeeHashMap* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_key_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_key_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_map_set_key_equal_func (GeeHashMap* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_hash_map_set_key_equal_func (GeeHashMap* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_key_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_equal_func_target_destroy_notify (self->priv->_key_equal_func_target), NULL); + self->priv->_key_equal_func = NULL; + self->priv->_key_equal_func_target = NULL; + self->priv->_key_equal_func_target_destroy_notify = NULL; self->priv->_key_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "key-equal-func"); + self->priv->_key_equal_func_target = _tmp0__target; + self->priv->_key_equal_func_target_destroy_notify = NULL; } -GEqualFunc gee_hash_map_get_value_equal_func (GeeHashMap* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +GeeEqualDataFunc gee_hash_map_get_value_equal_func (GeeHashMap* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_value_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_value_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_map_set_value_equal_func (GeeHashMap* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_hash_map_set_value_equal_func (GeeHashMap* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; self->priv->_value_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "value-equal-func"); + self->priv->_value_equal_func_target = _tmp0__target; + self->priv->_value_equal_func_target_destroy_notify = NULL; } @@ -1827,12 +2065,22 @@ static void gee_hash_map_entry_real_set_value (GeeMapEntry* base, gconstpointer } +static gboolean gee_hash_map_entry_real_get_read_only (GeeMapEntry* base) { + gboolean result; + GeeHashMapEntry* self; + self = (GeeHashMapEntry*) base; + result = FALSE; + return result; +} + + static void gee_hash_map_entry_class_init (GeeHashMapEntryClass * klass) { gee_hash_map_entry_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapEntryPrivate)); GEE_MAP_ENTRY_CLASS (klass)->get_key = gee_hash_map_entry_real_get_key; GEE_MAP_ENTRY_CLASS (klass)->get_value = gee_hash_map_entry_real_get_value; GEE_MAP_ENTRY_CLASS (klass)->set_value = gee_hash_map_entry_real_set_value; + GEE_MAP_ENTRY_CLASS (klass)->get_read_only = gee_hash_map_entry_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_entry_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_entry_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_map_entry_finalize; @@ -1844,6 +2092,7 @@ static void gee_hash_map_entry_class_init (GeeHashMapEntryClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_KEY, g_param_spec_pointer ("key", "key", "key", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_VALUE, g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -1881,6 +2130,9 @@ static void _vala_gee_hash_map_entry_get_property (GObject * object, guint prope case GEE_HASH_MAP_ENTRY_VALUE: g_value_set_pointer (value, gee_map_entry_get_value ((GeeMapEntry*) self)); break; + case GEE_HASH_MAP_ENTRY_READ_ONLY: + g_value_set_boolean (value, gee_map_entry_get_read_only ((GeeMapEntry*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -1998,30 +2250,27 @@ static gboolean gee_hash_map_key_set_real_contains (GeeAbstractCollection* base, } -static gboolean gee_hash_map_key_set_real_add_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapKeySet * self; +static gboolean gee_hash_map_key_set_add_all (GeeHashMapKeySet* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapKeySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_key_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapKeySet * self; +static gboolean gee_hash_map_key_set_remove_all (GeeHashMapKeySet* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapKeySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_key_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapKeySet * self; +static gboolean gee_hash_map_key_set_retain_all (GeeHashMapKeySet* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapKeySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; @@ -2043,6 +2292,15 @@ static gint gee_hash_map_key_set_real_get_size (GeeAbstractCollection* base) { } +static gboolean gee_hash_map_key_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeHashMapKeySet* self; + self = (GeeHashMapKeySet*) base; + result = TRUE; + return result; +} + + static void gee_hash_map_key_set_class_init (GeeHashMapKeySetClass * klass) { gee_hash_map_key_set_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapKeySetPrivate)); @@ -2051,10 +2309,8 @@ static void gee_hash_map_key_set_class_init (GeeHashMapKeySetClass * klass) { GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_hash_map_key_set_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_hash_map_key_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_hash_map_key_set_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_hash_map_key_set_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_hash_map_key_set_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_hash_map_key_set_real_retain_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_hash_map_key_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_hash_map_key_set_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_key_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_key_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_map_key_set_finalize; @@ -2065,6 +2321,7 @@ static void gee_hash_map_key_set_class_init (GeeHashMapKeySetClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -2100,6 +2357,9 @@ static void _vala_gee_hash_map_key_set_get_property (GObject * object, guint pro case GEE_HASH_MAP_KEY_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_HASH_MAP_KEY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2211,8 +2471,10 @@ static gboolean gee_hash_map_value_collection_real_contains (GeeAbstractCollecti GeeIterator* _tmp1_; gboolean _tmp2_ = FALSE; GeeHashMap* _tmp3_; - GEqualFunc _tmp4_; - GEqualFunc _tmp5_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; GeeIterator* _tmp6_; gpointer _tmp7_ = NULL; gpointer _tmp8_; @@ -2225,13 +2487,14 @@ static gboolean gee_hash_map_value_collection_real_contains (GeeAbstractCollecti break; } _tmp3_ = self->priv->_map; - _tmp4_ = gee_hash_map_get_value_equal_func (_tmp3_); + _tmp4_ = gee_hash_map_get_value_equal_func (_tmp3_, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = it; _tmp7_ = gee_iterator_get (_tmp6_); _tmp8_ = _tmp7_; _tmp9_ = value; - _tmp10_ = _tmp5_ (_tmp8_, _tmp9_); + _tmp10_ = _tmp5_ (_tmp8_, _tmp9_, _tmp5__target); _tmp11_ = _tmp10_; ((_tmp8_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp8_ = (self->priv->v_destroy_func (_tmp8_), NULL)); if (_tmp11_) { @@ -2246,30 +2509,27 @@ static gboolean gee_hash_map_value_collection_real_contains (GeeAbstractCollecti } -static gboolean gee_hash_map_value_collection_real_add_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapValueCollection * self; +static gboolean gee_hash_map_value_collection_add_all (GeeHashMapValueCollection* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapValueCollection*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_value_collection_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapValueCollection * self; +static gboolean gee_hash_map_value_collection_remove_all (GeeHashMapValueCollection* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapValueCollection*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_value_collection_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeHashMapValueCollection * self; +static gboolean gee_hash_map_value_collection_retain_all (GeeHashMapValueCollection* self, GeeCollection* collection) { gboolean result = FALSE; - self = (GeeHashMapValueCollection*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (collection != NULL, FALSE); g_assert_not_reached (); return result; @@ -2291,6 +2551,15 @@ static gint gee_hash_map_value_collection_real_get_size (GeeAbstractCollection* } +static gboolean gee_hash_map_value_collection_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeHashMapValueCollection* self; + self = (GeeHashMapValueCollection*) base; + result = TRUE; + return result; +} + + static void gee_hash_map_value_collection_class_init (GeeHashMapValueCollectionClass * klass) { gee_hash_map_value_collection_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapValueCollectionPrivate)); @@ -2299,10 +2568,8 @@ static void gee_hash_map_value_collection_class_init (GeeHashMapValueCollectionC GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_hash_map_value_collection_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_hash_map_value_collection_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_hash_map_value_collection_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_hash_map_value_collection_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_hash_map_value_collection_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_hash_map_value_collection_real_retain_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_hash_map_value_collection_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_hash_map_value_collection_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_value_collection_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_value_collection_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_map_value_collection_finalize; @@ -2313,6 +2580,7 @@ static void gee_hash_map_value_collection_class_init (GeeHashMapValueCollectionC g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_VALUE_COLLECTION_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_VALUE_COLLECTION_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_VALUE_COLLECTION_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_VALUE_COLLECTION_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -2348,6 +2616,9 @@ static void _vala_gee_hash_map_value_collection_get_property (GObject * object, case GEE_HASH_MAP_VALUE_COLLECTION_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_HASH_MAP_VALUE_COLLECTION_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2475,30 +2746,27 @@ static gboolean gee_hash_map_entry_set_real_contains (GeeAbstractCollection* bas } -static gboolean gee_hash_map_entry_set_real_add_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeHashMapEntrySet * self; +static gboolean gee_hash_map_entry_set_add_all (GeeHashMapEntrySet* self, GeeCollection* entries) { gboolean result = FALSE; - self = (GeeHashMapEntrySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (entries != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_entry_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeHashMapEntrySet * self; +static gboolean gee_hash_map_entry_set_remove_all (GeeHashMapEntrySet* self, GeeCollection* entries) { gboolean result = FALSE; - self = (GeeHashMapEntrySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (entries != NULL, FALSE); g_assert_not_reached (); return result; } -static gboolean gee_hash_map_entry_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeHashMapEntrySet * self; +static gboolean gee_hash_map_entry_set_retain_all (GeeHashMapEntrySet* self, GeeCollection* entries) { gboolean result = FALSE; - self = (GeeHashMapEntrySet*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (entries != NULL, FALSE); g_assert_not_reached (); return result; @@ -2520,6 +2788,15 @@ static gint gee_hash_map_entry_set_real_get_size (GeeAbstractCollection* base) { } +static gboolean gee_hash_map_entry_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeHashMapEntrySet* self; + self = (GeeHashMapEntrySet*) base; + result = TRUE; + return result; +} + + static void gee_hash_map_entry_set_class_init (GeeHashMapEntrySetClass * klass) { gee_hash_map_entry_set_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapEntrySetPrivate)); @@ -2528,10 +2805,8 @@ static void gee_hash_map_entry_set_class_init (GeeHashMapEntrySetClass * klass) GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_hash_map_entry_set_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_hash_map_entry_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_hash_map_entry_set_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_hash_map_entry_set_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_hash_map_entry_set_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_hash_map_entry_set_real_retain_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_hash_map_entry_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_hash_map_entry_set_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_entry_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_entry_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_map_entry_set_finalize; @@ -2542,6 +2817,7 @@ static void gee_hash_map_entry_set_class_init (GeeHashMapEntrySetClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -2577,6 +2853,9 @@ static void _vala_gee_hash_map_entry_set_get_property (GObject * object, guint p case GEE_HASH_MAP_ENTRY_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_HASH_MAP_ENTRY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2706,7 +2985,7 @@ static gboolean gee_hash_map_node_iterator_has_next (GeeHashMapNodeIterator* sel gint _tmp10_; GeeHashMap* _tmp11_; gint _tmp12_; - _tmp10_ = self->priv->_index; + _tmp10_ = self->_index; _tmp11_ = self->_map; _tmp12_ = _tmp11_->priv->_array_size; _tmp8_ = (_tmp10_ + 1) < _tmp12_; @@ -2717,12 +2996,12 @@ static gboolean gee_hash_map_node_iterator_has_next (GeeHashMapNodeIterator* sel if (!_tmp13_) { break; } - _tmp14_ = self->priv->_index; - self->priv->_index = _tmp14_ + 1; + _tmp14_ = self->_index; + self->_index = _tmp14_ + 1; _tmp15_ = self->_map; _tmp16_ = _tmp15_->priv->_nodes; _tmp16__length1 = _tmp15_->priv->_nodes_length1; - _tmp17_ = self->priv->_index; + _tmp17_ = self->_index; _tmp18_ = _tmp16_[_tmp17_]; self->_next = _tmp18_; } @@ -2733,31 +3012,27 @@ static gboolean gee_hash_map_node_iterator_has_next (GeeHashMapNodeIterator* sel } -static gboolean gee_hash_map_node_iterator_first (GeeHashMapNodeIterator* self) { - gboolean result = FALSE; - gint _tmp0_; - GeeHashMap* _tmp1_; - gint _tmp2_; - GeeHashMap* _tmp3_; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; +static gboolean gee_hash_map_node_iterator_get_read_only (GeeHashMapNodeIterator* self) { g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->_stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->_stamp; - _vala_assert (_tmp0_ == _tmp2_, "_stamp == _map._stamp"); - _tmp3_ = self->_map; - _tmp4_ = gee_abstract_map_get_size ((GeeMap*) _tmp3_); - _tmp5_ = _tmp4_; - if (_tmp5_ == 0) { - result = FALSE; - return result; - } - self->priv->_index = -1; - self->_next = NULL; - _tmp6_ = gee_hash_map_node_iterator_next (self); - result = _tmp6_; + return GEE_HASH_MAP_NODE_ITERATOR_GET_CLASS (self)->get_read_only (self); +} + + +static gboolean gee_hash_map_node_iterator_real_get_read_only (GeeHashMapNodeIterator* base) { + gboolean result; + GeeHashMapNodeIterator* self; + self = base; + result = TRUE; + return result; +} + + +static gboolean gee_hash_map_node_iterator_get_valid (GeeHashMapNodeIterator* self) { + gboolean result; + GeeHashMapNode* _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->_node; + result = _tmp0_ != NULL; return result; } @@ -2765,6 +3040,7 @@ static gboolean gee_hash_map_node_iterator_first (GeeHashMapNodeIterator* self) static void gee_hash_map_node_iterator_class_init (GeeHashMapNodeIteratorClass * klass) { gee_hash_map_node_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapNodeIteratorPrivate)); + GEE_HASH_MAP_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_hash_map_node_iterator_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_node_iterator_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_node_iterator_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_map_node_iterator_finalize; @@ -2774,12 +3050,14 @@ static void gee_hash_map_node_iterator_class_init (GeeHashMapNodeIteratorClass * g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_NODE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_NODE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_NODE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_NODE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_NODE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } static void gee_hash_map_node_iterator_instance_init (GeeHashMapNodeIterator * self) { self->priv = GEE_HASH_MAP_NODE_ITERATOR_GET_PRIVATE (self); - self->priv->_index = -1; + self->_index = -1; } @@ -2807,6 +3085,12 @@ static void _vala_gee_hash_map_node_iterator_get_property (GObject * object, gui GeeHashMapNodeIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_MAP_TYPE_NODE_ITERATOR, GeeHashMapNodeIterator); switch (property_id) { + case GEE_HASH_MAP_NODE_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_hash_map_node_iterator_get_read_only (self)); + break; + case GEE_HASH_MAP_NODE_ITERATOR_VALID: + g_value_set_boolean (value, gee_hash_map_node_iterator_get_valid (self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2896,6 +3180,100 @@ static void gee_hash_map_key_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_hash_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeHashMapKeyIterator * self; + gboolean result = FALSE; + GeeHashMapNode* _tmp0_; + self = (GeeHashMapKeyIterator*) base; + _tmp0_ = ((GeeHashMapNodeIterator*) self)->_node; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeHashMapNode* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + gboolean _tmp5_ = FALSE; + GeeHashMapNode* _tmp6_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp3_ = _tmp2_->key; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + _tmp5_ = _tmp1_ (_tmp4_, _tmp1__target); + if (!_tmp5_) { + result = FALSE; + return result; + } + _tmp6_ = ((GeeHashMapNodeIterator*) self)->_next; + if (_tmp6_ == NULL) { + GeeHashMapNode* _tmp7_; + GeeHashMapNode* _tmp8_; + _tmp7_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp8_ = _tmp7_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp8_; + } + } + while (TRUE) { + gint _tmp18_; + GeeHashMap* _tmp19_; + gint _tmp20_; + while (TRUE) { + GeeHashMapNode* _tmp9_; + GeeHashMapNode* _tmp10_; + GeeForallFunc _tmp11_; + void* _tmp11__target; + GeeHashMapNode* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + gboolean _tmp15_ = FALSE; + GeeHashMapNode* _tmp16_; + GeeHashMapNode* _tmp17_; + _tmp9_ = ((GeeHashMapNodeIterator*) self)->_next; + if (!(_tmp9_ != NULL)) { + break; + } + _tmp10_ = ((GeeHashMapNodeIterator*) self)->_next; + ((GeeHashMapNodeIterator*) self)->_node = _tmp10_; + _tmp11_ = f; + _tmp11__target = f_target; + _tmp12_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp13_ = _tmp12_->key; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _tmp15_ = _tmp11_ (_tmp14_, _tmp11__target); + if (!_tmp15_) { + result = FALSE; + return result; + } + _tmp16_ = ((GeeHashMapNodeIterator*) self)->_next; + _tmp17_ = _tmp16_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp17_; + } + _tmp18_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp19_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp20_ = _tmp19_->priv->_array_size; + if ((_tmp18_ + 1) < _tmp20_) { + GeeHashMap* _tmp21_; + GeeHashMapNode** _tmp22_; + gint _tmp22__length1; + gint _tmp23_; + gint _tmp24_; + GeeHashMapNode* _tmp25_; + _tmp21_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp22_ = _tmp21_->priv->_nodes; + _tmp22__length1 = _tmp21_->priv->_nodes_length1; + _tmp23_ = ((GeeHashMapNodeIterator*) self)->_index; + ((GeeHashMapNodeIterator*) self)->_index = _tmp23_ + 1; + _tmp24_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp25_ = _tmp22_[_tmp24_]; + ((GeeHashMapNodeIterator*) self)->_next = _tmp25_; + } else { + result = TRUE; + return result; + } + } +} + + static void gee_hash_map_key_iterator_class_init (GeeHashMapKeyIteratorClass * klass) { gee_hash_map_key_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapKeyIteratorPrivate)); @@ -2910,13 +3288,38 @@ static void gee_hash_map_key_iterator_class_init (GeeHashMapKeyIteratorClass * k } +static GType gee_hash_map_key_iterator_gee_traversable_get_g_type (GeeHashMapKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_hash_map_key_iterator_gee_traversable_get_g_dup_func (GeeHashMapKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_hash_map_key_iterator_gee_traversable_get_g_destroy_func (GeeHashMapKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_hash_map_key_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_hash_map_key_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_hash_map_key_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_hash_map_key_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_hash_map_key_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_hash_map_key_iterator_gee_traversable_get_g_destroy_func; +} + + static void gee_hash_map_key_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { gee_hash_map_key_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->get = (gpointer (*)(GeeIterator*)) gee_hash_map_key_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_hash_map_key_iterator_real_remove; iface->next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_first; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_read_only; } @@ -2929,9 +3332,11 @@ static GType gee_hash_map_key_iterator_get_type (void) { static volatile gsize gee_hash_map_key_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_hash_map_key_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeHashMapKeyIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_map_key_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashMapKeyIterator), 0, (GInstanceInitFunc) gee_hash_map_key_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_hash_map_key_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_hash_map_key_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_hash_map_key_iterator_type_id; gee_hash_map_key_iterator_type_id = g_type_register_static (GEE_HASH_MAP_TYPE_NODE_ITERATOR, "GeeHashMapKeyIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_hash_map_key_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_hash_map_key_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_hash_map_key_iterator_type_id__volatile, gee_hash_map_key_iterator_type_id); } @@ -3047,7 +3452,7 @@ static void gee_hash_map_map_iterator_real_unset (GeeMapIterator* base) { _tmp4_ = ((GeeHashMapNodeIterator*) self)->_map; _tmp5_ = ((GeeHashMapNodeIterator*) self)->_node; _tmp6_ = _tmp5_->key; - gee_abstract_map_unset ((GeeAbstractMap*) _tmp4_, _tmp6_, NULL); + gee_hash_map_unset_helper (_tmp4_, _tmp6_, NULL); ((GeeHashMapNodeIterator*) self)->_node = NULL; _tmp7_ = ((GeeHashMapNodeIterator*) self)->_map; _tmp8_ = _tmp7_->priv->_stamp; @@ -3110,9 +3515,28 @@ static void gee_hash_map_map_iterator_real_set_value (GeeMapIterator* base, gcon } +static gboolean gee_hash_map_map_iterator_real_get_mutable (GeeMapIterator* base) { + gboolean result; + GeeHashMapMapIterator* self; + self = (GeeHashMapMapIterator*) base; + result = TRUE; + return result; +} + + +static gboolean gee_hash_map_map_iterator_real_get_read_only (GeeHashMapNodeIterator* base) { + gboolean result; + GeeHashMapMapIterator* self; + self = (GeeHashMapMapIterator*) base; + result = FALSE; + return result; +} + + static void gee_hash_map_map_iterator_class_init (GeeHashMapMapIteratorClass * klass) { gee_hash_map_map_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapMapIteratorPrivate)); + GEE_HASH_MAP_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_hash_map_map_iterator_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_map_map_iterator_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_map_map_iterator_set_property; g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); @@ -3121,6 +3545,38 @@ static void gee_hash_map_map_iterator_class_init (GeeHashMapMapIteratorClass * k g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_MUTABLE, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_MAP_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_hash_map_map_iterator_gee_map_iterator_get_k_type (GeeHashMapMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_hash_map_map_iterator_gee_map_iterator_get_k_dup_func (GeeHashMapMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_hash_map_map_iterator_gee_map_iterator_get_k_destroy_func (GeeHashMapMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_hash_map_map_iterator_gee_map_iterator_get_v_type (GeeHashMapMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_hash_map_map_iterator_gee_map_iterator_get_v_dup_func (GeeHashMapMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_hash_map_map_iterator_gee_map_iterator_get_v_destroy_func (GeeHashMapMapIterator* self) { + return self->priv->v_destroy_func; } @@ -3130,9 +3586,17 @@ static void gee_hash_map_map_iterator_gee_map_iterator_interface_init (GeeMapIte iface->unset = (void (*)(GeeMapIterator*)) gee_hash_map_map_iterator_real_unset; iface->get_value = (gpointer (*)(GeeMapIterator*)) gee_hash_map_map_iterator_real_get_value; iface->set_value = (void (*)(GeeMapIterator*, gconstpointer)) gee_hash_map_map_iterator_real_set_value; + iface->get_k_type = (GType(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_hash_map_map_iterator_gee_map_iterator_get_v_destroy_func; iface->next = (gboolean (*)(GeeMapIterator*)) gee_hash_map_node_iterator_next; iface->has_next = (gboolean (*)(GeeMapIterator*)) gee_hash_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeMapIterator*)) gee_hash_map_node_iterator_first; + iface->get_mutable = gee_hash_map_map_iterator_real_get_mutable; + iface->get_read_only = gee_hash_map_map_iterator_real_get_read_only; + iface->get_valid = (gboolean (*) (GeeMapIterator *)) gee_hash_map_node_iterator_get_valid; } @@ -3159,6 +3623,12 @@ static void _vala_gee_hash_map_map_iterator_get_property (GObject * object, guin GeeHashMapMapIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_MAP_TYPE_MAP_ITERATOR, GeeHashMapMapIterator); switch (property_id) { + case GEE_HASH_MAP_MAP_ITERATOR_MUTABLE: + g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self)); + break; + case GEE_HASH_MAP_MAP_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_hash_map_node_iterator_get_read_only ((GeeHashMapNodeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -3248,6 +3718,100 @@ static void gee_hash_map_value_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_hash_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeHashMapValueIterator * self; + gboolean result = FALSE; + GeeHashMapNode* _tmp0_; + self = (GeeHashMapValueIterator*) base; + _tmp0_ = ((GeeHashMapNodeIterator*) self)->_node; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeHashMapNode* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + gboolean _tmp5_ = FALSE; + GeeHashMapNode* _tmp6_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp3_ = _tmp2_->value; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + _tmp5_ = _tmp1_ (_tmp4_, _tmp1__target); + if (!_tmp5_) { + result = FALSE; + return result; + } + _tmp6_ = ((GeeHashMapNodeIterator*) self)->_next; + if (_tmp6_ == NULL) { + GeeHashMapNode* _tmp7_; + GeeHashMapNode* _tmp8_; + _tmp7_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp8_ = _tmp7_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp8_; + } + } + while (TRUE) { + gint _tmp18_; + GeeHashMap* _tmp19_; + gint _tmp20_; + while (TRUE) { + GeeHashMapNode* _tmp9_; + GeeHashMapNode* _tmp10_; + GeeForallFunc _tmp11_; + void* _tmp11__target; + GeeHashMapNode* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + gboolean _tmp15_ = FALSE; + GeeHashMapNode* _tmp16_; + GeeHashMapNode* _tmp17_; + _tmp9_ = ((GeeHashMapNodeIterator*) self)->_next; + if (!(_tmp9_ != NULL)) { + break; + } + _tmp10_ = ((GeeHashMapNodeIterator*) self)->_next; + ((GeeHashMapNodeIterator*) self)->_node = _tmp10_; + _tmp11_ = f; + _tmp11__target = f_target; + _tmp12_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp13_ = _tmp12_->value; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _tmp15_ = _tmp11_ (_tmp14_, _tmp11__target); + if (!_tmp15_) { + result = FALSE; + return result; + } + _tmp16_ = ((GeeHashMapNodeIterator*) self)->_next; + _tmp17_ = _tmp16_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp17_; + } + _tmp18_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp19_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp20_ = _tmp19_->priv->_array_size; + if ((_tmp18_ + 1) < _tmp20_) { + GeeHashMap* _tmp21_; + GeeHashMapNode** _tmp22_; + gint _tmp22__length1; + gint _tmp23_; + gint _tmp24_; + GeeHashMapNode* _tmp25_; + _tmp21_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp22_ = _tmp21_->priv->_nodes; + _tmp22__length1 = _tmp21_->priv->_nodes_length1; + _tmp23_ = ((GeeHashMapNodeIterator*) self)->_index; + ((GeeHashMapNodeIterator*) self)->_index = _tmp23_ + 1; + _tmp24_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp25_ = _tmp22_[_tmp24_]; + ((GeeHashMapNodeIterator*) self)->_next = _tmp25_; + } else { + result = TRUE; + return result; + } + } +} + + static void gee_hash_map_value_iterator_class_init (GeeHashMapValueIteratorClass * klass) { gee_hash_map_value_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapValueIteratorPrivate)); @@ -3262,13 +3826,38 @@ static void gee_hash_map_value_iterator_class_init (GeeHashMapValueIteratorClass } +static GType gee_hash_map_value_iterator_gee_traversable_get_g_type (GeeHashMapValueIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_hash_map_value_iterator_gee_traversable_get_g_dup_func (GeeHashMapValueIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_hash_map_value_iterator_gee_traversable_get_g_destroy_func (GeeHashMapValueIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_hash_map_value_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_hash_map_value_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_hash_map_value_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_hash_map_value_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_hash_map_value_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_hash_map_value_iterator_gee_traversable_get_g_destroy_func; +} + + static void gee_hash_map_value_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { gee_hash_map_value_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->get = (gpointer (*)(GeeIterator*)) gee_hash_map_value_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_hash_map_value_iterator_real_remove; iface->next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_first; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_read_only; } @@ -3281,9 +3870,11 @@ static GType gee_hash_map_value_iterator_get_type (void) { static volatile gsize gee_hash_map_value_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_hash_map_value_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeHashMapValueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_map_value_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashMapValueIterator), 0, (GInstanceInitFunc) gee_hash_map_value_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_hash_map_value_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_hash_map_value_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_hash_map_value_iterator_type_id; gee_hash_map_value_iterator_type_id = g_type_register_static (GEE_HASH_MAP_TYPE_NODE_ITERATOR, "GeeHashMapValueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_hash_map_value_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_hash_map_value_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_hash_map_value_iterator_type_id__volatile, gee_hash_map_value_iterator_type_id); } @@ -3382,6 +3973,96 @@ static void gee_hash_map_entry_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_hash_map_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeHashMapEntryIterator * self; + gboolean result = FALSE; + GeeHashMapNode* _tmp0_; + self = (GeeHashMapEntryIterator*) base; + _tmp0_ = ((GeeHashMapNodeIterator*) self)->_node; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeHashMapNode* _tmp2_; + GeeMapEntry* _tmp3_ = NULL; + gboolean _tmp4_ = FALSE; + GeeHashMapNode* _tmp5_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp3_ = gee_hash_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + _tmp4_ = _tmp1_ (_tmp3_, _tmp1__target); + if (!_tmp4_) { + result = FALSE; + return result; + } + _tmp5_ = ((GeeHashMapNodeIterator*) self)->_next; + if (_tmp5_ == NULL) { + GeeHashMapNode* _tmp6_; + GeeHashMapNode* _tmp7_; + _tmp6_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp7_ = _tmp6_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp7_; + } + } + while (TRUE) { + gint _tmp16_; + GeeHashMap* _tmp17_; + gint _tmp18_; + while (TRUE) { + GeeHashMapNode* _tmp8_; + GeeHashMapNode* _tmp9_; + GeeForallFunc _tmp10_; + void* _tmp10__target; + GeeHashMapNode* _tmp11_; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeHashMapNode* _tmp14_; + GeeHashMapNode* _tmp15_; + _tmp8_ = ((GeeHashMapNodeIterator*) self)->_next; + if (!(_tmp8_ != NULL)) { + break; + } + _tmp9_ = ((GeeHashMapNodeIterator*) self)->_next; + ((GeeHashMapNodeIterator*) self)->_node = _tmp9_; + _tmp10_ = f; + _tmp10__target = f_target; + _tmp11_ = ((GeeHashMapNodeIterator*) self)->_node; + _tmp12_ = gee_hash_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp11_); + _tmp13_ = _tmp10_ (_tmp12_, _tmp10__target); + if (!_tmp13_) { + result = FALSE; + return result; + } + _tmp14_ = ((GeeHashMapNodeIterator*) self)->_next; + _tmp15_ = _tmp14_->next; + ((GeeHashMapNodeIterator*) self)->_next = _tmp15_; + } + _tmp16_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp17_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp18_ = _tmp17_->priv->_array_size; + if ((_tmp16_ + 1) < _tmp18_) { + GeeHashMap* _tmp19_; + GeeHashMapNode** _tmp20_; + gint _tmp20__length1; + gint _tmp21_; + gint _tmp22_; + GeeHashMapNode* _tmp23_; + _tmp19_ = ((GeeHashMapNodeIterator*) self)->_map; + _tmp20_ = _tmp19_->priv->_nodes; + _tmp20__length1 = _tmp19_->priv->_nodes_length1; + _tmp21_ = ((GeeHashMapNodeIterator*) self)->_index; + ((GeeHashMapNodeIterator*) self)->_index = _tmp21_ + 1; + _tmp22_ = ((GeeHashMapNodeIterator*) self)->_index; + _tmp23_ = _tmp20_[_tmp22_]; + ((GeeHashMapNodeIterator*) self)->_next = _tmp23_; + } else { + result = TRUE; + return result; + } + } +} + + static void gee_hash_map_entry_iterator_class_init (GeeHashMapEntryIteratorClass * klass) { gee_hash_map_entry_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashMapEntryIteratorPrivate)); @@ -3396,13 +4077,38 @@ static void gee_hash_map_entry_iterator_class_init (GeeHashMapEntryIteratorClass } +static GType gee_hash_map_entry_iterator_gee_traversable_get_g_type (GeeHashMapEntryIterator* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_hash_map_entry_iterator_gee_traversable_get_g_dup_func (GeeHashMapEntryIterator* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_hash_map_entry_iterator_gee_traversable_get_g_destroy_func (GeeHashMapEntryIterator* self) { + return g_object_unref; +} + + +static void gee_hash_map_entry_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_hash_map_entry_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_hash_map_entry_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_hash_map_entry_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_hash_map_entry_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_hash_map_entry_iterator_gee_traversable_get_g_destroy_func; +} + + static void gee_hash_map_entry_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { gee_hash_map_entry_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->get = (gpointer (*)(GeeIterator*)) gee_hash_map_entry_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_hash_map_entry_iterator_real_remove; iface->next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_hash_map_node_iterator_first; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_hash_map_node_iterator_get_read_only; } @@ -3415,9 +4121,11 @@ static GType gee_hash_map_entry_iterator_get_type (void) { static volatile gsize gee_hash_map_entry_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_hash_map_entry_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeHashMapEntryIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_map_entry_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashMapEntryIterator), 0, (GInstanceInitFunc) gee_hash_map_entry_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_hash_map_entry_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_hash_map_entry_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_hash_map_entry_iterator_type_id; gee_hash_map_entry_iterator_type_id = g_type_register_static (GEE_HASH_MAP_TYPE_NODE_ITERATOR, "GeeHashMapEntryIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_hash_map_entry_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_hash_map_entry_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_hash_map_entry_iterator_type_id__volatile, gee_hash_map_entry_iterator_type_id); } @@ -3476,6 +4184,7 @@ static void gee_hash_map_class_init (GeeHashMapClass * klass) { GEE_ABSTRACT_MAP_CLASS (klass)->clear = gee_hash_map_real_clear; GEE_ABSTRACT_MAP_CLASS (klass)->map_iterator = gee_hash_map_real_map_iterator; GEE_ABSTRACT_MAP_CLASS (klass)->get_size = gee_hash_map_real_get_size; + GEE_ABSTRACT_MAP_CLASS (klass)->get_read_only = gee_hash_map_real_get_read_only; GEE_ABSTRACT_MAP_CLASS (klass)->get_keys = gee_hash_map_real_get_keys; GEE_ABSTRACT_MAP_CLASS (klass)->get_values = gee_hash_map_real_get_values; GEE_ABSTRACT_MAP_CLASS (klass)->get_entries = gee_hash_map_real_get_entries; @@ -3492,6 +4201,10 @@ static void gee_hash_map_class_init (GeeHashMapClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -3504,18 +4217,6 @@ static void gee_hash_map_class_init (GeeHashMapClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_ENTRIES, g_param_spec_object ("entries", "entries", "entries", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The keys' hash function. - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_HASH_FUNC, g_param_spec_pointer ("key-hash-func", "key-hash-func", "key-hash-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The keys' equality testing function. - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_KEY_EQUAL_FUNC, g_param_spec_pointer ("key-equal-func", "key-equal-func", "key-equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The values' equality testing function. - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MAP_VALUE_EQUAL_FUNC, g_param_spec_pointer ("value-equal-func", "value-equal-func", "value-equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -3529,6 +4230,18 @@ static void gee_hash_map_finalize (GObject* obj) { GeeHashMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_HASH_MAP, GeeHashMap); gee_abstract_map_clear ((GeeAbstractMap*) self); + (self->priv->_key_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_hash_func_target_destroy_notify (self->priv->_key_hash_func_target), NULL); + self->priv->_key_hash_func = NULL; + self->priv->_key_hash_func_target = NULL; + self->priv->_key_hash_func_target_destroy_notify = NULL; + (self->priv->_key_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_equal_func_target_destroy_notify (self->priv->_key_equal_func_target), NULL); + self->priv->_key_equal_func = NULL; + self->priv->_key_equal_func_target = NULL; + self->priv->_key_equal_func_target_destroy_notify = NULL; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_map_node_free), NULL); G_OBJECT_CLASS (gee_hash_map_parent_class)->finalize (obj); } @@ -3562,6 +4275,9 @@ static void _vala_gee_hash_map_get_property (GObject * object, guint property_id case GEE_HASH_MAP_SIZE: g_value_set_int (value, gee_abstract_map_get_size ((GeeAbstractMap*) self)); break; + case GEE_HASH_MAP_READ_ONLY: + g_value_set_boolean (value, gee_abstract_map_get_read_only ((GeeAbstractMap*) self)); + break; case GEE_HASH_MAP_KEYS: g_value_take_object (value, gee_abstract_map_get_keys ((GeeAbstractMap*) self)); break; @@ -3571,15 +4287,6 @@ static void _vala_gee_hash_map_get_property (GObject * object, guint property_id case GEE_HASH_MAP_ENTRIES: g_value_take_object (value, gee_abstract_map_get_entries ((GeeAbstractMap*) self)); break; - case GEE_HASH_MAP_KEY_HASH_FUNC: - g_value_set_pointer (value, gee_hash_map_get_key_hash_func (self)); - break; - case GEE_HASH_MAP_KEY_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_map_get_key_equal_func (self)); - break; - case GEE_HASH_MAP_VALUE_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_map_get_value_equal_func (self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -3591,15 +4298,6 @@ static void _vala_gee_hash_map_set_property (GObject * object, guint property_id GeeHashMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_MAP, GeeHashMap); switch (property_id) { - case GEE_HASH_MAP_KEY_HASH_FUNC: - gee_hash_map_set_key_hash_func (self, g_value_get_pointer (value)); - break; - case GEE_HASH_MAP_KEY_EQUAL_FUNC: - gee_hash_map_set_key_equal_func (self, g_value_get_pointer (value)); - break; - case GEE_HASH_MAP_VALUE_EQUAL_FUNC: - gee_hash_map_set_value_equal_func (self, g_value_get_pointer (value)); - break; case GEE_HASH_MAP_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; diff --git a/gee/hashmap.vala b/gee/hashmap.vala index 6e8670f..da06f72 100644 --- a/gee/hashmap.vala +++ b/gee/hashmap.vala @@ -40,6 +40,13 @@ public class Gee.HashMap : Gee.AbstractMap { public override int size { get { return _nnodes; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * {@inheritDoc} @@ -89,17 +96,20 @@ public class Gee.HashMap : Gee.AbstractMap { /** * The keys' hash function. */ - public HashFunc key_hash_func { private set; get; } + [CCode (notify = false)] + public HashDataFunc key_hash_func { private set; get; } /** * The keys' equality testing function. */ - public EqualFunc key_equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc key_equal_func { private set; get; } /** * The values' equality testing function. */ - public EqualFunc value_equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc value_equal_func { private set; get; } private int _array_size; private int _nnodes; @@ -125,7 +135,7 @@ public class Gee.HashMap : Gee.AbstractMap { * @param key_equal_func an optional key equality testing function * @param value_equal_func an optional value equality testing function */ - public HashMap (HashFunc? key_hash_func = null, EqualFunc? key_equal_func = null, EqualFunc? value_equal_func = null) { + public HashMap (owned HashDataFunc? key_hash_func = null, owned EqualDataFunc? key_equal_func = null, owned EqualDataFunc? value_equal_func = null) { if (key_hash_func == null) { key_hash_func = Functions.get_hash_func_for (typeof (K)); } @@ -236,9 +246,7 @@ public class Gee.HashMap : Gee.AbstractMap { if (*node != null) { Node next = (owned) (*node)->next; - if (&value != null) { - value = (owned) (*node)->value; - } + value = (owned) (*node)->value; (*node)->key = null; (*node)->value = null; @@ -321,6 +329,8 @@ public class Gee.HashMap : Gee.AbstractMap { get { return _node.value; } set { _node.value = value; } } + + public override bool read_only { get { return false; } } } private class KeySet : AbstractSet { @@ -338,6 +348,10 @@ public class Gee.HashMap : Gee.AbstractMap { get { return _map.size; } } + public override bool read_only { + get { return true; } + } + public override bool add (K key) { assert_not_reached (); } @@ -354,15 +368,15 @@ public class Gee.HashMap : Gee.AbstractMap { return _map.has_key (key); } - public override bool add_all (Collection collection) { + public bool add_all (Collection collection) { assert_not_reached (); } - public override bool remove_all (Collection collection) { + public bool remove_all (Collection collection) { assert_not_reached (); } - public override bool retain_all (Collection collection) { + public bool retain_all (Collection collection) { assert_not_reached (); } @@ -383,6 +397,10 @@ public class Gee.HashMap : Gee.AbstractMap { get { return _map.size; } } + public override bool read_only { + get { return true; } + } + public override bool add (V value) { assert_not_reached (); } @@ -405,15 +423,15 @@ public class Gee.HashMap : Gee.AbstractMap { return false; } - public override bool add_all (Collection collection) { + public bool add_all (Collection collection) { assert_not_reached (); } - public override bool remove_all (Collection collection) { + public bool remove_all (Collection collection) { assert_not_reached (); } - public override bool retain_all (Collection collection) { + public bool retain_all (Collection collection) { assert_not_reached (); } } @@ -433,6 +451,10 @@ public class Gee.HashMap : Gee.AbstractMap { get { return _map.size; } } + public override bool read_only { + get { return true; } + } + public override bool add (Map.Entry entry) { assert_not_reached (); } @@ -449,22 +471,22 @@ public class Gee.HashMap : Gee.AbstractMap { return _map.has (entry.key, entry.value); } - public override bool add_all (Collection> entries) { + public bool add_all (Collection> entries) { assert_not_reached (); } - public override bool remove_all (Collection> entries) { + public bool remove_all (Collection> entries) { assert_not_reached (); } - public override bool retain_all (Collection> entries) { + public bool retain_all (Collection> entries) { assert_not_reached (); } } private abstract class NodeIterator : Object { protected HashMap _map; - private int _index = -1; + protected int _index = -1; protected weak Node _node; protected weak Node _next; @@ -500,19 +522,21 @@ public class Gee.HashMap : Gee.AbstractMap { } return (_next != null); } - - public bool first () { - assert (_stamp == _map._stamp); - if (_map.size == 0) { - return false; + + public virtual bool read_only { + get { + return true; + } + } + + public bool valid { + get { + return _node != null; } - _index = -1; - _next = null; - return next (); } } - private class KeyIterator : NodeIterator, Iterator { + private class KeyIterator : NodeIterator, Traversable, Iterator { public KeyIterator (HashMap map) { base (map); } @@ -526,6 +550,31 @@ public class Gee.HashMap : Gee.AbstractMap { public void remove () { assert_not_reached (); } + + public bool foreach(ForallFunc f) { + if (_node != null) { + if (!f(_node.key)) { + return false; + } + if(_next == null) { + _next = _node.next; + } + } + do { + while(_next != null) { + _node = _next; + if (!f(_node.key)) { + return false; + } + _next = _next.next; + } + if (_index + 1 < _map._array_size) { + _next = _map._nodes[++_index]; + } else { + return true; + } + } while(true); + } } private class MapIterator : NodeIterator, Gee.MapIterator { @@ -543,7 +592,7 @@ public class Gee.HashMap : Gee.AbstractMap { assert (_stamp == _map._stamp); assert (_node != null); has_next (); - _map.unset (_node.key); + _map.unset_helper (_node.key); _node = null; _stamp = _map._stamp; } @@ -560,9 +609,21 @@ public class Gee.HashMap : Gee.AbstractMap { _map.set (_node.key, value); _stamp = _map._stamp; } + + public bool mutable { + get { + return true; + } + } + + public override bool read_only { + get { + return false; + } + } } - private class ValueIterator : NodeIterator, Iterator { + private class ValueIterator : NodeIterator, Traversable, Iterator { public ValueIterator (HashMap map) { base (map); } @@ -576,9 +637,34 @@ public class Gee.HashMap : Gee.AbstractMap { public void remove () { assert_not_reached (); } + + public bool foreach(ForallFunc f) { + if (_node != null) { + if (!f(_node.value)) { + return false; + } + if(_next == null) { + _next = _node.next; + } + } + do { + while(_next != null) { + _node = _next; + if (!f(_node.value)) { + return false; + } + _next = _next.next; + } + if (_index + 1 < _map._array_size) { + _next = _map._nodes[++_index]; + } else { + return true; + } + } while(true); + } } - private class EntryIterator : NodeIterator, Iterator> { + private class EntryIterator : NodeIterator, Traversable>, Iterator> { public EntryIterator (HashMap map) { base (map); } @@ -592,6 +678,31 @@ public class Gee.HashMap : Gee.AbstractMap { public void remove () { assert_not_reached (); } + + public bool foreach(ForallFunc> f) { + if (_node != null) { + if (!f(Entry.entry_for (_node))) { + return false; + } + if(_next == null) { + _next = _node.next; + } + } + do { + while(_next != null) { + _node = _next; + if (!f(Entry.entry_for (_node))) { + return false; + } + _next = _next.next; + } + if (_index + 1 < _map._array_size) { + _next = _map._nodes[++_index]; + } else { + return true; + } + } while(true); + } } } diff --git a/gee/hashmultimap.c b/gee/hashmultimap.c index acb30b1..1035541 100644 --- a/gee/hashmultimap.c +++ b/gee/hashmultimap.c @@ -35,13 +35,25 @@ typedef struct _GeeMultiMap GeeMultiMap; typedef struct _GeeMultiMapIface GeeMultiMapIface; -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -51,6 +63,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -75,6 +95,14 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeMultiSet GeeMultiSet; typedef struct _GeeMultiSetIface GeeMultiSetIface; +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + #define GEE_TYPE_ABSTRACT_MULTI_MAP (gee_abstract_multi_map_get_type ()) #define GEE_ABSTRACT_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap)) #define GEE_ABSTRACT_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapClass)) @@ -94,14 +122,6 @@ typedef struct _GeeAbstractMultiMapPrivate GeeAbstractMultiMapPrivate; typedef struct _GeeMap GeeMap; typedef struct _GeeMapIface GeeMapIface; -#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) -#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) -#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) -#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) - -typedef struct _GeeMapIterator GeeMapIterator; -typedef struct _GeeMapIteratorIface GeeMapIteratorIface; - #define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) #define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) #define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) @@ -194,23 +214,55 @@ typedef struct _GeeAbstractMultiSetClass GeeAbstractMultiSetClass; typedef struct _GeeHashMultiSet GeeHashMultiSet; typedef struct _GeeHashMultiSetClass GeeHashMultiSetClass; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -222,21 +274,58 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeMultiMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); GeeSet* (*get_keys) (GeeMultiMap* self); GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); GeeCollection* (*get_values) (GeeMultiMap* self); @@ -246,44 +335,38 @@ struct _GeeMultiMapIface { gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); }; -struct _GeeMapIteratorIface { - GTypeInterface parent_iface; - gboolean (*next) (GeeMapIterator* self); - gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); - gpointer (*get_key) (GeeMapIterator* self); - gpointer (*get_value) (GeeMapIterator* self); - void (*set_value) (GeeMapIterator* self, gconstpointer value); - void (*unset) (GeeMapIterator* self); -}; - +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiMap { @@ -296,7 +379,17 @@ struct _GeeAbstractMultiMapClass { GObjectClass parent_class; GeeCollection* (*create_value_storage) (GeeAbstractMultiMap* self); GeeMultiSet* (*create_multi_key_set) (GeeAbstractMultiMap* self); - GEqualFunc (*get_value_equal_func) (GeeAbstractMultiMap* self); + GeeEqualDataFunc (*get_value_equal_func) (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); + void (*reserved0) (GeeAbstractMultiMap* self); + void (*reserved1) (GeeAbstractMultiMap* self); + void (*reserved2) (GeeAbstractMultiMap* self); + void (*reserved3) (GeeAbstractMultiMap* self); + void (*reserved4) (GeeAbstractMultiMap* self); + void (*reserved5) (GeeAbstractMultiMap* self); + void (*reserved6) (GeeAbstractMultiMap* self); + void (*reserved7) (GeeAbstractMultiMap* self); + void (*reserved8) (GeeAbstractMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeAbstractMultiMap* self); }; struct _GeeHashMultiMap { @@ -308,6 +401,7 @@ struct _GeeHashMultiMapClass { GeeAbstractMultiMapClass parent_class; }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); struct _GeeHashMultiMapPrivate { GType k_type; GBoxedCopyFunc k_dup_func; @@ -315,21 +409,34 @@ struct _GeeHashMultiMapPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - GHashFunc _value_hash_func; - GEqualFunc _value_equal_func; + GeeHashDataFunc _value_hash_func; + gpointer _value_hash_func_target; + GDestroyNotify _value_hash_func_target_destroy_notify; + GeeEqualDataFunc _value_equal_func; + gpointer _value_equal_func_target; + GDestroyNotify _value_equal_func_target_destroy_notify; }; static gpointer gee_hash_multi_map_parent_class = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_multi_map_get_type (void) G_GNUC_CONST; GType gee_abstract_multi_map_get_type (void) G_GNUC_CONST; -GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_map_entry_get_type (void) G_GNUC_CONST; GType gee_map_get_type (void) G_GNUC_CONST; GType gee_hash_multi_map_get_type (void) G_GNUC_CONST; @@ -341,41 +448,37 @@ enum { GEE_HASH_MULTI_MAP_K_DESTROY_FUNC, GEE_HASH_MULTI_MAP_V_TYPE, GEE_HASH_MULTI_MAP_V_DUP_FUNC, - GEE_HASH_MULTI_MAP_V_DESTROY_FUNC, - GEE_HASH_MULTI_MAP_KEY_HASH_FUNC, - GEE_HASH_MULTI_MAP_KEY_EQUAL_FUNC, - GEE_HASH_MULTI_MAP_VALUE_HASH_FUNC, - GEE_HASH_MULTI_MAP_VALUE_EQUAL_FUNC + GEE_HASH_MULTI_MAP_V_DESTROY_FUNC }; -GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func); -GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); +GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GType gee_abstract_map_get_type (void) G_GNUC_CONST; GType gee_hash_map_get_type (void) G_GNUC_CONST; GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* storage_map); -GHashFunc gee_functions_get_hash_func_for (GType t); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_hash_multi_map_set_value_hash_func (GeeHashMultiMap* self, GHashFunc value); -static void gee_hash_multi_map_set_value_equal_func (GeeHashMultiMap* self, GEqualFunc value); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_hash_multi_map_set_value_hash_func (GeeHashMultiMap* self, GeeHashDataFunc value, gpointer value_target); +static void gee_hash_multi_map_set_value_equal_func (GeeHashMultiMap* self, GeeEqualDataFunc value, gpointer value_target); static GeeCollection* gee_hash_multi_map_real_create_value_storage (GeeAbstractMultiMap* base); -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; GType gee_hash_set_get_type (void) G_GNUC_CONST; static GeeMultiSet* gee_hash_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* base); -GHashFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self); -GEqualFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self); -GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); +GeeHashDataFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self, gpointer* result_target); +GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); GType gee_abstract_multi_set_get_type (void) G_GNUC_CONST; GType gee_hash_multi_set_get_type (void) G_GNUC_CONST; -static GEqualFunc gee_hash_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base); -GHashFunc gee_hash_map_get_key_hash_func (GeeHashMap* self); -GEqualFunc gee_hash_map_get_key_equal_func (GeeHashMap* self); -GHashFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self); -GEqualFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self); +static GeeEqualDataFunc gee_hash_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target); +GeeHashDataFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self, gpointer* result_target); static void gee_hash_multi_map_finalize (GObject* obj); static void _vala_gee_hash_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -392,65 +495,115 @@ static void _vala_gee_hash_multi_map_set_property (GObject * object, guint prope * @param value_hash_func an optional value hash function * @param value_equal_func an optional value equality testing function */ -GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func) { +GeeHashMultiMap* gee_hash_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { GeeHashMultiMap * self = NULL; - GHashFunc _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; - GeeHashMap* _tmp3_; - GeeHashMap* _tmp4_; - GHashFunc _tmp5_; - GEqualFunc _tmp7_; - GHashFunc _tmp9_; - GEqualFunc _tmp10_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + void* _tmp2_ = NULL; + GDestroyNotify _tmp3_ = NULL; + GeeEqualDataFunc _tmp4_ = NULL; + GeeHashMap* _tmp5_; + GeeHashMap* _tmp6_; + GeeHashDataFunc _tmp7_; + void* _tmp7__target; + GeeEqualDataFunc _tmp11_; + void* _tmp11__target; + GeeHashDataFunc _tmp15_; + void* _tmp15__target; + GeeEqualDataFunc _tmp16_; + void* _tmp16__target; _tmp0_ = key_hash_func; + _tmp0__target = key_hash_func_target; _tmp1_ = key_equal_func; - _tmp2_ = g_direct_equal; - _tmp3_ = gee_hash_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, GEE_TYPE_SET, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp0_, _tmp1_, _tmp2_); - _tmp4_ = _tmp3_; - self = (GeeHashMultiMap*) gee_abstract_multi_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMap*) _tmp4_); + _tmp1__target = key_equal_func_target; + _tmp4_ = gee_functions_get_equal_func_for (GEE_TYPE_SET, &_tmp2_, &_tmp3_); + _tmp5_ = gee_hash_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, GEE_TYPE_SET, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp0_, _tmp0__target, NULL, _tmp1_, _tmp1__target, NULL, _tmp4_, _tmp2_, _tmp3_); + _tmp6_ = _tmp5_; + self = (GeeHashMultiMap*) gee_abstract_multi_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMap*) _tmp6_); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; self->priv->v_type = v_type; self->priv->v_dup_func = v_dup_func; self->priv->v_destroy_func = v_destroy_func; - _g_object_unref0 (_tmp4_); - _tmp5_ = value_hash_func; - if (_tmp5_ == NULL) { - GHashFunc _tmp6_ = NULL; - _tmp6_ = gee_functions_get_hash_func_for (v_type); - value_hash_func = _tmp6_; - } - _tmp7_ = value_equal_func; + _g_object_unref0 (_tmp6_); + _tmp7_ = value_hash_func; + _tmp7__target = value_hash_func_target; if (_tmp7_ == NULL) { - GEqualFunc _tmp8_ = NULL; - _tmp8_ = gee_functions_get_equal_func_for (v_type); - value_equal_func = _tmp8_; + void* _tmp8_ = NULL; + GDestroyNotify _tmp9_ = NULL; + GeeHashDataFunc _tmp10_ = NULL; + _tmp10_ = gee_functions_get_hash_func_for (v_type, &_tmp8_, &_tmp9_); + (value_hash_func_target_destroy_notify == NULL) ? NULL : (value_hash_func_target_destroy_notify (value_hash_func_target), NULL); + value_hash_func = NULL; + value_hash_func_target = NULL; + value_hash_func_target_destroy_notify = NULL; + value_hash_func = _tmp10_; + value_hash_func_target = _tmp8_; + value_hash_func_target_destroy_notify = _tmp9_; + } + _tmp11_ = value_equal_func; + _tmp11__target = value_equal_func_target; + if (_tmp11_ == NULL) { + void* _tmp12_ = NULL; + GDestroyNotify _tmp13_ = NULL; + GeeEqualDataFunc _tmp14_ = NULL; + _tmp14_ = gee_functions_get_equal_func_for (v_type, &_tmp12_, &_tmp13_); + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; + value_equal_func = _tmp14_; + value_equal_func_target = _tmp12_; + value_equal_func_target_destroy_notify = _tmp13_; } - _tmp9_ = value_hash_func; - gee_hash_multi_map_set_value_hash_func (self, _tmp9_); - _tmp10_ = value_equal_func; - gee_hash_multi_map_set_value_equal_func (self, _tmp10_); + _tmp15_ = value_hash_func; + _tmp15__target = value_hash_func_target; + gee_hash_multi_map_set_value_hash_func (self, _tmp15_, _tmp15__target); + _tmp16_ = value_equal_func; + _tmp16__target = value_equal_func_target; + gee_hash_multi_map_set_value_equal_func (self, _tmp16_, _tmp16__target); + (key_hash_func_target_destroy_notify == NULL) ? NULL : (key_hash_func_target_destroy_notify (key_hash_func_target), NULL); + key_hash_func = NULL; + key_hash_func_target = NULL; + key_hash_func_target_destroy_notify = NULL; + (key_equal_func_target_destroy_notify == NULL) ? NULL : (key_equal_func_target_destroy_notify (key_equal_func_target), NULL); + key_equal_func = NULL; + key_equal_func_target = NULL; + key_equal_func_target_destroy_notify = NULL; + (value_hash_func_target_destroy_notify == NULL) ? NULL : (value_hash_func_target_destroy_notify (value_hash_func_target), NULL); + value_hash_func = NULL; + value_hash_func_target = NULL; + value_hash_func_target_destroy_notify = NULL; + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; return self; } -GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GHashFunc value_hash_func, GEqualFunc value_equal_func) { - return gee_hash_multi_map_construct (GEE_TYPE_HASH_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_hash_func, key_equal_func, value_hash_func, value_equal_func); +GeeHashMultiMap* gee_hash_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeHashDataFunc value_hash_func, void* value_hash_func_target, GDestroyNotify value_hash_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { + return gee_hash_multi_map_construct (GEE_TYPE_HASH_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_hash_func, key_hash_func_target, key_hash_func_target_destroy_notify, key_equal_func, key_equal_func_target, key_equal_func_target_destroy_notify, value_hash_func, value_hash_func_target, value_hash_func_target_destroy_notify, value_equal_func, value_equal_func_target, value_equal_func_target_destroy_notify); } static GeeCollection* gee_hash_multi_map_real_create_value_storage (GeeAbstractMultiMap* base) { GeeHashMultiMap * self; GeeCollection* result = NULL; - GHashFunc _tmp0_; - GEqualFunc _tmp1_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; GeeHashSet* _tmp2_; self = (GeeHashMultiMap*) base; _tmp0_ = self->priv->_value_hash_func; + _tmp0__target = self->priv->_value_hash_func_target; _tmp1_ = self->priv->_value_equal_func; - _tmp2_ = gee_hash_set_new (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + _tmp1__target = self->priv->_value_equal_func_target; + _tmp2_ = gee_hash_set_new (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp0__target, NULL, _tmp1_, _tmp1__target, NULL); result = (GeeCollection*) _tmp2_; return result; } @@ -459,96 +612,156 @@ static GeeCollection* gee_hash_multi_map_real_create_value_storage (GeeAbstractM static GeeMultiSet* gee_hash_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* base) { GeeHashMultiMap * self; GeeMultiSet* result = NULL; - GHashFunc _tmp0_; - GHashFunc _tmp1_; - GEqualFunc _tmp2_; - GEqualFunc _tmp3_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; + GeeEqualDataFunc _tmp2_; + void* _tmp2__target; + GeeEqualDataFunc _tmp3_; + void* _tmp3__target; GeeHashMultiSet* _tmp4_; self = (GeeHashMultiMap*) base; - _tmp0_ = gee_hash_multi_map_get_key_hash_func (self); + _tmp0_ = gee_hash_multi_map_get_key_hash_func (self, &_tmp0__target); _tmp1_ = _tmp0_; - _tmp2_ = gee_hash_multi_map_get_key_equal_func (self); + _tmp1__target = _tmp0__target; + _tmp2_ = gee_hash_multi_map_get_key_equal_func (self, &_tmp2__target); _tmp3_ = _tmp2_; - _tmp4_ = gee_hash_multi_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, _tmp1_, _tmp3_); + _tmp3__target = _tmp2__target; + _tmp4_ = gee_hash_multi_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, _tmp1_, _tmp1__target, _tmp3_, _tmp3__target); result = (GeeMultiSet*) _tmp4_; return result; } -static GEqualFunc gee_hash_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base) { +static GeeEqualDataFunc gee_hash_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base, void** result_target, GDestroyNotify* result_target_destroy_notify) { GeeHashMultiMap * self; - GEqualFunc result = NULL; - GEqualFunc _tmp0_; + GeeEqualDataFunc result = NULL; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; self = (GeeHashMultiMap*) base; _tmp0_ = self->priv->_value_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_value_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + _tmp1__target_destroy_notify = NULL; + *result_target = _tmp1__target; + *result_target_destroy_notify = _tmp1__target_destroy_notify; + result = _tmp1_; return result; } -GHashFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self) { - GHashFunc result; +GeeHashDataFunc gee_hash_multi_map_get_key_hash_func (GeeHashMultiMap* self, gpointer* result_target) { + GeeHashDataFunc result; GeeMap* _tmp0_; - GHashFunc _tmp1_; - GHashFunc _tmp2_; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; + GeeHashDataFunc _tmp2_; + void* _tmp2__target; + GeeHashDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiMap*) self)->_storage_map; - _tmp1_ = gee_hash_map_get_key_hash_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap)); + _tmp1_ = gee_hash_map_get_key_hash_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } -GEqualFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self) { - GEqualFunc result; +GeeEqualDataFunc gee_hash_multi_map_get_key_equal_func (GeeHashMultiMap* self, gpointer* result_target) { + GeeEqualDataFunc result; GeeMap* _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + GeeEqualDataFunc _tmp2_; + void* _tmp2__target; + GeeEqualDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiMap*) self)->_storage_map; - _tmp1_ = gee_hash_map_get_key_equal_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap)); + _tmp1_ = gee_hash_map_get_key_equal_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } -GHashFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self) { - GHashFunc result; - GHashFunc _tmp0_; +GeeHashDataFunc gee_hash_multi_map_get_value_hash_func (GeeHashMultiMap* self, gpointer* result_target) { + GeeHashDataFunc result; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_value_hash_func; - result = _tmp0_; + _tmp0__target = self->priv->_value_hash_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_multi_map_set_value_hash_func (GeeHashMultiMap* self, GHashFunc value) { - GHashFunc _tmp0_; +static void gee_hash_multi_map_set_value_hash_func (GeeHashMultiMap* self, GeeHashDataFunc value, gpointer value_target) { + GeeHashDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_value_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_hash_func_target_destroy_notify (self->priv->_value_hash_func_target), NULL); + self->priv->_value_hash_func = NULL; + self->priv->_value_hash_func_target = NULL; + self->priv->_value_hash_func_target_destroy_notify = NULL; self->priv->_value_hash_func = _tmp0_; - g_object_notify ((GObject *) self, "value-hash-func"); + self->priv->_value_hash_func_target = _tmp0__target; + self->priv->_value_hash_func_target_destroy_notify = NULL; } -GEqualFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +GeeEqualDataFunc gee_hash_multi_map_get_value_equal_func (GeeHashMultiMap* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_value_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_value_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_multi_map_set_value_equal_func (GeeHashMultiMap* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_hash_multi_map_set_value_equal_func (GeeHashMultiMap* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; self->priv->_value_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "value-equal-func"); + self->priv->_value_equal_func_target = _tmp0__target; + self->priv->_value_equal_func_target_destroy_notify = NULL; } @@ -567,10 +780,6 @@ static void gee_hash_multi_map_class_init (GeeHashMultiMapClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_KEY_HASH_FUNC, g_param_spec_pointer ("key-hash-func", "key-hash-func", "key-hash-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_KEY_EQUAL_FUNC, g_param_spec_pointer ("key-equal-func", "key-equal-func", "key-equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_VALUE_HASH_FUNC, g_param_spec_pointer ("value-hash-func", "value-hash-func", "value-hash-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_MAP_VALUE_EQUAL_FUNC, g_param_spec_pointer ("value-equal-func", "value-equal-func", "value-equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -582,6 +791,14 @@ static void gee_hash_multi_map_instance_init (GeeHashMultiMap * self) { static void gee_hash_multi_map_finalize (GObject* obj) { GeeHashMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMap); + (self->priv->_value_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_hash_func_target_destroy_notify (self->priv->_value_hash_func_target), NULL); + self->priv->_value_hash_func = NULL; + self->priv->_value_hash_func_target = NULL; + self->priv->_value_hash_func_target_destroy_notify = NULL; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; G_OBJECT_CLASS (gee_hash_multi_map_parent_class)->finalize (obj); } @@ -605,18 +822,6 @@ static void _vala_gee_hash_multi_map_get_property (GObject * object, guint prope GeeHashMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMap); switch (property_id) { - case GEE_HASH_MULTI_MAP_KEY_HASH_FUNC: - g_value_set_pointer (value, gee_hash_multi_map_get_key_hash_func (self)); - break; - case GEE_HASH_MULTI_MAP_KEY_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_multi_map_get_key_equal_func (self)); - break; - case GEE_HASH_MULTI_MAP_VALUE_HASH_FUNC: - g_value_set_pointer (value, gee_hash_multi_map_get_value_hash_func (self)); - break; - case GEE_HASH_MULTI_MAP_VALUE_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_multi_map_get_value_equal_func (self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -628,12 +833,6 @@ static void _vala_gee_hash_multi_map_set_property (GObject * object, guint prope GeeHashMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMap); switch (property_id) { - case GEE_HASH_MULTI_MAP_VALUE_HASH_FUNC: - gee_hash_multi_map_set_value_hash_func (self, g_value_get_pointer (value)); - break; - case GEE_HASH_MULTI_MAP_VALUE_EQUAL_FUNC: - gee_hash_multi_map_set_value_equal_func (self, g_value_get_pointer (value)); - break; case GEE_HASH_MULTI_MAP_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; diff --git a/gee/hashmultimap.vala b/gee/hashmultimap.vala index 3a10220..2eddecd 100644 --- a/gee/hashmultimap.vala +++ b/gee/hashmultimap.vala @@ -24,17 +24,19 @@ * Hash table implementation of the {@link MultiMap} interface. */ public class Gee.HashMultiMap : AbstractMultiMap { - public HashFunc key_hash_func { + public HashDataFunc key_hash_func { get { return ((HashMap>) _storage_map).key_hash_func; } } - public EqualFunc key_equal_func { + public EqualDataFunc key_equal_func { get { return ((HashMap>) _storage_map).key_equal_func; } } - public HashFunc value_hash_func { private set; get; } + [CCode (notify = false)] + public HashDataFunc value_hash_func { private set; get; } - public EqualFunc value_equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc value_equal_func { private set; get; } /** * Constructs a new, empty hash multimap. @@ -47,9 +49,9 @@ public class Gee.HashMultiMap : AbstractMultiMap { * @param value_hash_func an optional value hash function * @param value_equal_func an optional value equality testing function */ - public HashMultiMap (HashFunc? key_hash_func = null, EqualFunc? key_equal_func = null, - HashFunc? value_hash_func = null, EqualFunc? value_equal_func = null) { - base (new HashMap> (key_hash_func, key_equal_func, direct_equal)); + public HashMultiMap (owned HashDataFunc? key_hash_func = null, owned EqualDataFunc? key_equal_func = null, + owned HashDataFunc? value_hash_func = null, owned EqualDataFunc? value_equal_func = null) { + base (new HashMap> (key_hash_func, key_equal_func, Functions.get_equal_func_for (typeof (Set)))); if (value_hash_func == null) { value_hash_func = Functions.get_hash_func_for (typeof (V)); } @@ -68,7 +70,7 @@ public class Gee.HashMultiMap : AbstractMultiMap { return new HashMultiSet (key_hash_func, key_equal_func); } - protected override EqualFunc get_value_equal_func () { + protected override EqualDataFunc get_value_equal_func () { return _value_equal_func; } } diff --git a/gee/hashmultiset.c b/gee/hashmultiset.c index 5f408d4..0ae8afd 100644 --- a/gee/hashmultiset.c +++ b/gee/hashmultiset.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -147,23 +167,55 @@ typedef struct _GeeHashMap GeeHashMap; typedef struct _GeeHashMapClass GeeHashMapClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -175,6 +227,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -189,62 +242,88 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiSet { @@ -255,6 +334,16 @@ struct _GeeAbstractMultiSet { struct _GeeAbstractMultiSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractMultiSet* self); + void (*reserved1) (GeeAbstractMultiSet* self); + void (*reserved2) (GeeAbstractMultiSet* self); + void (*reserved3) (GeeAbstractMultiSet* self); + void (*reserved4) (GeeAbstractMultiSet* self); + void (*reserved5) (GeeAbstractMultiSet* self); + void (*reserved6) (GeeAbstractMultiSet* self); + void (*reserved7) (GeeAbstractMultiSet* self); + void (*reserved8) (GeeAbstractMultiSet* self); + GeeMultiSet* (*get_read_only_view) (GeeAbstractMultiSet* self); }; struct _GeeHashMultiSet { @@ -272,10 +361,21 @@ struct _GeeHashMultiSetPrivate { GDestroyNotify g_destroy_func; }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); static gpointer gee_hash_multi_set_parent_class = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -291,21 +391,19 @@ enum { GEE_HASH_MULTI_SET_DUMMY_PROPERTY, GEE_HASH_MULTI_SET_G_TYPE, GEE_HASH_MULTI_SET_G_DUP_FUNC, - GEE_HASH_MULTI_SET_G_DESTROY_FUNC, - GEE_HASH_MULTI_SET_HASH_FUNC, - GEE_HASH_MULTI_SET_EQUAL_FUNC + GEE_HASH_MULTI_SET_G_DESTROY_FUNC }; -GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); +GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GType gee_abstract_map_get_type (void) G_GNUC_CONST; GType gee_hash_map_get_type (void) G_GNUC_CONST; GeeAbstractMultiSet* gee_abstract_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMap* storage_map); -GHashFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self); -GHashFunc gee_hash_map_get_key_hash_func (GeeHashMap* self); -GEqualFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self); -GEqualFunc gee_hash_map_get_key_equal_func (GeeHashMap* self); +GeeHashDataFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self, gpointer* result_target); +GeeHashDataFunc gee_hash_map_get_key_hash_func (GeeHashMap* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_map_get_key_equal_func (GeeHashMap* self, gpointer* result_target); static void _vala_gee_hash_multi_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_multi_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -319,15 +417,19 @@ static void _vala_gee_hash_multi_set_set_property (GObject * object, guint prope * @param hash_func an optional element hash function * @param equal_func an optional element equality testing function */ -GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func) { +GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target) { GeeHashMultiSet * self = NULL; - GHashFunc _tmp0_; - GEqualFunc _tmp1_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; GeeHashMap* _tmp2_; GeeHashMap* _tmp3_; _tmp0_ = hash_func; + _tmp0__target = hash_func_target; _tmp1_ = equal_func; - _tmp2_ = gee_hash_map_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_INT, NULL, NULL, _tmp0_, _tmp1_, NULL); + _tmp1__target = equal_func_target; + _tmp2_ = gee_hash_map_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_INT, NULL, NULL, _tmp0_, _tmp0__target, NULL, _tmp1_, _tmp1__target, NULL, NULL, NULL, NULL); _tmp3_ = _tmp2_; self = (GeeHashMultiSet*) gee_abstract_multi_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeMap*) _tmp3_); self->priv->g_type = g_type; @@ -338,35 +440,51 @@ GeeHashMultiSet* gee_hash_multi_set_construct (GType object_type, GType g_type, } -GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func) { - return gee_hash_multi_set_construct (GEE_TYPE_HASH_MULTI_SET, g_type, g_dup_func, g_destroy_func, hash_func, equal_func); +GeeHashMultiSet* gee_hash_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GeeEqualDataFunc equal_func, void* equal_func_target) { + return gee_hash_multi_set_construct (GEE_TYPE_HASH_MULTI_SET, g_type, g_dup_func, g_destroy_func, hash_func, hash_func_target, equal_func, equal_func_target); } -GHashFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self) { - GHashFunc result; +GeeHashDataFunc gee_hash_multi_set_get_hash_func (GeeHashMultiSet* self, gpointer* result_target) { + GeeHashDataFunc result; GeeMap* _tmp0_; - GHashFunc _tmp1_; - GHashFunc _tmp2_; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; + GeeHashDataFunc _tmp2_; + void* _tmp2__target; + GeeHashDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiSet*) self)->_storage_map; - _tmp1_ = gee_hash_map_get_key_hash_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap)); + _tmp1_ = gee_hash_map_get_key_hash_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } -GEqualFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self) { - GEqualFunc result; +GeeEqualDataFunc gee_hash_multi_set_get_equal_func (GeeHashMultiSet* self, gpointer* result_target) { + GeeEqualDataFunc result; GeeMap* _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + GeeEqualDataFunc _tmp2_; + void* _tmp2__target; + GeeEqualDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiSet*) self)->_storage_map; - _tmp1_ = gee_hash_map_get_key_equal_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap)); + _tmp1_ = gee_hash_map_get_key_equal_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_HASH_MAP, GeeHashMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } @@ -379,8 +497,6 @@ static void gee_hash_multi_set_class_init (GeeHashMultiSetClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_SET_HASH_FUNC, g_param_spec_pointer ("hash-func", "hash-func", "hash-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_MULTI_SET_EQUAL_FUNC, g_param_spec_pointer ("equal-func", "equal-func", "equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -408,12 +524,6 @@ static void _vala_gee_hash_multi_set_get_property (GObject * object, guint prope GeeHashMultiSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_MULTI_SET, GeeHashMultiSet); switch (property_id) { - case GEE_HASH_MULTI_SET_HASH_FUNC: - g_value_set_pointer (value, gee_hash_multi_set_get_hash_func (self)); - break; - case GEE_HASH_MULTI_SET_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_multi_set_get_equal_func (self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/gee/hashmultiset.vala b/gee/hashmultiset.vala index 596da77..2e59c07 100644 --- a/gee/hashmultiset.vala +++ b/gee/hashmultiset.vala @@ -24,11 +24,11 @@ * Hash table implementation of the {@link MultiSet} interface. */ public class Gee.HashMultiSet : AbstractMultiSet { - public HashFunc hash_func { + public HashDataFunc hash_func { get { return ((HashMap) _storage_map).key_hash_func; } } - public EqualFunc equal_func { + public EqualDataFunc equal_func { get { return ((HashMap) _storage_map).key_equal_func; } } @@ -41,7 +41,7 @@ public class Gee.HashMultiSet : AbstractMultiSet { * @param hash_func an optional element hash function * @param equal_func an optional element equality testing function */ - public HashMultiSet (HashFunc? hash_func = null, EqualFunc? equal_func = null) { + public HashMultiSet (HashDataFunc? hash_func = null, EqualDataFunc? equal_func = null) { base (new HashMap (hash_func, equal_func)); } } diff --git a/gee/hashset.c b/gee/hashset.c index 49b431d..a5709a9 100644 --- a/gee/hashset.c +++ b/gee/hashset.c @@ -29,13 +29,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -45,6 +57,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -109,23 +129,57 @@ typedef struct _GeeHashSetIteratorPrivate GeeHashSetIteratorPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -137,6 +191,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -151,19 +206,28 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; @@ -174,6 +238,16 @@ struct _GeeAbstractSet { struct _GeeAbstractSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); GeeSet* (*get_read_only_view) (GeeAbstractSet* self); }; @@ -190,8 +264,12 @@ struct _GeeHashSetPrivate { GType g_type; GBoxedCopyFunc g_dup_func; GDestroyNotify g_destroy_func; - GHashFunc _hash_func; - GEqualFunc _equal_func; + GeeHashDataFunc _hash_func; + gpointer _hash_func_target; + GDestroyNotify _hash_func_target_destroy_notify; + GeeEqualDataFunc _equal_func; + gpointer _equal_func_target; + GDestroyNotify _equal_func_target_destroy_notify; gint _array_size; gint _nnodes; GeeHashSetNode** _nodes; @@ -229,9 +307,19 @@ struct _GeeHashSetIteratorPrivate { static gpointer gee_hash_set_parent_class = NULL; static gpointer gee_hash_set_iterator_parent_class = NULL; +static GeeTraversableIface* gee_hash_set_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_hash_set_iterator_gee_iterator_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -246,22 +334,21 @@ enum { GEE_HASH_SET_G_DUP_FUNC, GEE_HASH_SET_G_DESTROY_FUNC, GEE_HASH_SET_SIZE, - GEE_HASH_SET_HASH_FUNC, - GEE_HASH_SET_EQUAL_FUNC + GEE_HASH_SET_READ_ONLY }; void gee_abstract_collection_clear (GeeAbstractCollection* self); #define GEE_HASH_SET_MIN_SIZE 11 #define GEE_HASH_SET_MAX_SIZE 13845163 -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GHashFunc gee_functions_get_hash_func_for (GType t); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_hash_set_set_hash_func (GeeHashSet* self, GHashFunc value); -static void gee_hash_set_set_equal_func (GeeHashSet* self, GEqualFunc value); +GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_hash_set_set_hash_func (GeeHashSet* self, GeeHashDataFunc value, gpointer value_target); +static void gee_hash_set_set_equal_func (GeeHashSet* self, GeeEqualDataFunc value, gpointer value_target); static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointer key); -GHashFunc gee_hash_set_get_hash_func (GeeHashSet* self); -GEqualFunc gee_hash_set_get_equal_func (GeeHashSet* self); +GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target); +GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target); static gboolean gee_hash_set_real_contains (GeeAbstractCollection* base, gconstpointer key); static GeeIterator* gee_hash_set_real_iterator (GeeAbstractCollection* base); static GeeHashSetIterator* gee_hash_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashSet* set); @@ -280,20 +367,24 @@ enum { GEE_HASH_SET_ITERATOR_DUMMY_PROPERTY, GEE_HASH_SET_ITERATOR_G_TYPE, GEE_HASH_SET_ITERATOR_G_DUP_FUNC, - GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC + GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC, + GEE_HASH_SET_ITERATOR_READ_ONLY, + GEE_HASH_SET_ITERATOR_VALID }; static gboolean gee_hash_set_iterator_real_next (GeeIterator* base); gboolean gee_iterator_has_next (GeeIterator* self); static gboolean gee_hash_set_iterator_real_has_next (GeeIterator* base); -static gboolean gee_hash_set_iterator_real_first (GeeIterator* base); -gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gboolean gee_iterator_next (GeeIterator* self); static gpointer gee_hash_set_iterator_real_get (GeeIterator* base); static void gee_hash_set_iterator_real_remove (GeeIterator* base); +static gboolean gee_hash_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_hash_set_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); static void _vala_gee_hash_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_hash_set_finalize (GObject* obj); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_hash_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_hash_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); @@ -309,54 +400,88 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify * @param hash_func an optional hash function * @param equal_func an optional equality testing function */ -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func) { +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { GeeHashSet * self = NULL; - GHashFunc _tmp0_; - GEqualFunc _tmp2_; - GHashFunc _tmp4_; - GEqualFunc _tmp5_; - gint _tmp6_; - GeeHashSetNode** _tmp7_ = NULL; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeHashDataFunc _tmp8_; + void* _tmp8__target; + GeeEqualDataFunc _tmp9_; + void* _tmp9__target; + gint _tmp10_; + GeeHashSetNode** _tmp11_ = NULL; self = (GeeHashSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _tmp0_ = hash_func; + _tmp0__target = hash_func_target; if (_tmp0_ == NULL) { - GHashFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_hash_func_for (g_type); - hash_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeHashDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_hash_func_for (g_type, &_tmp1_, &_tmp2_); + (hash_func_target_destroy_notify == NULL) ? NULL : (hash_func_target_destroy_notify (hash_func_target), NULL); + hash_func = NULL; + hash_func_target = NULL; + hash_func_target_destroy_notify = NULL; + hash_func = _tmp3_; + hash_func_target = _tmp1_; + hash_func_target_destroy_notify = _tmp2_; } - _tmp2_ = equal_func; - if (_tmp2_ == NULL) { - GEqualFunc _tmp3_ = NULL; - _tmp3_ = gee_functions_get_equal_func_for (g_type); - equal_func = _tmp3_; + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + if (_tmp4_ == NULL) { + void* _tmp5_ = NULL; + GDestroyNotify _tmp6_ = NULL; + GeeEqualDataFunc _tmp7_ = NULL; + _tmp7_ = gee_functions_get_equal_func_for (g_type, &_tmp5_, &_tmp6_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp7_; + equal_func_target = _tmp5_; + equal_func_target_destroy_notify = _tmp6_; } - _tmp4_ = hash_func; - gee_hash_set_set_hash_func (self, _tmp4_); - _tmp5_ = equal_func; - gee_hash_set_set_equal_func (self, _tmp5_); + _tmp8_ = hash_func; + _tmp8__target = hash_func_target; + gee_hash_set_set_hash_func (self, _tmp8_, _tmp8__target); + _tmp9_ = equal_func; + _tmp9__target = equal_func_target; + gee_hash_set_set_equal_func (self, _tmp9_, _tmp9__target); self->priv->_array_size = GEE_HASH_SET_MIN_SIZE; - _tmp6_ = self->priv->_array_size; - _tmp7_ = g_new0 (GeeHashSetNode*, _tmp6_ + 1); + _tmp10_ = self->priv->_array_size; + _tmp11_ = g_new0 (GeeHashSetNode*, _tmp10_ + 1); self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL); - self->priv->_nodes = _tmp7_; - self->priv->_nodes_length1 = _tmp6_; + self->priv->_nodes = _tmp11_; + self->priv->_nodes_length1 = _tmp10_; self->priv->__nodes_size_ = self->priv->_nodes_length1; + (hash_func_target_destroy_notify == NULL) ? NULL : (hash_func_target_destroy_notify (hash_func_target), NULL); + hash_func = NULL; + hash_func_target = NULL; + hash_func_target_destroy_notify = NULL; + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; return self; } -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func) { - return gee_hash_set_construct (GEE_TYPE_HASH_SET, g_type, g_dup_func, g_destroy_func, hash_func, equal_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_hash_set_construct (GEE_TYPE_HASH_SET, g_type, g_dup_func, g_destroy_func, hash_func, hash_func_target, hash_func_target_destroy_notify, equal_func, equal_func_target, equal_func_target_destroy_notify); } static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointer key) { GeeHashSetNode** result = NULL; - GHashFunc _tmp0_; - GHashFunc _tmp1_; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; gconstpointer _tmp2_; guint _tmp3_ = 0U; guint hash_value; @@ -367,10 +492,11 @@ static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointe GeeHashSetNode** node; GeeHashSetNode** _tmp22_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = gee_hash_set_get_hash_func (self); + _tmp0_ = gee_hash_set_get_hash_func (self, &_tmp0__target); _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; _tmp2_ = key; - _tmp3_ = _tmp1_ (_tmp2_); + _tmp3_ = _tmp1_ (_tmp2_, _tmp1__target); hash_value = _tmp3_; _tmp4_ = self->priv->_nodes; _tmp4__length1 = self->priv->_nodes_length1; @@ -395,18 +521,21 @@ static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointe if (_tmp10_ != _tmp12_) { _tmp9_ = TRUE; } else { - GEqualFunc _tmp13_; - GEqualFunc _tmp14_; + GeeEqualDataFunc _tmp13_; + void* _tmp13__target; + GeeEqualDataFunc _tmp14_; + void* _tmp14__target; GeeHashSetNode** _tmp15_; gconstpointer _tmp16_; gconstpointer _tmp17_; gboolean _tmp18_ = FALSE; - _tmp13_ = gee_hash_set_get_equal_func (self); + _tmp13_ = gee_hash_set_get_equal_func (self, &_tmp13__target); _tmp14_ = _tmp13_; + _tmp14__target = _tmp13__target; _tmp15_ = node; _tmp16_ = (*_tmp15_)->key; _tmp17_ = key; - _tmp18_ = _tmp14_ (_tmp16_, _tmp17_); + _tmp18_ = _tmp14_ (_tmp16_, _tmp17_, _tmp14__target); _tmp9_ = !_tmp18_; } _tmp19_ = _tmp9_; @@ -478,8 +607,10 @@ static gboolean gee_hash_set_real_add (GeeAbstractCollection* base, gconstpointe result = FALSE; return result; } else { - GHashFunc _tmp3_; - GHashFunc _tmp4_; + GeeHashDataFunc _tmp3_; + void* _tmp3__target; + GeeHashDataFunc _tmp4_; + void* _tmp4__target; gconstpointer _tmp5_; guint _tmp6_ = 0U; guint hash_value; @@ -491,10 +622,11 @@ static gboolean gee_hash_set_real_add (GeeAbstractCollection* base, gconstpointe GeeHashSetNode* _tmp12_; gint _tmp13_; gint _tmp14_; - _tmp3_ = gee_hash_set_get_hash_func (self); + _tmp3_ = gee_hash_set_get_hash_func (self, &_tmp3__target); _tmp4_ = _tmp3_; + _tmp4__target = _tmp3__target; _tmp5_ = key; - _tmp6_ = _tmp4_ (_tmp5_); + _tmp6_ = _tmp4_ (_tmp5_, _tmp4__target); hash_value = _tmp6_; _tmp7_ = node; _tmp8_ = key; @@ -852,41 +984,78 @@ static gint gee_hash_set_real_get_size (GeeAbstractCollection* base) { } -GHashFunc gee_hash_set_get_hash_func (GeeHashSet* self) { - GHashFunc result; - GHashFunc _tmp0_; +static gboolean gee_hash_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeHashSet* self; + self = (GeeHashSet*) base; + result = FALSE; + return result; +} + + +GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target) { + GeeHashDataFunc result; + GeeHashDataFunc _tmp0_; + void* _tmp0__target; + GeeHashDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_hash_func; - result = _tmp0_; + _tmp0__target = self->priv->_hash_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_set_set_hash_func (GeeHashSet* self, GHashFunc value) { - GHashFunc _tmp0_; +static void gee_hash_set_set_hash_func (GeeHashSet* self, GeeHashDataFunc value, gpointer value_target) { + GeeHashDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_hash_func_target_destroy_notify (self->priv->_hash_func_target), NULL); + self->priv->_hash_func = NULL; + self->priv->_hash_func_target = NULL; + self->priv->_hash_func_target_destroy_notify = NULL; self->priv->_hash_func = _tmp0_; - g_object_notify ((GObject *) self, "hash-func"); + self->priv->_hash_func_target = _tmp0__target; + self->priv->_hash_func_target_destroy_notify = NULL; } -GEqualFunc gee_hash_set_get_equal_func (GeeHashSet* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_hash_set_set_equal_func (GeeHashSet* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_hash_set_set_equal_func (GeeHashSet* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; self->priv->_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "equal-func"); + self->priv->_equal_func_target = _tmp0__target; + self->priv->_equal_func_target_destroy_notify = NULL; } @@ -1044,36 +1213,6 @@ static gboolean gee_hash_set_iterator_real_has_next (GeeIterator* base) { } -static gboolean gee_hash_set_iterator_real_first (GeeIterator* base) { - GeeHashSetIterator * self; - gboolean result = FALSE; - gint _tmp0_; - GeeHashSet* _tmp1_; - gint _tmp2_; - GeeHashSet* _tmp3_; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - self = (GeeHashSetIterator*) base; - _tmp0_ = self->priv->_stamp; - _tmp1_ = self->priv->_set; - _tmp2_ = _tmp1_->priv->_stamp; - _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp"); - _tmp3_ = self->priv->_set; - _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_); - _tmp5_ = _tmp4_; - if (_tmp5_ == 0) { - result = FALSE; - return result; - } - self->priv->_index = -1; - self->priv->_next = NULL; - _tmp6_ = gee_iterator_next ((GeeIterator*) self); - result = _tmp6_; - return result; -} - - static gpointer gee_hash_set_iterator_real_get (GeeIterator* base) { GeeHashSetIterator * self; gpointer result = NULL; @@ -1129,6 +1268,126 @@ static void gee_hash_set_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_hash_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeHashSetIterator * self; + gboolean result = FALSE; + gint _tmp0_; + GeeHashSet* _tmp1_; + gint _tmp2_; + GeeHashSetNode* _tmp3_; + self = (GeeHashSetIterator*) base; + _tmp0_ = self->priv->_stamp; + _tmp1_ = self->priv->_set; + _tmp2_ = _tmp1_->priv->_stamp; + _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp"); + _tmp3_ = self->priv->_node; + if (_tmp3_ != NULL) { + GeeForallFunc _tmp4_; + void* _tmp4__target; + GeeHashSetNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp4_ = f; + _tmp4__target = f_target; + _tmp5_ = self->priv->_node; + _tmp6_ = _tmp5_->key; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + _tmp8_ = _tmp4_ (_tmp7_, _tmp4__target); + if (!_tmp8_) { + result = FALSE; + return result; + } + } + while (TRUE) { + gboolean _tmp9_ = FALSE; + gint _tmp10_; + GeeHashSet* _tmp11_; + gint _tmp12_; + gboolean _tmp14_; + GeeHashSetNode* _tmp15_; + _tmp10_ = self->priv->_index; + _tmp11_ = self->priv->_set; + _tmp12_ = _tmp11_->priv->_array_size; + if ((_tmp10_ + 1) < _tmp12_) { + _tmp9_ = TRUE; + } else { + GeeHashSetNode* _tmp13_; + _tmp13_ = self->priv->_next; + _tmp9_ = _tmp13_ != NULL; + } + _tmp14_ = _tmp9_; + if (!_tmp14_) { + break; + } + _tmp15_ = self->priv->_next; + if (_tmp15_ != NULL) { + GeeHashSetNode* _tmp16_; + GeeForallFunc _tmp17_; + void* _tmp17__target; + GeeHashSetNode* _tmp18_; + gconstpointer _tmp19_; + gpointer _tmp20_; + gboolean _tmp21_ = FALSE; + GeeHashSetNode* _tmp22_; + GeeHashSetNode* _tmp23_; + _tmp16_ = self->priv->_next; + self->priv->_node = _tmp16_; + _tmp17_ = f; + _tmp17__target = f_target; + _tmp18_ = self->priv->_node; + _tmp19_ = _tmp18_->key; + _tmp20_ = ((_tmp19_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp19_) : ((gpointer) _tmp19_); + _tmp21_ = _tmp17_ (_tmp20_, _tmp17__target); + if (!_tmp21_) { + result = FALSE; + return result; + } + _tmp22_ = self->priv->_node; + _tmp23_ = _tmp22_->next; + self->priv->_next = _tmp23_; + } else { + gint _tmp24_; + GeeHashSet* _tmp25_; + GeeHashSetNode** _tmp26_; + gint _tmp26__length1; + gint _tmp27_; + GeeHashSetNode* _tmp28_; + _tmp24_ = self->priv->_index; + self->priv->_index = _tmp24_ + 1; + _tmp25_ = self->priv->_set; + _tmp26_ = _tmp25_->priv->_nodes; + _tmp26__length1 = _tmp25_->priv->_nodes_length1; + _tmp27_ = self->priv->_index; + _tmp28_ = _tmp26_[_tmp27_]; + self->priv->_next = _tmp28_; + } + } + result = FALSE; + return result; +} + + +static gboolean gee_hash_set_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeHashSetIterator* self; + self = (GeeHashSetIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_hash_set_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeHashSetIterator* self; + GeeHashSetNode* _tmp0_; + self = (GeeHashSetIterator*) base; + _tmp0_ = self->priv->_node; + result = _tmp0_ != NULL; + return result; +} + + static void gee_hash_set_iterator_class_init (GeeHashSetIteratorClass * klass) { gee_hash_set_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeHashSetIteratorPrivate)); @@ -1138,6 +1397,32 @@ static void gee_hash_set_iterator_class_init (GeeHashSetIteratorClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_hash_set_iterator_gee_traversable_get_g_type (GeeHashSetIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_hash_set_iterator_gee_traversable_get_g_dup_func (GeeHashSetIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_hash_set_iterator_gee_traversable_get_g_destroy_func (GeeHashSetIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_hash_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_hash_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_hash_set_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_destroy_func; } @@ -1145,9 +1430,10 @@ static void gee_hash_set_iterator_gee_iterator_interface_init (GeeIteratorIface gee_hash_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_hash_set_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_hash_set_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_hash_set_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_hash_set_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_hash_set_iterator_real_remove; + iface->get_read_only = gee_hash_set_iterator_real_get_read_only; + iface->get_valid = gee_hash_set_iterator_real_get_valid; } @@ -1170,9 +1456,11 @@ static GType gee_hash_set_iterator_get_type (void) { static volatile gsize gee_hash_set_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_hash_set_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeHashSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashSetIterator), 0, (GInstanceInitFunc) gee_hash_set_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_hash_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_hash_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_hash_set_iterator_type_id; gee_hash_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeHashSetIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_hash_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_hash_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_hash_set_iterator_type_id__volatile, gee_hash_set_iterator_type_id); } @@ -1184,6 +1472,12 @@ static void _vala_gee_hash_set_iterator_get_property (GObject * object, guint pr GeeHashSetIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator); switch (property_id) { + case GEE_HASH_SET_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_HASH_SET_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -1220,6 +1514,7 @@ static void gee_hash_set_class_init (GeeHashSetClass * klass) { GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_hash_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_hash_set_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_hash_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_hash_set_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_hash_set_finalize; @@ -1231,13 +1526,9 @@ static void gee_hash_set_class_init (GeeHashSetClass * klass) { */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * The elements' hash function. - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_HASH_FUNC, g_param_spec_pointer ("hash-func", "hash-func", "hash-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The elements' equality testing function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_EQUAL_FUNC, g_param_spec_pointer ("equal-func", "equal-func", "equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -1251,6 +1542,14 @@ static void gee_hash_set_finalize (GObject* obj) { GeeHashSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_HASH_SET, GeeHashSet); gee_abstract_collection_clear ((GeeAbstractCollection*) self); + (self->priv->_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_hash_func_target_destroy_notify (self->priv->_hash_func_target), NULL); + self->priv->_hash_func = NULL; + self->priv->_hash_func_target = NULL; + self->priv->_hash_func_target_destroy_notify = NULL; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL); G_OBJECT_CLASS (gee_hash_set_parent_class)->finalize (obj); } @@ -1284,11 +1583,8 @@ static void _vala_gee_hash_set_get_property (GObject * object, guint property_id case GEE_HASH_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; - case GEE_HASH_SET_HASH_FUNC: - g_value_set_pointer (value, gee_hash_set_get_hash_func (self)); - break; - case GEE_HASH_SET_EQUAL_FUNC: - g_value_set_pointer (value, gee_hash_set_get_equal_func (self)); + case GEE_HASH_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -1301,12 +1597,6 @@ static void _vala_gee_hash_set_set_property (GObject * object, guint property_id GeeHashSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_SET, GeeHashSet); switch (property_id) { - case GEE_HASH_SET_HASH_FUNC: - gee_hash_set_set_hash_func (self, g_value_get_pointer (value)); - break; - case GEE_HASH_SET_EQUAL_FUNC: - gee_hash_set_set_equal_func (self, g_value_get_pointer (value)); - break; case GEE_HASH_SET_G_TYPE: self->priv->g_type = g_value_get_gtype (value); break; diff --git a/gee/hashset.vala b/gee/hashset.vala index 2d83511..e8c9f26 100644 --- a/gee/hashset.vala +++ b/gee/hashset.vala @@ -24,6 +24,11 @@ using GLib; +namespace Gee { + public delegate uint HashDataFunc (T v); + public delegate bool EqualDataFunc (T a, T b); +} + /** * Hash table implementation of the {@link Set} interface. * @@ -40,16 +45,25 @@ public class Gee.HashSet : AbstractSet { public override int size { get { return _nnodes; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * The elements' hash function. */ - public HashFunc hash_func { private set; get; } + [CCode (notify = false)] + public HashDataFunc hash_func { private set; get; } /** * The elements' equality testing function. */ - public EqualFunc equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc equal_func { private set; get; } private int _array_size; private int _nnodes; @@ -70,7 +84,7 @@ public class Gee.HashSet : AbstractSet { * @param hash_func an optional hash function * @param equal_func an optional equality testing function */ - public HashSet (HashFunc? hash_func = null, EqualFunc? equal_func = null) { + public HashSet (owned HashDataFunc? hash_func = null, owned EqualDataFunc? equal_func = null) { if (hash_func == null) { hash_func = Functions.get_hash_func_for (typeof (G)); } @@ -208,7 +222,7 @@ public class Gee.HashSet : AbstractSet { } } - private class Iterator : Object, Gee.Iterator { + private class Iterator : Object, Traversable, Gee.Iterator { private HashSet _set; private int _index = -1; private weak Node _node; @@ -247,16 +261,6 @@ public class Gee.HashSet : AbstractSet { return (_next != null); } - public bool first () { - assert (_stamp == _set._stamp); - if (_set.size == 0) { - return false; - } - _index = -1; - _next = null; - return next (); - } - public new G get () { assert (_stamp == _set._stamp); assert (_node != null); @@ -271,6 +275,40 @@ public class Gee.HashSet : AbstractSet { _node = null; _stamp = _set._stamp; } + + public bool read_only { + get { + return false; + } + } + + public bool valid { + get { + return _node != null; + } + } + + public bool foreach (ForallFunc f) { + assert (_stamp == _set._stamp); + if (_node != null) { + if (!f (_node.key)) { + return false; + } + } + while (_index + 1 < _set._array_size || _next != null) { + if (_next != null) { + _node = _next; + if (!f (_node.key)) { + return false; + } + _next = _node.next; + } else { + _index++; + _next = _set._nodes[_index]; + } + } + return false; + } } } diff --git a/gee/hazardpointer.c b/gee/hazardpointer.c new file mode 100644 index 0000000..b56e627 --- /dev/null +++ b/gee/hazardpointer.c @@ -0,0 +1,2278 @@ +/* hazardpointer.c generated by valac 0.18.0, the Vala compiler + * generated from hazardpointer.vala, do not modify */ + +/* hazardpointer.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include + +typedef struct _GeeHazardPointer GeeHazardPointer; +typedef struct _GeeHazardPointerNode GeeHazardPointerNode; + +#define GEE_HAZARD_POINTER_TYPE_POLICY (gee_hazard_pointer_policy_get_type ()) + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; + +#define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ()) +#define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList)) +#define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) +#define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST)) +#define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass)) + +typedef struct _GeeAbstractList GeeAbstractList; +typedef struct _GeeAbstractListClass GeeAbstractListClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; + +#define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) +#define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) +#define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) +#define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST)) +#define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST)) +#define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) + +typedef struct _GeeArrayList GeeArrayList; +typedef struct _GeeArrayListClass GeeArrayListClass; +typedef struct _GeeHazardPointerFreeNode GeeHazardPointerFreeNode; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_QUEUE (gee_queue_get_type ()) +#define GEE_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_QUEUE, GeeQueue)) +#define GEE_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_QUEUE)) +#define GEE_QUEUE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_QUEUE, GeeQueueIface)) + +typedef struct _GeeQueue GeeQueue; +typedef struct _GeeQueueIface GeeQueueIface; + +#define GEE_HAZARD_POINTER_TYPE_RELEASE_POLICY (gee_hazard_pointer_release_policy_get_type ()) + +#define GEE_TYPE_LINKED_LIST (gee_linked_list_get_type ()) +#define GEE_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedList)) +#define GEE_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LINKED_LIST, GeeLinkedListClass)) +#define GEE_IS_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LINKED_LIST)) +#define GEE_IS_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LINKED_LIST)) +#define GEE_LINKED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedListClass)) + +typedef struct _GeeLinkedList GeeLinkedList; +typedef struct _GeeLinkedListClass GeeLinkedListClass; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) +#define _gee_hazard_pointer_free0(var) ((var == NULL) ? NULL : (var = (gee_hazard_pointer_free (var), NULL))) +typedef struct _GeeHazardPointerContext GeeHazardPointerContext; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; + +#define GEE_TYPE_HASH_SET (gee_hash_set_get_type ()) +#define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet)) +#define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass)) +#define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET)) +#define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET)) +#define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass)) + +typedef struct _GeeHashSet GeeHashSet; +typedef struct _GeeHashSetClass GeeHashSetClass; +typedef struct _Block5Data Block5Data; +#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeHazardPointer { + GeeHazardPointerNode* _node; +}; + +typedef enum { + GEE_HAZARD_POINTER_POLICY_DEFAULT, + GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, + GEE_HAZARD_POINTER_POLICY_TRY_FREE, + GEE_HAZARD_POINTER_POLICY_FREE, + GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, + GEE_HAZARD_POINTER_POLICY_RELEASE +} GeeHazardPointerPolicy; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeQueueIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); + gboolean (*offer) (GeeQueue* self, gconstpointer element); + gpointer (*peek) (GeeQueue* self); + gpointer (*poll) (GeeQueue* self); + gint (*drain) (GeeQueue* self, GeeCollection* recipient, gint amount); + gint (*get_capacity) (GeeQueue* self); + gint (*get_remaining_capacity) (GeeQueue* self); + gboolean (*get_is_full) (GeeQueue* self); +}; + +typedef enum { + GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD, + GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP +} GeeHazardPointerReleasePolicy; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +typedef void (*GeeHazardPointerDestroyNotify) (void* ptr, void* user_data); +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +struct _GeeHazardPointerFreeNode { + void* pointer; + GeeHazardPointerDestroyNotify destroy_notify; + gpointer destroy_notify_target; + GDestroyNotify destroy_notify_target_destroy_notify; +}; + +struct _Block5Data { + int _ref_count_; + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeHazardPointerContext { + GeeHazardPointerContext* _parent; + GeeArrayList* _to_free; + GeeHazardPointerPolicy* _policy; +}; + +struct _GeeHazardPointerNode { + GeeHazardPointerNode* _next; + gint _active; + void* _hazard; +}; + + +extern gint gee_hazard_pointer__default_policy; +extern gint gee_hazard_pointer__thread_exit_policy; +extern GStaticMutex gee_hazard_pointer__queue_mutex; +extern GeeQueue* gee_hazard_pointer__queue; +extern gint gee_hazard_pointer_release_policy; +extern GeeArrayList* gee_hazard_pointer__global_to_free; +extern GeeHazardPointerNode* gee_hazard_pointer__head; +GeeHazardPointerNode* gee_hazard_pointer__head = NULL; +gint gee_hazard_pointer__default_policy = (gint) GEE_HAZARD_POINTER_POLICY_TRY_FREE; +gint gee_hazard_pointer__thread_exit_policy = (gint) GEE_HAZARD_POINTER_POLICY_RELEASE; +gint gee_hazard_pointer_release_policy = 0; +GeeQueue* gee_hazard_pointer__queue = NULL; +GStaticMutex gee_hazard_pointer__queue_mutex = G_STATIC_MUTEX_INIT; +GeeArrayList* gee_hazard_pointer__global_to_free = NULL; +static guint gee_hazard_pointer_context_THRESHOLD; +extern GStaticPrivate gee_hazard_pointer_context__current_context; +GStaticPrivate gee_hazard_pointer_context__current_context = G_STATIC_PRIVATE_INIT; +extern GStaticPrivate gee_hazard_pointer_context__root_context; +GStaticPrivate gee_hazard_pointer_context__root_context = G_STATIC_PRIVATE_INIT; +static guint gee_hazard_pointer_context_THRESHOLD = (guint) 10; + +void gee_hazard_pointer_free (GeeHazardPointer* self); +void gee_hazard_pointer_node_free (GeeHazardPointerNode* self); +static void gee_hazard_pointer_instance_init (GeeHazardPointer * self); +void gee_hazard_pointer_node_release (GeeHazardPointerNode* self); +GType gee_hazard_pointer_policy_get_type (void) G_GNUC_CONST; +gboolean gee_hazard_pointer_policy_is_concrete (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_blocking (GeeHazardPointerPolicy self); +gboolean gee_hazard_pointer_policy_is_safe (GeeHazardPointerPolicy self); +GeeHazardPointerPolicy gee_hazard_pointer_policy_to_concrete (GeeHazardPointerPolicy self); +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_array_list_get_type (void) G_GNUC_CONST; +void gee_hazard_pointer_free_node_free (GeeHazardPointerFreeNode* self); +GeeArrayList* gee_hazard_pointer_policy_perform (GeeHazardPointerPolicy self, GeeArrayList* to_free); +gboolean gee_hazard_pointer_try_free (GeeArrayList* to_free); +void gee_hazard_pointer_release_policy_ensure_start (void); +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_queue_get_type (void) G_GNUC_CONST; +gboolean gee_queue_offer (GeeQueue* self, gconstpointer element); +GType gee_hazard_pointer_release_policy_get_type (void) G_GNUC_CONST; +static void gee_hazard_pointer_release_policy_start (GeeHazardPointerReleasePolicy _self_); +static gboolean ___lambda33_ (void); +static inline void gee_hazard_pointer_release_policy_attempt_free (void); +static gpointer ____lambda33__gthread_func (gpointer self); +static gboolean ___lambda35_ (void); +static gboolean ____lambda35__gsource_func (gpointer self); +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GType gee_linked_list_get_type (void) G_GNUC_CONST; +GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +gint gee_queue_drain (GeeQueue* self, GeeCollection* recipient, gint amount); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static gboolean ___lambda34_ (GeeArrayList* x); +gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection); +static gboolean ____lambda34__gee_forall_func (gpointer g, gpointer self); +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr); +GeeHazardPointerNode* gee_hazard_pointer_acquire (void); +void gee_hazard_pointer_node_set (GeeHazardPointerNode* self, void* ptr); +GeeHazardPointer* gee_hazard_pointer_new_from_node (GeeHazardPointerNode* node); +GeeHazardPointer* gee_hazard_pointer_new_from_node (GeeHazardPointerNode* node); +GeeHazardPointer* gee_hazard_pointer_get_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out); +GeeHazardPointer* gee_hazard_pointer_exchange_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask); +GeeHazardPointerDestroyNotify gee_hazard_pointer_get_destroy_notify (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, void** result_target, GDestroyNotify* result_target_destroy_notify); +void gee_hazard_pointer_release (GeeHazardPointer* self, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify); +gpointer gee_hazard_pointer_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask); +gconstpointer gee_hazard_pointer_get (GeeHazardPointer* self, gboolean other_thread); +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask); +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self); +GeeHazardPointerContext* gee_hazard_pointer_context_get_current_context (void); +void gee_hazard_pointer_context_release_ptr (GeeHazardPointerContext* self, void* ptr, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify); +void* gee_hazard_pointer_node_get (GeeHazardPointerNode* self, gboolean safe); +void gee_hazard_pointer_set_default_policy (GeeHazardPointerPolicy policy); +void gee_hazard_pointer_set_thread_exit_policy (GeeHazardPointerPolicy policy); +gboolean gee_hazard_pointer_set_release_policy (GeeHazardPointerReleasePolicy policy); +GeeHazardPointerNode* gee_hazard_pointer_get_head (void); +GeeHazardPointerNode* gee_hazard_pointer_node_get_next (GeeHazardPointerNode* self); +gboolean gee_hazard_pointer_node_activate (GeeHazardPointerNode* self); +GeeHazardPointerNode* gee_hazard_pointer_node_new (void); +GeeHazardPointerNode* gee_hazard_pointer_node_new (void); +void gee_hazard_pointer_node_set_next (GeeHazardPointerNode* self, GeeHazardPointerNode* next); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_hash_set_get_type (void) G_GNUC_CONST; +gboolean gee_collection_add (GeeCollection* self, gconstpointer item); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); +gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); +gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index); +void gee_abstract_list_set (GeeAbstractList* self, gint index, gconstpointer item); +static Block5Data* block5_data_ref (Block5Data* _data5_); +static void block5_data_unref (void * _userdata_); +static void __lambda36_ (Block5Data* _data5_, void* ptr); +static void ___lambda36__gee_hazard_pointer_destroy_notify (void* ptr, gpointer self); +static void gee_hazard_pointer_context_instance_init (GeeHazardPointerContext * self); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy); +static GeeHazardPointerPolicy* _gee_hazard_pointer_policy_dup (GeeHazardPointerPolicy* self); +void gee_hazard_pointer_context_try_free (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_free_all (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_try_release (GeeHazardPointerContext* self); +void gee_hazard_pointer_context_release (GeeHazardPointerContext* self); +GeeHazardPointerFreeNode* gee_hazard_pointer_free_node_new (void); +GeeHazardPointerFreeNode* gee_hazard_pointer_free_node_new (void); +gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); +static void gee_hazard_pointer_free_node_instance_init (GeeHazardPointerFreeNode * self); +static void gee_hazard_pointer_node_instance_init (GeeHazardPointerNode * self); +gboolean gee_hazard_pointer_node_is_active (GeeHazardPointerNode* self); + + +/** + * Checks if the policy is concrete or if it depends on global variables. + * + * @return ``true`` if this policy does not depend on global variables + */ +gboolean gee_hazard_pointer_policy_is_concrete (GeeHazardPointerPolicy self) { + gboolean result = FALSE; + switch (self) { + case GEE_HAZARD_POINTER_POLICY_DEFAULT: + case GEE_HAZARD_POINTER_POLICY_THREAD_EXIT: + { + result = FALSE; + return result; + } + case GEE_HAZARD_POINTER_POLICY_TRY_FREE: + case GEE_HAZARD_POINTER_POLICY_FREE: + case GEE_HAZARD_POINTER_POLICY_TRY_RELEASE: + case GEE_HAZARD_POINTER_POLICY_RELEASE: + { + result = TRUE; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +/** + * Checks if policy blocks or is lock-free. + * Please note that it works on a concrete policy only. + * + * @return ``true`` if the policy may block the thread. + */ +gboolean gee_hazard_pointer_policy_is_blocking (GeeHazardPointerPolicy self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + _tmp0_ = gee_hazard_pointer_policy_is_concrete (self); + g_return_val_if_fail (_tmp0_, FALSE); + switch (self) { + case GEE_HAZARD_POINTER_POLICY_TRY_FREE: + case GEE_HAZARD_POINTER_POLICY_TRY_RELEASE: + { + result = FALSE; + return result; + } + case GEE_HAZARD_POINTER_POLICY_FREE: + case GEE_HAZARD_POINTER_POLICY_RELEASE: + { + result = TRUE; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +/** + * Checks if policy guarantees freeing all elements. + * Please note that it works on a concrete policy only. + * + * @return ``true`` if the policy guarantees freeing all elements. + */ +gboolean gee_hazard_pointer_policy_is_safe (GeeHazardPointerPolicy self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + _tmp0_ = gee_hazard_pointer_policy_is_concrete (self); + g_return_val_if_fail (_tmp0_, FALSE); + switch (self) { + case GEE_HAZARD_POINTER_POLICY_TRY_FREE: + case GEE_HAZARD_POINTER_POLICY_TRY_RELEASE: + { + result = FALSE; + return result; + } + case GEE_HAZARD_POINTER_POLICY_FREE: + case GEE_HAZARD_POINTER_POLICY_RELEASE: + { + result = TRUE; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +/** + * Finds concrete policy which corresponds to given policy. + * + * @return Policy that corresponds to given policy at given time in given thread. + */ +GeeHazardPointerPolicy gee_hazard_pointer_policy_to_concrete (GeeHazardPointerPolicy self) { + GeeHazardPointerPolicy result = 0; + switch (self) { + case GEE_HAZARD_POINTER_POLICY_TRY_FREE: + case GEE_HAZARD_POINTER_POLICY_FREE: + case GEE_HAZARD_POINTER_POLICY_TRY_RELEASE: + case GEE_HAZARD_POINTER_POLICY_RELEASE: + { + GeeHazardPointerPolicy _tmp0_; + gboolean _tmp1_ = FALSE; + result = self; + _tmp0_ = result; + _tmp1_ = gee_hazard_pointer_policy_is_concrete (_tmp0_); + g_warn_if_fail (_tmp1_); + return result; + } + case GEE_HAZARD_POINTER_POLICY_DEFAULT: + { + gint _tmp2_ = 0; + GeeHazardPointerPolicy _tmp3_; + gboolean _tmp4_ = FALSE; + _tmp2_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer__default_policy)); + result = (GeeHazardPointerPolicy) _tmp2_; + _tmp3_ = result; + _tmp4_ = gee_hazard_pointer_policy_is_concrete (_tmp3_); + g_warn_if_fail (_tmp4_); + return result; + } + case GEE_HAZARD_POINTER_POLICY_THREAD_EXIT: + { + gint _tmp5_ = 0; + GeeHazardPointerPolicy _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp5_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer__thread_exit_policy)); + result = (GeeHazardPointerPolicy) _tmp5_; + _tmp6_ = result; + _tmp7_ = gee_hazard_pointer_policy_is_concrete (_tmp6_); + g_warn_if_fail (_tmp7_); + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +/** + * Runs the policy. + * @param to_free List containing elements to free. + * @return Non-empty list of not freed elements or ``null`` if all elements have been disposed. + */ +GeeArrayList* gee_hazard_pointer_policy_perform (GeeHazardPointerPolicy self, GeeArrayList* to_free) { + GeeArrayList* result = NULL; + GeeHazardPointerPolicy _tmp0_ = 0; + g_return_val_if_fail (to_free != NULL, NULL); + _tmp0_ = gee_hazard_pointer_policy_to_concrete (self); + switch (_tmp0_) { + case GEE_HAZARD_POINTER_POLICY_TRY_FREE: + { + GeeArrayList* _tmp1_ = NULL; + GeeArrayList* _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp2_ = to_free; + _tmp3_ = gee_hazard_pointer_try_free (_tmp2_); + if (_tmp3_) { + GeeArrayList* _tmp4_; + _tmp4_ = to_free; + to_free = NULL; + _g_object_unref0 (_tmp1_); + _tmp1_ = _tmp4_; + } else { + _g_object_unref0 (_tmp1_); + _tmp1_ = NULL; + } + result = _tmp1_; + _g_object_unref0 (to_free); + return result; + } + case GEE_HAZARD_POINTER_POLICY_FREE: + { + while (TRUE) { + GeeArrayList* _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = to_free; + _tmp6_ = gee_hazard_pointer_try_free (_tmp5_); + if (!_tmp6_) { + break; + } + g_thread_yield (); + } + result = NULL; + _g_object_unref0 (to_free); + return result; + } + case GEE_HAZARD_POINTER_POLICY_TRY_RELEASE: + { + gboolean _tmp7_ = FALSE; + gee_hazard_pointer_release_policy_ensure_start (); + _tmp7_ = g_static_mutex_trylock (&gee_hazard_pointer__queue_mutex); + if (_tmp7_) { + GeeQueue* _tmp8_; + GeeArrayList* _tmp9_; + GeeArrayList* _tmp10_; + _tmp8_ = gee_hazard_pointer__queue; + _tmp9_ = to_free; + to_free = NULL; + _tmp10_ = _tmp9_; + gee_queue_offer (_tmp8_, _tmp10_); + _g_object_unref0 (_tmp10_); + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); + result = NULL; + _g_object_unref0 (to_free); + return result; + } else { + GeeArrayList* _tmp11_; + _tmp11_ = to_free; + to_free = NULL; + result = _tmp11_; + _g_object_unref0 (to_free); + return result; + } + } + case GEE_HAZARD_POINTER_POLICY_RELEASE: + { + GeeQueue* _tmp12_; + GeeArrayList* _tmp13_; + GeeArrayList* _tmp14_; + gee_hazard_pointer_release_policy_ensure_start (); + g_static_mutex_lock (&gee_hazard_pointer__queue_mutex); + _tmp12_ = gee_hazard_pointer__queue; + _tmp13_ = to_free; + to_free = NULL; + _tmp14_ = _tmp13_; + gee_queue_offer (_tmp12_, _tmp14_); + _g_object_unref0 (_tmp14_); + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); + result = NULL; + _g_object_unref0 (to_free); + return result; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (to_free); +} + + +/** + * Policy determines what happens on exit from Context. + */ +GType gee_hazard_pointer_policy_get_type (void) { + static volatile gsize gee_hazard_pointer_policy_type_id__volatile = 0; + if (g_once_init_enter (&gee_hazard_pointer_policy_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_HAZARD_POINTER_POLICY_DEFAULT, "GEE_HAZARD_POINTER_POLICY_DEFAULT", "default"}, {GEE_HAZARD_POINTER_POLICY_THREAD_EXIT, "GEE_HAZARD_POINTER_POLICY_THREAD_EXIT", "thread-exit"}, {GEE_HAZARD_POINTER_POLICY_TRY_FREE, "GEE_HAZARD_POINTER_POLICY_TRY_FREE", "try-free"}, {GEE_HAZARD_POINTER_POLICY_FREE, "GEE_HAZARD_POINTER_POLICY_FREE", "free"}, {GEE_HAZARD_POINTER_POLICY_TRY_RELEASE, "GEE_HAZARD_POINTER_POLICY_TRY_RELEASE", "try-release"}, {GEE_HAZARD_POINTER_POLICY_RELEASE, "GEE_HAZARD_POINTER_POLICY_RELEASE", "release"}, {0, NULL, NULL}}; + GType gee_hazard_pointer_policy_type_id; + gee_hazard_pointer_policy_type_id = g_enum_register_static ("GeeHazardPointerPolicy", values); + g_once_init_leave (&gee_hazard_pointer_policy_type_id__volatile, gee_hazard_pointer_policy_type_id); + } + return gee_hazard_pointer_policy_type_id__volatile; +} + + +static gboolean ___lambda33_ (void) { + gboolean result = FALSE; + GThread* _tmp0_ = NULL; + _tmp0_ = g_thread_self (); + g_thread_set_priority (_tmp0_, G_THREAD_PRIORITY_LOW); + while (TRUE) { + g_thread_yield (); + gee_hazard_pointer_release_policy_attempt_free (); + } + return result; +} + + +static gpointer ____lambda33__gthread_func (gpointer self) { + gpointer result; + result = ___lambda33_ (); + return result; +} + + +static gboolean ___lambda35_ (void) { + gboolean result = FALSE; + gee_hazard_pointer_release_policy_attempt_free (); + result = TRUE; + return result; +} + + +static gboolean ____lambda35__gsource_func (gpointer self) { + gboolean result; + result = ___lambda35_ (); + return result; +} + + +static void gee_hazard_pointer_release_policy_start (GeeHazardPointerReleasePolicy _self_) { + GeeHazardPointerReleasePolicy _tmp0_; + GError * _inner_error_ = NULL; + _tmp0_ = _self_; + switch (_tmp0_) { + case GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD: + { + g_thread_create (____lambda33__gthread_func, NULL, FALSE, &_inner_error_); + if (_inner_error_ != NULL) { + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return; + } + break; + } + case GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP: + { + g_idle_add_full (G_PRIORITY_LOW, ____lambda35__gsource_func, NULL, NULL); + break; + } + default: + { + g_assert_not_reached (); + } + } +} + + +/** + * Ensures that helper methods are started. + */ +inline void gee_hazard_pointer_release_policy_ensure_start (void) { + gint _tmp0_ = 0; + gint policy; + gint _tmp1_; + gboolean _tmp2_ = FALSE; + _tmp0_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer_release_policy)); + policy = _tmp0_; + _tmp1_ = policy; + if ((_tmp1_ & (1 << ((sizeof (gint) * 8) - 1))) != 0) { + return; + } + _tmp2_ = g_static_mutex_trylock (&gee_hazard_pointer__queue_mutex); + if (_tmp2_) { + gint _tmp3_ = 0; + gint _tmp4_; + _tmp3_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer_release_policy)); + policy = _tmp3_; + _tmp4_ = policy; + if ((_tmp4_ & (1 << ((sizeof (gint) * 8) - 1))) == 0) { + GeeLinkedList* _tmp5_; + gint _tmp6_ = 0; + gint _tmp7_; + _tmp5_ = gee_linked_list_new (GEE_TYPE_ARRAY_LIST, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); + _g_object_unref0 (gee_hazard_pointer__queue); + gee_hazard_pointer__queue = (GeeQueue*) _tmp5_; + _tmp6_ = g_atomic_int_exchange_and_add ((volatile gint *) (&gee_hazard_pointer_release_policy), (gint) (1 << ((sizeof (gint) * 8) - 1))); + policy = _tmp6_; + _tmp7_ = policy; + gee_hazard_pointer_release_policy_start ((GeeHazardPointerReleasePolicy) _tmp7_); + } + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); + } +} + + +static gboolean ___lambda34_ (GeeArrayList* x) { + gboolean result = FALSE; + GeeArrayList* _tmp0_; + GeeArrayList* _tmp1_; + g_return_val_if_fail (x != NULL, FALSE); + _tmp0_ = gee_hazard_pointer__global_to_free; + _tmp1_ = x; + gee_array_list_add_all (_tmp0_, (GeeCollection*) _tmp1_); + result = TRUE; + _g_object_unref0 (x); + return result; +} + + +static gboolean ____lambda34__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = ___lambda34_ (g); + return result; +} + + +static inline void gee_hazard_pointer_release_policy_attempt_free (void) { + gboolean _tmp0_ = FALSE; + GeeArrayList* _tmp5_; + _tmp0_ = g_static_mutex_trylock (&gee_hazard_pointer__queue_mutex); + if (_tmp0_) { + GeeArrayList* _tmp1_; + GeeCollection* temp; + GeeQueue* _tmp2_; + GeeCollection* _tmp3_; + GeeCollection* _tmp4_; + _tmp1_ = gee_array_list_new (GEE_TYPE_ARRAY_LIST, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); + temp = (GeeCollection*) _tmp1_; + _tmp2_ = gee_hazard_pointer__queue; + _tmp3_ = temp; + gee_queue_drain (_tmp2_, _tmp3_, -1); + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); + _tmp4_ = temp; + gee_traversable_foreach ((GeeTraversable*) _tmp4_, ____lambda34__gee_forall_func, NULL); + _g_object_unref0 (temp); + } + _tmp5_ = gee_hazard_pointer__global_to_free; + gee_hazard_pointer_try_free (_tmp5_); +} + + +/** + * Release policy determines what happens with object freed by Policy.TRY_RELEASE + * and Policy.RELEASE. + */ +GType gee_hazard_pointer_release_policy_get_type (void) { + static volatile gsize gee_hazard_pointer_release_policy_type_id__volatile = 0; + if (g_once_init_enter (&gee_hazard_pointer_release_policy_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD, "GEE_HAZARD_POINTER_RELEASE_POLICY_HELPER_THREAD", "helper-thread"}, {GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP, "GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP", "main-loop"}, {0, NULL, NULL}}; + GType gee_hazard_pointer_release_policy_type_id; + gee_hazard_pointer_release_policy_type_id = g_enum_register_static ("GeeHazardPointerReleasePolicy", values); + g_once_init_leave (&gee_hazard_pointer_release_policy_type_id__volatile, gee_hazard_pointer_release_policy_type_id); + } + return gee_hazard_pointer_release_policy_type_id__volatile; +} + + +/** + * Creates a hazard pointer for a pointer. + * + * @param ptr Protected pointer + */ +GeeHazardPointer* gee_hazard_pointer_new (gconstpointer* ptr) { + GeeHazardPointer* self; + GeeHazardPointerNode* _tmp0_ = NULL; + GeeHazardPointerNode* _tmp1_; + gconstpointer* _tmp2_; + self = g_slice_new0 (GeeHazardPointer); + gee_hazard_pointer_instance_init (self); + _tmp0_ = gee_hazard_pointer_acquire (); + self->_node = _tmp0_; + _tmp1_ = self->_node; + _tmp2_ = ptr; + gee_hazard_pointer_node_set (_tmp1_, (void*) _tmp2_); + return self; +} + + +/** + * Create a hazard pointer from Node. + */ +GeeHazardPointer* gee_hazard_pointer_new_from_node (GeeHazardPointerNode* node) { + GeeHazardPointer* self; + GeeHazardPointerNode* _tmp0_; + g_return_val_if_fail (node != NULL, NULL); + self = g_slice_new0 (GeeHazardPointer); + gee_hazard_pointer_instance_init (self); + _tmp0_ = node; + self->_node = _tmp0_; + return self; +} + + +/** + * Gets hazard pointer from atomic pointer safely. + * + * @param aptr Atomic pointer. + * @param mask Mask of bits. + * @param mask_out Result of mask. + * @return Hazard pointer containing the element. + */ +GeeHazardPointer* gee_hazard_pointer_get_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out) { + gsize _vala_mask_out = 0UL; + GeeHazardPointer* result = NULL; + GeeHazardPointerNode* _tmp0_ = NULL; + GeeHazardPointerNode* node; + void* rptr; + void* ptr; + void* _tmp14_; + _tmp0_ = gee_hazard_pointer_acquire (); + node = _tmp0_; + rptr = NULL; + ptr = NULL; + _vala_mask_out = (gsize) 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gconstpointer** _tmp6_; + void* _tmp7_ = NULL; + void* _tmp8_; + gsize _tmp9_; + void* _tmp10_; + gsize _tmp11_; + GeeHazardPointerNode* _tmp12_; + void* _tmp13_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + void* _tmp3_; + gconstpointer** _tmp4_; + void* _tmp5_ = NULL; + _tmp3_ = rptr; + _tmp4_ = aptr; + _tmp5_ = g_atomic_pointer_get ((volatile gpointer *) ((void**) _tmp4_)); + if (!(_tmp3_ != _tmp5_)) { + break; + } + } + _tmp1_ = FALSE; + _tmp6_ = aptr; + _tmp7_ = g_atomic_pointer_get ((volatile gpointer *) ((void**) _tmp6_)); + rptr = _tmp7_; + _tmp8_ = rptr; + _tmp9_ = mask; + ptr = (void*) (((gsize) _tmp8_) & (~_tmp9_)); + _tmp10_ = rptr; + _tmp11_ = mask; + _vala_mask_out = ((gsize) _tmp10_) & _tmp11_; + _tmp12_ = node; + _tmp13_ = ptr; + gee_hazard_pointer_node_set (_tmp12_, _tmp13_); + } + } + _tmp14_ = ptr; + if (_tmp14_ != NULL) { + GeeHazardPointerNode* _tmp15_; + GeeHazardPointer* _tmp16_; + _tmp15_ = node; + _tmp16_ = gee_hazard_pointer_new_from_node (_tmp15_); + result = _tmp16_; + if (mask_out) { + *mask_out = _vala_mask_out; + } + return result; + } else { + GeeHazardPointerNode* _tmp17_; + _tmp17_ = node; + gee_hazard_pointer_node_release (_tmp17_); + result = NULL; + if (mask_out) { + *mask_out = _vala_mask_out; + } + return result; + } + if (mask_out) { + *mask_out = _vala_mask_out; + } +} + + +/** + * Copy an object from atomic pointer. + * + * @param aptr Atomic pointer. + * @param mask Mask of flags. + * @param mask_out Result of mask. + * @return A copy of object from atomic pointer. + */ +gpointer gee_hazard_pointer_get_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gsize mask, gsize* mask_out) { + gsize _vala_mask_out = 0UL; + gpointer result = NULL; + GeeHazardPointerNode* _tmp0_ = NULL; + GeeHazardPointerNode* node; + void* rptr; + void* ptr; + void* _tmp14_; + gpointer _tmp15_; + gpointer res; + GeeHazardPointerNode* _tmp16_; + _tmp0_ = gee_hazard_pointer_acquire (); + node = _tmp0_; + rptr = NULL; + ptr = NULL; + _vala_mask_out = (gsize) 0; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + gconstpointer** _tmp6_; + void* _tmp7_ = NULL; + void* _tmp8_; + gsize _tmp9_; + void* _tmp10_; + gsize _tmp11_; + GeeHazardPointerNode* _tmp12_; + void* _tmp13_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + void* _tmp3_; + gconstpointer** _tmp4_; + void* _tmp5_ = NULL; + _tmp3_ = rptr; + _tmp4_ = aptr; + _tmp5_ = g_atomic_pointer_get ((volatile gpointer *) ((void**) _tmp4_)); + if (!(_tmp3_ != _tmp5_)) { + break; + } + } + _tmp1_ = FALSE; + _tmp6_ = aptr; + _tmp7_ = g_atomic_pointer_get ((volatile gpointer *) ((void**) _tmp6_)); + rptr = _tmp7_; + _tmp8_ = rptr; + _tmp9_ = mask; + ptr = (void*) (((gsize) _tmp8_) & (~_tmp9_)); + _tmp10_ = rptr; + _tmp11_ = mask; + _vala_mask_out = ((gsize) _tmp10_) & _tmp11_; + _tmp12_ = node; + _tmp13_ = ptr; + gee_hazard_pointer_node_set (_tmp12_, _tmp13_); + } + } + _tmp14_ = ptr; + _tmp15_ = ((((gconstpointer*) _tmp14_) != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) ((gconstpointer*) _tmp14_)) : ((gpointer) ((gconstpointer*) _tmp14_)); + res = _tmp15_; + _tmp16_ = node; + gee_hazard_pointer_node_release (_tmp16_); + result = res; + if (mask_out) { + *mask_out = _vala_mask_out; + } + return result; +} + + +/** + * Exchange objects safly. + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + * @param old_mask Previous mask mask. + * @return Hazard pointer containing old value. + */ +GeeHazardPointer* gee_hazard_pointer_exchange_hazard_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask) { + gsize _vala_old_mask = 0UL; + GeeHazardPointer* result = NULL; + GeeHazardPointerNode* new_node; + gconstpointer _tmp0_; + gpointer _tmp4_; + gsize _tmp5_; + gsize _tmp6_; + void* new_rptr; + GeeHazardPointerNode* _tmp7_ = NULL; + GeeHazardPointerNode* node; + void* rptr; + void* ptr; + GeeHazardPointerNode* _tmp22_; + void* _tmp24_; + new_node = NULL; + _tmp0_ = new_ptr; + if (_tmp0_ != NULL) { + GeeHazardPointerNode* _tmp1_ = NULL; + GeeHazardPointerNode* _tmp2_; + gconstpointer _tmp3_; + _tmp1_ = gee_hazard_pointer_acquire (); + new_node = _tmp1_; + _tmp2_ = new_node; + _tmp3_ = new_ptr; + gee_hazard_pointer_node_set (_tmp2_, _tmp3_); + } + _vala_old_mask = (gsize) 0; + _tmp4_ = new_ptr; + new_ptr = NULL; + _tmp5_ = mask; + _tmp6_ = new_mask; + new_rptr = (void*) (((gsize) _tmp4_) | (_tmp5_ & _tmp6_)); + _tmp7_ = gee_hazard_pointer_acquire (); + node = _tmp7_; + rptr = NULL; + ptr = NULL; + { + gboolean _tmp8_; + _tmp8_ = TRUE; + while (TRUE) { + gboolean _tmp9_; + gconstpointer** _tmp14_; + void* _tmp15_ = NULL; + void* _tmp16_; + gsize _tmp17_; + void* _tmp18_; + gsize _tmp19_; + GeeHazardPointerNode* _tmp20_; + void* _tmp21_; + _tmp9_ = _tmp8_; + if (!_tmp9_) { + gconstpointer** _tmp10_; + void* _tmp11_; + void* _tmp12_; + gboolean _tmp13_ = FALSE; + _tmp10_ = aptr; + _tmp11_ = rptr; + _tmp12_ = new_rptr; + _tmp13_ = g_atomic_pointer_compare_and_exchange ((volatile gpointer *) ((void**) _tmp10_), _tmp11_, _tmp12_); + if (!(!_tmp13_)) { + break; + } + } + _tmp8_ = FALSE; + _tmp14_ = aptr; + _tmp15_ = g_atomic_pointer_get ((volatile gpointer *) ((void**) _tmp14_)); + rptr = _tmp15_; + _tmp16_ = rptr; + _tmp17_ = mask; + ptr = (void*) (((gsize) _tmp16_) & (~_tmp17_)); + _tmp18_ = rptr; + _tmp19_ = mask; + _vala_old_mask = ((gsize) _tmp18_) & _tmp19_; + _tmp20_ = node; + _tmp21_ = ptr; + gee_hazard_pointer_node_set (_tmp20_, _tmp21_); + } + } + _tmp22_ = new_node; + if (_tmp22_ != NULL) { + GeeHazardPointerNode* _tmp23_; + _tmp23_ = new_node; + gee_hazard_pointer_node_release (_tmp23_); + } + _tmp24_ = ptr; + if (_tmp24_ != NULL) { + GeeHazardPointerNode* _tmp25_; + GeeHazardPointer* _tmp26_; + _tmp25_ = node; + _tmp26_ = gee_hazard_pointer_new_from_node (_tmp25_); + result = _tmp26_; + _g_destroy_func0 (new_ptr); + if (old_mask) { + *old_mask = _vala_old_mask; + } + return result; + } else { + GeeHazardPointerNode* _tmp27_; + _tmp27_ = node; + gee_hazard_pointer_node_release (_tmp27_); + result = NULL; + _g_destroy_func0 (new_ptr); + if (old_mask) { + *old_mask = _vala_old_mask; + } + return result; + } + _g_destroy_func0 (new_ptr); + if (old_mask) { + *old_mask = _vala_old_mask; + } +} + + +/** + * Sets object safely + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + */ +void gee_hazard_pointer_set_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask) { + gconstpointer** _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_; + gsize _tmp3_; + gsize _tmp4_; + GeeHazardPointer* _tmp5_ = NULL; + GeeHazardPointer* ptr; + GeeHazardPointer* _tmp6_; + _tmp0_ = aptr; + _tmp1_ = new_ptr; + _tmp2_ = ((_tmp1_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); + _tmp3_ = mask; + _tmp4_ = new_mask; + _tmp5_ = gee_hazard_pointer_exchange_hazard_pointer (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, _tmp2_, _tmp3_, _tmp4_, NULL); + ptr = _tmp5_; + _tmp6_ = ptr; + if (_tmp6_ != NULL) { + void* _tmp7_ = NULL; + GDestroyNotify _tmp8_ = NULL; + GeeHazardPointerDestroyNotify _tmp9_ = NULL; + GeeHazardPointerDestroyNotify notify; + void* notify_target; + GDestroyNotify notify_target_destroy_notify; + GeeHazardPointer* _tmp10_; + GeeHazardPointerDestroyNotify _tmp11_; + void* _tmp11__target; + GDestroyNotify _tmp11__target_destroy_notify; + _tmp9_ = gee_hazard_pointer_get_destroy_notify (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, &_tmp7_, &_tmp8_); + notify = _tmp9_; + notify_target = _tmp7_; + notify_target_destroy_notify = _tmp8_; + _tmp10_ = ptr; + _tmp11_ = notify; + _tmp11__target = notify_target; + _tmp11__target_destroy_notify = notify_target_destroy_notify; + notify_target_destroy_notify = NULL; + gee_hazard_pointer_release (_tmp10_, _tmp11_, _tmp11__target, _tmp11__target_destroy_notify); + (notify_target_destroy_notify == NULL) ? NULL : (notify_target_destroy_notify (notify_target), NULL); + notify = NULL; + notify_target = NULL; + notify_target_destroy_notify = NULL; + } + _gee_hazard_pointer_free0 (ptr); + _g_destroy_func0 (new_ptr); +} + + +/** + * Exchange objects safly. + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + * @param old_mask Previous mask mask. + * @return Value that was previously stored. + */ +gpointer gee_hazard_pointer_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gpointer new_ptr, gsize mask, gsize new_mask, gsize* old_mask) { + gsize _vala_old_mask = 0UL; + gpointer result = NULL; + gconstpointer** _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_; + gsize _tmp3_; + gsize _tmp4_; + gsize _tmp5_ = 0UL; + GeeHazardPointer* _tmp6_ = NULL; + GeeHazardPointer* ptr; + gconstpointer _tmp7_ = NULL; + GeeHazardPointer* _tmp8_; + gconstpointer _tmp11_; + gpointer _tmp12_; + gpointer rptr; + _tmp0_ = aptr; + _tmp1_ = new_ptr; + _tmp2_ = ((_tmp1_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); + _tmp3_ = mask; + _tmp4_ = new_mask; + _tmp6_ = gee_hazard_pointer_exchange_hazard_pointer (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_, _tmp2_, _tmp3_, _tmp4_, &_tmp5_); + _vala_old_mask = _tmp5_; + ptr = _tmp6_; + _tmp8_ = ptr; + if (_tmp8_ != NULL) { + GeeHazardPointer* _tmp9_; + gconstpointer _tmp10_ = NULL; + _tmp9_ = ptr; + _tmp10_ = gee_hazard_pointer_get (_tmp9_, FALSE); + _tmp7_ = _tmp10_; + } else { + _tmp7_ = NULL; + } + _tmp11_ = _tmp7_; + _tmp12_ = ((_tmp11_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_); + rptr = _tmp12_; + result = rptr; + _gee_hazard_pointer_free0 (ptr); + _g_destroy_func0 (new_ptr); + if (old_mask) { + *old_mask = _vala_old_mask; + } + return result; +} + + +/** + * Compares and exchanges objects. + * + * @param aptr Atomic pointer. + * @param old_ptr Old pointer. + * @param _new_ptr New value. + * @param old_mask Old mask. + * @param new_mask New mask. + * @return Value that was previously stored. + */ +gboolean gee_hazard_pointer_compare_and_exchange_pointer (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer** aptr, gconstpointer old_ptr, gpointer _new_ptr, gsize mask, gsize old_mask, gsize new_mask) { + gboolean result = FALSE; + gpointer _tmp0_; + gconstpointer* new_ptr; + gconstpointer* _tmp1_; + gsize _tmp2_; + gsize _tmp3_; + void* new_rptr; + gconstpointer _tmp4_; + gsize _tmp5_; + gsize _tmp6_; + void* old_rptr; + gconstpointer** _tmp7_; + void* _tmp8_; + void* _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean success; + gboolean _tmp11_; + _tmp0_ = _new_ptr; + _new_ptr = NULL; + new_ptr = _tmp0_; + _tmp1_ = new_ptr; + _tmp2_ = mask; + _tmp3_ = new_mask; + new_rptr = (void*) (((gsize) _tmp1_) | (_tmp2_ & _tmp3_)); + _tmp4_ = old_ptr; + _tmp5_ = mask; + _tmp6_ = old_mask; + old_rptr = (void*) (((gsize) _tmp4_) | (_tmp5_ & _tmp6_)); + _tmp7_ = aptr; + _tmp8_ = old_rptr; + _tmp9_ = new_rptr; + _tmp10_ = g_atomic_pointer_compare_and_exchange ((volatile gpointer *) ((void**) _tmp7_), _tmp8_, _tmp9_); + success = _tmp10_; + _tmp11_ = success; + if (_tmp11_) { + void* _tmp12_ = NULL; + GDestroyNotify _tmp13_ = NULL; + GeeHazardPointerDestroyNotify _tmp14_ = NULL; + GeeHazardPointerDestroyNotify notify; + void* notify_target; + GDestroyNotify notify_target_destroy_notify; + gconstpointer _tmp15_; + _tmp14_ = gee_hazard_pointer_get_destroy_notify (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, &_tmp12_, &_tmp13_); + notify = _tmp14_; + notify_target = _tmp12_; + notify_target_destroy_notify = _tmp13_; + _tmp15_ = old_ptr; + if (_tmp15_ != NULL) { + GeeHazardPointerContext* _tmp16_ = NULL; + gconstpointer _tmp17_; + GeeHazardPointerDestroyNotify _tmp18_; + void* _tmp18__target; + GDestroyNotify _tmp18__target_destroy_notify; + _tmp16_ = gee_hazard_pointer_context_get_current_context (); + _tmp17_ = old_ptr; + _tmp18_ = notify; + _tmp18__target = notify_target; + _tmp18__target_destroy_notify = notify_target_destroy_notify; + notify_target_destroy_notify = NULL; + gee_hazard_pointer_context_release_ptr (_tmp16_, _tmp17_, _tmp18_, _tmp18__target, _tmp18__target_destroy_notify); + } + (notify_target_destroy_notify == NULL) ? NULL : (notify_target_destroy_notify (notify_target), NULL); + notify = NULL; + notify_target = NULL; + notify_target_destroy_notify = NULL; + } else { + gconstpointer* _tmp19_; + _tmp19_ = new_ptr; + if (_tmp19_ != NULL) { + gconstpointer* _tmp20_; + _tmp20_ = new_ptr; + new_ptr = NULL; + _g_destroy_func0 (_new_ptr); + _new_ptr = _tmp20_; + } + } + result = success; + _g_destroy_func0 (_new_ptr); + return result; +} + + +/** + * Gets the pointer hold by hazard pointer. + * + * @param other_thread Have to be set to ``true`` if accessed from thread that did not create this thread. + * @return The value hold by pointer. + */ +inline gconstpointer gee_hazard_pointer_get (GeeHazardPointer* self, gboolean other_thread) { + gconstpointer result = NULL; + GeeHazardPointerNode* _tmp0_; + gboolean _tmp1_; + void* _tmp2_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->_node; + _tmp1_ = other_thread; + _tmp2_ = gee_hazard_pointer_node_get (_tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * Free the pointer. + * + * @param notify method freeing object + */ +void gee_hazard_pointer_release (GeeHazardPointer* self, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify) { + GeeHazardPointerNode* _tmp0_; + void* _tmp1_ = NULL; + gconstpointer item; + GeeHazardPointerNode* _tmp2_; + gconstpointer _tmp3_; + g_return_if_fail (self != NULL); + _tmp0_ = self->_node; + _tmp1_ = gee_hazard_pointer_node_get (_tmp0_, FALSE); + item = _tmp1_; + _tmp2_ = self->_node; + gee_hazard_pointer_node_set (_tmp2_, NULL); + _tmp3_ = item; + if (_tmp3_ != NULL) { + GeeHazardPointerContext* _tmp4_ = NULL; + gconstpointer _tmp5_; + GeeHazardPointerDestroyNotify _tmp6_; + void* _tmp6__target; + GDestroyNotify _tmp6__target_destroy_notify; + _tmp4_ = gee_hazard_pointer_context_get_current_context (); + _tmp5_ = item; + _tmp6_ = notify; + _tmp6__target = notify_target; + _tmp6__target_destroy_notify = notify_target_destroy_notify; + notify_target_destroy_notify = NULL; + gee_hazard_pointer_context_release_ptr (_tmp4_, _tmp5_, _tmp6_, _tmp6__target, _tmp6__target_destroy_notify); + } + (notify_target_destroy_notify == NULL) ? NULL : (notify_target_destroy_notify (notify_target), NULL); + notify = NULL; + notify_target = NULL; + notify_target_destroy_notify = NULL; +} + + +/** + * Sets default policy (i.e. default policy for user-created contexts). + * The policy must be concrete and should not be blocking. + * + * @param policy New default policy. + */ +void gee_hazard_pointer_set_default_policy (GeeHazardPointerPolicy policy) { + GeeHazardPointerPolicy _tmp0_; + gboolean _tmp1_ = FALSE; + GeeHazardPointerPolicy _tmp2_; + gboolean _tmp3_ = FALSE; + GeeHazardPointerPolicy _tmp4_; + _tmp0_ = policy; + _tmp1_ = gee_hazard_pointer_policy_is_concrete (_tmp0_); + g_return_if_fail (_tmp1_); + _tmp2_ = policy; + _tmp3_ = gee_hazard_pointer_policy_is_blocking (_tmp2_); + if (_tmp3_) { + g_warning ("hazardpointer.vala:250: Setting blocking defautl Gee.HazardPointer.Pol" \ +"icy (there may be a deadlock).\n"); + } + _tmp4_ = policy; + g_atomic_int_set ((volatile gint *) (&gee_hazard_pointer__default_policy), (gint) _tmp4_); +} + + +/** + * Sets thread exit policy (i.e. default policy for the top-most Context). + * The policy must be concrete and should not be unsafe. + * + * @param policy New thread policy. + */ +void gee_hazard_pointer_set_thread_exit_policy (GeeHazardPointerPolicy policy) { + GeeHazardPointerPolicy _tmp0_; + gboolean _tmp1_ = FALSE; + GeeHazardPointerPolicy _tmp2_; + gboolean _tmp3_ = FALSE; + GeeHazardPointerPolicy _tmp4_; + _tmp0_ = policy; + _tmp1_ = gee_hazard_pointer_policy_is_concrete (_tmp0_); + g_return_if_fail (_tmp1_); + _tmp2_ = policy; + _tmp3_ = gee_hazard_pointer_policy_is_safe (_tmp2_); + if (!_tmp3_) { + g_warning ("hazardpointer.vala:262: Setting unsafe globale thread-exit Gee.HazardP" \ +"ointer.Policy (there may be a memory leak).\n"); + } + _tmp4_ = policy; + g_atomic_int_set ((volatile gint *) (&gee_hazard_pointer__thread_exit_policy), (gint) _tmp4_); +} + + +/** + * Sets release (i.e. how exactly the released objects arefreed). + * + * The method can be only set before any objects is released and is not thread-safe. + * + * @param policy New release policy. + */ +gboolean gee_hazard_pointer_set_release_policy (GeeHazardPointerReleasePolicy policy) { + gboolean result = FALSE; + gint _tmp0_ = 0; + gint old_policy; + gint _tmp1_; + gint _tmp2_; + GeeHazardPointerReleasePolicy _tmp3_; + gboolean _tmp4_ = FALSE; + _tmp0_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer_release_policy)); + old_policy = _tmp0_; + _tmp1_ = old_policy; + if ((_tmp1_ & ((sizeof (gint) * 8) - 1)) != 0) { + g_critical ("hazardpointer.vala:276: Attempt to change the policy of running helper" \ +". Failing."); + result = FALSE; + return result; + } + _tmp2_ = old_policy; + _tmp3_ = policy; + _tmp4_ = g_atomic_int_compare_and_exchange ((volatile gint *) (&gee_hazard_pointer_release_policy), _tmp2_, (gint) _tmp3_); + if (!_tmp4_) { + g_critical ("hazardpointer.vala:280: Concurrent access to release policy detected. " \ +"Failing."); + result = FALSE; + return result; + } + result = TRUE; + return result; +} + + +/** + * Gets a new hazard pointer node. + * + * @return new hazard pointer node. + */ +inline GeeHazardPointerNode* gee_hazard_pointer_acquire (void) { + GeeHazardPointerNode* result = NULL; + GeeHazardPointerNode* _tmp9_; + GeeHazardPointerNode* node; + GeeHazardPointerNode* old_head; + GeeHazardPointerNode* _tmp18_; + { + GeeHazardPointerNode* _tmp0_ = NULL; + GeeHazardPointerNode* curr; + _tmp0_ = gee_hazard_pointer_get_head (); + curr = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + GeeHazardPointerNode* _tmp5_; + GeeHazardPointerNode* _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + GeeHazardPointerNode* _tmp3_; + GeeHazardPointerNode* _tmp4_ = NULL; + _tmp3_ = curr; + _tmp4_ = gee_hazard_pointer_node_get_next (_tmp3_); + curr = _tmp4_; + } + _tmp1_ = FALSE; + _tmp5_ = curr; + if (!(_tmp5_ != NULL)) { + break; + } + _tmp6_ = curr; + _tmp7_ = gee_hazard_pointer_node_activate (_tmp6_); + if (_tmp7_) { + GeeHazardPointerNode* _tmp8_; + _tmp8_ = curr; + result = _tmp8_; + return result; + } + } + } + } + _tmp9_ = gee_hazard_pointer_node_new (); + node = _tmp9_; + old_head = NULL; + { + gboolean _tmp10_; + _tmp10_ = TRUE; + while (TRUE) { + gboolean _tmp11_; + GeeHazardPointerNode* _tmp15_; + void* _tmp16_ = NULL; + GeeHazardPointerNode* _tmp17_; + _tmp11_ = _tmp10_; + if (!_tmp11_) { + GeeHazardPointerNode* _tmp12_; + GeeHazardPointerNode* _tmp13_; + gboolean _tmp14_ = FALSE; + _tmp12_ = old_head; + _tmp13_ = node; + _tmp14_ = g_atomic_pointer_compare_and_exchange ((volatile gpointer *) (&gee_hazard_pointer__head), _tmp12_, _tmp13_); + if (!(!_tmp14_)) { + break; + } + } + _tmp10_ = FALSE; + _tmp15_ = node; + _tmp16_ = g_atomic_pointer_get ((volatile gpointer *) (&gee_hazard_pointer__head)); + old_head = (GeeHazardPointerNode*) _tmp16_; + _tmp17_ = old_head; + gee_hazard_pointer_node_set_next (_tmp15_, _tmp17_); + } + } + _tmp18_ = node; + result = _tmp18_; + return result; +} + + +/** + * Tries to free from list. + * + * @return ``true`` if list is empty. + */ +gboolean gee_hazard_pointer_try_free (GeeArrayList* to_free) { + gboolean result = FALSE; + GeeHashSet* _tmp0_; + GeeCollection* used; + GeeArrayList* _tmp45_; + gint _tmp46_; + gint _tmp47_; + g_return_val_if_fail (to_free != NULL, FALSE); + _tmp0_ = gee_hash_set_new (G_TYPE_POINTER, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + used = (GeeCollection*) _tmp0_; + { + GeeHazardPointerNode* _tmp1_ = NULL; + GeeHazardPointerNode* current; + _tmp1_ = gee_hazard_pointer_get_head (); + current = _tmp1_; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + GeeHazardPointerNode* _tmp6_; + GeeCollection* _tmp7_; + GeeHazardPointerNode* _tmp8_; + void* _tmp9_ = NULL; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + GeeHazardPointerNode* _tmp4_; + GeeHazardPointerNode* _tmp5_ = NULL; + _tmp4_ = current; + _tmp5_ = gee_hazard_pointer_node_get_next (_tmp4_); + current = _tmp5_; + } + _tmp2_ = FALSE; + _tmp6_ = current; + if (!(_tmp6_ != NULL)) { + break; + } + _tmp7_ = used; + _tmp8_ = current; + _tmp9_ = gee_hazard_pointer_node_get (_tmp8_, TRUE); + gee_collection_add (_tmp7_, _tmp9_); + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp10_; + _tmp10_ = TRUE; + while (TRUE) { + gboolean _tmp11_; + gint _tmp12_; + GeeArrayList* _tmp13_; + gint _tmp14_; + gint _tmp15_; + GeeArrayList* _tmp16_; + gint _tmp17_; + gpointer _tmp18_ = NULL; + GeeHazardPointerFreeNode* current; + GeeCollection* _tmp19_; + GeeHazardPointerFreeNode* _tmp20_; + void* _tmp21_; + gboolean _tmp22_ = FALSE; + _tmp11_ = _tmp10_; + if (!_tmp11_) { + } + _tmp10_ = FALSE; + _tmp12_ = i; + _tmp13_ = to_free; + _tmp14_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + if (!(_tmp12_ < _tmp15_)) { + break; + } + _tmp16_ = to_free; + _tmp17_ = i; + _tmp18_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, _tmp17_); + current = _tmp18_; + _tmp19_ = used; + _tmp20_ = current; + _tmp21_ = _tmp20_->pointer; + _tmp22_ = gee_collection_contains (_tmp19_, _tmp21_); + if (_tmp22_) { + gint _tmp23_; + _tmp23_ = i; + i = _tmp23_ + 1; + } else { + GeeArrayList* _tmp24_; + GeeArrayList* _tmp25_; + gint _tmp26_; + gint _tmp27_; + gpointer _tmp28_ = NULL; + GeeHazardPointerFreeNode* cur; + gint _tmp29_; + GeeArrayList* _tmp30_; + gint _tmp31_; + gint _tmp32_; + GeeHazardPointerFreeNode* _tmp40_; + GeeHazardPointerDestroyNotify _tmp41_; + void* _tmp41__target; + GeeHazardPointerFreeNode* _tmp42_; + void* _tmp43_; + GeeHazardPointerFreeNode* _tmp44_; + _tmp24_ = to_free; + _tmp25_ = to_free; + _tmp26_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp25_); + _tmp27_ = _tmp26_; + _tmp28_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp24_, _tmp27_ - 1); + cur = _tmp28_; + _tmp29_ = i; + _tmp30_ = to_free; + _tmp31_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp30_); + _tmp32_ = _tmp31_; + if (_tmp29_ != _tmp32_) { + GeeArrayList* _tmp33_; + gint _tmp34_; + gpointer _tmp35_ = NULL; + GeeHazardPointerFreeNode* temp; + GeeArrayList* _tmp36_; + gint _tmp37_; + GeeHazardPointerFreeNode* _tmp38_; + GeeHazardPointerFreeNode* _tmp39_; + _tmp33_ = to_free; + _tmp34_ = i; + _tmp35_ = gee_abstract_list_get ((GeeAbstractList*) _tmp33_, _tmp34_); + temp = _tmp35_; + _tmp36_ = to_free; + _tmp37_ = i; + _tmp38_ = cur; + gee_abstract_list_set ((GeeAbstractList*) _tmp36_, _tmp37_, _tmp38_); + _tmp39_ = temp; + cur = _tmp39_; + } + _tmp40_ = cur; + _tmp41_ = _tmp40_->destroy_notify; + _tmp41__target = _tmp40_->destroy_notify_target; + _tmp42_ = cur; + _tmp43_ = _tmp42_->pointer; + _tmp41_ (_tmp43_, _tmp41__target); + _tmp44_ = cur; + gee_hazard_pointer_free_node_free (_tmp44_); + } + } + } + } + _tmp45_ = to_free; + _tmp46_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp45_); + _tmp47_ = _tmp46_; + result = _tmp47_ > 0; + _g_object_unref0 (used); + return result; +} + + +/** + * Gets head of hazard pointers. + * @return Hazard pointer head. + */ +GeeHazardPointerNode* gee_hazard_pointer_get_head (void) { + GeeHazardPointerNode* result = NULL; + void* _tmp0_ = NULL; + _tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&gee_hazard_pointer__head)); + result = (GeeHazardPointerNode*) _tmp0_; + return result; +} + + +static Block5Data* block5_data_ref (Block5Data* _data5_) { + g_atomic_int_inc (&_data5_->_ref_count_); + return _data5_; +} + + +static void block5_data_unref (void * _userdata_) { + Block5Data* _data5_; + _data5_ = (Block5Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + g_type = _data5_->g_type; + g_dup_func = _data5_->g_dup_func; + g_destroy_func = _data5_->g_destroy_func; + g_slice_free (Block5Data, _data5_); + } +} + + +static void __lambda36_ (Block5Data* _data5_, void* ptr) { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + void* _tmp0_; + gconstpointer* gptr; + gconstpointer* _tmp1_; + gpointer obj; + g_type = _data5_->g_type; + g_dup_func = _data5_->g_dup_func; + g_destroy_func = _data5_->g_destroy_func; + _tmp0_ = ptr; + gptr = _tmp0_; + _tmp1_ = gptr; + gptr = NULL; + obj = _tmp1_; + _g_destroy_func0 (obj); + obj = NULL; + _g_destroy_func0 (obj); +} + + +static void ___lambda36__gee_hazard_pointer_destroy_notify (void* ptr, gpointer self) { + __lambda36_ (self, ptr); +} + + +GeeHazardPointerDestroyNotify gee_hazard_pointer_get_destroy_notify (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, void** result_target, GDestroyNotify* result_target_destroy_notify) { + GeeHazardPointerDestroyNotify result = NULL; + Block5Data* _data5_; + GeeHazardPointerDestroyNotify _tmp0_; + void* _tmp0__target; + GDestroyNotify _tmp0__target_destroy_notify; + _data5_ = g_slice_new0 (Block5Data); + _data5_->_ref_count_ = 1; + _data5_->g_type = g_type; + _data5_->g_dup_func = g_dup_func; + _data5_->g_destroy_func = g_destroy_func; + _tmp0_ = ___lambda36__gee_hazard_pointer_destroy_notify; + _tmp0__target = block5_data_ref (_data5_); + _tmp0__target_destroy_notify = block5_data_unref; + *result_target = _tmp0__target; + *result_target_destroy_notify = _tmp0__target_destroy_notify; + result = _tmp0_; + block5_data_unref (_data5_); + _data5_ = NULL; + return result; +} + + +static GeeHazardPointerPolicy* _gee_hazard_pointer_policy_dup (GeeHazardPointerPolicy* self) { + GeeHazardPointerPolicy* dup; + dup = g_new0 (GeeHazardPointerPolicy, 1); + memcpy (dup, self, sizeof (GeeHazardPointerPolicy)); + return dup; +} + + +static gpointer __gee_hazard_pointer_policy_dup0 (gpointer self) { + return self ? _gee_hazard_pointer_policy_dup (self) : NULL; +} + + +GeeHazardPointerContext* gee_hazard_pointer_context_new (GeeHazardPointerPolicy* policy) { + GeeHazardPointerContext* self; + GeeArrayList* _tmp0_; + void* _tmp1_ = NULL; + GeeHazardPointerPolicy* _tmp2_; + self = g_slice_new0 (GeeHazardPointerContext); + gee_hazard_pointer_context_instance_init (self); + _tmp0_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL, NULL, NULL); + _g_object_unref0 (self->_to_free); + self->_to_free = _tmp0_; + _tmp1_ = g_static_private_get (&gee_hazard_pointer_context__current_context); + self->_parent = _tmp1_; + g_static_private_set (&gee_hazard_pointer_context__current_context, self, NULL); + _tmp2_ = policy; + if (_tmp2_ == NULL) { + GeeHazardPointerContext* _tmp3_; + _tmp3_ = self->_parent; + if (_tmp3_ == NULL) { + gint _tmp4_ = 0; + GeeHazardPointerPolicy _tmp5_; + GeeHazardPointerPolicy* _tmp6_; + _tmp4_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer__thread_exit_policy)); + _tmp5_ = (GeeHazardPointerPolicy) _tmp4_; + _tmp6_ = __gee_hazard_pointer_policy_dup0 (&_tmp5_); + _g_free0 (self->_policy); + self->_policy = _tmp6_; + } else { + gint _tmp7_ = 0; + GeeHazardPointerPolicy _tmp8_; + GeeHazardPointerPolicy* _tmp9_; + _tmp7_ = g_atomic_int_get ((volatile gint *) (&gee_hazard_pointer__default_policy)); + _tmp8_ = (GeeHazardPointerPolicy) _tmp7_; + _tmp9_ = __gee_hazard_pointer_policy_dup0 (&_tmp8_); + _g_free0 (self->_policy); + self->_policy = _tmp9_; + } + } else { + GeeHazardPointerPolicy* _tmp10_; + GeeHazardPointerPolicy _tmp11_ = 0; + GeeHazardPointerPolicy* _tmp12_; + _tmp10_ = policy; + _tmp11_ = gee_hazard_pointer_policy_to_concrete (*_tmp10_); + _tmp12_ = __gee_hazard_pointer_policy_dup0 (&_tmp11_); + _g_free0 (self->_policy); + self->_policy = _tmp12_; + } + return self; +} + + +/** + * Tries to free all freed pointer in current context. + */ +void gee_hazard_pointer_context_try_free (GeeHazardPointerContext* self) { + GeeArrayList* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = self->_to_free; + gee_hazard_pointer_try_free (_tmp0_); +} + + +/** + * Ensure that whole context is freed. Plase note that it might block. + */ +void gee_hazard_pointer_context_free_all (GeeHazardPointerContext* self) { + g_return_if_fail (self != NULL); + while (TRUE) { + GeeArrayList* _tmp0_; + gboolean _tmp1_ = FALSE; + _tmp0_ = self->_to_free; + _tmp1_ = gee_hazard_pointer_try_free (_tmp0_); + if (!_tmp1_) { + break; + } + g_thread_yield (); + } +} + + +/** + * Tries to push the current context to releaser. + */ +void gee_hazard_pointer_context_try_release (GeeHazardPointerContext* self) { + gboolean _tmp0_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = g_static_mutex_trylock (&gee_hazard_pointer__queue_mutex); + if (_tmp0_) { + GeeQueue* _tmp1_; + GeeArrayList* _tmp2_; + GeeArrayList* _tmp3_; + GeeArrayList* _tmp4_; + _tmp1_ = gee_hazard_pointer__queue; + _tmp2_ = self->_to_free; + self->_to_free = NULL; + _tmp3_ = _tmp2_; + gee_queue_offer (_tmp1_, _tmp3_); + _g_object_unref0 (_tmp3_); + _tmp4_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL, NULL, NULL); + _g_object_unref0 (self->_to_free); + self->_to_free = _tmp4_; + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); + } +} + + +/** + * Pushes the current context to releaser. Plase note that it might block. + */ +void gee_hazard_pointer_context_release (GeeHazardPointerContext* self) { + GeeQueue* _tmp0_; + GeeArrayList* _tmp1_; + GeeArrayList* _tmp2_; + GeeArrayList* _tmp3_; + g_return_if_fail (self != NULL); + g_static_mutex_lock (&gee_hazard_pointer__queue_mutex); + _tmp0_ = gee_hazard_pointer__queue; + _tmp1_ = self->_to_free; + self->_to_free = NULL; + _tmp2_ = _tmp1_; + gee_queue_offer (_tmp0_, _tmp2_); + _g_object_unref0 (_tmp2_); + _tmp3_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL, NULL, NULL); + _g_object_unref0 (self->_to_free); + self->_to_free = _tmp3_; + g_static_mutex_unlock (&gee_hazard_pointer__queue_mutex); +} + + +/** + * Add pointer to freed array. + */ +inline void gee_hazard_pointer_context_release_ptr (GeeHazardPointerContext* self, void* ptr, GeeHazardPointerDestroyNotify notify, void* notify_target, GDestroyNotify notify_target_destroy_notify) { + GeeHazardPointerFreeNode* _tmp0_; + GeeHazardPointerFreeNode* node; + GeeHazardPointerFreeNode* _tmp1_; + void* _tmp2_; + GeeHazardPointerFreeNode* _tmp3_; + GeeHazardPointerDestroyNotify _tmp4_; + void* _tmp4__target; + GDestroyNotify _tmp4__target_destroy_notify; + GeeArrayList* _tmp5_; + GeeHazardPointerFreeNode* _tmp6_; + GeeArrayList* _tmp7_; + gint _tmp8_; + gint _tmp9_; + guint _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = gee_hazard_pointer_free_node_new (); + node = _tmp0_; + _tmp1_ = node; + _tmp2_ = ptr; + _tmp1_->pointer = _tmp2_; + _tmp3_ = node; + _tmp4_ = notify; + _tmp4__target = notify_target; + _tmp4__target_destroy_notify = notify_target_destroy_notify; + notify_target_destroy_notify = NULL; + (_tmp3_->destroy_notify_target_destroy_notify == NULL) ? NULL : (_tmp3_->destroy_notify_target_destroy_notify (_tmp3_->destroy_notify_target), NULL); + _tmp3_->destroy_notify = NULL; + _tmp3_->destroy_notify_target = NULL; + _tmp3_->destroy_notify_target_destroy_notify = NULL; + _tmp3_->destroy_notify = _tmp4_; + _tmp3_->destroy_notify_target = _tmp4__target; + _tmp3_->destroy_notify_target_destroy_notify = _tmp4__target_destroy_notify; + _tmp5_ = self->_to_free; + _tmp6_ = node; + gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp6_); + _tmp7_ = self->_to_free; + _tmp8_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = gee_hazard_pointer_context_THRESHOLD; + if (((guint) _tmp9_) >= _tmp10_) { + GeeArrayList* _tmp11_; + _tmp11_ = self->_to_free; + gee_hazard_pointer_try_free (_tmp11_); + } + (notify_target_destroy_notify == NULL) ? NULL : (notify_target_destroy_notify (notify_target), NULL); + notify = NULL; + notify_target = NULL; + notify_target_destroy_notify = NULL; +} + + +/** + * Gets current context. + */ +inline GeeHazardPointerContext* gee_hazard_pointer_context_get_current_context (void) { + GeeHazardPointerContext* result = NULL; + void* _tmp0_ = NULL; + _tmp0_ = g_static_private_get (&gee_hazard_pointer_context__current_context); + result = _tmp0_; + return result; +} + + +static void gee_hazard_pointer_context_instance_init (GeeHazardPointerContext * self) { +} + + +void gee_hazard_pointer_context_free (GeeHazardPointerContext* self) { + GeeArrayList* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint size; + gboolean clean_parent; + gint _tmp3_; + GeeHazardPointerContext* _tmp18_; + gboolean _tmp19_; + _tmp0_ = self->_to_free; + _tmp1_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp0_); + _tmp2_ = _tmp1_; + size = _tmp2_; + clean_parent = FALSE; + _tmp3_ = size; + if (_tmp3_ > 0) { + GeeArrayList* remaining = NULL; + gboolean _tmp4_ = FALSE; + GeeHazardPointerContext* _tmp5_; + gboolean _tmp8_; + GeeArrayList* _tmp13_; + _tmp5_ = self->_parent; + if (_tmp5_ == NULL) { + _tmp4_ = TRUE; + } else { + gint _tmp6_; + guint _tmp7_; + _tmp6_ = size; + _tmp7_ = gee_hazard_pointer_context_THRESHOLD; + _tmp4_ = ((guint) _tmp6_) >= _tmp7_; + } + _tmp8_ = _tmp4_; + if (_tmp8_) { + GeeHazardPointerPolicy* _tmp9_; + GeeArrayList* _tmp10_; + GeeArrayList* _tmp11_ = NULL; + _tmp9_ = self->_policy; + _tmp10_ = self->_to_free; + self->_to_free = NULL; + _tmp11_ = gee_hazard_pointer_policy_perform (*_tmp9_, _tmp10_); + _g_object_unref0 (remaining); + remaining = _tmp11_; + } else { + GeeArrayList* _tmp12_; + _tmp12_ = self->_to_free; + self->_to_free = NULL; + _g_object_unref0 (remaining); + remaining = _tmp12_; + } + _tmp13_ = remaining; + if (_tmp13_ != NULL) { + GeeHazardPointerContext* _tmp14_; + GeeHazardPointerContext* _tmp15_; + GeeArrayList* _tmp16_; + GeeArrayList* _tmp17_; + _tmp14_ = self->_parent; + _vala_assert (_tmp14_ != NULL, "_parent != null"); + _tmp15_ = self->_parent; + _tmp16_ = _tmp15_->_to_free; + _tmp17_ = remaining; + gee_array_list_add_all (_tmp16_, (GeeCollection*) _tmp17_); + clean_parent = TRUE; + } + _g_object_unref0 (remaining); + } + _tmp18_ = self->_parent; + g_static_private_set (&gee_hazard_pointer_context__current_context, _tmp18_, NULL); + _tmp19_ = clean_parent; + if (_tmp19_) { + GeeHazardPointerContext* _tmp20_; + GeeArrayList* _tmp21_; + _tmp20_ = self->_parent; + _tmp21_ = _tmp20_->_to_free; + gee_hazard_pointer_try_free (_tmp21_); + } + _g_object_unref0 (self->_to_free); + _g_free0 (self->_policy); + g_slice_free (GeeHazardPointerContext, self); +} + + +GeeHazardPointerFreeNode* gee_hazard_pointer_free_node_new (void) { + GeeHazardPointerFreeNode* self; + self = g_slice_new0 (GeeHazardPointerFreeNode); + gee_hazard_pointer_free_node_instance_init (self); + return self; +} + + +static void gee_hazard_pointer_free_node_instance_init (GeeHazardPointerFreeNode * self) { +} + + +void gee_hazard_pointer_free_node_free (GeeHazardPointerFreeNode* self) { + (self->destroy_notify_target_destroy_notify == NULL) ? NULL : (self->destroy_notify_target_destroy_notify (self->destroy_notify_target), NULL); + self->destroy_notify = NULL; + self->destroy_notify_target = NULL; + self->destroy_notify_target_destroy_notify = NULL; + g_slice_free (GeeHazardPointerFreeNode, self); +} + + +GeeHazardPointerNode* gee_hazard_pointer_node_new (void) { + GeeHazardPointerNode* self; + self = g_slice_new0 (GeeHazardPointerNode); + gee_hazard_pointer_node_instance_init (self); + g_atomic_pointer_set ((volatile gpointer *) (&self->_hazard), NULL); + g_atomic_int_set ((volatile gint *) (&self->_active), 1); + return self; +} + + +void gee_hazard_pointer_node_release (GeeHazardPointerNode* self) { + g_return_if_fail (self != NULL); + g_atomic_pointer_set ((volatile gpointer *) (&self->_hazard), NULL); + g_atomic_int_set ((volatile gint *) (&self->_active), 0); +} + + +inline gboolean gee_hazard_pointer_node_is_active (GeeHazardPointerNode* self) { + gboolean result = FALSE; + gint _tmp0_ = 0; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = g_atomic_int_get ((volatile gint *) (&self->_active)); + result = _tmp0_ != 0; + return result; +} + + +inline gboolean gee_hazard_pointer_node_activate (GeeHazardPointerNode* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = g_atomic_int_compare_and_exchange ((volatile gint *) (&self->_active), 0, 1); + result = _tmp0_; + return result; +} + + +inline void gee_hazard_pointer_node_set (GeeHazardPointerNode* self, void* ptr) { + void* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = ptr; + g_atomic_pointer_set ((volatile gpointer *) (&self->_hazard), _tmp0_); +} + + +inline void* gee_hazard_pointer_node_get (GeeHazardPointerNode* self, gboolean safe) { + void* result = NULL; + gboolean _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = safe; + if (_tmp0_) { + void* _tmp1_ = NULL; + _tmp1_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_hazard)); + result = (void*) _tmp1_; + return result; + } else { + void* _tmp2_; + _tmp2_ = self->_hazard; + result = (void*) _tmp2_; + return result; + } +} + + +inline GeeHazardPointerNode* gee_hazard_pointer_node_get_next (GeeHazardPointerNode* self) { + GeeHazardPointerNode* result = NULL; + void* _tmp0_ = NULL; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_next)); + result = (GeeHazardPointerNode*) _tmp0_; + return result; +} + + +inline void gee_hazard_pointer_node_set_next (GeeHazardPointerNode* self, GeeHazardPointerNode* next) { + GeeHazardPointerNode* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = next; + g_atomic_pointer_set ((volatile gpointer *) (&self->_next), _tmp0_); +} + + +static void gee_hazard_pointer_node_instance_init (GeeHazardPointerNode * self) { +} + + +void gee_hazard_pointer_node_free (GeeHazardPointerNode* self) { + GeeHazardPointerNode* _tmp0_; + _tmp0_ = self->_next; + gee_hazard_pointer_node_free (_tmp0_); + g_slice_free (GeeHazardPointerNode, self); +} + + +static void gee_hazard_pointer_instance_init (GeeHazardPointer * self) { +} + + +void gee_hazard_pointer_free (GeeHazardPointer* self) { + GeeHazardPointerNode* _tmp0_; + _tmp0_ = self->_node; + gee_hazard_pointer_node_release (_tmp0_); + g_slice_free (GeeHazardPointer, self); +} + + + diff --git a/gee/hazardpointer.vala b/gee/hazardpointer.vala new file mode 100644 index 0000000..3151632 --- /dev/null +++ b/gee/hazardpointer.vala @@ -0,0 +1,768 @@ +/* hazardpointer.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Hazard pointer is a method of protecting a pointer shared by many threads. + * If you want to use atomic pointer that may be freed you should use following code: + * + * {{{ + * string *shared_pointer = ...; + * HazardPointer hptr = HazardPointer.get_hazard_pointer (&shared_pointer); + * // my_string contains value from shared_pinter. It is valid as long as hptr is alive. + * unowned string my_string = ptr.get (); + * // instead of delete + * ptr.release ((ptr) => {string *sptr = ptr;string ref = (owned)sptr;}); + * }); + * }}} + * + * In some cases you may use helper methods which might involve copying of object (and are unsafe for unowned objects): + * {{{ + * Gtk.Window *window = ...; + * Gtk.Window? local_window = HazardPointer.get_pointer (&window); + * HazardPointer.set_pointer (&window, ...) + * local_window = HazardPointer.exchange_pointer (&window, null); + * HazardPointer.compare_and_exchange (&window, null, local_window); + * }}} + * + * The class also provides helper methods if least significant bits are used for storing flags. + * + * HazardPointers are not thread-safe (unless documentation states otherwise). + */ +[Compact] +public class Gee.HazardPointer { // FIXME: Make it a struct + /** + * Creates a hazard pointer for a pointer. + * + * @param ptr Protected pointer + */ + public HazardPointer (G *ptr) { + this._node = acquire (); + this._node.set ((void *)ptr); + } + + /** + * Create a hazard pointer from Node. + */ + internal HazardPointer.from_node (Node node) { + this._node = node; + } + + /** + * Gets hazard pointer from atomic pointer safely. + * + * @param aptr Atomic pointer. + * @param mask Mask of bits. + * @param mask_out Result of mask. + * @return Hazard pointer containing the element. + */ + public static HazardPointer? get_hazard_pointer (G **aptr, size_t mask = 0, out size_t mask_out = null) { + unowned Node node = acquire (); + void *rptr = null; + void *ptr = null; + mask_out = 0; + do { + rptr = AtomicPointer.get ((void **)aptr); + ptr = (void *)((size_t) rptr & ~mask); + mask_out = (size_t) rptr & mask; + node.set (ptr); + } while (rptr != AtomicPointer.get ((void **)aptr)); + if (ptr != null) { + return new HazardPointer.from_node (node); + } else { + node.release (); + return null; + } + } + + /** + * Copy an object from atomic pointer. + * + * @param aptr Atomic pointer. + * @param mask Mask of flags. + * @param mask_out Result of mask. + * @return A copy of object from atomic pointer. + */ + public static G? get_pointer (G **aptr, size_t mask = 0, out size_t mask_out = null) { + unowned Node node = acquire (); + void *rptr = null; + void *ptr = null; + mask_out = 0; + do { + rptr = AtomicPointer.get ((void **)aptr); + ptr = (void *)((size_t) rptr & ~mask); + mask_out = (size_t) rptr & mask; + node.set (ptr); + } while (rptr != AtomicPointer.get ((void **)aptr)); + G? res = (G *)ptr; + node.release (); + return res; + } + + /** + * Exchange objects safly. + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + * @param old_mask Previous mask mask. + * @return Hazard pointer containing old value. + */ + public static HazardPointer? exchange_hazard_pointer (G **aptr, owned G? new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null) { + unowned Node? new_node = null; + if (new_ptr != null) { + new_node = acquire (); + new_node.set (new_ptr); + } + old_mask = 0; + void *new_rptr = (void *)((size_t)((owned) new_ptr) | (mask & new_mask)); + unowned Node node = acquire (); + void *rptr = null; + void *ptr = null; + do { + rptr = AtomicPointer.get ((void **)aptr); + ptr = (void *)((size_t) rptr & ~mask); + old_mask = (size_t) rptr & mask; + node.set (ptr); + } while (!AtomicPointer.compare_and_exchange((void **)aptr, rptr, new_rptr)); + if (new_node != null) + new_node.release (); + if (ptr != null) { + return new HazardPointer.from_node (node); + } else { + node.release (); + return null; + } + } + + /** + * Sets object safely + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + */ + public static void set_pointer (G **aptr, owned G? new_ptr, size_t mask = 0, size_t new_mask = 0) { + HazardPointer? ptr = exchange_hazard_pointer (aptr, new_ptr, mask, new_mask, null); + if (ptr != null) { + DestroyNotify notify = get_destroy_notify (); + ptr.release ((owned)notify); + } + } + + /** + * Exchange objects safly. + * + * @param aptr Atomic pointer. + * @param new_ptr New value + * @param mask Mask of flags. + * @param new_mask New mask. + * @param old_mask Previous mask mask. + * @return Value that was previously stored. + */ + public static G? exchange_pointer (G **aptr, owned G? new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null) { + HazardPointer? ptr = exchange_hazard_pointer (aptr, new_ptr, mask, new_mask, out old_mask); + G? rptr = ptr != null ? ptr.get () : null; + return rptr; + } + + /** + * Compares and exchanges objects. + * + * @param aptr Atomic pointer. + * @param old_ptr Old pointer. + * @param _new_ptr New value. + * @param old_mask Old mask. + * @param new_mask New mask. + * @return Value that was previously stored. + */ + public static bool compare_and_exchange_pointer (G **aptr, G? old_ptr, owned G? _new_ptr, size_t mask = 0, size_t old_mask = 0, size_t new_mask = 0) { + G *new_ptr = (owned)_new_ptr; + void *new_rptr = (void *)((size_t)(new_ptr) | (mask & new_mask)); + void *old_rptr = (void *)((size_t)(old_ptr) | (mask & old_mask)); + bool success = AtomicPointer.compare_and_exchange((void **)aptr, old_rptr, new_rptr); + if (success) { + DestroyNotify notify = get_destroy_notify (); + if (old_ptr != null) { + Context.get_current_context ()->release_ptr (old_ptr, (owned)notify); + } + } else if (new_ptr != null) { + _new_ptr = (owned)new_ptr; + } + return success; + } + + ~HazardPointer () { + _node.release (); + } + + /** + * Gets the pointer hold by hazard pointer. + * + * @param other_thread Have to be set to ``true`` if accessed from thread that did not create this thread. + * @return The value hold by pointer. + */ + public inline new unowned G get (bool other_thread = false) { + return _node[other_thread]; + } + + /** + * Free the pointer. + * + * @param notify method freeing object + */ + public void release (owned DestroyNotify notify) { + unowned G item = _node[false]; + _node.set (null); + if (item != null) { + Context.get_current_context ()->release_ptr (item, (owned)notify); + } + } + + /** + * Sets default policy (i.e. default policy for user-created contexts). + * The policy must be concrete and should not be blocking. + * + * @param policy New default policy. + */ + public static void set_default_policy (Policy policy) requires (policy.is_concrete ()) { + if (policy.is_blocking ()) + warning ("Setting blocking defautl Gee.HazardPointer.Policy (there may be a deadlock).\n"); + AtomicInt.set(ref _default_policy, (int)policy); + } + + /** + * Sets thread exit policy (i.e. default policy for the top-most Context). + * The policy must be concrete and should not be unsafe. + * + * @param policy New thread policy. + */ + public static void set_thread_exit_policy (Policy policy) requires (policy.is_concrete ()) { + if (!policy.is_safe ()) + warning ("Setting unsafe globale thread-exit Gee.HazardPointer.Policy (there may be a memory leak).\n"); + AtomicInt.set(ref _thread_exit_policy, (int)policy); + } + + /** + * Sets release (i.e. how exactly the released objects arefreed). + * + * The method can be only set before any objects is released and is not thread-safe. + * + * @param policy New release policy. + */ + public static bool set_release_policy (ReleasePolicy policy) { + int old_policy = AtomicInt.get (ref release_policy); + if ((old_policy & (sizeof(int) * 8 - 1)) != 0) { + critical ("Attempt to change the policy of running helper. Failing."); + return false; + } + if (!AtomicInt.compare_and_exchange (ref release_policy, old_policy, (int)policy)) { + critical ("Concurrent access to release policy detected. Failing."); + return false; + } + return true; + } + + /** + * Policy determines what happens on exit from Context. + */ + public enum Policy { + /** + * Performs default action on exit from thread. + */ + DEFAULT, + /** + * Performs the same action as on exit from current thread. + */ + THREAD_EXIT, + /** + * Goes through the free list and attempts to free un-freed elements. + */ + TRY_FREE, + /** + * Goes through the free list and attempts to free un-freed elements + * untill all elements are freed. + */ + FREE, + /** + * Release the un-freed elements to either helper thread or to main loop. + * Please note if the operation would block it is not performed. + */ + TRY_RELEASE, + /** + * Release the un-freed elements to either helper thread or to main loop. + * Please note it may block while adding to queue. + */ + RELEASE; + + /** + * Checks if the policy is concrete or if it depends on global variables. + * + * @return ``true`` if this policy does not depend on global variables + */ + public bool is_concrete () { + switch (this) { + case DEFAULT: + case THREAD_EXIT: + return false; + case TRY_FREE: + case FREE: + case TRY_RELEASE: + case RELEASE: + return true; + default: + assert_not_reached (); + } + } + + /** + * Checks if policy blocks or is lock-free. + * Please note that it works on a concrete policy only. + * + * @return ``true`` if the policy may block the thread. + */ + public bool is_blocking () requires (this.is_concrete ()) { + switch (this) { + case TRY_FREE: + case TRY_RELEASE: + return false; + case FREE: + case RELEASE: + return true; + default: + assert_not_reached (); + } + } + + /** + * Checks if policy guarantees freeing all elements. + * Please note that it works on a concrete policy only. + * + * @return ``true`` if the policy guarantees freeing all elements. + */ + public bool is_safe () requires (this.is_concrete ()) { + switch (this) { + case TRY_FREE: + case TRY_RELEASE: + return false; + case FREE: + case RELEASE: + return true; + default: + assert_not_reached (); + } + } + + /** + * Finds concrete policy which corresponds to given policy. + * + * @return Policy that corresponds to given policy at given time in given thread. + */ + public Policy to_concrete () ensures (result.is_concrete ()) { + switch (this) { + case TRY_FREE: + case FREE: + case TRY_RELEASE: + case RELEASE: + return this; + case DEFAULT: + return (Policy) AtomicInt.get (ref _default_policy); + case THREAD_EXIT: + return (Policy) AtomicInt.get (ref _thread_exit_policy); + default: + assert_not_reached (); + + } + } + + /** + * Runs the policy. + * @param to_free List containing elements to free. + * @return Non-empty list of not freed elements or ``null`` if all elements have been disposed. + */ + internal ArrayList? perform (owned ArrayList to_free) { + switch (this.to_concrete ()) { + case TRY_FREE: + return try_free (to_free) ? (owned) to_free : null; + case FREE: + while (try_free (to_free)) { + Thread.yield (); + } + return null; + case TRY_RELEASE: + ReleasePolicy.ensure_start (); + if (_queue_mutex.trylock ()) { + _queue.offer ((owned) to_free); + _queue_mutex.unlock (); + return null; + } else { + return (owned) to_free; + } + case RELEASE: + ReleasePolicy.ensure_start (); + _queue_mutex.lock (); + _queue.offer ((owned) to_free); + _queue_mutex.unlock (); + return null; + default: + assert_not_reached (); + } + } + } + + public delegate void DestroyNotify (void *ptr); + + /** + * Release policy determines what happens with object freed by Policy.TRY_RELEASE + * and Policy.RELEASE. + */ + public enum ReleasePolicy { + /** + * Libgee spawns helper thread to free those elements. + * This is default. + */ + HELPER_THREAD, + /** + * Libgee uses GLib main loop. + * This is recommended for application using GLib main loop. + */ + MAIN_LOOP; + + private static void start (ReleasePolicy self) { // FIXME: Make it non-static [bug 659778] + switch (self) { + case HELPER_THREAD: + Thread.create (() => { + Thread.self ().set_priority (ThreadPriority.LOW); + while (true) { + Thread.yield (); + attempt_free (); + } + }, false); + break; + case MAIN_LOOP: + Idle.add (() => { + attempt_free (); + return true; + }, Priority.LOW); + break; + default: + assert_not_reached (); + } + } + + /** + * Ensures that helper methods are started. + */ + internal static inline void ensure_start () { + int policy = AtomicInt.get (ref release_policy); + if ((policy & (1 << (sizeof(int) * 8 - 1))) != 0) + return; + if (_queue_mutex.trylock ()) { + policy = AtomicInt.get (ref release_policy); + if ((policy & (1 << (sizeof(int) * 8 - 1))) == 0) { + _queue = new LinkedList> (); + // Hack to not lie about successfull setting policy + policy = AtomicInt.exchange_and_add (ref release_policy, (int)(1 << (sizeof(int) * 8 - 1))); + start ((ReleasePolicy) policy); + } + _queue_mutex.unlock (); + } + } + + private static inline void attempt_free () { + if (_queue_mutex.trylock ()) { + Collection> temp = new ArrayList> (); + _queue.drain (temp); + _queue_mutex.unlock (); + temp.foreach ((x) => {_global_to_free.add_all (x); return true;}); + } + try_free (_global_to_free); + } + } + + /** + * Create a new context. User does not need to create explicitly however it might be benefitial + * if he is about to issue bunch of commands he might consider it benefitial to fine-tune the creation of contexts. + * + * {{{ + * Context ctx = new Context (); + * lock_free_collection.operation1 (); + * // Normally on exit the thread exit operation would be executed but here the default operation of + * // child context is executed. + * lock_free_collection.operation2 (); + * }}} + * + * Please note that the Context in implicitly part of stack and: + * + * 1. It cannot be moved between threads. + * 2. If in given thread the child (created later) context is alive parent must be alive as well. + */ + [Compact] + public class Context { // FIXME: Should be struct + public Context (Policy? policy = null) { + this._to_free = new ArrayList (); + this._parent = _current_context.get (); + _current_context.set (this, null); + if (policy == null) { + if (_parent == null) { + _policy = (Policy)AtomicInt.get (ref _thread_exit_policy); + } else { + _policy = (Policy)AtomicInt.get (ref _default_policy); + } + } else { + this._policy = policy.to_concrete (); + } +#if DEBUG + stderr.printf ("Entering context %p (policy %s, parent %p)\n", this, _policy != null ? _policy.to_string () : null, _parent); +#endif + } + + ~Context () { +#if DEBUG + stderr.printf ("Exiting context %p (policy %s, parent %p)\n", this, _policy != null ? _policy.to_string () : null, _parent); +#endif + int size = _to_free.size; + bool clean_parent = false; + if (size > 0) { + ArrayList? remaining; + if (_parent == null || size >= THRESHOLD) + remaining = _policy.perform ((owned) _to_free); + else + remaining = (owned) _to_free; + if (remaining != null) { + assert (_parent != null); + _parent->_to_free.add_all (remaining); + clean_parent = true; + } + } +#if DEBUG + stderr.printf ("Setting current context to %p\n", _parent); +#endif + _current_context.set (_parent, null); + if (clean_parent) + HazardPointer.try_free (_parent->_to_free); + } + + /** + * Tries to free all freed pointer in current context. + */ + public void try_free () { + HazardPointer.try_free (_to_free); + } + + /** + * Ensure that whole context is freed. Plase note that it might block. + */ + public void free_all () { + while (HazardPointer.try_free (_to_free)) + Thread.yield (); + } + + /** + * Tries to push the current context to releaser. + */ + public void try_release () { + if (_queue_mutex.trylock ()) { + _queue.offer ((owned) _to_free); + _to_free = new ArrayList (); + _queue_mutex.unlock (); + } + } + + /** + * Pushes the current context to releaser. Plase note that it might block. + */ + public void release () { + _queue_mutex.lock (); + _queue.offer ((owned) _to_free); + _to_free = new ArrayList (); + _queue_mutex.unlock (); + } + + /** + * Add pointer to freed array. + */ + internal inline void release_ptr (void *ptr, owned DestroyNotify notify) { + FreeNode *node = new FreeNode (); + node->pointer = ptr; + node->destroy_notify = (owned)notify; + _to_free.add (node); + if (_to_free.size >= THRESHOLD) + HazardPointer.try_free (_to_free); + } + + /** + * Gets current context. + */ + internal inline static Context *get_current_context () { + return _current_context.get (); + } + + internal Context *_parent; + internal ArrayList _to_free; + internal Policy? _policy; + internal static StaticPrivate _current_context; + internal static StaticPrivate _root_context; + private static uint THRESHOLD = 10; + } + + /** + * Gets a new hazard pointer node. + * + * @return new hazard pointer node. + */ + internal static inline unowned Node acquire () { + for (unowned Node? curr = get_head (); curr != null; curr = curr.get_next ()) + if (curr.activate ()) + return curr; + Node *node = new Node (); + Node *old_head = null; + do { + node->set_next (old_head = (Node *)AtomicPointer.get (&_head)); + } while (!AtomicPointer.compare_and_exchange (&_head, old_head, node)); + return node; + } + + /** + * Tries to free from list. + * + * @return ``true`` if list is empty. + */ + internal static bool try_free (ArrayList to_free) { + Collection used = new HashSet(); + for (unowned Node? current = get_head (); current != null; current = current.get_next ()) { + used.add (current.get ()); + } + for (int i = 0; i < to_free.size;) { + FreeNode *current = to_free[i]; + if (used.contains (current->pointer)) { +#if DEBUG + stderr.printf ("Skipping freeing %p\n", current->pointer); +#endif + i++; + } else { +#if DEBUG + stderr.printf ("Freeing %p\n", current->pointer); +#endif + FreeNode *cur = to_free.remove_at (to_free.size - 1); + if (i != to_free.size) { + FreeNode *temp = to_free[i]; + to_free[i] = cur; + cur = temp; + } + cur->destroy_notify (cur->pointer); + delete cur; + } + } + return to_free.size > 0; + } + + /** + * Gets head of hazard pointers. + * @return Hazard pointer head. + */ + internal static unowned Node? get_head () { + return (Node *)AtomicPointer.get(&_head); + } + + internal unowned Node _node; + + internal static Node *_head = null; + + internal static int _default_policy = (int)Policy.TRY_FREE; + internal static int _thread_exit_policy = (int)Policy.RELEASE; + + internal static int release_policy = 0; + + internal static Queue> _queue; + internal static StaticMutex _queue_mutex; + + internal static ArrayList _global_to_free; + + internal static DestroyNotify get_destroy_notify () { + return (ptr) => { + G *gptr = ptr; + G obj = (owned)gptr; + obj = null; + }; + } + + [Compact] + internal class FreeNode { + public void *pointer; + public DestroyNotify destroy_notify; + } + + /** + * List of used pointers. + */ + [Compact] + internal class Node { + public Node () { + AtomicPointer.set (&_hazard, null); + AtomicInt.set (ref _active, 1); + } + + inline ~Node () { + delete _next; + } + + public void release () { + AtomicPointer.set (&_hazard, null); + AtomicInt.set (ref _active, 0); + } + + public inline bool is_active () { + return AtomicInt.get (ref _active) != 0; + } + + public inline bool activate () { + return AtomicInt.compare_and_exchange (ref _active, 0, 1); + } + + public inline void set (void *ptr) { + AtomicPointer.set (&_hazard, ptr); + } + + public inline void *get (bool safe = true) { + if (safe) { + return (void *)AtomicPointer.get (&_hazard); + } else { + return (void *)_hazard; + } + } + + public inline unowned Node? get_next () { + return (Node *)AtomicPointer.get (&_next); + } + + public inline void set_next (Node *next) { + AtomicPointer.set (&_next, next); + } + + public Node *_next; + public int _active; + public void *_hazard; + } +} + diff --git a/gee/iterable.c b/gee/iterable.c index cc60bfe..79792eb 100644 --- a/gee/iterable.c +++ b/gee/iterable.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,27 +55,72 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GeeIterator* gee_iterable_iterator (GeeIterable* self); -GType gee_iterable_get_element_type (GeeIterable* self); /** @@ -79,20 +136,10 @@ GeeIterator* gee_iterable_iterator (GeeIterable* self) { } -GType gee_iterable_get_element_type (GeeIterable* self) { - g_return_val_if_fail (self != NULL, 0UL); - return GEE_ITERABLE_GET_INTERFACE (self)->get_element_type (self); -} - - static void gee_iterable_base_init (GeeIterableIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; - /** - * The type of the elements in this collection. - */ - g_object_interface_install_property (iface, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } } @@ -107,6 +154,7 @@ GType gee_iterable_get_type (void) { GType gee_iterable_type_id; gee_iterable_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeIterable", &g_define_type_info, 0); g_type_interface_add_prerequisite (gee_iterable_type_id, G_TYPE_OBJECT); + g_type_interface_add_prerequisite (gee_iterable_type_id, GEE_TYPE_TRAVERSABLE); g_once_init_leave (&gee_iterable_type_id__volatile, gee_iterable_type_id); } return gee_iterable_type_id__volatile; diff --git a/gee/iterable.vala b/gee/iterable.vala index a6ef612..bbaa765 100644 --- a/gee/iterable.vala +++ b/gee/iterable.vala @@ -25,12 +25,8 @@ using GLib; /** * An object that can provide an {@link Iterator}. */ -public interface Gee.Iterable : Object { - /** - * The type of the elements in this collection. - */ - public abstract Type element_type { get; } - +[GenericAccessors] +public interface Gee.Iterable : Object, Traversable { /** * Returns a {@link Iterator} that can be used for simple iteration over a * collection. diff --git a/gee/iterator.c b/gee/iterator.c index 3ffe3ee..1cb8ac9 100644 --- a/gee/iterator.c +++ b/gee/iterator.c @@ -5,6 +5,7 @@ * * Copyright (C) 2007-2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2010-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +31,26 @@ #include +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) @@ -38,23 +59,95 @@ typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_UNFOLD_ITERATOR (gee_unfold_iterator_get_type ()) +#define GEE_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator)) +#define GEE_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) +#define GEE_IS_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_IS_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_UNFOLD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) + +typedef struct _GeeUnfoldIterator GeeUnfoldIterator; +typedef struct _GeeUnfoldIteratorClass GeeUnfoldIteratorClass; +#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _Block6Data Block6Data; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); }; +typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data); +struct _Block6Data { + int _ref_count_; + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeIterator* current; + GeeIterator* iters; +}; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; gboolean gee_iterator_next (GeeIterator* self); gboolean gee_iterator_has_next (GeeIterator* self); -gboolean gee_iterator_first (GeeIterator* self); gpointer gee_iterator_get (GeeIterator* self); void gee_iterator_remove (GeeIterator* self); +GeeIterator* gee_iterator_unfold (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeUnfoldFunc f, void* f_target, GDestroyNotify f_target_destroy_notify, GeeLazy* current); +GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); +GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); +GType gee_unfold_iterator_get_type (void) G_GNUC_CONST; +GeeIterator* gee_iterator_concat (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iters); +static Block6Data* block6_data_ref (Block6Data* _data6_); +static void block6_data_unref (void * _userdata_); +gboolean gee_iterator_get_valid (GeeIterator* self); +static GeeLazy* __lambda2_ (Block6Data* _data6_); +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +static GeeLazy* ___lambda2__gee_unfold_func (gpointer self); +gboolean gee_iterator_get_read_only (GeeIterator* self); /** @@ -79,17 +172,6 @@ gboolean gee_iterator_has_next (GeeIterator* self) { } -/** - * Rewinds to the first element in the iteration. - * - * @return ``true`` if the iterator has a first element - */ -gboolean gee_iterator_first (GeeIterator* self) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ITERATOR_GET_INTERFACE (self)->first (self); -} - - /** * Returns the current element in the iteration. * @@ -104,7 +186,7 @@ gpointer gee_iterator_get (GeeIterator* self) { /** * Removes the current element in the iteration. The cursor is set in an * in-between state. Both {@link get} and {@link remove} will fail until - * the next move of the cursor (calling {@link next} or {@link first}). + * the next move of the cursor (calling {@link next}). */ void gee_iterator_remove (GeeIterator* self) { g_return_if_fail (self != NULL); @@ -112,10 +194,199 @@ void gee_iterator_remove (GeeIterator* self) { } +/** + * Create iterator from unfolding function. The lazy value is + * force-evaluated before progressing to next element. + * + * @param f Unfolding function + * @param current If iterator is to be valid it contains the current value of it + */ +GeeIterator* gee_iterator_unfold (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeUnfoldFunc f, void* f_target, GDestroyNotify f_target_destroy_notify, GeeLazy* current) { + GeeIterator* result = NULL; + GeeUnfoldFunc _tmp0_; + void* _tmp0__target; + GDestroyNotify _tmp0__target_destroy_notify; + GeeLazy* _tmp1_; + GeeUnfoldIterator* _tmp2_; + _tmp0_ = f; + _tmp0__target = f_target; + _tmp0__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp1_ = current; + current = NULL; + _tmp2_ = gee_unfold_iterator_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify, _tmp1_); + result = (GeeIterator*) _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + _gee_lazy_unref0 (current); + return result; +} + + +/** + * Concatinate iterators. + * + * @param iters Iterators of iterators + * @return Iterator containg values of each iterator + */ +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static Block6Data* block6_data_ref (Block6Data* _data6_) { + g_atomic_int_inc (&_data6_->_ref_count_); + return _data6_; +} + + +static void block6_data_unref (void * _userdata_) { + Block6Data* _data6_; + _data6_ = (Block6Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + g_type = _data6_->g_type; + g_dup_func = _data6_->g_dup_func; + g_destroy_func = _data6_->g_destroy_func; + _g_object_unref0 (_data6_->current); + _g_object_unref0 (_data6_->iters); + g_slice_free (Block6Data, _data6_); + } +} + + +static GeeLazy* __lambda2_ (Block6Data* _data6_) { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeLazy* result = NULL; + g_type = _data6_->g_type; + g_dup_func = _data6_->g_dup_func; + g_destroy_func = _data6_->g_destroy_func; + while (TRUE) { + GeeIterator* _tmp0_; + _tmp0_ = _data6_->current; + if (_tmp0_ == NULL) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + _tmp1_ = _data6_->iters; + _tmp2_ = gee_iterator_next (_tmp1_); + if (_tmp2_) { + GeeIterator* _tmp3_; + gpointer _tmp4_ = NULL; + _tmp3_ = _data6_->iters; + _tmp4_ = gee_iterator_get (_tmp3_); + _g_object_unref0 (_data6_->current); + _data6_->current = (GeeIterator*) _tmp4_; + } else { + result = NULL; + return result; + } + } else { + GeeIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = _data6_->current; + _tmp6_ = gee_iterator_next (_tmp5_); + if (_tmp6_) { + GeeIterator* _tmp7_; + gpointer _tmp8_ = NULL; + gpointer _tmp9_; + GeeLazy* _tmp10_; + GeeLazy* _tmp11_; + _tmp7_ = _data6_->current; + _tmp8_ = gee_iterator_get (_tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = gee_lazy_new_from_value (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp9_); + _tmp11_ = _tmp10_; + _g_destroy_func0 (_tmp9_); + result = _tmp11_; + return result; + } else { + _g_object_unref0 (_data6_->current); + _data6_->current = NULL; + } + } + } +} + + +static GeeLazy* ___lambda2__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = __lambda2_ (self); + return result; +} + + +GeeIterator* gee_iterator_concat (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iters) { + GeeIterator* result = NULL; + Block6Data* _data6_; + GeeIterator* _tmp0_; + GeeIterator* _tmp1_; + GeeIterator* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + GeeIterator* _tmp7_ = NULL; + g_return_val_if_fail (iters != NULL, NULL); + _data6_ = g_slice_new0 (Block6Data); + _data6_->_ref_count_ = 1; + _data6_->g_type = g_type; + _data6_->g_dup_func = g_dup_func; + _data6_->g_destroy_func = g_destroy_func; + _tmp0_ = iters; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (_data6_->iters); + _data6_->iters = _tmp1_; + _data6_->current = NULL; + _tmp2_ = _data6_->iters; + _tmp3_ = gee_iterator_get_valid (_tmp2_); + _tmp4_ = _tmp3_; + if (_tmp4_) { + GeeIterator* _tmp5_; + gpointer _tmp6_ = NULL; + _tmp5_ = _data6_->iters; + _tmp6_ = gee_iterator_get (_tmp5_); + _g_object_unref0 (_data6_->current); + _data6_->current = (GeeIterator*) _tmp6_; + } + _tmp7_ = gee_iterator_unfold (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, ___lambda2__gee_unfold_func, block6_data_ref (_data6_), block6_data_unref, NULL); + result = _tmp7_; + block6_data_unref (_data6_); + _data6_ = NULL; + return result; +} + + +gboolean gee_iterator_get_valid (GeeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_ITERATOR_GET_INTERFACE (self)->get_valid (self); +} + + +gboolean gee_iterator_get_read_only (GeeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_ITERATOR_GET_INTERFACE (self)->get_read_only (self); +} + + static void gee_iterator_base_init (GeeIteratorIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; + /** + * Determines wheather the call to {@link get} is legal. It is false at the + * beginning and after {@link remove} call and true otherwise. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * Determines wheather the call to {@link remove} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } } @@ -124,12 +395,12 @@ static void gee_iterator_base_init (GeeIteratorIface * iface) { * An iterator over a collection. * * Gee's iterators are "on-track" iterators. They always point to an item - * except before the first call to {@link next} or {@link first}, or, when an - * item has been removed, until the next call to {@link next} or {@link first}. + * except before the first call to {@link next}, or, when an + * item has been removed, until the next call to {@link next}. * * Please note that when the iterator is out of track, neither {@link get} nor * {@link remove} are defined and both will fail. After the next call to - * {@link next} or {@link first}, they will be defined again. + * {@link next}, they will be defined again. */ GType gee_iterator_get_type (void) { static volatile gsize gee_iterator_type_id__volatile = 0; @@ -138,6 +409,7 @@ GType gee_iterator_get_type (void) { GType gee_iterator_type_id; gee_iterator_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeIterator", &g_define_type_info, 0); g_type_interface_add_prerequisite (gee_iterator_type_id, G_TYPE_OBJECT); + g_type_interface_add_prerequisite (gee_iterator_type_id, GEE_TYPE_TRAVERSABLE); g_once_init_leave (&gee_iterator_type_id__volatile, gee_iterator_type_id); } return gee_iterator_type_id__volatile; diff --git a/gee/iterator.vala b/gee/iterator.vala index 8b243e6..b22fa10 100644 --- a/gee/iterator.vala +++ b/gee/iterator.vala @@ -2,6 +2,7 @@ * * Copyright (C) 2007-2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2010-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,14 +28,14 @@ * An iterator over a collection. * * Gee's iterators are "on-track" iterators. They always point to an item - * except before the first call to {@link next} or {@link first}, or, when an - * item has been removed, until the next call to {@link next} or {@link first}. + * except before the first call to {@link next}, or, when an + * item has been removed, until the next call to {@link next}. * * Please note that when the iterator is out of track, neither {@link get} nor * {@link remove} are defined and both will fail. After the next call to - * {@link next} or {@link first}, they will be defined again. + * {@link next}, they will be defined again. */ -public interface Gee.Iterator : Object { +public interface Gee.Iterator : Object, Traversable { /** * Advances to the next element in the iteration. * @@ -49,13 +50,6 @@ public interface Gee.Iterator : Object { */ public abstract bool has_next (); - /** - * Rewinds to the first element in the iteration. - * - * @return ``true`` if the iterator has a first element - */ - public abstract bool first (); - /** * Returns the current element in the iteration. * @@ -66,8 +60,59 @@ public interface Gee.Iterator : Object { /** * Removes the current element in the iteration. The cursor is set in an * in-between state. Both {@link get} and {@link remove} will fail until - * the next move of the cursor (calling {@link next} or {@link first}). + * the next move of the cursor (calling {@link next}). */ public abstract void remove (); + + /** + * Determines wheather the call to {@link get} is legal. It is false at the + * beginning and after {@link remove} call and true otherwise. + */ + public abstract bool valid { get; } + + /** + * Determines wheather the call to {@link remove} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + public abstract bool read_only { get; } + + /** + * Create iterator from unfolding function. The lazy value is + * force-evaluated before progressing to next element. + * + * @param f Unfolding function + * @param current If iterator is to be valid it contains the current value of it + */ + public static Iterator unfold (owned UnfoldFunc f, owned Lazy? current = null) { + return new UnfoldIterator ((owned) f, (owned) current); + } + + /** + * Concatinate iterators. + * + * @param iters Iterators of iterators + * @return Iterator containg values of each iterator + */ + public static Iterator concat (Iterator> iters) { + Iterator? current = null; + if (iters.valid) + current = iters.get (); + return unfold (() => { + while (true) { + if (current == null) { + if (iters.next ()) { + current = iters.get (); + } else { + return null; + } + } else if (current.next ()) { + return new Lazy.from_value (current.get ()); + } else { + current = null; + } + } + }); + } } diff --git a/gee/lazy.c b/gee/lazy.c new file mode 100644 index 0000000..216018a --- /dev/null +++ b/gee/lazy.c @@ -0,0 +1,367 @@ +/* lazy.c generated by valac 0.18.0, the Vala compiler + * generated from lazy.vala, do not modify */ + +/* lazy.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include + + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; +typedef struct _GeeLazyPrivate GeeLazyPrivate; +#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) +typedef struct _GeeParamSpecLazy GeeParamSpecLazy; + +typedef gpointer (*GeeLazyFunc) (void* user_data); +struct _GeeLazy { + GTypeInstance parent_instance; + volatile int ref_count; + GeeLazyPrivate * priv; +}; + +struct _GeeLazyClass { + GTypeClass parent_class; + void (*finalize) (GeeLazy *self); +}; + +struct _GeeLazyPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeLazyFunc _func; + gpointer _func_target; + GDestroyNotify _func_target_destroy_notify; + gpointer _value; +}; + +struct _GeeParamSpecLazy { + GParamSpec parent_instance; +}; + + +static gpointer gee_lazy_parent_class = NULL; + +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +#define GEE_LAZY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_LAZY, GeeLazyPrivate)) +enum { + GEE_LAZY_DUMMY_PROPERTY +}; +GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +void gee_lazy_eval (GeeLazy* self); +gpointer gee_lazy_get (GeeLazy* self); +gconstpointer gee_lazy_get_value (GeeLazy* self); +static void gee_lazy_finalize (GeeLazy* obj); + + +GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify) { + GeeLazy* self = NULL; + GeeLazyFunc _tmp0_; + void* _tmp0__target; + GDestroyNotify _tmp0__target_destroy_notify; + self = (GeeLazy*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = func; + _tmp0__target = func_target; + _tmp0__target_destroy_notify = func_target_destroy_notify; + func_target_destroy_notify = NULL; + (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL); + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + self->priv->_func = _tmp0_; + self->priv->_func_target = _tmp0__target; + self->priv->_func_target_destroy_notify = _tmp0__target_destroy_notify; + (func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL); + func = NULL; + func_target = NULL; + func_target_destroy_notify = NULL; + return self; +} + + +GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify) { + return gee_lazy_construct (GEE_TYPE_LAZY, g_type, g_dup_func, g_destroy_func, func, func_target, func_target_destroy_notify); +} + + +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item) { + GeeLazy* self = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + self = (GeeLazy*) g_type_create_instance (object_type); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = item; + _tmp1_ = ((_tmp0_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + _g_destroy_func0 (self->priv->_value); + self->priv->_value = _tmp1_; + return self; +} + + +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item) { + return gee_lazy_construct_from_value (GEE_TYPE_LAZY, g_type, g_dup_func, g_destroy_func, item); +} + + +void gee_lazy_eval (GeeLazy* self) { + GeeLazyFunc _tmp0_; + void* _tmp0__target; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->_func; + _tmp0__target = self->priv->_func_target; + if (_tmp0_ != NULL) { + GeeLazyFunc _tmp1_; + void* _tmp1__target; + gpointer _tmp2_ = NULL; + _tmp1_ = self->priv->_func; + _tmp1__target = self->priv->_func_target; + _tmp2_ = _tmp1_ (_tmp1__target); + ((self->priv->_value == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->g_destroy_func (self->priv->_value), NULL)); + self->priv->_value = _tmp2_; + (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL); + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + } +} + + +gpointer gee_lazy_get (GeeLazy* self) { + gpointer result = NULL; + gconstpointer _tmp0_; + gpointer _tmp1_; + g_return_val_if_fail (self != NULL, NULL); + gee_lazy_eval (self); + _tmp0_ = self->priv->_value; + _tmp1_ = ((_tmp0_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_); + result = _tmp1_; + return result; +} + + +gconstpointer gee_lazy_get_value (GeeLazy* self) { + gconstpointer result; + gconstpointer _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + gee_lazy_eval (self); + _tmp0_ = self->priv->_value; + result = _tmp0_; + return result; +} + + +static void gee_value_lazy_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void gee_value_lazy_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_lazy_unref (value->data[0].v_pointer); + } +} + + +static void gee_value_lazy_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_lazy_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer gee_value_lazy_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* gee_value_lazy_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeLazy* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_lazy_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* gee_value_lazy_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeLazy** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_lazy_ref (value->data[0].v_pointer); + } + return NULL; +} + + +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeParamSpecLazy* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_TYPE_LAZY), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +gpointer gee_value_get_lazy (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_LAZY), NULL); + return value->data[0].v_pointer; +} + + +void gee_value_set_lazy (GValue* value, gpointer v_object) { + GeeLazy* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_LAZY)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_LAZY)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_lazy_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_lazy_unref (old); + } +} + + +void gee_value_take_lazy (GValue* value, gpointer v_object) { + GeeLazy* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_LAZY)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_LAZY)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_lazy_unref (old); + } +} + + +static void gee_lazy_class_init (GeeLazyClass * klass) { + gee_lazy_parent_class = g_type_class_peek_parent (klass); + GEE_LAZY_CLASS (klass)->finalize = gee_lazy_finalize; + g_type_class_add_private (klass, sizeof (GeeLazyPrivate)); +} + + +static void gee_lazy_instance_init (GeeLazy * self) { + self->priv = GEE_LAZY_GET_PRIVATE (self); + self->ref_count = 1; +} + + +static void gee_lazy_finalize (GeeLazy* obj) { + GeeLazy * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_LAZY, GeeLazy); + (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL); + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + ((self->priv->_value == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->g_destroy_func (self->priv->_value), NULL)); +} + + +/** + * Represents a lazy value. I.e. value that is computed on demand. + */ +GType gee_lazy_get_type (void) { + static volatile gsize gee_lazy_type_id__volatile = 0; + if (g_once_init_enter (&gee_lazy_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_value_lazy_init, gee_value_lazy_free_value, gee_value_lazy_copy_value, gee_value_lazy_peek_pointer, "p", gee_value_lazy_collect_value, "p", gee_value_lazy_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeLazyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_lazy_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeLazy), 0, (GInstanceInitFunc) gee_lazy_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_lazy_type_id; + gee_lazy_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeLazy", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_lazy_type_id__volatile, gee_lazy_type_id); + } + return gee_lazy_type_id__volatile; +} + + +gpointer gee_lazy_ref (gpointer instance) { + GeeLazy* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +void gee_lazy_unref (gpointer instance) { + GeeLazy* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_LAZY_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + + diff --git a/gee/lazy.vala b/gee/lazy.vala new file mode 100644 index 0000000..36c1d3d --- /dev/null +++ b/gee/lazy.vala @@ -0,0 +1,60 @@ +/* lazy.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +namespace Gee { + public delegate G LazyFunc (); +} + +/** + * Represents a lazy value. I.e. value that is computed on demand. + */ +public class Gee.Lazy { + public Lazy (owned LazyFunc func) { + _func = (owned)func; + } + + public Lazy.from_value (G item) { + _value = item; + } + + public void eval () { + if (_func != null) { + _value = _func (); + _func = null; + } + } + + public new G get () { + eval (); + return _value; + } + + public new G value { + get { + eval (); + return _value; + } + } + + private LazyFunc? _func; + private G? _value; +} diff --git a/gee/libgee_0_8_la_vala.stamp b/gee/libgee_0_8_la_vala.stamp new file mode 100644 index 0000000..859afb1 --- /dev/null +++ b/gee/libgee_0_8_la_vala.stamp @@ -0,0 +1 @@ +stamp diff --git a/gee/linkedlist.c b/gee/linkedlist.c index c622869..84030bc 100644 --- a/gee/linkedlist.c +++ b/gee/linkedlist.c @@ -31,13 +31,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -47,6 +59,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -74,14 +94,6 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -101,6 +113,41 @@ typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; + #define GEE_TYPE_QUEUE (gee_queue_get_type ()) #define GEE_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_QUEUE, GeeQueue)) #define GEE_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_QUEUE)) @@ -143,23 +190,55 @@ typedef struct _GeeLinkedListIteratorClass GeeLinkedListIteratorClass; typedef struct _GeeLinkedListIteratorPrivate GeeLinkedListIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -171,6 +250,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -185,34 +265,35 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -223,7 +304,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -241,14 +322,73 @@ struct _GeeAbstractListClass { void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); gpointer (*remove_at) (GeeAbstractList* self, gint index); GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); - gpointer (*first) (GeeAbstractList* self); - gpointer (*last) (GeeAbstractList* self); - void (*insert_all) (GeeAbstractList* self, gint index, GeeCollection* collection); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); GeeList* (*get_read_only_view) (GeeAbstractList* self); }; +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { + GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -260,6 +400,9 @@ struct _GeeQueueIface { struct _GeeDequeIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeDeque* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeDeque* self); + GDestroyNotify (*get_g_destroy_func) (GeeDeque* self); gboolean (*offer_head) (GeeDeque* self, gconstpointer element); gpointer (*peek_head) (GeeDeque* self); gpointer (*poll_head) (GeeDeque* self); @@ -271,14 +414,15 @@ struct _GeeDequeIface { }; struct _GeeLinkedList { - GeeAbstractList parent_instance; + GeeAbstractBidirList parent_instance; GeeLinkedListPrivate * priv; }; struct _GeeLinkedListClass { - GeeAbstractListClass parent_class; + GeeAbstractBidirListClass parent_class; }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeLinkedListPrivate { GType g_type; GBoxedCopyFunc g_dup_func; @@ -287,7 +431,9 @@ struct _GeeLinkedListPrivate { gint _stamp; GeeLinkedListNode* _head; GeeLinkedListNode* _tail; - GEqualFunc _equal_func; + GeeEqualDataFunc _equal_func; + gpointer _equal_func_target; + GDestroyNotify _equal_func_target_destroy_notify; }; struct _GeeLinkedListNode { @@ -320,20 +466,34 @@ struct _GeeLinkedListIteratorPrivate { static gpointer gee_linked_list_parent_class = NULL; static gpointer gee_linked_list_iterator_parent_class = NULL; +static GeeTraversableIface* gee_linked_list_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_linked_list_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_linked_list_iterator_gee_bidir_iterator_parent_iface = NULL; static GeeListIteratorIface* gee_linked_list_iterator_gee_list_iterator_parent_iface = NULL; +static GeeBidirListIteratorIface* gee_linked_list_iterator_gee_bidir_list_iterator_parent_iface = NULL; static GeeQueueIface* gee_linked_list_gee_queue_parent_iface = NULL; static GeeDequeIface* gee_linked_list_gee_deque_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; GType gee_queue_get_type (void) G_GNUC_CONST; GType gee_deque_get_type (void) G_GNUC_CONST; GType gee_linked_list_get_type (void) G_GNUC_CONST; @@ -344,45 +504,45 @@ enum { GEE_LINKED_LIST_G_TYPE, GEE_LINKED_LIST_G_DUP_FUNC, GEE_LINKED_LIST_G_DESTROY_FUNC, - GEE_LINKED_LIST_EQUAL_FUNC, GEE_LINKED_LIST_SIZE, + GEE_LINKED_LIST_READ_ONLY, GEE_LINKED_LIST_CAPACITY, GEE_LINKED_LIST_REMAINING_CAPACITY, GEE_LINKED_LIST_IS_FULL }; void gee_abstract_collection_clear (GeeAbstractCollection* self); -GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeAbstractList* gee_abstract_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_linked_list_set_equal_func (GeeLinkedList* self, GEqualFunc value); +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_linked_list_set_equal_func (GeeLinkedList* self, GeeEqualDataFunc value, gpointer value_target); +static gboolean gee_linked_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target); static GeeIterator* gee_linked_list_real_iterator (GeeAbstractCollection* base); static GeeLinkedListIterator* gee_linked_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLinkedList* list); static GeeLinkedListIterator* gee_linked_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLinkedList* list); static GType gee_linked_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GeeListIterator* gee_linked_list_real_list_iterator (GeeAbstractList* base); +static GeeBidirListIterator* gee_linked_list_real_bidir_list_iterator (GeeAbstractBidirList* base); static gboolean gee_linked_list_real_contains (GeeAbstractCollection* base, gconstpointer item); gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item); static gboolean gee_linked_list_real_add (GeeAbstractCollection* base, gconstpointer item); static GeeLinkedListNode* gee_linked_list_node_new (gpointer data); static GeeLinkedListNode* gee_linked_list_node_new (gpointer data); static gboolean gee_linked_list_real_remove (GeeAbstractCollection* base, gconstpointer item); -GEqualFunc gee_linked_list_get_equal_func (GeeLinkedList* self); +GeeEqualDataFunc gee_linked_list_get_equal_func (GeeLinkedList* self, gpointer* result_target); static void _gee_linked_list_remove_node (GeeLinkedList* self, GeeLinkedListNode* _n); static void gee_linked_list_real_clear (GeeAbstractCollection* base); static gpointer gee_linked_list_real_get (GeeAbstractList* base, gint index); static GeeLinkedListNode* _gee_linked_list_get_node_at (GeeLinkedList* self, gint index); static void gee_linked_list_real_set (GeeAbstractList* base, gint index, gconstpointer item); static gint gee_linked_list_real_index_of (GeeAbstractList* base, gconstpointer item); -gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); static void gee_linked_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item); gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item); static gpointer gee_linked_list_real_remove_at (GeeAbstractList* base, gint index); static GeeList* gee_linked_list_real_slice (GeeAbstractList* base, gint start, gint stop); gboolean gee_collection_add (GeeCollection* self, gconstpointer item); -static gpointer gee_linked_list_real_first (GeeAbstractList* base); -static gpointer gee_linked_list_real_last (GeeAbstractList* base); +gpointer gee_linked_list_first (GeeLinkedList* self); +gpointer gee_linked_list_last (GeeLinkedList* self); static gboolean gee_linked_list_real_offer (GeeQueue* base, gconstpointer element); gboolean gee_deque_offer_tail (GeeDeque* self, gconstpointer element); static gpointer gee_linked_list_real_peek (GeeQueue* base); @@ -394,6 +554,7 @@ gint gee_deque_drain_head (GeeDeque* self, GeeCollection* recipient, gint amount static gboolean gee_linked_list_real_offer_head (GeeDeque* base, gconstpointer element); void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item); static gpointer gee_linked_list_real_peek_head (GeeDeque* base); +gpointer gee_abstract_list_get (GeeAbstractList* self, gint index); static gpointer gee_linked_list_real_poll_head (GeeDeque* base); gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index); static gint gee_linked_list_real_drain_head (GeeDeque* base, GeeCollection* recipient, gint amount); @@ -408,24 +569,31 @@ enum { GEE_LINKED_LIST_ITERATOR_DUMMY_PROPERTY, GEE_LINKED_LIST_ITERATOR_G_TYPE, GEE_LINKED_LIST_ITERATOR_G_DUP_FUNC, - GEE_LINKED_LIST_ITERATOR_G_DESTROY_FUNC + GEE_LINKED_LIST_ITERATOR_G_DESTROY_FUNC, + GEE_LINKED_LIST_ITERATOR_READ_ONLY, + GEE_LINKED_LIST_ITERATOR_VALID }; static gboolean gee_linked_list_iterator_real_next (GeeIterator* base); static gboolean gee_linked_list_iterator_real_has_next (GeeIterator* base); -static gboolean gee_linked_list_iterator_real_first (GeeIterator* base); +static gboolean gee_linked_list_iterator_real_first (GeeBidirIterator* base); +gint gee_abstract_collection_get_size (GeeAbstractCollection* self); static gpointer gee_linked_list_iterator_real_get (GeeIterator* base); static void gee_linked_list_iterator_real_remove (GeeIterator* base); static gboolean gee_linked_list_iterator_real_previous (GeeBidirIterator* base); static gboolean gee_linked_list_iterator_real_has_previous (GeeBidirIterator* base); static gboolean gee_linked_list_iterator_real_last (GeeBidirIterator* base); static void gee_linked_list_iterator_real_set (GeeListIterator* base, gconstpointer item); -static void gee_linked_list_iterator_real_insert (GeeListIterator* base, gconstpointer item); +static void gee_linked_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item); static void gee_linked_list_iterator_real_add (GeeListIterator* base, gconstpointer item); static gint gee_linked_list_iterator_real_index (GeeListIterator* base); +static gboolean gee_linked_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_linked_list_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); static void _vala_gee_linked_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_linked_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_linked_list_finalize (GObject* obj); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); gint gee_queue_get_capacity (GeeQueue* self); gint gee_queue_get_remaining_capacity (GeeQueue* self); gboolean gee_queue_get_is_full (GeeQueue* self); @@ -441,28 +609,99 @@ static void _vala_gee_linked_list_set_property (GObject * object, guint property * * @param equal_func an optional element equality testing function */ -GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func) { +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { GeeLinkedList * self = NULL; - GEqualFunc _tmp0_; - GEqualFunc _tmp2_; - self = (GeeLinkedList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + self = (GeeLinkedList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _tmp0_ = equal_func; + _tmp0__target = equal_func_target; if (_tmp0_ == NULL) { - GEqualFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_equal_func_for (g_type); - equal_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; + equal_func = _tmp3_; + equal_func_target = _tmp1_; + equal_func_target_destroy_notify = _tmp2_; } - _tmp2_ = equal_func; - gee_linked_list_set_equal_func (self, _tmp2_); + _tmp4_ = equal_func; + _tmp4__target = equal_func_target; + gee_linked_list_set_equal_func (self, _tmp4_, _tmp4__target); + (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL); + equal_func = NULL; + equal_func_target = NULL; + equal_func_target_destroy_notify = NULL; return self; } -GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func) { - return gee_linked_list_construct (GEE_TYPE_LINKED_LIST, g_type, g_dup_func, g_destroy_func, equal_func); +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) { + return gee_linked_list_construct (GEE_TYPE_LINKED_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify); +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_linked_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) { + GeeLinkedList * self; + gboolean result = FALSE; + self = (GeeLinkedList*) base; + { + GeeLinkedListNode* _tmp0_; + GeeLinkedListNode* node; + _tmp0_ = self->priv->_head; + node = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + GeeLinkedListNode* _tmp5_; + GeeForallFunc _tmp6_; + void* _tmp6__target; + GeeLinkedListNode* _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + GeeLinkedListNode* _tmp3_; + GeeLinkedListNode* _tmp4_; + _tmp3_ = node; + _tmp4_ = _tmp3_->next; + node = _tmp4_; + } + _tmp1_ = FALSE; + _tmp5_ = node; + if (!(_tmp5_ != NULL)) { + break; + } + _tmp6_ = f; + _tmp6__target = f_target; + _tmp7_ = node; + _tmp8_ = _tmp7_->data; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + _tmp10_ = _tmp6_ (_tmp9_, _tmp6__target); + if (!_tmp10_) { + result = FALSE; + return result; + } + } + } + } + result = TRUE; + return result; } @@ -494,6 +733,20 @@ static GeeListIterator* gee_linked_list_real_list_iterator (GeeAbstractList* bas } +/** + * {@inheritDoc} + */ +static GeeBidirListIterator* gee_linked_list_real_bidir_list_iterator (GeeAbstractBidirList* base) { + GeeLinkedList * self; + GeeBidirListIterator* result = NULL; + GeeLinkedListIterator* _tmp0_; + self = (GeeLinkedList*) base; + _tmp0_ = gee_linked_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self); + result = (GeeBidirListIterator*) _tmp0_; + return result; +} + + /** * {@inheritDoc} */ @@ -592,8 +845,10 @@ static gboolean gee_linked_list_real_remove (GeeAbstractCollection* base, gconst while (TRUE) { gboolean _tmp2_; GeeLinkedListNode* _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; + GeeEqualDataFunc _tmp7_; + void* _tmp7__target; gconstpointer _tmp8_; GeeLinkedListNode* _tmp9_; gconstpointer _tmp10_; @@ -611,12 +866,13 @@ static gboolean gee_linked_list_real_remove (GeeAbstractCollection* base, gconst if (!(_tmp5_ != NULL)) { break; } - _tmp6_ = gee_linked_list_get_equal_func (self); + _tmp6_ = gee_linked_list_get_equal_func (self, &_tmp6__target); _tmp7_ = _tmp6_; + _tmp7__target = _tmp6__target; _tmp8_ = item; _tmp9_ = n; _tmp10_ = _tmp9_->data; - _tmp11_ = _tmp7_ (_tmp8_, _tmp10_); + _tmp11_ = _tmp7_ (_tmp8_, _tmp10_, _tmp7__target); if (_tmp11_) { GeeLinkedListNode* _tmp12_; _tmp12_ = n; @@ -722,79 +978,62 @@ static void gee_linked_list_real_set (GeeAbstractList* base, gint index, gconstp /** * {@inheritDoc} */ -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - static gint gee_linked_list_real_index_of (GeeAbstractList* base, gconstpointer item) { GeeLinkedList * self; gint result = 0; - gint _result_; gint idx; self = (GeeLinkedList*) base; - _result_ = -1; idx = 0; { - GeeLinkedList* _tmp0_; - GeeLinkedList* _node_item_list; - GeeLinkedList* _tmp1_; - gint _tmp2_; - gint _tmp3_; - gint _node_item_size; - gint _node_item_index; - _tmp0_ = _g_object_ref0 (self); - _node_item_list = _tmp0_; - _tmp1_ = _node_item_list; - _tmp2_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp1_); - _tmp3_ = _tmp2_; - _node_item_size = _tmp3_; - _node_item_index = -1; - while (TRUE) { - gint _tmp4_; - gint _tmp5_; - gint _tmp6_; - GeeLinkedList* _tmp7_; - gint _tmp8_; - gpointer _tmp9_ = NULL; - gpointer node_item; - GEqualFunc _tmp10_; - GEqualFunc _tmp11_; - gconstpointer _tmp12_; - gconstpointer _tmp13_; - gboolean _tmp14_ = FALSE; - _tmp4_ = _node_item_index; - _node_item_index = _tmp4_ + 1; - _tmp5_ = _node_item_index; - _tmp6_ = _node_item_size; - if (!(_tmp5_ < _tmp6_)) { - break; - } - _tmp7_ = _node_item_list; - _tmp8_ = _node_item_index; - _tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _tmp8_); - node_item = _tmp9_; - _tmp10_ = gee_linked_list_get_equal_func (self); - _tmp11_ = _tmp10_; - _tmp12_ = item; - _tmp13_ = node_item; - _tmp14_ = _tmp11_ (_tmp12_, _tmp13_); - if (_tmp14_) { - gint _tmp15_; - _tmp15_ = idx; - _result_ = _tmp15_; - ((node_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (node_item = (self->priv->g_destroy_func (node_item), NULL)); - break; - } else { - gint _tmp16_; - _tmp16_ = idx; - idx = _tmp16_ + 1; + GeeLinkedListNode* _tmp0_; + GeeLinkedListNode* node; + _tmp0_ = self->priv->_head; + node = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + GeeLinkedListNode* _tmp6_; + GeeEqualDataFunc _tmp7_; + void* _tmp7__target; + GeeEqualDataFunc _tmp8_; + void* _tmp8__target; + gconstpointer _tmp9_; + GeeLinkedListNode* _tmp10_; + gconstpointer _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + GeeLinkedListNode* _tmp3_; + GeeLinkedListNode* _tmp4_; + gint _tmp5_; + _tmp3_ = node; + _tmp4_ = _tmp3_->next; + node = _tmp4_; + _tmp5_ = idx; + idx = _tmp5_ + 1; + } + _tmp1_ = FALSE; + _tmp6_ = node; + if (!(_tmp6_ != NULL)) { + break; + } + _tmp7_ = gee_linked_list_get_equal_func (self, &_tmp7__target); + _tmp8_ = _tmp7_; + _tmp8__target = _tmp7__target; + _tmp9_ = item; + _tmp10_ = node; + _tmp11_ = _tmp10_->data; + _tmp12_ = _tmp8_ (_tmp9_, _tmp11_, _tmp8__target); + if (_tmp12_) { + result = idx; + return result; + } } - ((node_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (node_item = (self->priv->g_destroy_func (node_item), NULL)); } - _g_object_unref0 (_node_item_list); } - result = _result_; + result = -1; return result; } @@ -969,8 +1208,10 @@ static GeeList* gee_linked_list_real_slice (GeeAbstractList* base, gint start, g gint _tmp2_; gint _tmp3_; gint _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + GeeEqualDataFunc _tmp6_; + void* _tmp6__target; GeeLinkedList* _tmp7_; GeeList* slice; gint _tmp8_; @@ -985,9 +1226,10 @@ static GeeList* gee_linked_list_real_slice (GeeAbstractList* base, gint start, g _tmp3_ = stop; _tmp4_ = self->priv->_size; g_return_val_if_fail (_tmp3_ <= _tmp4_, NULL); - _tmp5_ = gee_linked_list_get_equal_func (self); + _tmp5_ = gee_linked_list_get_equal_func (self, &_tmp5__target); _tmp6_ = _tmp5_; - _tmp7_ = gee_linked_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_); + _tmp6__target = _tmp5__target; + _tmp7_ = gee_linked_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, _tmp6__target, NULL); slice = (GeeList*) _tmp7_; _tmp8_ = start; _tmp9_ = _gee_linked_list_get_node_at (self, _tmp8_); @@ -1039,14 +1281,13 @@ static GeeList* gee_linked_list_real_slice (GeeAbstractList* base, gint start, g /** * {@inheritDoc} */ -static gpointer gee_linked_list_real_first (GeeAbstractList* base) { - GeeLinkedList * self; +gpointer gee_linked_list_first (GeeLinkedList* self) { gpointer result = NULL; gint _tmp0_; GeeLinkedListNode* _tmp1_; gconstpointer _tmp2_; gpointer _tmp3_; - self = (GeeLinkedList*) base; + g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_size; _vala_assert (_tmp0_ > 0, "_size > 0"); _tmp1_ = self->priv->_head; @@ -1060,14 +1301,13 @@ static gpointer gee_linked_list_real_first (GeeAbstractList* base) { /** * {@inheritDoc} */ -static gpointer gee_linked_list_real_last (GeeAbstractList* base) { - GeeLinkedList * self; +gpointer gee_linked_list_last (GeeLinkedList* self) { gpointer result = NULL; gint _tmp0_; GeeLinkedListNode* _tmp1_; gconstpointer _tmp2_; gpointer _tmp3_; - self = (GeeLinkedList*) base; + g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_size; _vala_assert (_tmp0_ > 0, "_size > 0"); _tmp1_ = self->priv->_tail; @@ -1575,22 +1815,36 @@ static void _gee_linked_list_remove_node (GeeLinkedList* self, GeeLinkedListNode } -GEqualFunc gee_linked_list_get_equal_func (GeeLinkedList* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +GeeEqualDataFunc gee_linked_list_get_equal_func (GeeLinkedList* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_equal_func; - result = _tmp0_; + _tmp0__target = self->priv->_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_linked_list_set_equal_func (GeeLinkedList* self, GEqualFunc value) { - GEqualFunc _tmp0_; +static void gee_linked_list_set_equal_func (GeeLinkedList* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; self->priv->_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "equal-func"); + self->priv->_equal_func_target = _tmp0__target; + self->priv->_equal_func_target_destroy_notify = NULL; } @@ -1605,6 +1859,15 @@ static gint gee_linked_list_real_get_size (GeeAbstractCollection* base) { } +static gboolean gee_linked_list_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeLinkedList* self; + self = (GeeLinkedList*) base; + result = FALSE; + return result; +} + + static gint gee_linked_list_real_get_capacity (GeeQueue* base) { gint result; GeeLinkedList* self; @@ -1655,6 +1918,11 @@ static void gee_linked_list_node_free (GeeLinkedListNode* self) { } +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + static GeeLinkedListIterator* gee_linked_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLinkedList* list) { GeeLinkedListIterator * self = NULL; GeeLinkedList* _tmp0_; @@ -1690,80 +1958,71 @@ static gboolean gee_linked_list_iterator_real_next (GeeIterator* base) { gint _tmp0_; GeeLinkedList* _tmp1_; gint _tmp2_; - gboolean _tmp3_ = FALSE; - gboolean _tmp4_; - gboolean _tmp6_; + gboolean _tmp3_; self = (GeeLinkedListIterator*) base; _tmp0_ = self->priv->_stamp; _tmp1_ = self->priv->_list; _tmp2_ = _tmp1_->priv->_stamp; _vala_assert (_tmp0_ == _tmp2_, "this._stamp == this._list._stamp"); - _tmp4_ = self->priv->removed; - if (_tmp4_) { - GeeLinkedListNode* _tmp5_; - _tmp5_ = self->priv->position; - _tmp3_ = _tmp5_ != NULL; - } else { - _tmp3_ = FALSE; - } - _tmp6_ = _tmp3_; - if (_tmp6_) { - self->priv->removed = FALSE; - result = TRUE; - return result; - } else { - gboolean _tmp7_ = FALSE; - gboolean _tmp8_; - gboolean _tmp11_; - _tmp8_ = self->priv->started; - if (!_tmp8_) { - GeeLinkedList* _tmp9_; - GeeLinkedListNode* _tmp10_; - _tmp9_ = self->priv->_list; - _tmp10_ = _tmp9_->priv->_head; - _tmp7_ = _tmp10_ != NULL; - } else { - _tmp7_ = FALSE; - } - _tmp11_ = _tmp7_; - if (_tmp11_) { - GeeLinkedList* _tmp12_; - GeeLinkedListNode* _tmp13_; - gint _tmp14_; - self->priv->started = TRUE; - _tmp12_ = self->priv->_list; - _tmp13_ = _tmp12_->priv->_head; - self->priv->position = _tmp13_; - _tmp14_ = self->priv->_index; - self->priv->_index = _tmp14_ + 1; + _tmp3_ = self->priv->removed; + if (_tmp3_) { + GeeLinkedListNode* _tmp4_; + _tmp4_ = self->priv->position; + if (_tmp4_ != NULL) { + self->priv->removed = FALSE; result = TRUE; return result; } else { - gboolean _tmp15_ = FALSE; - GeeLinkedListNode* _tmp16_; - gboolean _tmp19_; - _tmp16_ = self->priv->position; - if (_tmp16_ != NULL) { - GeeLinkedListNode* _tmp17_; - GeeLinkedListNode* _tmp18_; - _tmp17_ = self->priv->position; - _tmp18_ = _tmp17_->next; - _tmp15_ = _tmp18_ != NULL; - } else { - _tmp15_ = FALSE; - } - _tmp19_ = _tmp15_; - if (_tmp19_) { - GeeLinkedListNode* _tmp20_; - GeeLinkedListNode* _tmp21_; - gint _tmp22_; - _tmp20_ = self->priv->position; - _tmp21_ = _tmp20_->next; - self->priv->position = _tmp21_; - _tmp22_ = self->priv->_index; - self->priv->_index = _tmp22_ + 1; + result = FALSE; + return result; + } + } else { + gboolean _tmp5_; + _tmp5_ = self->priv->started; + if (!_tmp5_) { + GeeLinkedList* _tmp6_; + GeeLinkedListNode* _tmp7_; + _tmp6_ = self->priv->_list; + _tmp7_ = _tmp6_->priv->_head; + if (_tmp7_ != NULL) { + GeeLinkedList* _tmp8_; + GeeLinkedListNode* _tmp9_; + gint _tmp10_; + self->priv->started = TRUE; + _tmp8_ = self->priv->_list; + _tmp9_ = _tmp8_->priv->_head; + self->priv->position = _tmp9_; + _tmp10_ = self->priv->_index; + self->priv->_index = _tmp10_ + 1; result = TRUE; return result; + } else { + result = FALSE; + return result; + } + } else { + GeeLinkedListNode* _tmp11_; + _tmp11_ = self->priv->position; + if (_tmp11_ != NULL) { + GeeLinkedListNode* _tmp12_; + GeeLinkedListNode* _tmp13_; + _tmp12_ = self->priv->position; + _tmp13_ = _tmp12_->next; + if (_tmp13_ != NULL) { + GeeLinkedListNode* _tmp14_; + GeeLinkedListNode* _tmp15_; + gint _tmp16_; + _tmp14_ = self->priv->position; + _tmp15_ = _tmp14_->next; + self->priv->position = _tmp15_; + _tmp16_ = self->priv->_index; + self->priv->_index = _tmp16_ + 1; + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } } } } @@ -1818,7 +2077,7 @@ static gboolean gee_linked_list_iterator_real_has_next (GeeIterator* base) { } -static gboolean gee_linked_list_iterator_real_first (GeeIterator* base) { +static gboolean gee_linked_list_iterator_real_first (GeeBidirIterator* base) { GeeLinkedListIterator * self; gboolean result = FALSE; gint _tmp0_; @@ -2066,7 +2325,7 @@ static void gee_linked_list_iterator_real_set (GeeListIterator* base, gconstpoin } -static void gee_linked_list_iterator_real_insert (GeeListIterator* base, gconstpointer item) { +static void gee_linked_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item) { GeeLinkedListIterator * self; gint _tmp0_; GeeLinkedList* _tmp1_; @@ -2286,6 +2545,100 @@ static gint gee_linked_list_iterator_real_index (GeeListIterator* base) { } +static gboolean gee_linked_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeLinkedListIterator * self; + gboolean result = FALSE; + gint _tmp0_; + GeeLinkedList* _tmp1_; + gint _tmp2_; + gboolean _tmp3_; + GeeLinkedList* _tmp15_; + GeeLinkedListNode* _tmp16_; + self = (GeeLinkedListIterator*) base; + _tmp0_ = self->priv->_stamp; + _tmp1_ = self->priv->_list; + _tmp2_ = _tmp1_->priv->_stamp; + _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp"); + _tmp3_ = self->priv->started; + if (!_tmp3_) { + GeeLinkedList* _tmp4_; + GeeLinkedListNode* _tmp5_; + GeeLinkedListNode* _tmp6_; + _tmp4_ = self->priv->_list; + _tmp5_ = _tmp4_->priv->_head; + self->priv->position = _tmp5_; + _tmp6_ = self->priv->position; + if (_tmp6_ != NULL) { + self->priv->started = TRUE; + } + } + self->priv->removed = FALSE; + while (TRUE) { + GeeLinkedListNode* _tmp7_; + GeeForallFunc _tmp8_; + void* _tmp8__target; + GeeLinkedListNode* _tmp9_; + gconstpointer _tmp10_; + gpointer _tmp11_; + gboolean _tmp12_ = FALSE; + GeeLinkedListNode* _tmp13_; + GeeLinkedListNode* _tmp14_; + _tmp7_ = self->priv->position; + if (!(_tmp7_ != NULL)) { + break; + } + _tmp8_ = f; + _tmp8__target = f_target; + _tmp9_ = self->priv->position; + _tmp10_ = _tmp9_->data; + _tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_); + _tmp12_ = _tmp8_ (_tmp11_, _tmp8__target); + if (!_tmp12_) { + result = FALSE; + return result; + } + _tmp13_ = self->priv->position; + _tmp14_ = _tmp13_->next; + self->priv->position = _tmp14_; + } + _tmp15_ = self->priv->_list; + _tmp16_ = _tmp15_->priv->_tail; + self->priv->position = _tmp16_; + result = TRUE; + return result; +} + + +static gboolean gee_linked_list_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeLinkedListIterator* self; + self = (GeeLinkedListIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_linked_list_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeLinkedListIterator* self; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_; + gboolean _tmp3_; + self = (GeeLinkedListIterator*) base; + _tmp1_ = self->priv->removed; + if (!_tmp1_) { + GeeLinkedListNode* _tmp2_; + _tmp2_ = self->priv->position; + _tmp0_ = _tmp2_ != NULL; + } else { + _tmp0_ = FALSE; + } + _tmp3_ = _tmp0_; + result = _tmp3_; + return result; +} + + static void gee_linked_list_iterator_class_init (GeeLinkedListIteratorClass * klass) { gee_linked_list_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeLinkedListIteratorPrivate)); @@ -2295,6 +2648,32 @@ static void gee_linked_list_iterator_class_init (GeeLinkedListIteratorClass * kl g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_linked_list_iterator_gee_traversable_get_g_type (GeeLinkedListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_linked_list_iterator_gee_traversable_get_g_dup_func (GeeLinkedListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_linked_list_iterator_gee_traversable_get_g_destroy_func (GeeLinkedListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_linked_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_linked_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_linked_list_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_linked_list_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_linked_list_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_linked_list_iterator_gee_traversable_get_g_destroy_func; } @@ -2302,29 +2681,72 @@ static void gee_linked_list_iterator_gee_iterator_interface_init (GeeIteratorIfa gee_linked_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_linked_list_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_linked_list_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_linked_list_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_linked_list_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_linked_list_iterator_real_remove; + iface->get_read_only = gee_linked_list_iterator_real_get_read_only; + iface->get_valid = gee_linked_list_iterator_real_get_valid; +} + + +static GType gee_linked_list_iterator_gee_bidir_iterator_get_g_type (GeeLinkedListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_linked_list_iterator_gee_bidir_iterator_get_g_dup_func (GeeLinkedListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_linked_list_iterator_gee_bidir_iterator_get_g_destroy_func (GeeLinkedListIterator* self) { + return self->priv->g_destroy_func; } static void gee_linked_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { gee_linked_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_linked_list_iterator_real_first; iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_linked_list_iterator_real_previous; iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_linked_list_iterator_real_has_previous; iface->last = (gboolean (*)(GeeBidirIterator*)) gee_linked_list_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_linked_list_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_linked_list_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_linked_list_iterator_gee_bidir_iterator_get_g_destroy_func; } static void gee_linked_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) { gee_linked_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_linked_list_iterator_real_set; - iface->insert = (void (*)(GeeListIterator*, gconstpointer)) gee_linked_list_iterator_real_insert; iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_linked_list_iterator_real_add; iface->index = (gint (*)(GeeListIterator*)) gee_linked_list_iterator_real_index; } +static GType gee_linked_list_iterator_gee_bidir_list_iterator_get_g_type (GeeLinkedListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_linked_list_iterator_gee_bidir_list_iterator_get_g_dup_func (GeeLinkedListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_linked_list_iterator_gee_bidir_list_iterator_get_g_destroy_func (GeeLinkedListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_linked_list_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface) { + gee_linked_list_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->insert = (void (*)(GeeBidirListIterator*, gconstpointer)) gee_linked_list_iterator_real_insert; + iface->get_g_type = (GType(*)(GeeBidirListIterator*)) gee_linked_list_iterator_gee_bidir_list_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirListIterator*)) gee_linked_list_iterator_gee_bidir_list_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirListIterator*)) gee_linked_list_iterator_gee_bidir_list_iterator_get_g_destroy_func; +} + + static void gee_linked_list_iterator_instance_init (GeeLinkedListIterator * self) { self->priv = GEE_LINKED_LIST_ITERATOR_GET_PRIVATE (self); self->priv->started = FALSE; @@ -2344,14 +2766,18 @@ static GType gee_linked_list_iterator_get_type (void) { static volatile gsize gee_linked_list_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_linked_list_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeLinkedListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_linked_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeLinkedListIterator), 0, (GInstanceInitFunc) gee_linked_list_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_linked_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_linked_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_linked_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_linked_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gee_linked_list_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_linked_list_iterator_type_id; gee_linked_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeLinkedListIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_linked_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_linked_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_type_add_interface_static (gee_linked_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); g_type_add_interface_static (gee_linked_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info); + g_type_add_interface_static (gee_linked_list_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info); g_once_init_leave (&gee_linked_list_iterator_type_id__volatile, gee_linked_list_iterator_type_id); } return gee_linked_list_iterator_type_id__volatile; @@ -2362,6 +2788,12 @@ static void _vala_gee_linked_list_iterator_get_property (GObject * object, guint GeeLinkedListIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_LINKED_LIST_TYPE_ITERATOR, GeeLinkedListIterator); switch (property_id) { + case GEE_LINKED_LIST_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_LINKED_LIST_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2392,8 +2824,10 @@ static void _vala_gee_linked_list_iterator_set_property (GObject * object, guint static void gee_linked_list_class_init (GeeLinkedListClass * klass) { gee_linked_list_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeLinkedListPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_linked_list_real_foreach; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_linked_list_real_iterator; GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_linked_list_real_list_iterator; + GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->bidir_list_iterator = gee_linked_list_real_bidir_list_iterator; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_linked_list_real_contains; GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_linked_list_real_add; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_linked_list_real_remove; @@ -2404,9 +2838,8 @@ static void gee_linked_list_class_init (GeeLinkedListClass * klass) { GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_linked_list_real_insert; GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_linked_list_real_remove_at; GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_linked_list_real_slice; - GEE_ABSTRACT_LIST_CLASS (klass)->first = gee_linked_list_real_first; - GEE_ABSTRACT_LIST_CLASS (klass)->last = gee_linked_list_real_last; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_linked_list_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_linked_list_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_linked_list_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_linked_list_set_property; G_OBJECT_CLASS (klass)->finalize = gee_linked_list_finalize; @@ -2414,13 +2847,13 @@ static void gee_linked_list_class_init (GeeLinkedListClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); /** - * The elements' equality testing function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_EQUAL_FUNC, g_param_spec_pointer ("equal-func", "equal-func", "equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_LINKED_LIST_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -2436,18 +2869,51 @@ static void gee_linked_list_class_init (GeeLinkedListClass * klass) { } +static GType gee_linked_list_gee_queue_get_g_type (GeeLinkedList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_linked_list_gee_queue_get_g_dup_func (GeeLinkedList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_linked_list_gee_queue_get_g_destroy_func (GeeLinkedList* self) { + return self->priv->g_destroy_func; +} + + static void gee_linked_list_gee_queue_interface_init (GeeQueueIface * iface) { gee_linked_list_gee_queue_parent_iface = g_type_interface_peek_parent (iface); iface->offer = (gboolean (*)(GeeQueue*, gconstpointer)) gee_linked_list_real_offer; iface->peek = (gpointer (*)(GeeQueue*)) gee_linked_list_real_peek; iface->poll = (gpointer (*)(GeeQueue*)) gee_linked_list_real_poll; iface->drain = (gint (*)(GeeQueue*, GeeCollection*, gint)) gee_linked_list_real_drain; + iface->get_g_type = (GType(*)(GeeQueue*)) gee_linked_list_gee_queue_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeQueue*)) gee_linked_list_gee_queue_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeQueue*)) gee_linked_list_gee_queue_get_g_destroy_func; iface->get_capacity = gee_linked_list_real_get_capacity; iface->get_remaining_capacity = gee_linked_list_real_get_remaining_capacity; iface->get_is_full = gee_linked_list_real_get_is_full; } +static GType gee_linked_list_gee_deque_get_g_type (GeeLinkedList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_linked_list_gee_deque_get_g_dup_func (GeeLinkedList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_linked_list_gee_deque_get_g_destroy_func (GeeLinkedList* self) { + return self->priv->g_destroy_func; +} + + static void gee_linked_list_gee_deque_interface_init (GeeDequeIface * iface) { gee_linked_list_gee_deque_parent_iface = g_type_interface_peek_parent (iface); iface->offer_head = (gboolean (*)(GeeDeque*, gconstpointer)) gee_linked_list_real_offer_head; @@ -2458,6 +2924,9 @@ static void gee_linked_list_gee_deque_interface_init (GeeDequeIface * iface) { iface->peek_tail = (gpointer (*)(GeeDeque*)) gee_linked_list_real_peek_tail; iface->poll_tail = (gpointer (*)(GeeDeque*)) gee_linked_list_real_poll_tail; iface->drain_tail = (gint (*)(GeeDeque*, GeeCollection*, gint)) gee_linked_list_real_drain_tail; + iface->get_g_type = (GType(*)(GeeDeque*)) gee_linked_list_gee_deque_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeDeque*)) gee_linked_list_gee_deque_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeDeque*)) gee_linked_list_gee_deque_get_g_destroy_func; } @@ -2475,6 +2944,10 @@ static void gee_linked_list_finalize (GObject* obj) { self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_LINKED_LIST, GeeLinkedList); gee_abstract_collection_clear ((GeeAbstractCollection*) self); _gee_linked_list_node_free0 (self->priv->_head); + (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL); + self->priv->_equal_func = NULL; + self->priv->_equal_func_target = NULL; + self->priv->_equal_func_target_destroy_notify = NULL; G_OBJECT_CLASS (gee_linked_list_parent_class)->finalize (obj); } @@ -2494,7 +2967,7 @@ GType gee_linked_list_get_type (void) { static const GInterfaceInfo gee_queue_info = { (GInterfaceInitFunc) gee_linked_list_gee_queue_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_deque_info = { (GInterfaceInitFunc) gee_linked_list_gee_deque_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_linked_list_type_id; - gee_linked_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_LIST, "GeeLinkedList", &g_define_type_info, 0); + gee_linked_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_LIST, "GeeLinkedList", &g_define_type_info, 0); g_type_add_interface_static (gee_linked_list_type_id, GEE_TYPE_QUEUE, &gee_queue_info); g_type_add_interface_static (gee_linked_list_type_id, GEE_TYPE_DEQUE, &gee_deque_info); g_once_init_leave (&gee_linked_list_type_id__volatile, gee_linked_list_type_id); @@ -2507,12 +2980,12 @@ static void _vala_gee_linked_list_get_property (GObject * object, guint property GeeLinkedList * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_LINKED_LIST, GeeLinkedList); switch (property_id) { - case GEE_LINKED_LIST_EQUAL_FUNC: - g_value_set_pointer (value, gee_linked_list_get_equal_func (self)); - break; case GEE_LINKED_LIST_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_LINKED_LIST_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; case GEE_LINKED_LIST_CAPACITY: g_value_set_int (value, gee_queue_get_capacity ((GeeQueue*) self)); break; @@ -2533,9 +3006,6 @@ static void _vala_gee_linked_list_set_property (GObject * object, guint property GeeLinkedList * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_LINKED_LIST, GeeLinkedList); switch (property_id) { - case GEE_LINKED_LIST_EQUAL_FUNC: - gee_linked_list_set_equal_func (self, g_value_get_pointer (value)); - break; case GEE_LINKED_LIST_G_TYPE: self->priv->g_type = g_value_get_gtype (value); break; diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala index 5c9cfd3..54e7cf8 100644 --- a/gee/linkedlist.vala +++ b/gee/linkedlist.vala @@ -32,7 +32,7 @@ * * @see ArrayList */ -public class Gee.LinkedList : AbstractList, Queue, Deque { +public class Gee.LinkedList : AbstractBidirList, Queue, Deque { private int _size = 0; private int _stamp = 0; private Node? _head = null; @@ -41,7 +41,8 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { /** * The elements' equality testing function. */ - public EqualFunc equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc equal_func { private set; get; } /** * Constructs a new, empty linked list. @@ -51,7 +52,7 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { * * @param equal_func an optional element equality testing function */ - public LinkedList (EqualFunc? equal_func = null) { + public LinkedList (owned EqualDataFunc? equal_func = null) { if (equal_func == null) { equal_func = Functions.get_equal_func_for (typeof (G)); } @@ -62,6 +63,18 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { this.clear (); } + /** + * {@inheritDoc} + */ + public override bool foreach(ForallFunc f) { + for (weak Node? node = _head; node != null; node = node.next) { + if (!f (node.data)) { + return false; + } + } + return true; + } + /** * {@inheritDoc} */ @@ -76,12 +89,26 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { return new Iterator (this); } + /** + * {@inheritDoc} + */ + public override BidirListIterator bidir_list_iterator () { + return new Iterator (this); + } + /** * {@inheritDoc} */ public override int size { get { return this._size; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * {@inheritDoc} @@ -166,17 +193,13 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { * {@inheritDoc} */ public override int index_of (G item) { - int result = -1; int idx = 0; - foreach (G node_item in this) { - if (this.equal_func (item, node_item)) { - result = idx; - break; - } else { - idx++; + for (weak Node? node = _head; node != null; node = node.next, idx++) { + if (this.equal_func (item, node.data)) { + return idx; } } - return result; + return -1; } /** @@ -247,7 +270,7 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { /** * {@inheritDoc} */ - public override G first () { + public G first () { assert (_size > 0); return _head.data; } @@ -255,7 +278,7 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { /** * {@inheritDoc} */ - public override G last () { + public G last () { assert (_size > 0); return _tail.data; } @@ -406,7 +429,7 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { } } - private class Iterator : Object, Gee.Iterator, BidirIterator, ListIterator { + private class Iterator : Object, Traversable, Gee.Iterator, BidirIterator, ListIterator, BidirListIterator { private bool started = false; private bool removed = false; private unowned Node? position; @@ -424,18 +447,30 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { public bool next () { assert (this._stamp == this._list._stamp); - if (this.removed && this.position != null) { - this.removed = false; - return true; - } else if (!this.started && this._list._head != null) { - this.started = true; - this.position = this._list._head; - this._index++; - return true; - } else if (this.position != null && this.position.next != null) { - this.position = this.position.next; - this._index++; - return true; + if (this.removed) { + if (this.position != null) { + this.removed = false; + return true; + } else { + return false; + } + } else if (!this.started) { + if (this._list._head != null) { + this.started = true; + this.position = this._list._head; + this._index++; + return true; + } else { + return false; + } + } else if (this.position != null) { + if (this.position.next != null) { + this.position = this.position.next; + this._index++; + return true; + } else { + return false; + } } return false; } @@ -578,6 +613,36 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { return this._index; } + + public bool read_only { + get { + return false; + } + } + + public bool valid { + get { + return !this.removed && this.position != null; + } + } + + public bool foreach (ForallFunc f) { + assert (_stamp == _list._stamp); + if (!started) { + position = _list._head; + if (position != null) + started = true; + } + removed = false; + while (position != null) { + if (!f (position.data)) { + return false; + } + position = position.next; + } + position = _list._tail; + return true; + } } private unowned Node? _get_node_at (int index) { diff --git a/gee/list.c b/gee/list.c index d8bdbe7..65df983 100644 --- a/gee/list.c +++ b/gee/list.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -59,14 +79,6 @@ typedef struct _GeeCollectionIface GeeCollectionIface; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -74,6 +86,7 @@ typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; typedef struct _GeeListIterator GeeListIterator; typedef struct _GeeListIteratorIface GeeListIteratorIface; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) @@ -95,6 +108,16 @@ typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; + #define GEE_TYPE_LINKED_LIST (gee_linked_list_get_type ()) #define GEE_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LINKED_LIST, GeeLinkedList)) #define GEE_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LINKED_LIST, GeeLinkedListClass)) @@ -104,25 +127,80 @@ typedef struct _GeeAbstractListClass GeeAbstractListClass; typedef struct _GeeLinkedList GeeLinkedList; typedef struct _GeeLinkedListClass GeeLinkedListClass; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -134,26 +212,22 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -164,16 +238,53 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; GeeListIterator* gee_list_list_iterator (GeeList* self); @@ -184,16 +295,30 @@ void gee_list_insert (GeeList* self, gint index, gconstpointer item); gpointer gee_list_remove_at (GeeList* self, gint index); GeeList* gee_list_slice (GeeList* self, gint start, gint stop); gpointer gee_list_first (GeeList* self); +static gpointer gee_list_real_first (GeeList* self); gpointer gee_list_last (GeeList* self); +static gpointer gee_list_real_last (GeeList* self); +gint gee_collection_get_size (GeeCollection* self); void gee_list_insert_all (GeeList* self, gint index, GeeCollection* collection); -void gee_list_sort (GeeList* self, GCompareFunc compare_func); +static void gee_list_real_insert_all (GeeList* self, gint index, GeeCollection* collection); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gboolean gee_iterator_next (GeeIterator* self); +gpointer gee_iterator_get (GeeIterator* self); +void gee_list_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +static void gee_list_real_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); GeeList* gee_list_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); -GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); +GeeLinkedList* gee_linked_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeLinkedList* gee_linked_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; GType gee_linked_list_get_type (void) G_GNUC_CONST; -GeeList* gee_abstract_list_get_read_only_view (GeeAbstractList* self); +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GeeBidirList* gee_abstract_bidir_list_get_read_only_view (GeeAbstractBidirList* self); GeeList* gee_list_get_read_only_view (GeeList* self); @@ -289,6 +414,15 @@ GeeList* gee_list_slice (GeeList* self, gint start, gint stop) { * * @return first item in the list */ +static gpointer gee_list_real_first (GeeList* self) { + gpointer result = NULL; + gpointer _tmp0_ = NULL; + _tmp0_ = gee_list_get (self, 0); + result = _tmp0_; + return result; +} + + gpointer gee_list_first (GeeList* self) { g_return_val_if_fail (self != NULL, NULL); return GEE_LIST_GET_INTERFACE (self)->first (self); @@ -300,6 +434,19 @@ gpointer gee_list_first (GeeList* self) { * * @return last item in the list */ +static gpointer gee_list_real_last (GeeList* self) { + gpointer result = NULL; + gint _tmp0_; + gint _tmp1_; + gpointer _tmp2_ = NULL; + _tmp0_ = gee_collection_get_size ((GeeCollection*) self); + _tmp1_ = _tmp0_; + _tmp2_ = gee_list_get (self, _tmp1_ - 1); + result = _tmp2_; + return result; +} + + gpointer gee_list_last (GeeList* self) { g_return_val_if_fail (self != NULL, NULL); return GEE_LIST_GET_INTERFACE (self)->last (self); @@ -313,6 +460,44 @@ gpointer gee_list_last (GeeList* self) { * @param index zero-based index of the items to be inserted * @param collection collection of items to be inserted */ +static void gee_list_real_insert_all (GeeList* self, gint index, GeeCollection* collection) { + g_return_if_fail (collection != NULL); + { + GeeCollection* _tmp0_; + GeeIterator* _tmp1_ = NULL; + GeeIterator* _item_it; + _tmp0_ = collection; + _tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_); + _item_it = _tmp1_; + while (TRUE) { + GeeIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeIterator* _tmp4_; + gpointer _tmp5_ = NULL; + gpointer item; + gint _tmp6_; + gconstpointer _tmp7_; + gint _tmp8_; + _tmp2_ = _item_it; + _tmp3_ = gee_iterator_next (_tmp2_); + if (!_tmp3_) { + break; + } + _tmp4_ = _item_it; + _tmp5_ = gee_iterator_get (_tmp4_); + item = _tmp5_; + _tmp6_ = index; + _tmp7_ = item; + gee_list_insert (self, _tmp6_, _tmp7_); + _tmp8_ = index; + index = _tmp8_ + 1; + ((item == NULL) || (GEE_LIST_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_LIST_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + } + _g_object_unref0 (_item_it); + } +} + + void gee_list_insert_all (GeeList* self, gint index, GeeCollection* collection) { g_return_if_fail (self != NULL); GEE_LIST_GET_INTERFACE (self)->insert_all (self, index, collection); @@ -324,9 +509,39 @@ void gee_list_insert_all (GeeList* self, gint index, GeeCollection* collection) * * @param compare_func compare function to use to compare items */ -void gee_list_sort (GeeList* self, GCompareFunc compare_func) { +static void gee_list_real_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + _tmp0_ = compare_func; + _tmp0__target = compare_func_target; + if (_tmp0_ == NULL) { + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GCompareDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_compare_func_for (GEE_LIST_GET_INTERFACE (self)->get_g_type (self), &_tmp1_, &_tmp2_); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; + compare_func = _tmp3_; + compare_func_target = _tmp1_; + compare_func_target_destroy_notify = _tmp2_; + } + _tmp4_ = compare_func; + _tmp4__target = compare_func_target; + gee_tim_sort_sort (GEE_LIST_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_LIST_GET_INTERFACE (self)->get_g_dup_func (self), GEE_LIST_GET_INTERFACE (self)->get_g_destroy_func (self), self, _tmp4_, _tmp4__target); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; +} + + +void gee_list_sort (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { g_return_if_fail (self != NULL); - GEE_LIST_GET_INTERFACE (self)->sort (self, compare_func); + GEE_LIST_GET_INTERFACE (self)->sort (self, compare_func, compare_func_target, compare_func_target_destroy_notify); } @@ -339,14 +554,14 @@ GeeList* gee_list_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify GeeList* result = NULL; GeeLinkedList* _tmp0_; GeeLinkedList* _tmp1_; - GeeList* _tmp2_; - GeeList* _tmp3_; + GeeBidirList* _tmp2_; + GeeBidirList* _tmp3_; GeeList* _tmp4_; - _tmp0_ = gee_linked_list_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL); + _tmp0_ = gee_linked_list_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL); _tmp1_ = _tmp0_; - _tmp2_ = gee_abstract_list_get_read_only_view ((GeeAbstractList*) _tmp1_); + _tmp2_ = gee_abstract_bidir_list_get_read_only_view ((GeeAbstractBidirList*) _tmp1_); _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_; + _tmp4_ = (GeeList*) _tmp3_; _g_object_unref0 (_tmp1_); result = _tmp4_; return result; @@ -367,6 +582,10 @@ static void gee_list_base_init (GeeListIface * iface) { * The read-only view of this list. */ g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->first = gee_list_real_first; + iface->last = gee_list_real_last; + iface->insert_all = gee_list_real_insert_all; + iface->sort = gee_list_real_sort; } } diff --git a/gee/list.vala b/gee/list.vala index d5193e3..5f08aba 100644 --- a/gee/list.vala +++ b/gee/list.vala @@ -23,6 +23,7 @@ /** * An ordered collection. */ +[GenericAccessors] public interface Gee.List : Collection { /** * Returns a ListIterator that can be used for iteration over this list. @@ -88,14 +89,18 @@ public interface Gee.List : Collection { * * @return first item in the list */ - public abstract G first (); + public virtual G first () { + return get (0); + } /** * Returns the last item of the list. Fails if the list is empty. * * @return last item in the list */ - public abstract G last (); + public virtual G last () { + return get (size - 1); + } /** * Inserts items into this list for the input collection at the @@ -104,14 +109,24 @@ public interface Gee.List : Collection { * @param index zero-based index of the items to be inserted * @param collection collection of items to be inserted */ - public abstract void insert_all (int index, Collection collection); + public virtual void insert_all (int index, Collection collection) { + foreach (G item in collection) { + insert(index, item); + index++; + } + } /** * Sorts items by comparing with the specified compare function. * * @param compare_func compare function to use to compare items */ - public abstract void sort (CompareFunc? compare_func = null); + public virtual void sort (owned CompareDataFunc? compare_func = null) { + if (compare_func == null) { + compare_func = Functions.get_compare_func_for (typeof (G)); + } + TimSort.sort (this, compare_func); + } /** * The read-only view of this list. diff --git a/gee/listiterator.c b/gee/listiterator.c index 577d80c..0d5d0b8 100644 --- a/gee/listiterator.c +++ b/gee/listiterator.c @@ -27,6 +27,26 @@ #include +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) @@ -35,14 +55,6 @@ typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -51,37 +63,63 @@ typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; typedef struct _GeeListIterator GeeListIterator; typedef struct _GeeListIteratorIface GeeListIteratorIface; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); -}; - -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); }; struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; void gee_list_iterator_set (GeeListIterator* self, gconstpointer item); -void gee_list_iterator_insert (GeeListIterator* self, gconstpointer item); void gee_list_iterator_add (GeeListIterator* self, gconstpointer item); gint gee_list_iterator_index (GeeListIterator* self); @@ -95,16 +133,6 @@ void gee_list_iterator_set (GeeListIterator* self, gconstpointer item) { } -/** - * Inserts the specified item before the current item in the iteration. The - * cursor is let to point to the current item. - */ -void gee_list_iterator_insert (GeeListIterator* self, gconstpointer item) { - g_return_if_fail (self != NULL); - GEE_LIST_ITERATOR_GET_INTERFACE (self)->insert (self, item); -} - - /** * Adds the specified item after the current item in the iteration. The * cursor is moved to point to the new added item. @@ -143,7 +171,7 @@ GType gee_list_iterator_get_type (void) { static const GTypeInfo g_define_type_info = { sizeof (GeeListIteratorIface), (GBaseInitFunc) gee_list_iterator_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType gee_list_iterator_type_id; gee_list_iterator_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeListIterator", &g_define_type_info, 0); - g_type_interface_add_prerequisite (gee_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR); + g_type_interface_add_prerequisite (gee_list_iterator_type_id, GEE_TYPE_ITERATOR); g_once_init_leave (&gee_list_iterator_type_id__volatile, gee_list_iterator_type_id); } return gee_list_iterator_type_id__volatile; diff --git a/gee/listiterator.vala b/gee/listiterator.vala index 34eb3e0..2dfd0e9 100644 --- a/gee/listiterator.vala +++ b/gee/listiterator.vala @@ -23,18 +23,12 @@ /** * A list iterator. This supports bi-directionnal and index-based iteration. */ -public interface Gee.ListIterator : Gee.BidirIterator { +public interface Gee.ListIterator : Gee.Iterator { /** * Sets the current item in the iteration to the specified new item. */ public abstract void set (G item); - /** - * Inserts the specified item before the current item in the iteration. The - * cursor is let to point to the current item. - */ - public abstract void insert (G item); - /** * Adds the specified item after the current item in the iteration. The * cursor is moved to point to the new added item. diff --git a/gee/map.c b/gee/map.c index 56fc4f7..9ed4be3 100644 --- a/gee/map.c +++ b/gee/map.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -84,6 +104,7 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeMapEntry GeeMapEntry; typedef struct _GeeMapEntryClass GeeMapEntryClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) #define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) @@ -104,37 +125,80 @@ typedef struct _GeeAbstractMapClass GeeAbstractMapClass; typedef struct _GeeHashMap GeeHashMap; typedef struct _GeeHashMapClass GeeHashMapClass; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef struct _GeeMapEntryPrivate GeeMapEntryPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -146,40 +210,47 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeMapEntry { GObject parent_instance; GeeMapEntryPrivate * priv; @@ -190,6 +261,7 @@ struct _GeeMapEntryClass { gconstpointer (*get_key) (GeeMapEntry* self); gconstpointer (*get_value) (GeeMapEntry* self); void (*set_value) (GeeMapEntry* self, gconstpointer value); + gboolean (*get_read_only) (GeeMapEntry* self); }; struct _GeeMapEntryPrivate { @@ -204,7 +276,16 @@ struct _GeeMapEntryPrivate { static gpointer gee_map_entry_parent_class = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; @@ -221,21 +302,30 @@ gboolean gee_map_remove (GeeMap* self, gconstpointer key, gpointer* value) G_GNU void gee_map_clear (GeeMap* self); GeeMapIterator* gee_map_map_iterator (GeeMap* self); void gee_map_set_all (GeeMap* self, GeeMap* map); +static void gee_map_real_set_all (GeeMap* self, GeeMap* map); +GeeSet* gee_map_get_entries (GeeMap* self); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gboolean gee_iterator_next (GeeIterator* self); +gpointer gee_iterator_get (GeeIterator* self); +gconstpointer gee_map_entry_get_key (GeeMapEntry* self); +gconstpointer gee_map_entry_get_value (GeeMapEntry* self); gboolean gee_map_unset_all (GeeMap* self, GeeMap* map); +static gboolean gee_map_real_unset_all (GeeMap* self, GeeMap* map); +GeeSet* gee_map_get_keys (GeeMap* self); gboolean gee_map_remove_all (GeeMap* self, GeeMap* map) G_GNUC_DEPRECATED; gboolean gee_map_has_all (GeeMap* self, GeeMap* map); +static gboolean gee_map_real_has_all (GeeMap* self, GeeMap* map); gboolean gee_map_contains_all (GeeMap* self, GeeMap* map) G_GNUC_DEPRECATED; GeeMap* gee_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); -GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); -GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GHashFunc key_hash_func, GEqualFunc key_equal_func, GEqualFunc value_equal_func); +GeeHashMap* gee_hash_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeHashMap* gee_hash_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeHashDataFunc key_hash_func, void* key_hash_func_target, GDestroyNotify key_hash_func_target_destroy_notify, GeeEqualDataFunc key_equal_func, void* key_equal_func_target, GDestroyNotify key_equal_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GType gee_abstract_map_get_type (void) G_GNUC_CONST; GType gee_hash_map_get_type (void) G_GNUC_CONST; GeeMap* gee_abstract_map_get_read_only_view (GeeAbstractMap* self); gint gee_map_get_size (GeeMap* self); gboolean gee_map_get_is_empty (GeeMap* self); -GeeSet* gee_map_get_keys (GeeMap* self); +gboolean gee_map_get_read_only (GeeMap* self); GeeCollection* gee_map_get_values (GeeMap* self); -GeeSet* gee_map_get_entries (GeeMap* self); GeeMap* gee_map_get_read_only_view (GeeMap* self); GType gee_map_get_key_type (GeeMap* self); GType gee_map_get_value_type (GeeMap* self); @@ -249,12 +339,12 @@ enum { GEE_MAP_ENTRY_V_DUP_FUNC, GEE_MAP_ENTRY_V_DESTROY_FUNC, GEE_MAP_ENTRY_KEY, - GEE_MAP_ENTRY_VALUE + GEE_MAP_ENTRY_VALUE, + GEE_MAP_ENTRY_READ_ONLY }; GeeMapEntry* gee_map_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); -gconstpointer gee_map_entry_get_key (GeeMapEntry* self); -gconstpointer gee_map_entry_get_value (GeeMapEntry* self); void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value); +gboolean gee_map_entry_get_read_only (GeeMapEntry* self); static void _vala_gee_map_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_map_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -278,12 +368,15 @@ gboolean gee_map_has_key (GeeMap* self, gconstpointer key) { * @param key the key to locate in the map * * @return ``true`` if key is found, ``false`` otherwise - * - * @deprecated Use {@link has_key} method instead. */ gboolean gee_map_contains (GeeMap* self, gconstpointer key) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_MAP_GET_INTERFACE (self)->contains (self, key); + gboolean result = FALSE; + gconstpointer _tmp0_; + gboolean _tmp1_ = FALSE; + _tmp0_ = key; + _tmp1_ = gee_map_has_key (self, _tmp0_); + result = _tmp1_; + return result; } @@ -348,12 +441,24 @@ gboolean gee_map_unset (GeeMap* self, gconstpointer key, gpointer* value) { * @param value the receiver variable for the removed value * * @return ``true`` if the map has been changed, ``false`` otherwise - * - * @deprecated Use {@link unset} method instead. */ gboolean gee_map_remove (GeeMap* self, gconstpointer key, gpointer* value) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_MAP_GET_INTERFACE (self)->remove (self, key, value); + gpointer _vala_value = NULL; + gboolean result = FALSE; + gconstpointer _tmp0_; + gpointer _tmp1_ = NULL; + gboolean _tmp2_ = FALSE; + _tmp0_ = key; + _tmp2_ = gee_map_unset (self, _tmp0_, &_tmp1_); + ((_vala_value == NULL) || (GEE_MAP_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_vala_value = (GEE_MAP_GET_INTERFACE (self)->get_v_destroy_func (self) (_vala_value), NULL)); + _vala_value = _tmp1_; + result = _tmp2_; + if (value) { + *value = _vala_value; + } else { + ((_vala_value == NULL) || (GEE_MAP_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_vala_value = (GEE_MAP_GET_INTERFACE (self)->get_v_destroy_func (self) (_vala_value), NULL)); + } + return result; } @@ -383,6 +488,58 @@ GeeMapIterator* gee_map_map_iterator (GeeMap* self) { * * @param map the map which items are inserted to this map */ +static void gee_map_real_set_all (GeeMap* self, GeeMap* map) { + g_return_if_fail (map != NULL); + { + GeeMap* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* _tmp3_; + GeeIterator* _tmp4_ = NULL; + GeeIterator* _tmp5_; + GeeIterator* _entry_it; + _tmp0_ = map; + _tmp1_ = gee_map_get_entries (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp3_); + _entry_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + GeeMapEntry* entry; + GeeMapEntry* _tmp10_; + gconstpointer _tmp11_; + gconstpointer _tmp12_; + GeeMapEntry* _tmp13_; + gconstpointer _tmp14_; + gconstpointer _tmp15_; + _tmp6_ = _entry_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _entry_it; + _tmp9_ = gee_iterator_get (_tmp8_); + entry = (GeeMapEntry*) _tmp9_; + _tmp10_ = entry; + _tmp11_ = gee_map_entry_get_key (_tmp10_); + _tmp12_ = _tmp11_; + _tmp13_ = entry; + _tmp14_ = gee_map_entry_get_value (_tmp13_); + _tmp15_ = _tmp14_; + gee_map_set (self, _tmp12_, _tmp15_); + _g_object_unref0 (entry); + } + _g_object_unref0 (_entry_it); + } +} + + void gee_map_set_all (GeeMap* self, GeeMap* map) { g_return_if_fail (self != NULL); GEE_MAP_GET_INTERFACE (self)->set_all (self, map); @@ -395,6 +552,57 @@ void gee_map_set_all (GeeMap* self, GeeMap* map) { * * @param map the map which common items are deleted from this map */ +static gboolean gee_map_real_unset_all (GeeMap* self, GeeMap* map) { + gboolean result = FALSE; + gboolean changed; + g_return_val_if_fail (map != NULL, FALSE); + changed = FALSE; + { + GeeMap* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* _tmp3_; + GeeIterator* _tmp4_ = NULL; + GeeIterator* _tmp5_; + GeeIterator* _key_it; + _tmp0_ = map; + _tmp1_ = gee_map_get_keys (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp3_); + _key_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + gpointer key; + gboolean _tmp10_; + gconstpointer _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp6_ = _key_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _key_it; + _tmp9_ = gee_iterator_get (_tmp8_); + key = _tmp9_; + _tmp10_ = changed; + _tmp11_ = key; + _tmp12_ = gee_map_unset (self, _tmp11_, NULL); + changed = _tmp10_ | _tmp12_; + ((key == NULL) || (GEE_MAP_GET_INTERFACE (self)->get_k_destroy_func (self) == NULL)) ? NULL : (key = (GEE_MAP_GET_INTERFACE (self)->get_k_destroy_func (self) (key), NULL)); + } + _g_object_unref0 (_key_it); + } + result = changed; + return result; +} + + gboolean gee_map_unset_all (GeeMap* self, GeeMap* map) { g_return_val_if_fail (self != NULL, FALSE); return GEE_MAP_GET_INTERFACE (self)->unset_all (self, map); @@ -406,12 +614,16 @@ gboolean gee_map_unset_all (GeeMap* self, GeeMap* map) { * and this map. * * @param map the map which common items are deleted from this map - * - * @deprecated Use {@link unset_all} method instead. */ gboolean gee_map_remove_all (GeeMap* self, GeeMap* map) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_MAP_GET_INTERFACE (self)->remove_all (self, map); + gboolean result = FALSE; + GeeMap* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (map != NULL, FALSE); + _tmp0_ = map; + _tmp1_ = gee_map_unset_all (self, _tmp0_); + result = _tmp1_; + return result; } @@ -420,6 +632,68 @@ gboolean gee_map_remove_all (GeeMap* self, GeeMap* map) { * * @param map the map which items will be compared with this map */ +static gboolean gee_map_real_has_all (GeeMap* self, GeeMap* map) { + gboolean result = FALSE; + g_return_val_if_fail (map != NULL, FALSE); + { + GeeMap* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* _tmp3_; + GeeIterator* _tmp4_ = NULL; + GeeIterator* _tmp5_; + GeeIterator* _entry_it; + _tmp0_ = map; + _tmp1_ = gee_map_get_entries (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp3_); + _entry_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + GeeMapEntry* entry; + GeeMapEntry* _tmp10_; + gconstpointer _tmp11_; + gconstpointer _tmp12_; + GeeMapEntry* _tmp13_; + gconstpointer _tmp14_; + gconstpointer _tmp15_; + gboolean _tmp16_ = FALSE; + _tmp6_ = _entry_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _entry_it; + _tmp9_ = gee_iterator_get (_tmp8_); + entry = (GeeMapEntry*) _tmp9_; + _tmp10_ = entry; + _tmp11_ = gee_map_entry_get_key (_tmp10_); + _tmp12_ = _tmp11_; + _tmp13_ = entry; + _tmp14_ = gee_map_entry_get_value (_tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = gee_map_has (self, _tmp12_, _tmp15_); + if (!_tmp16_) { + result = FALSE; + _g_object_unref0 (entry); + _g_object_unref0 (_entry_it); + return result; + } + _g_object_unref0 (entry); + } + _g_object_unref0 (_entry_it); + } + result = TRUE; + return result; +} + + gboolean gee_map_has_all (GeeMap* self, GeeMap* map) { g_return_val_if_fail (self != NULL, FALSE); return GEE_MAP_GET_INTERFACE (self)->has_all (self, map); @@ -430,12 +704,16 @@ gboolean gee_map_has_all (GeeMap* self, GeeMap* map) { * Returns ``true`` it this map contains all items as the input map. * * @param map the map which items will be compared with this map - * - * @deprecated Use {@link has_all} method instead. */ gboolean gee_map_contains_all (GeeMap* self, GeeMap* map) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_MAP_GET_INTERFACE (self)->contains_all (self, map); + gboolean result = FALSE; + GeeMap* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (map != NULL, FALSE); + _tmp0_ = map; + _tmp1_ = gee_map_has_all (self, _tmp0_); + result = _tmp1_; + return result; } @@ -451,7 +729,7 @@ GeeMap* gee_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k GeeMap* _tmp2_; GeeMap* _tmp3_; GeeMap* _tmp4_; - _tmp0_ = gee_hash_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, NULL, NULL, NULL); + _tmp0_ = gee_hash_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); _tmp1_ = _tmp0_; _tmp2_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp1_); _tmp3_ = _tmp2_; @@ -474,6 +752,25 @@ gboolean gee_map_get_is_empty (GeeMap* self) { } +static gboolean gee_map_real_get_is_empty (GeeMap* base) { + gboolean result; + GeeMap* self; + gint _tmp0_; + gint _tmp1_; + self = base; + _tmp0_ = gee_map_get_size (self); + _tmp1_ = _tmp0_; + result = _tmp1_ == 0; + return result; +} + + +gboolean gee_map_get_read_only (GeeMap* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_GET_INTERFACE (self)->get_read_only (self); +} + + GeeSet* gee_map_get_keys (GeeMap* self) { g_return_val_if_fail (self != NULL, NULL); return GEE_MAP_GET_INTERFACE (self)->get_keys (self); @@ -499,14 +796,18 @@ GeeMap* gee_map_get_read_only_view (GeeMap* self) { GType gee_map_get_key_type (GeeMap* self) { + GType result; g_return_val_if_fail (self != NULL, 0UL); - return GEE_MAP_GET_INTERFACE (self)->get_key_type (self); + result = GEE_MAP_GET_INTERFACE (self)->get_k_type (self); + return result; } GType gee_map_get_value_type (GeeMap* self) { + GType result; g_return_val_if_fail (self != NULL, 0UL); - return GEE_MAP_GET_INTERFACE (self)->get_value_type (self); + result = GEE_MAP_GET_INTERFACE (self)->get_v_type (self); + return result; } @@ -541,6 +842,12 @@ void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value) { } +gboolean gee_map_entry_get_read_only (GeeMapEntry* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_ENTRY_GET_CLASS (self)->get_read_only (self); +} + + static void gee_map_entry_class_init (GeeMapEntryClass * klass) { gee_map_entry_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeMapEntryPrivate)); @@ -560,6 +867,10 @@ static void gee_map_entry_class_init (GeeMapEntryClass * klass) { * The value of this entry. */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_MAP_ENTRY_VALUE, g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + /** + * ``true`` if the setting value is permitted. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_MAP_ENTRY_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -632,9 +943,10 @@ static void gee_map_base_init (GeeMapIface * iface) { */ g_object_interface_install_property (iface, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * Specifies whether this map is empty. + * Specifies whether this collection can change - i.e. wheather {@link set}, + * {@link remove} etc. are legal operations. */ - g_object_interface_install_property (iface, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_interface_install_property (iface, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * The read-only view of the keys of this map. */ @@ -651,14 +963,10 @@ static void gee_map_base_init (GeeMapIface * iface) { * The read-only view this map. */ g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The type of the keys in this map. - */ - g_object_interface_install_property (iface, g_param_spec_gtype ("key-type", "key-type", "key-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * The type of the values in this map. - */ - g_object_interface_install_property (iface, g_param_spec_gtype ("value-type", "value-type", "value-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->set_all = gee_map_real_set_all; + iface->unset_all = gee_map_real_unset_all; + iface->has_all = gee_map_real_has_all; + iface->get_is_empty = gee_map_real_get_is_empty; } } diff --git a/gee/map.vala b/gee/map.vala index a2b9a3b..e8e3138 100644 --- a/gee/map.vala +++ b/gee/map.vala @@ -23,6 +23,7 @@ /** * An object that maps keys to values. */ +[GenericAccessors] public interface Gee.Map : Object, Iterable> { /** * The number of items in this map. @@ -32,7 +33,13 @@ public interface Gee.Map : Object, Iterable> { /** * Specifies whether this map is empty. */ - public abstract bool is_empty { get; } + public virtual bool is_empty { get { return size == 0; } } + + /** + * Specifies whether this collection can change - i.e. wheather {@link set}, + * {@link remove} etc. are legal operations. + */ + public abstract bool read_only { get; } /** * The read-only view of the keys of this map. @@ -62,6 +69,11 @@ public interface Gee.Map : Object, Iterable> { * The value of this entry. */ public abstract V value { get; set; } + + /** + * ``true`` if the setting value is permitted. + */ + public abstract bool read_only { get; } } /** @@ -79,11 +91,11 @@ public interface Gee.Map : Object, Iterable> { * @param key the key to locate in the map * * @return ``true`` if key is found, ``false`` otherwise - * - * @deprecated Use {@link has_key} method instead. */ - [Deprecated] - public abstract bool contains (K key); + [Deprecated (replacement = "Map.has_key")] + public bool contains (K key) { + return has_key(key); + } /** * Determines whether this map has the specified key/value entry. @@ -130,11 +142,11 @@ public interface Gee.Map : Object, Iterable> { * @param value the receiver variable for the removed value * * @return ``true`` if the map has been changed, ``false`` otherwise - * - * @deprecated Use {@link unset} method instead. */ - [Deprecated] - public abstract bool remove (K key, out V? value = null); + [Deprecated (replacement = "Map.unset")] + public bool remove (K key, out V? value = null) { + return unset (key, out value); + } /** * Removes all items from this collection. Must not be called on @@ -154,7 +166,11 @@ public interface Gee.Map : Object, Iterable> { * * @param map the map which items are inserted to this map */ - public abstract void set_all (Map map); + public virtual void set_all (Map map) { + foreach (Map.Entry entry in map.entries) { + set (entry.key, entry.value); + } + } /** * Removes all items from this map that are common to the input map @@ -162,35 +178,48 @@ public interface Gee.Map : Object, Iterable> { * * @param map the map which common items are deleted from this map */ - public abstract bool unset_all (Map map); + public virtual bool unset_all (Map map) { + bool changed = false; + foreach (K key in map.keys) { + changed = changed | unset (key); + } + return changed; + } /** * Removes all items from this map that are common to the input map * and this map. * * @param map the map which common items are deleted from this map - * - * @deprecated Use {@link unset_all} method instead. */ - [Deprecated] - public abstract bool remove_all (Map map); + [Deprecated (replacement = "Map.unset_all")] + public bool remove_all (Map map) { + return unset_all (map); + } /** * Returns ``true`` it this map contains all items as the input map. * * @param map the map which items will be compared with this map */ - public abstract bool has_all (Map map); + public virtual bool has_all (Map map) { + foreach (Map.Entry entry in map.entries) { + if (!has (entry.key, entry.value)) { + return false; + } + } + return true; + } /** * Returns ``true`` it this map contains all items as the input map. * * @param map the map which items will be compared with this map - * - * @deprecated Use {@link has_all} method instead. */ - [Deprecated] - public abstract bool contains_all (Map map); + [Deprecated (replacement = "Map.has_all")] + public bool contains_all (Map map) { + return has_all (map); + } /** * The read-only view this map. @@ -200,12 +229,12 @@ public interface Gee.Map : Object, Iterable> { /** * The type of the keys in this map. */ - public abstract Type key_type { get; } + public Type key_type { get { return typeof(K); } } /** * The type of the values in this map. */ - public abstract Type value_type { get; } + public Type value_type { get { return typeof(V); } } /** * Returns an immutable empty map. diff --git a/gee/mapiterator.c b/gee/mapiterator.c index 82d133b..f7f2b1e 100644 --- a/gee/mapiterator.c +++ b/gee/mapiterator.c @@ -4,6 +4,7 @@ /* mapiterator.vala * * Copyright (C) 2009 Didier Villevalois + * Copyright (C) 2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,16 +35,29 @@ typedef struct _GeeMapIterator GeeMapIterator; typedef struct _GeeMapIteratorIface GeeMapIteratorIface; +#define _a_destroy_func0(var) (((var == NULL) || (a_destroy_func == NULL)) ? NULL : (var = (a_destroy_func (var), NULL))) +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; @@ -51,11 +65,17 @@ struct _GeeMapIteratorIface { GType gee_map_iterator_get_type (void) G_GNUC_CONST; gboolean gee_map_iterator_next (GeeMapIterator* self); gboolean gee_map_iterator_has_next (GeeMapIterator* self); -gboolean gee_map_iterator_first (GeeMapIterator* self); gpointer gee_map_iterator_get_key (GeeMapIterator* self); gpointer gee_map_iterator_get_value (GeeMapIterator* self); void gee_map_iterator_set_value (GeeMapIterator* self, gconstpointer value); void gee_map_iterator_unset (GeeMapIterator* self); +gpointer gee_map_iterator_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); +static gpointer gee_map_iterator_real_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); +gboolean gee_map_iterator_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); +static gboolean gee_map_iterator_real_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); +gboolean gee_map_iterator_get_read_only (GeeMapIterator* self); /** @@ -80,17 +100,6 @@ gboolean gee_map_iterator_has_next (GeeMapIterator* self) { } -/** - * Rewinds to the first entry in the iteration. - * - * @return ``true`` if the iterator has a first entry - */ -gboolean gee_map_iterator_first (GeeMapIterator* self) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_MAP_ITERATOR_GET_INTERFACE (self)->first (self); -} - - /** * Returns the current key in the iteration. * @@ -128,7 +137,7 @@ void gee_map_iterator_set_value (GeeMapIterator* self, gconstpointer value) { * Unsets the current entry in the iteration. The cursor is set in an * in-between state. {@link get_key}, {@link get_value}, {@link set_value} * and {@link unset} will fail until the next move of the cursor (calling - * {@link next} or {@link first}). + * {@link next}). */ void gee_map_iterator_unset (GeeMapIterator* self) { g_return_if_fail (self != NULL); @@ -136,10 +145,205 @@ void gee_map_iterator_unset (GeeMapIterator* self) { } +/** + * Standard aggragation function. + * + * It takes a function, seed and first element, returns the new seed and + * progress to next element when the operation repeats. + * + * Operation moves the iterator to last element in iteration. If iterator + * points at some element it will be included in iteration. + */ +static gpointer gee_map_iterator_real_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed) { + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + gpointer _tmp17_; + _tmp0_ = gee_map_iterator_get_valid (self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeFoldMapFunc _tmp2_; + void* _tmp2__target; + gpointer _tmp3_ = NULL; + gpointer _tmp4_; + gpointer _tmp5_ = NULL; + gpointer _tmp6_; + gpointer _tmp7_; + gpointer _tmp8_ = NULL; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_map_iterator_get_key (self); + _tmp4_ = _tmp3_; + _tmp5_ = gee_map_iterator_get_value (self); + _tmp6_ = _tmp5_; + _tmp7_ = seed; + seed = NULL; + _tmp8_ = _tmp2_ (_tmp4_, _tmp6_, _tmp7_, _tmp2__target); + _a_destroy_func0 (seed); + seed = _tmp8_; + ((_tmp6_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_tmp6_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) (_tmp6_), NULL)); + ((_tmp4_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) == NULL)) ? NULL : (_tmp4_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) (_tmp4_), NULL)); + } + while (TRUE) { + gboolean _tmp9_ = FALSE; + GeeFoldMapFunc _tmp10_; + void* _tmp10__target; + gpointer _tmp11_ = NULL; + gpointer _tmp12_; + gpointer _tmp13_ = NULL; + gpointer _tmp14_; + gpointer _tmp15_; + gpointer _tmp16_ = NULL; + _tmp9_ = gee_map_iterator_next (self); + if (!_tmp9_) { + break; + } + _tmp10_ = f; + _tmp10__target = f_target; + _tmp11_ = gee_map_iterator_get_key (self); + _tmp12_ = _tmp11_; + _tmp13_ = gee_map_iterator_get_value (self); + _tmp14_ = _tmp13_; + _tmp15_ = seed; + seed = NULL; + _tmp16_ = _tmp10_ (_tmp12_, _tmp14_, _tmp15_, _tmp10__target); + _a_destroy_func0 (seed); + seed = _tmp16_; + ((_tmp14_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_tmp14_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) (_tmp14_), NULL)); + ((_tmp12_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) == NULL)) ? NULL : (_tmp12_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) (_tmp12_), NULL)); + } + _tmp17_ = seed; + seed = NULL; + result = _tmp17_; + _a_destroy_func0 (seed); + return result; +} + + +gpointer gee_map_iterator_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_MAP_ITERATOR_GET_INTERFACE (self)->fold (self, a_type, a_dup_func, a_destroy_func, f, f_target, seed); +} + + +/** + * Apply function to each element returned by iterator. + * + * Operation moves the iterator to last element in iteration. If iterator + * points at some element it will be included in iteration. + */ +static gboolean gee_map_iterator_real_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target) { + gboolean result = FALSE; + gboolean _tmp0_; + gboolean _tmp1_; + _tmp0_ = gee_map_iterator_get_valid (self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeForallMapFunc _tmp2_; + void* _tmp2__target; + gpointer _tmp3_ = NULL; + gpointer _tmp4_; + gpointer _tmp5_ = NULL; + gpointer _tmp6_; + gboolean _tmp7_ = FALSE; + gboolean _tmp8_; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_map_iterator_get_key (self); + _tmp4_ = _tmp3_; + _tmp5_ = gee_map_iterator_get_value (self); + _tmp6_ = _tmp5_; + _tmp7_ = _tmp2_ (_tmp4_, _tmp6_, _tmp2__target); + _tmp8_ = !_tmp7_; + ((_tmp6_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_tmp6_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) (_tmp6_), NULL)); + ((_tmp4_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) == NULL)) ? NULL : (_tmp4_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) (_tmp4_), NULL)); + if (_tmp8_) { + result = FALSE; + return result; + } + } + while (TRUE) { + gboolean _tmp9_ = FALSE; + GeeForallMapFunc _tmp10_; + void* _tmp10__target; + gpointer _tmp11_ = NULL; + gpointer _tmp12_; + gpointer _tmp13_ = NULL; + gpointer _tmp14_; + gboolean _tmp15_ = FALSE; + gboolean _tmp16_; + _tmp9_ = gee_map_iterator_next (self); + if (!_tmp9_) { + break; + } + _tmp10_ = f; + _tmp10__target = f_target; + _tmp11_ = gee_map_iterator_get_key (self); + _tmp12_ = _tmp11_; + _tmp13_ = gee_map_iterator_get_value (self); + _tmp14_ = _tmp13_; + _tmp15_ = _tmp10_ (_tmp12_, _tmp14_, _tmp10__target); + _tmp16_ = !_tmp15_; + ((_tmp14_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) == NULL)) ? NULL : (_tmp14_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_v_destroy_func (self) (_tmp14_), NULL)); + ((_tmp12_ == NULL) || (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) == NULL)) ? NULL : (_tmp12_ = (GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_k_destroy_func (self) (_tmp12_), NULL)); + if (_tmp16_) { + result = FALSE; + return result; + } + } + result = TRUE; + return result; +} + + +gboolean gee_map_iterator_foreach (GeeMapIterator* self, GeeForallMapFunc f, void* f_target) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_ITERATOR_GET_INTERFACE (self)->foreach (self, f, f_target); +} + + +gboolean gee_map_iterator_get_valid (GeeMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_valid (self); +} + + +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_mutable (self); +} + + +gboolean gee_map_iterator_get_read_only (GeeMapIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MAP_ITERATOR_GET_INTERFACE (self)->get_read_only (self); +} + + static void gee_map_iterator_base_init (GeeMapIteratorIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; + /** + * Determines wheather the call to {@link get_key}, {@link get_value} and + * {@link set_value} is legal. It is false at the beginning and after + * {@link unset} call and true otherwise. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * Determines wheather the call to {@link set_value} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * Determines wheather the call to {@link unset} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->fold = gee_map_iterator_real_fold; + iface->foreach = gee_map_iterator_real_foreach; } } @@ -148,12 +352,12 @@ static void gee_map_iterator_base_init (GeeMapIteratorIface * iface) { * An iterator over a map. * * Gee's iterators are "on-track" iterators. They always point to an item - * except before the first call to {@link next} or {@link first}, or, when an - * item has been removed, until the next call to {@link next} or {@link first}. + * except before the first call to {@link next}, or, when an + * item has been removed, until the next call to {@link next}. * * Please note that when the iterator is out of track, neither {@link get_key}, * {@link get_value}, {@link set_value} nor {@link unset} are defined and all - * will fail. After the next call to {@link next} or {@link first}, they will + * will fail. After the next call to {@link next}, they will * be defined again. */ GType gee_map_iterator_get_type (void) { diff --git a/gee/mapiterator.vala b/gee/mapiterator.vala index 45c1e5b..ae83fcf 100644 --- a/gee/mapiterator.vala +++ b/gee/mapiterator.vala @@ -1,6 +1,7 @@ /* mapiterator.vala * * Copyright (C) 2009 Didier Villevalois + * Copyright (C) 2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,18 +21,24 @@ * Didier 'Ptitjes Villevalois */ +namespace Gee { + public delegate A FoldMapFunc (K k, V v, owned A a); + public delegate bool ForallMapFunc (K k, V v); +} + /** * An iterator over a map. * * Gee's iterators are "on-track" iterators. They always point to an item - * except before the first call to {@link next} or {@link first}, or, when an - * item has been removed, until the next call to {@link next} or {@link first}. + * except before the first call to {@link next}, or, when an + * item has been removed, until the next call to {@link next}. * * Please note that when the iterator is out of track, neither {@link get_key}, * {@link get_value}, {@link set_value} nor {@link unset} are defined and all - * will fail. After the next call to {@link next} or {@link first}, they will + * will fail. After the next call to {@link next}, they will * be defined again. */ +[GenericAccessors] public interface Gee.MapIterator : Object { /** * Advances to the next entry in the iteration. @@ -47,13 +54,6 @@ public interface Gee.MapIterator : Object { */ public abstract bool has_next (); - /** - * Rewinds to the first entry in the iteration. - * - * @return ``true`` if the iterator has a first entry - */ - public abstract bool first (); - /** * Returns the current key in the iteration. * @@ -79,8 +79,67 @@ public interface Gee.MapIterator : Object { * Unsets the current entry in the iteration. The cursor is set in an * in-between state. {@link get_key}, {@link get_value}, {@link set_value} * and {@link unset} will fail until the next move of the cursor (calling - * {@link next} or {@link first}). + * {@link next}). */ public abstract void unset (); + + /** + * Determines wheather the call to {@link get_key}, {@link get_value} and + * {@link set_value} is legal. It is false at the beginning and after + * {@link unset} call and true otherwise. + */ + public abstract bool valid { get; } + + /** + * Determines wheather the call to {@link set_value} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + public abstract bool mutable { get; } + + /** + * Determines wheather the call to {@link unset} is legal assuming the + * iterator is valid. The value must not change in runtime hence the user + * of iterator may cache it. + */ + public abstract bool read_only { get; } + + /** + * Standard aggragation function. + * + * It takes a function, seed and first element, returns the new seed and + * progress to next element when the operation repeats. + * + * Operation moves the iterator to last element in iteration. If iterator + * points at some element it will be included in iteration. + */ + public virtual A fold (FoldMapFunc f, owned A seed) + { + if (valid) + seed = f (get_key (), get_value (), (owned) seed); + while (next ()) + seed = f (get_key (), get_value (), (owned) seed); + return (owned) seed; + } + + /** + * Apply function to each element returned by iterator. + * + * Operation moves the iterator to last element in iteration. If iterator + * points at some element it will be included in iteration. + */ + public new virtual bool foreach (ForallMapFunc f) { + if (valid) { + if (!f (get_key (), get_value ())) { + return false; + } + } + while (next ()) { + if (!f (get_key (), get_value ())) { + return false; + } + } + return true; + } } diff --git a/gee/multimap.c b/gee/multimap.c index 457ed79..434043c 100644 --- a/gee/multimap.c +++ b/gee/multimap.c @@ -35,13 +35,25 @@ typedef struct _GeeMultiMap GeeMultiMap; typedef struct _GeeMultiMapIface GeeMultiMapIface; -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -51,6 +63,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -75,23 +95,73 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeMultiSet GeeMultiSet; typedef struct _GeeMultiSetIface GeeMultiSetIface; +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_READ_ONLY_MULTI_MAP (gee_read_only_multi_map_get_type ()) +#define GEE_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap)) +#define GEE_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) +#define GEE_IS_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_IS_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_READ_ONLY_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) + +typedef struct _GeeReadOnlyMultiMap GeeReadOnlyMultiMap; +typedef struct _GeeReadOnlyMultiMapClass GeeReadOnlyMultiMapClass; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -103,21 +173,58 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeMultiMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); GeeSet* (*get_keys) (GeeMultiMap* self); GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); GeeCollection* (*get_values) (GeeMultiMap* self); @@ -127,16 +234,29 @@ struct _GeeMultiMapIface { gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); }; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_multi_map_get_type (void) G_GNUC_CONST; GeeSet* gee_multi_map_get_keys (GeeMultiMap* self); GeeMultiSet* gee_multi_map_get_all_keys (GeeMultiMap* self); @@ -147,7 +267,15 @@ void gee_multi_map_set (GeeMultiMap* self, gconstpointer key, gconstpointer valu gboolean gee_multi_map_remove (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean gee_multi_map_remove_all (GeeMultiMap* self, gconstpointer key); void gee_multi_map_clear (GeeMultiMap* self); +GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self); gint gee_multi_map_get_size (GeeMultiMap* self); +gboolean gee_multi_map_get_read_only (GeeMultiMap* self); +GType gee_multi_map_get_key_type (GeeMultiMap* self); +GType gee_multi_map_get_value_type (GeeMultiMap* self); +GeeMultiMap* gee_multi_map_get_read_only_view (GeeMultiMap* self); +GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GeeReadOnlyMultiMap* gee_read_only_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GType gee_read_only_multi_map_get_type (void) G_GNUC_CONST; /** @@ -258,12 +386,62 @@ void gee_multi_map_clear (GeeMultiMap* self) { } +/** + * Returns an iterator for this map. + * + * @return a map iterator + */ +GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_MULTI_MAP_GET_INTERFACE (self)->map_iterator (self); +} + + gint gee_multi_map_get_size (GeeMultiMap* self) { g_return_val_if_fail (self != NULL, 0); return GEE_MULTI_MAP_GET_INTERFACE (self)->get_size (self); } +gboolean gee_multi_map_get_read_only (GeeMultiMap* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_MULTI_MAP_GET_INTERFACE (self)->get_read_only (self); +} + + +GType gee_multi_map_get_key_type (GeeMultiMap* self) { + GType result; + g_return_val_if_fail (self != NULL, 0UL); + result = GEE_MULTI_MAP_GET_INTERFACE (self)->get_k_type (self); + return result; +} + + +GType gee_multi_map_get_value_type (GeeMultiMap* self) { + GType result; + g_return_val_if_fail (self != NULL, 0UL); + result = GEE_MULTI_MAP_GET_INTERFACE (self)->get_v_type (self); + return result; +} + + +GeeMultiMap* gee_multi_map_get_read_only_view (GeeMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_MULTI_MAP_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static GeeMultiMap* gee_multi_map_real_get_read_only_view (GeeMultiMap* base) { + GeeMultiMap* result; + GeeMultiMap* self; + GeeReadOnlyMultiMap* _tmp0_; + self = base; + _tmp0_ = gee_read_only_multi_map_new (GEE_MULTI_MAP_GET_INTERFACE (self)->get_k_type (self), (GBoxedCopyFunc) GEE_MULTI_MAP_GET_INTERFACE (self)->get_k_dup_func (self), GEE_MULTI_MAP_GET_INTERFACE (self)->get_k_destroy_func (self), GEE_MULTI_MAP_GET_INTERFACE (self)->get_v_type (self), (GBoxedCopyFunc) GEE_MULTI_MAP_GET_INTERFACE (self)->get_v_dup_func (self), GEE_MULTI_MAP_GET_INTERFACE (self)->get_v_destroy_func (self), self); + result = (GeeMultiMap*) _tmp0_; + return result; +} + + static void gee_multi_map_base_init (GeeMultiMapIface * iface) { static gboolean initialized = FALSE; if (!initialized) { @@ -272,6 +450,12 @@ static void gee_multi_map_base_init (GeeMultiMapIface * iface) { * The number of key/value pairs in this map. */ g_object_interface_install_property (iface, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * Specifies whether this collection can change - i.e. wheather {@link set}, + * {@link remove} etc. are legal operations. + */ + g_object_interface_install_property (iface, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->get_read_only_view = gee_multi_map_real_get_read_only_view; } } diff --git a/gee/multimap.vala b/gee/multimap.vala index 7b4aac2..01c158f 100644 --- a/gee/multimap.vala +++ b/gee/multimap.vala @@ -23,11 +23,18 @@ /** * A map with multiple values per key. */ +[GenericAccessors] public interface Gee.MultiMap : Object { /** * The number of key/value pairs in this map. */ public abstract int size { get; } + + /** + * Specifies whether this collection can change - i.e. wheather {@link set}, + * {@link remove} etc. are legal operations. + */ + public abstract bool read_only { get; } /** * Returns the keys of this multimap as a read-only set. @@ -100,4 +107,27 @@ public interface Gee.MultiMap : Object { * Removes all items from this collection. */ public abstract void clear (); + + /** + * Returns an iterator for this map. + * + * @return a map iterator + */ + public abstract MapIterator map_iterator (); + + /** + * The type of the keys in this multimap. + */ + public Type key_type { get { return typeof (K); } } + + /** + * The type of the values in this multimap. + */ + public Type value_type { get { return typeof (V); } } + + public virtual MultiMap read_only_view { + owned get { + return new ReadOnlyMultiMap (this); + } + } } diff --git a/gee/multiset.c b/gee/multiset.c index 73e2507..ee42bb3 100644 --- a/gee/multiset.c +++ b/gee/multiset.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -59,23 +79,114 @@ typedef struct _GeeCollectionIface GeeCollectionIface; typedef struct _GeeMultiSet GeeMultiSet; typedef struct _GeeMultiSetIface GeeMultiSetIface; +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; + +#define GEE_TYPE_HASH_SET (gee_hash_set_get_type ()) +#define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet)) +#define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass)) +#define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET)) +#define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET)) +#define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass)) + +typedef struct _GeeHashSet GeeHashSet; +typedef struct _GeeHashSetClass GeeHashSetClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; + +#define GEE_TYPE_READ_ONLY_MULTI_SET (gee_read_only_multi_set_get_type ()) +#define GEE_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet)) +#define GEE_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) +#define GEE_IS_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_IS_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_READ_ONLY_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) + +typedef struct _GeeReadOnlyMultiSet GeeReadOnlyMultiSet; +typedef struct _GeeReadOnlyMultiSetClass GeeReadOnlyMultiSetClass; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -87,21 +198,58 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_multi_set_get_type (void) G_GNUC_CONST; gint gee_multi_set_count (GeeMultiSet* self, gconstpointer item); +GType gee_set_get_type (void) G_GNUC_CONST; +GeeSet* gee_multi_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_hash_set_get_type (void) G_GNUC_CONST; +GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self); +GeeMultiSet* gee_multi_set_get_read_only_view (GeeMultiSet* self); +GeeReadOnlyMultiSet* gee_read_only_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeReadOnlyMultiSet* gee_read_only_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_multi_set_get_type (void) G_GNUC_CONST; /** @@ -117,10 +265,51 @@ gint gee_multi_set_count (GeeMultiSet* self, gconstpointer item) { } +/** + * Returns an immutable empty set. + * + * @return an immutable empty set + */ +GeeSet* gee_multi_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeSet* result = NULL; + GeeHashSet* _tmp0_; + GeeHashSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* _tmp3_; + GeeSet* _tmp4_; + _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL); + _tmp1_ = _tmp0_; + _tmp2_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + return result; +} + + +GeeMultiSet* gee_multi_set_get_read_only_view (GeeMultiSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_MULTI_SET_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static GeeMultiSet* gee_multi_set_real_get_read_only_view (GeeMultiSet* base) { + GeeMultiSet* result; + GeeMultiSet* self; + GeeReadOnlyMultiSet* _tmp0_; + self = base; + _tmp0_ = gee_read_only_multi_set_new (GEE_MULTI_SET_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_MULTI_SET_GET_INTERFACE (self)->get_g_dup_func (self), GEE_MULTI_SET_GET_INTERFACE (self)->get_g_destroy_func (self), self); + result = (GeeMultiSet*) _tmp0_; + return result; +} + + static void gee_multi_set_base_init (GeeMultiSetIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; + iface->get_read_only_view = gee_multi_set_real_get_read_only_view; } } diff --git a/gee/multiset.vala b/gee/multiset.vala index 0c169e9..0236cea 100644 --- a/gee/multiset.vala +++ b/gee/multiset.vala @@ -23,6 +23,7 @@ /** * A collection with duplicate elements. */ +[GenericAccessors] public interface Gee.MultiSet : Collection { /** * Returns the number of occurences of an item in this multiset. @@ -32,4 +33,23 @@ public interface Gee.MultiSet : Collection { * @return the number of occurences of the item in this multiset. */ public abstract int count (G item); + + /** + * The read-only view of this set. + */ + public virtual new MultiSet read_only_view { + owned get { + return new ReadOnlyMultiSet (this); + } + } + + /** + * Returns an immutable empty set. + * + * @return an immutable empty set + */ + public static Set empty () { + return new HashSet ().read_only_view; + } } + diff --git a/gee/priorityqueue.c b/gee/priorityqueue.c index 358c41a..5c43e3e 100644 --- a/gee/priorityqueue.c +++ b/gee/priorityqueue.c @@ -4,6 +4,7 @@ /* priorityqueue.vala * * Copyright (C) 2009 Didier Villevalois + * Copyright (C) 2012 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,13 +30,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -45,6 +58,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -123,18 +144,9 @@ typedef struct _GeePriorityQueueType1NodeClass GeePriorityQueueType1NodeClass; typedef struct _GeePriorityQueueType2Node GeePriorityQueueType2Node; typedef struct _GeePriorityQueueType2NodeClass GeePriorityQueueType2NodeClass; - -#define GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR (gee_priority_queue_node_pair_get_type ()) -#define GEE_PRIORITY_QUEUE_NODE_PAIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, GeePriorityQueueNodePair)) -#define GEE_PRIORITY_QUEUE_NODE_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, GeePriorityQueueNodePairClass)) -#define GEE_PRIORITY_QUEUE_IS_NODE_PAIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)) -#define GEE_PRIORITY_QUEUE_IS_NODE_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)) -#define GEE_PRIORITY_QUEUE_NODE_PAIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, GeePriorityQueueNodePairClass)) - typedef struct _GeePriorityQueueNodePair GeePriorityQueueNodePair; -typedef struct _GeePriorityQueueNodePairClass GeePriorityQueueNodePairClass; #define _gee_priority_queue_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_priority_queue_node_unref (var), NULL))) -#define _gee_priority_queue_node_pair_unref0(var) ((var == NULL) ? NULL : (var = (gee_priority_queue_node_pair_unref (var), NULL))) +#define _gee_priority_queue_node_pair_free0(var) ((var == NULL) ? NULL : (var = (gee_priority_queue_node_pair_free (var), NULL))) typedef struct _GeePriorityQueueNodePrivate GeePriorityQueueNodePrivate; typedef struct _GeePriorityQueueType1NodePrivate GeePriorityQueueType1NodePrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) @@ -148,7 +160,6 @@ typedef struct _GeePriorityQueueType1NodePrivate GeePriorityQueueType1NodePrivat typedef struct _GeePriorityQueueIterator GeePriorityQueueIterator; typedef struct _GeePriorityQueueIteratorClass GeePriorityQueueIteratorClass; -typedef struct _GeePriorityQueueNodePairPrivate GeePriorityQueueNodePairPrivate; #define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) typedef struct _GeePriorityQueueParamSpecNode GeePriorityQueueParamSpecNode; typedef struct _GeePriorityQueueType2NodePrivate GeePriorityQueueType2NodePrivate; @@ -163,27 +174,58 @@ typedef struct _GeePriorityQueueType2NodePrivate GeePriorityQueueType2NodePrivat typedef struct _GeePriorityQueueDummyNode GeePriorityQueueDummyNode; typedef struct _GeePriorityQueueDummyNodeClass GeePriorityQueueDummyNodeClass; typedef struct _GeePriorityQueueDummyNodePrivate GeePriorityQueueDummyNodePrivate; -typedef struct _GeePriorityQueueParamSpecNodePair GeePriorityQueueParamSpecNodePair; typedef struct _GeePriorityQueueIteratorPrivate GeePriorityQueueIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -195,6 +237,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -209,19 +252,28 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -238,10 +290,18 @@ struct _GeeAbstractQueue { struct _GeeAbstractQueueClass { GeeAbstractCollectionClass parent_class; - gboolean (*offer) (GeeAbstractQueue* self, gconstpointer element); gpointer (*peek) (GeeAbstractQueue* self); gpointer (*poll) (GeeAbstractQueue* self); - gint (*drain) (GeeAbstractQueue* self, GeeCollection* recipient, gint amount); + void (*reserved0) (GeeAbstractQueue* self); + void (*reserved1) (GeeAbstractQueue* self); + void (*reserved2) (GeeAbstractQueue* self); + void (*reserved3) (GeeAbstractQueue* self); + void (*reserved4) (GeeAbstractQueue* self); + void (*reserved5) (GeeAbstractQueue* self); + void (*reserved6) (GeeAbstractQueue* self); + void (*reserved7) (GeeAbstractQueue* self); + void (*reserved8) (GeeAbstractQueue* self); + void (*reserved9) (GeeAbstractQueue* self); gint (*get_capacity) (GeeAbstractQueue* self); gint (*get_remaining_capacity) (GeeAbstractQueue* self); gboolean (*get_is_full) (GeeAbstractQueue* self); @@ -260,7 +320,9 @@ struct _GeePriorityQueuePrivate { GType g_type; GBoxedCopyFunc g_dup_func; GDestroyNotify g_destroy_func; - GCompareFunc _compare_func; + GCompareDataFunc _compare_func; + gpointer _compare_func_target; + GDestroyNotify _compare_func_target_destroy_notify; gint _size; gint _stamp; GeePriorityQueueType1Node* _r; @@ -318,20 +380,12 @@ struct _GeePriorityQueueType1NodeClass { }; struct _GeePriorityQueueNodePair { - GTypeInstance parent_instance; - volatile int ref_count; - GeePriorityQueueNodePairPrivate * priv; GeePriorityQueueNodePair* lp_prev; GeePriorityQueueNodePair* lp_next; GeePriorityQueueType1Node* node1; GeePriorityQueueType1Node* node2; }; -struct _GeePriorityQueueNodePairClass { - GTypeClass parent_class; - void (*finalize) (GeePriorityQueueNodePair *self); -}; - struct _GeePriorityQueueNodePrivate { GType g_type; GBoxedCopyFunc g_dup_func; @@ -378,16 +432,6 @@ struct _GeePriorityQueueDummyNodePrivate { GDestroyNotify g_destroy_func; }; -struct _GeePriorityQueueNodePairPrivate { - GType g_type; - GBoxedCopyFunc g_dup_func; - GDestroyNotify g_destroy_func; -}; - -struct _GeePriorityQueueParamSpecNodePair { - GParamSpec parent_instance; -}; - struct _GeePriorityQueueIterator { GObject parent_instance; GeePriorityQueueIteratorPrivate * priv; @@ -413,11 +457,20 @@ static gpointer gee_priority_queue_node_parent_class = NULL; static gpointer gee_priority_queue_type1_node_parent_class = NULL; static gpointer gee_priority_queue_type2_node_parent_class = NULL; static gpointer gee_priority_queue_dummy_node_parent_class = NULL; -static gpointer gee_priority_queue_node_pair_parent_class = NULL; static gpointer gee_priority_queue_iterator_parent_class = NULL; +static GeeTraversableIface* gee_priority_queue_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_priority_queue_iterator_gee_iterator_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -433,31 +486,25 @@ static gpointer gee_priority_queue_value_get_node (const GValue* value) G_GNUC_U static GType gee_priority_queue_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GType gee_priority_queue_type1_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GType gee_priority_queue_type2_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; -static gpointer gee_priority_queue_node_pair_ref (gpointer instance); -static void gee_priority_queue_node_pair_unref (gpointer instance); -static GParamSpec* gee_priority_queue_param_spec_node_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; -static void gee_priority_queue_value_set_node_pair (GValue* value, gpointer v_object) G_GNUC_UNUSED; -static void gee_priority_queue_value_take_node_pair (GValue* value, gpointer v_object) G_GNUC_UNUSED; -static gpointer gee_priority_queue_value_get_node_pair (const GValue* value) G_GNUC_UNUSED; -static GType gee_priority_queue_node_pair_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static void gee_priority_queue_node_pair_free (GeePriorityQueueNodePair* self); #define GEE_PRIORITY_QUEUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueuePrivate)) enum { GEE_PRIORITY_QUEUE_DUMMY_PROPERTY, GEE_PRIORITY_QUEUE_G_TYPE, GEE_PRIORITY_QUEUE_G_DUP_FUNC, GEE_PRIORITY_QUEUE_G_DESTROY_FUNC, - GEE_PRIORITY_QUEUE_COMPARE_FUNC, GEE_PRIORITY_QUEUE_CAPACITY, GEE_PRIORITY_QUEUE_REMAINING_CAPACITY, GEE_PRIORITY_QUEUE_IS_FULL, + GEE_PRIORITY_QUEUE_READ_ONLY, GEE_PRIORITY_QUEUE_SIZE }; -GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); +GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeAbstractQueue* gee_abstract_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GCompareFunc gee_functions_get_compare_func_for (GType t); -static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareFunc value); -static gboolean gee_priority_queue_real_offer (GeeAbstractQueue* base, gconstpointer element); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareDataFunc value, gpointer value_target); +gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element); static GeePriorityQueueType1Node* gee_priority_queue_type1_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail); static GeePriorityQueueType1Node* gee_priority_queue_type1_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail); static GeePriorityQueueType2Node* gee_priority_queue_type2_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data, GeePriorityQueueNode** head, GeePriorityQueueNode** tail); @@ -473,16 +520,15 @@ static void _gee_priority_queue_remove_type1_node (GeePriorityQueue* self, GeePr static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePriorityQueueType1Node* node); static void _gee_priority_queue_adjust (GeePriorityQueue* self, GeePriorityQueueType1Node* p1, GeePriorityQueueType1Node* p2); static gboolean _gee_priority_queue_check_linkable (GeePriorityQueue* self); -static gint gee_priority_queue_real_drain (GeeAbstractQueue* base, GeeCollection* recipient, gint amount); +gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount); gboolean gee_collection_add (GeeCollection* self, gconstpointer item); gpointer gee_abstract_queue_poll (GeeAbstractQueue* self); static gboolean gee_priority_queue_real_contains (GeeAbstractCollection* base, gconstpointer item); GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); gboolean gee_iterator_next (GeeIterator* self); gpointer gee_iterator_get (GeeIterator* self); -GCompareFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self); +GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target); static gboolean gee_priority_queue_real_add (GeeAbstractCollection* base, gconstpointer item); -gboolean gee_abstract_queue_offer (GeeAbstractQueue* self, gconstpointer element); static gboolean gee_priority_queue_real_remove (GeeAbstractCollection* base, gconstpointer item); static GeePriorityQueueIterator* gee_priority_queue_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue); static GeePriorityQueueIterator* gee_priority_queue_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueue* queue); @@ -494,11 +540,11 @@ static void _gee_priority_queue_link (GeePriorityQueue* self, GeePriorityQueueTy static inline gint gee_priority_queue_node_degree (GeePriorityQueueNode* self); static void _gee_priority_queue_add_to (GeePriorityQueue* self, GeePriorityQueueType1Node* node, GeePriorityQueueType1Node* parent); static GeePriorityQueueNode* _gee_priority_queue_re_insert (GeePriorityQueue* self, GeePriorityQueueType1Node* n); -static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n, GeePriorityQueueNode** prev); +static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n); static void _gee_priority_queue_decrease_key (GeePriorityQueue* self, GeePriorityQueueNode* n); static inline void gee_priority_queue_type1_node_add (GeePriorityQueueType1Node* self, GeePriorityQueueType1Node* node); -static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2); -static GeePriorityQueueNodePair* gee_priority_queue_node_pair_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2); +static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2); +static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2); static void _gee_priority_queue_updated_degree (GeePriorityQueue* self, GeePriorityQueueType1Node* node, gboolean child_removed); static inline void gee_priority_queue_type1_node_remove (GeePriorityQueueType1Node* self); #define GEE_QUEUE_UNBOUNDED_CAPACITY (-1) @@ -524,31 +570,32 @@ enum { }; static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next); static GeePriorityQueueDummyNode* gee_priority_queue_dummy_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueNode** prev_next, GeePriorityQueueNode** next_prev, GeePriorityQueueNode* iter_prev, GeePriorityQueueNode* iter_next); -#define GEE_PRIORITY_QUEUE_NODE_PAIR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, GeePriorityQueueNodePairPrivate)) -enum { - GEE_PRIORITY_QUEUE_NODE_PAIR_DUMMY_PROPERTY -}; -static void gee_priority_queue_node_pair_finalize (GeePriorityQueueNodePair* obj); +static void gee_priority_queue_node_pair_instance_init (GeePriorityQueueNodePair * self); #define GEE_PRIORITY_QUEUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIteratorPrivate)) enum { GEE_PRIORITY_QUEUE_ITERATOR_DUMMY_PROPERTY, GEE_PRIORITY_QUEUE_ITERATOR_G_TYPE, GEE_PRIORITY_QUEUE_ITERATOR_G_DUP_FUNC, - GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC + GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC, + GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY, + GEE_PRIORITY_QUEUE_ITERATOR_VALID }; static gboolean gee_priority_queue_iterator_real_next (GeeIterator* base); static inline GeePriorityQueueNode* _gee_priority_queue_iterator_get_next_node (GeePriorityQueueIterator* self); static gboolean gee_priority_queue_iterator_real_has_next (GeeIterator* base); -static gboolean gee_priority_queue_iterator_real_first (GeeIterator* base); static gpointer gee_priority_queue_iterator_real_get (GeeIterator* base); static void gee_priority_queue_iterator_real_remove (GeeIterator* base); +static gboolean gee_priority_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_priority_queue_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); +gboolean gee_iterator_get_valid (GeeIterator* self); static void _vala_gee_priority_queue_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_priority_queue_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_priority_queue_finalize (GObject* obj); gint gee_abstract_queue_get_capacity (GeeAbstractQueue* self); gint gee_abstract_queue_get_remaining_capacity (GeeAbstractQueue* self); gboolean gee_abstract_queue_get_is_full (GeeAbstractQueue* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); static void _vala_gee_priority_queue_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_priority_queue_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -564,28 +611,44 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify * * @param compare_func an optional element comparator function */ -GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { +GeePriorityQueue* gee_priority_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { GeePriorityQueue * self = NULL; - GCompareFunc _tmp0_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; self = (GeePriorityQueue*) gee_abstract_queue_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _tmp0_ = compare_func; + _tmp0__target = compare_func_target; if (_tmp0_ == NULL) { - GCompareFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_compare_func_for (g_type); - compare_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GCompareDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_compare_func_for (g_type, &_tmp1_, &_tmp2_); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; + compare_func = _tmp3_; + compare_func_target = _tmp1_; + compare_func_target_destroy_notify = _tmp2_; } - _tmp2_ = compare_func; - gee_priority_queue_set_compare_func (self, _tmp2_); + _tmp4_ = compare_func; + _tmp4__target = compare_func_target; + gee_priority_queue_set_compare_func (self, _tmp4_, _tmp4__target); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; return self; } -GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { - return gee_priority_queue_construct (GEE_TYPE_PRIORITY_QUEUE, g_type, g_dup_func, g_destroy_func, compare_func); +GeePriorityQueue* gee_priority_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + return gee_priority_queue_construct (GEE_TYPE_PRIORITY_QUEUE, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify); } @@ -597,13 +660,12 @@ static gpointer _gee_priority_queue_node_ref0 (gpointer self) { } -static gboolean gee_priority_queue_real_offer (GeeAbstractQueue* base, gconstpointer element) { - GeePriorityQueue * self; +gboolean gee_priority_queue_offer (GeePriorityQueue* self, gconstpointer element) { gboolean result = FALSE; GeePriorityQueueType1Node* _tmp0_; gint _tmp21_; gint _tmp22_; - self = (GeePriorityQueue*) base; + g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->priv->_r; if (_tmp0_ == NULL) { gconstpointer _tmp1_; @@ -731,8 +793,7 @@ static gpointer gee_priority_queue_real_poll (GeeAbstractQueue* base) { GeePriorityQueueType1Node* _tmp52_; GeePriorityQueueType1Node* _tmp53_; GeePriorityQueueType1Node* _tmp62_; - GeePriorityQueueType1Node* _tmp65_; - GeePriorityQueueType1Node* _tmp66_; + GeePriorityQueueType1Node* _tmp63_; self = (GeePriorityQueue*) base; _tmp0_ = self->priv->_r; if (_tmp0_ == NULL) { @@ -907,21 +968,12 @@ static gpointer gee_priority_queue_real_poll (GeeAbstractQueue* base) { _gee_priority_queue_node_unref0 (next); } _tmp62_ = self->priv->_p; - if (_tmp62_ == NULL) { - GeePriorityQueueType1Node* _tmp63_; - GeePriorityQueueType1Node* _tmp64_; - _tmp63_ = self->priv->_r; - _tmp64_ = _gee_priority_queue_node_ref0 (_tmp63_); - _gee_priority_queue_node_unref0 (self->priv->_p); - self->priv->_p = _tmp64_; - } - _tmp65_ = self->priv->_p; - _tmp66_ = self->priv->_p; - _gee_priority_queue_adjust (self, _tmp65_, _tmp66_); + _tmp63_ = self->priv->_p; + _gee_priority_queue_adjust (self, _tmp62_, _tmp63_); while (TRUE) { - gboolean _tmp67_ = FALSE; - _tmp67_ = _gee_priority_queue_check_linkable (self); - if (!_tmp67_) { + gboolean _tmp64_ = FALSE; + _tmp64_ = _gee_priority_queue_check_linkable (self); + if (!_tmp64_) { break; } } @@ -935,12 +987,11 @@ static gpointer gee_priority_queue_real_poll (GeeAbstractQueue* base) { /** * {@inheritDoc} */ -static gint gee_priority_queue_real_drain (GeeAbstractQueue* base, GeeCollection* recipient, gint amount) { - GeePriorityQueue * self; +gint gee_priority_queue_drain (GeePriorityQueue* self, GeeCollection* recipient, gint amount) { gint result = 0; gint _tmp0_; gint _tmp11_; - self = (GeePriorityQueue*) base; + g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (recipient != NULL, 0); _tmp0_ = amount; if (_tmp0_ == (-1)) { @@ -1011,8 +1062,10 @@ static gboolean gee_priority_queue_real_contains (GeeAbstractCollection* base, g GeeIterator* _tmp3_; gpointer _tmp4_ = NULL; gpointer an_item; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + GCompareDataFunc _tmp6_; + void* _tmp6__target; gconstpointer _tmp7_; gconstpointer _tmp8_; gint _tmp9_ = 0; @@ -1024,11 +1077,12 @@ static gboolean gee_priority_queue_real_contains (GeeAbstractCollection* base, g _tmp3_ = _an_item_it; _tmp4_ = gee_iterator_get (_tmp3_); an_item = _tmp4_; - _tmp5_ = gee_priority_queue_get_compare_func (self); + _tmp5_ = gee_priority_queue_get_compare_func (self, &_tmp5__target); _tmp6_ = _tmp5_; + _tmp6__target = _tmp5__target; _tmp7_ = item; _tmp8_ = an_item; - _tmp9_ = _tmp6_ (_tmp7_, _tmp8_); + _tmp9_ = _tmp6_ (_tmp7_, _tmp8_, _tmp6__target); if (_tmp9_ == 0) { result = TRUE; ((an_item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (an_item = (self->priv->g_destroy_func (an_item), NULL)); @@ -1054,7 +1108,7 @@ static gboolean gee_priority_queue_real_add (GeeAbstractCollection* base, gconst gboolean _tmp1_ = FALSE; self = (GeePriorityQueue*) base; _tmp0_ = item; - _tmp1_ = gee_abstract_queue_offer ((GeeAbstractQueue*) self, _tmp0_); + _tmp1_ = gee_priority_queue_offer (self, _tmp0_); result = _tmp1_; return result; } @@ -1077,8 +1131,10 @@ static gboolean gee_priority_queue_real_remove (GeeAbstractCollection* base, gco GeePriorityQueueIterator* _tmp3_; gpointer _tmp4_ = NULL; gpointer an_item; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + GCompareDataFunc _tmp6_; + void* _tmp6__target; gconstpointer _tmp7_; gconstpointer _tmp8_; gint _tmp9_ = 0; @@ -1090,11 +1146,12 @@ static gboolean gee_priority_queue_real_remove (GeeAbstractCollection* base, gco _tmp3_ = iterator; _tmp4_ = gee_iterator_get ((GeeIterator*) _tmp3_); an_item = _tmp4_; - _tmp5_ = gee_priority_queue_get_compare_func (self); + _tmp5_ = gee_priority_queue_get_compare_func (self, &_tmp5__target); _tmp6_ = _tmp5_; + _tmp6__target = _tmp5__target; _tmp7_ = item; _tmp8_ = an_item; - _tmp9_ = _tmp6_ (_tmp7_, _tmp8_); + _tmp9_ = _tmp6_ (_tmp7_, _tmp8_, _tmp6__target); if (_tmp9_ == 0) { GeePriorityQueueIterator* _tmp10_; _tmp10_ = iterator; @@ -1136,9 +1193,8 @@ static void gee_priority_queue_real_clear (GeeAbstractCollection* base) { self->priv->_a = _tmp0_; self->priv->_a_length1 = 0; self->priv->__a_size_ = self->priv->_a_length1; - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_head); + _gee_priority_queue_node_pair_free0 (self->priv->_lp_head); self->priv->_lp_head = NULL; - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_tail); self->priv->_lp_tail = NULL; _tmp1_ = g_new0 (gboolean, 0); self->priv->_b = (g_free (self->priv->_b), NULL); @@ -1189,20 +1245,23 @@ static inline gint _gee_priority_queue_compare (GeePriorityQueue* self, GeePrior result = 1; return result; } else { - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; GeePriorityQueueNode* _tmp6_; gconstpointer _tmp7_; GeePriorityQueueNode* _tmp8_; gconstpointer _tmp9_; gint _tmp10_ = 0; - _tmp4_ = gee_priority_queue_get_compare_func (self); + _tmp4_ = gee_priority_queue_get_compare_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = node1; _tmp7_ = _tmp6_->data; _tmp8_ = node2; _tmp9_ = _tmp8_->data; - _tmp10_ = _tmp5_ (_tmp7_, _tmp9_); + _tmp10_ = _tmp5_ (_tmp7_, _tmp9_, _tmp5__target); result = _tmp10_; return result; } @@ -1706,11 +1765,6 @@ static void _gee_priority_queue_add (GeePriorityQueue* self, GeePriorityQueueTyp } -static gpointer _gee_priority_queue_node_pair_ref0 (gpointer self) { - return self ? gee_priority_queue_node_pair_ref (self) : NULL; -} - - static gboolean _gee_priority_queue_check_linkable (GeePriorityQueue* self) { gboolean result = FALSE; GeePriorityQueueNodePair* _tmp0_; @@ -1718,26 +1772,23 @@ static gboolean _gee_priority_queue_check_linkable (GeePriorityQueue* self) { _tmp0_ = self->priv->_lp_head; if (_tmp0_ != NULL) { GeePriorityQueueNodePair* _tmp1_; - GeePriorityQueueNodePair* _tmp2_; GeePriorityQueueNodePair* pair; - GeePriorityQueueNodePair* _tmp3_; + GeePriorityQueueNodePair* _tmp2_; + GeePriorityQueueType1Node* _tmp3_; GeePriorityQueueType1Node* _tmp4_; - GeePriorityQueueType1Node* _tmp5_; - GeePriorityQueueNodePair* _tmp6_; + GeePriorityQueueNodePair* _tmp5_; + GeePriorityQueueType1Node* _tmp6_; GeePriorityQueueType1Node* _tmp7_; - GeePriorityQueueType1Node* _tmp8_; _tmp1_ = self->priv->_lp_head; - _tmp2_ = _gee_priority_queue_node_pair_ref0 (_tmp1_); - pair = _tmp2_; - _tmp3_ = pair; - _tmp4_ = _tmp3_->node1; - _tmp5_ = _gee_priority_queue_node_ref0 (_tmp4_); - _tmp6_ = pair; - _tmp7_ = _tmp6_->node2; - _tmp8_ = _gee_priority_queue_node_ref0 (_tmp7_); - _gee_priority_queue_link (self, _tmp5_, _tmp8_); + pair = _tmp1_; + _tmp2_ = pair; + _tmp3_ = _tmp2_->node1; + _tmp4_ = _gee_priority_queue_node_ref0 (_tmp3_); + _tmp5_ = pair; + _tmp6_ = _tmp5_->node2; + _tmp7_ = _gee_priority_queue_node_ref0 (_tmp6_); + _gee_priority_queue_link (self, _tmp4_, _tmp7_); result = TRUE; - _gee_priority_queue_node_pair_unref0 (pair); return result; } result = FALSE; @@ -1850,8 +1901,7 @@ static void _gee_priority_queue_adjust (GeePriorityQueue* self, GeePriorityQueue } -static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n, GeePriorityQueueNode** prev) { - GeePriorityQueueNode* _vala_prev = NULL; +static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueueNode* n) { GeePriorityQueueNode* _tmp0_; gpointer _tmp1_ = NULL; gpointer _tmp2_; @@ -1862,9 +1912,6 @@ static void _gee_priority_queue_delete (GeePriorityQueue* self, GeePriorityQueue _tmp1_ = gee_abstract_queue_poll ((GeeAbstractQueue*) self); _tmp2_ = _tmp1_; ((_tmp2_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->g_destroy_func (_tmp2_), NULL)); - if (prev) { - *prev = _vala_prev; - } } @@ -1977,12 +2024,12 @@ static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePrior gint _tmp49__length1; gint _tmp50_; GeePriorityQueueType1Node* _tmp51_; - GeePriorityQueueType1Node** _tmp85_; - gint _tmp85__length1; - gint _tmp86_; - GeePriorityQueueType1Node* _tmp87_; - GeePriorityQueueType1Node* _tmp88_; - GeePriorityQueueType1Node* _tmp89_; + GeePriorityQueueType1Node** _tmp82_; + gint _tmp82__length1; + gint _tmp83_; + GeePriorityQueueType1Node* _tmp84_; + GeePriorityQueueType1Node* _tmp85_; + GeePriorityQueueType1Node* _tmp86_; g_return_if_fail (self != NULL); g_return_if_fail (node != NULL); _tmp0_ = node; @@ -2154,14 +2201,14 @@ static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePrior GeePriorityQueueType1Node* _tmp65_; GeePriorityQueueNodePair* _tmp66_; GeePriorityQueueNodePair* _tmp67_; - gboolean* _tmp79_; - gint _tmp79__length1; - gint _tmp80_; - gboolean _tmp81_; + gboolean* _tmp76_; + gint _tmp76__length1; + gint _tmp77_; + gboolean _tmp78_; _tmp58_ = node; _tmp59_ = node; _tmp60_ = _tmp59_->brothers_next; - _tmp61_ = gee_priority_queue_node_pair_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp58_, _tmp60_); + _tmp61_ = gee_priority_queue_node_pair_new (_tmp58_, _tmp60_); pair = _tmp61_; _tmp62_ = node; _tmp63_ = _tmp62_->brothers_next; @@ -2174,63 +2221,57 @@ static void _gee_priority_queue_add_in_r_prime (GeePriorityQueue* self, GeePrior if (_tmp67_ == NULL) { GeePriorityQueueNodePair* _tmp68_; GeePriorityQueueNodePair* _tmp69_; - GeePriorityQueueNodePair* _tmp70_; - GeePriorityQueueNodePair* _tmp71_; _tmp68_ = pair; - _tmp69_ = _gee_priority_queue_node_pair_ref0 (_tmp68_); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_head); + self->priv->_lp_tail = _tmp68_; + _tmp69_ = pair; + pair = NULL; + _gee_priority_queue_node_pair_free0 (self->priv->_lp_head); self->priv->_lp_head = _tmp69_; - _tmp70_ = pair; - _tmp71_ = _gee_priority_queue_node_pair_ref0 (_tmp70_); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_tail); - self->priv->_lp_tail = _tmp71_; } else { + GeePriorityQueueNodePair* _tmp70_; + GeePriorityQueueNodePair* _tmp71_; GeePriorityQueueNodePair* _tmp72_; GeePriorityQueueNodePair* _tmp73_; GeePriorityQueueNodePair* _tmp74_; GeePriorityQueueNodePair* _tmp75_; - GeePriorityQueueNodePair* _tmp76_; - GeePriorityQueueNodePair* _tmp77_; - GeePriorityQueueNodePair* _tmp78_; - _tmp72_ = pair; - _tmp73_ = self->priv->_lp_tail; - _tmp72_->lp_prev = _tmp73_; + _tmp70_ = pair; + _tmp71_ = self->priv->_lp_tail; + _tmp70_->lp_prev = _tmp71_; + _tmp72_ = self->priv->_lp_tail; + _tmp73_ = pair; + pair = NULL; + _gee_priority_queue_node_pair_free0 (_tmp72_->lp_next); + _tmp72_->lp_next = _tmp73_; _tmp74_ = self->priv->_lp_tail; - _tmp75_ = pair; - _tmp76_ = _gee_priority_queue_node_pair_ref0 (_tmp75_); - _gee_priority_queue_node_pair_unref0 (_tmp74_->lp_next); - _tmp74_->lp_next = _tmp76_; - _tmp77_ = pair; - _tmp78_ = _gee_priority_queue_node_pair_ref0 (_tmp77_); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_tail); - self->priv->_lp_tail = _tmp78_; + _tmp75_ = _tmp74_->lp_next; + self->priv->_lp_tail = _tmp75_; } + _tmp76_ = self->priv->_b; + _tmp76__length1 = self->priv->_b_length1; + _tmp77_ = degree; + _tmp76_[_tmp77_] = FALSE; + _tmp78_ = _tmp76_[_tmp77_]; + _gee_priority_queue_node_pair_free0 (pair); + } else { + gboolean* _tmp79_; + gint _tmp79__length1; + gint _tmp80_; + gboolean _tmp81_; _tmp79_ = self->priv->_b; _tmp79__length1 = self->priv->_b_length1; _tmp80_ = degree; - _tmp79_[_tmp80_] = FALSE; + _tmp79_[_tmp80_] = TRUE; _tmp81_ = _tmp79_[_tmp80_]; - _gee_priority_queue_node_pair_unref0 (pair); - } else { - gboolean* _tmp82_; - gint _tmp82__length1; - gint _tmp83_; - gboolean _tmp84_; - _tmp82_ = self->priv->_b; - _tmp82__length1 = self->priv->_b_length1; - _tmp83_ = degree; - _tmp82_[_tmp83_] = TRUE; - _tmp84_ = _tmp82_[_tmp83_]; } } - _tmp85_ = self->priv->_a; - _tmp85__length1 = self->priv->_a_length1; - _tmp86_ = degree; - _tmp87_ = node; - _tmp88_ = _gee_priority_queue_node_ref0 (_tmp87_); - _gee_priority_queue_node_unref0 (_tmp85_[_tmp86_]); - _tmp85_[_tmp86_] = _tmp88_; - _tmp89_ = _tmp85_[_tmp86_]; + _tmp82_ = self->priv->_a; + _tmp82__length1 = self->priv->_a_length1; + _tmp83_ = degree; + _tmp84_ = node; + _tmp85_ = _gee_priority_queue_node_ref0 (_tmp84_); + _gee_priority_queue_node_unref0 (_tmp82_[_tmp83_]); + _tmp82_[_tmp83_] = _tmp85_; + _tmp86_ = _tmp82_[_tmp83_]; _gee_priority_queue_node_unref0 (insertion_point); } @@ -2241,8 +2282,8 @@ static void _gee_priority_queue_remove_type1_node (GeePriorityQueue* self, GeePr GeePriorityQueueType2Node* _tmp2_; GeePriorityQueueType1Node* _tmp55_; GeePriorityQueueType1Node* _tmp56_; - GeePriorityQueueType1Node* _tmp57_; - gboolean _tmp58_; + GeePriorityQueueType1Node* _tmp59_; + gboolean _tmp60_; g_return_if_fail (self != NULL); g_return_if_fail (node != NULL); _tmp0_ = node; @@ -2400,65 +2441,69 @@ static void _gee_priority_queue_remove_type1_node (GeePriorityQueue* self, GeePr _tmp55_ = node; _tmp56_ = self->priv->_p; if (_tmp55_ == _tmp56_) { + GeePriorityQueueType1Node* _tmp57_; + GeePriorityQueueType1Node* _tmp58_; + _tmp57_ = self->priv->_r; + _tmp58_ = _gee_priority_queue_node_ref0 (_tmp57_); _gee_priority_queue_node_unref0 (self->priv->_p); - self->priv->_p = NULL; + self->priv->_p = _tmp58_; } - _tmp57_ = node; - gee_priority_queue_type1_node_remove (_tmp57_); - _tmp58_ = with_iteration; - if (_tmp58_) { - GeePriorityQueueType1Node* _tmp59_; - GeePriorityQueueNode* _tmp60_; - GeePriorityQueueType1Node* _tmp69_; - GeePriorityQueueNode* _tmp70_; - _tmp59_ = node; - _tmp60_ = ((GeePriorityQueueNode*) _tmp59_)->iter_prev; - if (_tmp60_ != NULL) { - GeePriorityQueueType1Node* _tmp61_; - GeePriorityQueueNode* _tmp62_; + _tmp59_ = node; + gee_priority_queue_type1_node_remove (_tmp59_); + _tmp60_ = with_iteration; + if (_tmp60_) { + GeePriorityQueueType1Node* _tmp61_; + GeePriorityQueueNode* _tmp62_; + GeePriorityQueueType1Node* _tmp71_; + GeePriorityQueueNode* _tmp72_; + _tmp61_ = node; + _tmp62_ = ((GeePriorityQueueNode*) _tmp61_)->iter_prev; + if (_tmp62_ != NULL) { GeePriorityQueueType1Node* _tmp63_; GeePriorityQueueNode* _tmp64_; - _tmp61_ = node; - _tmp62_ = ((GeePriorityQueueNode*) _tmp61_)->iter_prev; + GeePriorityQueueType1Node* _tmp65_; + GeePriorityQueueNode* _tmp66_; _tmp63_ = node; - _tmp64_ = ((GeePriorityQueueNode*) _tmp63_)->iter_next; - _tmp62_->iter_next = _tmp64_; + _tmp64_ = ((GeePriorityQueueNode*) _tmp63_)->iter_prev; + _tmp65_ = node; + _tmp66_ = ((GeePriorityQueueNode*) _tmp65_)->iter_next; + _tmp64_->iter_next = _tmp66_; } else { - GeePriorityQueueNode* _tmp65_; - GeePriorityQueueType1Node* _tmp66_; - _tmp65_ = self->priv->_iter_head; - _tmp66_ = node; - if (_tmp65_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) { - GeePriorityQueueType1Node* _tmp67_; - GeePriorityQueueNode* _tmp68_; - _tmp67_ = node; - _tmp68_ = ((GeePriorityQueueNode*) _tmp67_)->iter_next; - self->priv->_iter_head = _tmp68_; + GeePriorityQueueNode* _tmp67_; + GeePriorityQueueType1Node* _tmp68_; + _tmp67_ = self->priv->_iter_head; + _tmp68_ = node; + if (_tmp67_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) { + GeePriorityQueueType1Node* _tmp69_; + GeePriorityQueueNode* _tmp70_; + _tmp69_ = node; + _tmp70_ = ((GeePriorityQueueNode*) _tmp69_)->iter_next; + self->priv->_iter_head = _tmp70_; } } - _tmp69_ = node; - _tmp70_ = ((GeePriorityQueueNode*) _tmp69_)->iter_next; - if (_tmp70_ != NULL) { - GeePriorityQueueType1Node* _tmp71_; - GeePriorityQueueNode* _tmp72_; + _tmp71_ = node; + _tmp72_ = ((GeePriorityQueueNode*) _tmp71_)->iter_next; + if (_tmp72_ != NULL) { GeePriorityQueueType1Node* _tmp73_; GeePriorityQueueNode* _tmp74_; - _tmp71_ = node; - _tmp72_ = ((GeePriorityQueueNode*) _tmp71_)->iter_next; + GeePriorityQueueType1Node* _tmp75_; + GeePriorityQueueNode* _tmp76_; _tmp73_ = node; - _tmp74_ = ((GeePriorityQueueNode*) _tmp73_)->iter_prev; - _tmp72_->iter_prev = _tmp74_; + _tmp74_ = ((GeePriorityQueueNode*) _tmp73_)->iter_next; + _tmp75_ = node; + _tmp76_ = ((GeePriorityQueueNode*) _tmp75_)->iter_prev; + _tmp74_->iter_prev = _tmp76_; } else { - GeePriorityQueueNode* _tmp75_; - GeePriorityQueueType1Node* _tmp76_; - _tmp75_ = self->priv->_iter_tail; - _tmp76_ = node; - if (_tmp75_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) { - GeePriorityQueueType1Node* _tmp77_; - GeePriorityQueueNode* _tmp78_; - _tmp77_ = node; - _tmp78_ = ((GeePriorityQueueNode*) _tmp77_)->iter_prev; - self->priv->_iter_tail = _tmp78_; + GeePriorityQueueNode* _tmp77_; + GeePriorityQueueType1Node* _tmp78_; + _tmp77_ = self->priv->_iter_tail; + _tmp78_ = node; + if (_tmp77_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, GEE_PRIORITY_QUEUE_TYPE_NODE, GeePriorityQueueNode)) { + GeePriorityQueueType1Node* _tmp79_; + GeePriorityQueueNode* _tmp80_; + _tmp79_ = node; + _tmp80_ = ((GeePriorityQueueNode*) _tmp79_)->iter_prev; + self->priv->_iter_tail = _tmp80_; } } } @@ -2469,289 +2514,305 @@ static void _gee_priority_queue_updated_degree (GeePriorityQueue* self, GeePrior GeePriorityQueueType1Node* _tmp0_; gint _tmp1_ = 0; gint degree; - gboolean _tmp2_ = FALSE; - gboolean _tmp3_; - gboolean _tmp7_; - gboolean* _tmp19_; - gint _tmp19__length1; - gint _tmp20_; - gboolean* _tmp21_; - gint _tmp21__length1; - gint _tmp22_; - gboolean _tmp23_; - gboolean _tmp24_; - GeePriorityQueueType1Node** _tmp25_; + gint _tmp2_; + GeePriorityQueueType1Node** _tmp3_; + gint _tmp3__length1; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_; + gboolean _tmp13_; + gboolean* _tmp25_; gint _tmp25__length1; gint _tmp26_; - GeePriorityQueueType1Node* _tmp27_; - GeePriorityQueueType1Node* _tmp28_; - GeePriorityQueueType1Node* _tmp58_; - GeePriorityQueueNodePair* _tmp59_; + gboolean* _tmp27_; + gint _tmp27__length1; + gint _tmp28_; + gboolean _tmp29_; + gboolean _tmp30_; + GeePriorityQueueType1Node** _tmp31_; + gint _tmp31__length1; + gint _tmp32_; + GeePriorityQueueType1Node* _tmp33_; + GeePriorityQueueType1Node* _tmp34_; + GeePriorityQueueType1Node* _tmp64_; + GeePriorityQueueNodePair* _tmp65_; g_return_if_fail (self != NULL); g_return_if_fail (node != NULL); _tmp0_ = node; _tmp1_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp0_); degree = _tmp1_; - _tmp3_ = child_removed; - if (_tmp3_) { - GeePriorityQueueType1Node** _tmp4_; - gint _tmp4__length1; - gint _tmp5_; - GeePriorityQueueType1Node* _tmp6_; - _tmp4_ = self->priv->_a; - _tmp4__length1 = self->priv->_a_length1; - _tmp5_ = degree; - _tmp6_ = _tmp4_[_tmp5_ - 1]; - _tmp2_ = _tmp6_ == NULL; - } else { - _tmp2_ = FALSE; + _tmp2_ = degree; + _tmp3_ = self->priv->_a; + _tmp3__length1 = self->priv->_a_length1; + if (_tmp2_ >= _tmp3__length1) { + gint _tmp4_; + gint _tmp5_ = 0; + gint _tmp6_; + gint _tmp7_ = 0; + _tmp4_ = degree; + _tmp5_ = _tmp4_ + 1; + self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp4_ + 1); + (_tmp5_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp5_ - self->priv->_a_length1)) : NULL; + self->priv->_a_length1 = _tmp5_; + self->priv->__a_size_ = _tmp5_; + _tmp6_ = degree; + _tmp7_ = _tmp6_ + 1; + self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp6_ + 1); + (_tmp7_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp7_ - self->priv->_b_length1)) : NULL; + self->priv->_b_length1 = _tmp7_; + self->priv->__b_size_ = _tmp7_; } - _tmp7_ = _tmp2_; - if (_tmp7_) { - GeePriorityQueueType1Node** _tmp8_; - gint _tmp8__length1; - gint _tmp9_; - GeePriorityQueueType1Node* _tmp10_; - GeePriorityQueueType1Node* _tmp11_; + _tmp9_ = child_removed; + if (_tmp9_) { + GeePriorityQueueType1Node** _tmp10_; + gint _tmp10__length1; + gint _tmp11_; GeePriorityQueueType1Node* _tmp12_; - gboolean* _tmp13_; - gint _tmp13__length1; - gint _tmp14_; - gboolean* _tmp15_; - gint _tmp15__length1; - gint _tmp16_; - gboolean _tmp17_; - gboolean _tmp18_; - _tmp8_ = self->priv->_a; - _tmp8__length1 = self->priv->_a_length1; - _tmp9_ = degree; - _tmp10_ = node; - _tmp11_ = _gee_priority_queue_node_ref0 (_tmp10_); - _gee_priority_queue_node_unref0 (_tmp8_[_tmp9_ - 1]); - _tmp8_[_tmp9_ - 1] = _tmp11_; - _tmp12_ = _tmp8_[_tmp9_ - 1]; - _tmp13_ = self->priv->_b; - _tmp13__length1 = self->priv->_b_length1; - _tmp14_ = degree; - _tmp15_ = self->priv->_b; - _tmp15__length1 = self->priv->_b_length1; - _tmp16_ = degree; - _tmp17_ = _tmp15_[_tmp16_ - 1]; - _tmp13_[_tmp14_ - 1] = !_tmp17_; - _tmp18_ = _tmp13_[_tmp14_ - 1]; - } - _tmp19_ = self->priv->_b; - _tmp19__length1 = self->priv->_b_length1; - _tmp20_ = degree; - _tmp21_ = self->priv->_b; - _tmp21__length1 = self->priv->_b_length1; - _tmp22_ = degree; - _tmp23_ = _tmp21_[_tmp22_]; - _tmp19_[_tmp20_] = !_tmp23_; - _tmp24_ = _tmp19_[_tmp20_]; - _tmp25_ = self->priv->_a; - _tmp25__length1 = self->priv->_a_length1; + _tmp10_ = self->priv->_a; + _tmp10__length1 = self->priv->_a_length1; + _tmp11_ = degree; + _tmp12_ = _tmp10_[_tmp11_ - 1]; + _tmp8_ = _tmp12_ == NULL; + } else { + _tmp8_ = FALSE; + } + _tmp13_ = _tmp8_; + if (_tmp13_) { + GeePriorityQueueType1Node** _tmp14_; + gint _tmp14__length1; + gint _tmp15_; + GeePriorityQueueType1Node* _tmp16_; + GeePriorityQueueType1Node* _tmp17_; + GeePriorityQueueType1Node* _tmp18_; + gboolean* _tmp19_; + gint _tmp19__length1; + gint _tmp20_; + gboolean* _tmp21_; + gint _tmp21__length1; + gint _tmp22_; + gboolean _tmp23_; + gboolean _tmp24_; + _tmp14_ = self->priv->_a; + _tmp14__length1 = self->priv->_a_length1; + _tmp15_ = degree; + _tmp16_ = node; + _tmp17_ = _gee_priority_queue_node_ref0 (_tmp16_); + _gee_priority_queue_node_unref0 (_tmp14_[_tmp15_ - 1]); + _tmp14_[_tmp15_ - 1] = _tmp17_; + _tmp18_ = _tmp14_[_tmp15_ - 1]; + _tmp19_ = self->priv->_b; + _tmp19__length1 = self->priv->_b_length1; + _tmp20_ = degree; + _tmp21_ = self->priv->_b; + _tmp21__length1 = self->priv->_b_length1; + _tmp22_ = degree; + _tmp23_ = _tmp21_[_tmp22_ - 1]; + _tmp19_[_tmp20_ - 1] = !_tmp23_; + _tmp24_ = _tmp19_[_tmp20_ - 1]; + } + _tmp25_ = self->priv->_b; + _tmp25__length1 = self->priv->_b_length1; _tmp26_ = degree; - _tmp27_ = _tmp25_[_tmp26_]; - _tmp28_ = node; - if (_tmp27_ == _tmp28_) { - GeePriorityQueueType1Node* _tmp29_; - GeePriorityQueueType1Node* _tmp30_; - GeePriorityQueueType1Node* _tmp31_; + _tmp27_ = self->priv->_b; + _tmp27__length1 = self->priv->_b_length1; + _tmp28_ = degree; + _tmp29_ = _tmp27_[_tmp28_]; + _tmp25_[_tmp26_] = !_tmp29_; + _tmp30_ = _tmp25_[_tmp26_]; + _tmp31_ = self->priv->_a; + _tmp31__length1 = self->priv->_a_length1; + _tmp32_ = degree; + _tmp33_ = _tmp31_[_tmp32_]; + _tmp34_ = node; + if (_tmp33_ == _tmp34_) { + GeePriorityQueueType1Node* _tmp35_; + GeePriorityQueueType1Node* _tmp36_; + GeePriorityQueueType1Node* _tmp37_; GeePriorityQueueType1Node* next; - gboolean _tmp32_ = FALSE; - GeePriorityQueueType1Node* _tmp33_; - gboolean _tmp37_; - _tmp29_ = node; - _tmp30_ = _tmp29_->brothers_next; - _tmp31_ = _gee_priority_queue_node_ref0 (_tmp30_); - next = _tmp31_; - _tmp33_ = next; - if (_tmp33_ != NULL) { - GeePriorityQueueType1Node* _tmp34_; - gint _tmp35_ = 0; - gint _tmp36_; - _tmp34_ = next; - _tmp35_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp34_); - _tmp36_ = degree; - _tmp32_ = _tmp35_ == _tmp36_; - } else { - _tmp32_ = FALSE; - } - _tmp37_ = _tmp32_; - if (_tmp37_) { - GeePriorityQueueType1Node** _tmp38_; - gint _tmp38__length1; - gint _tmp39_; + gboolean _tmp38_ = FALSE; + GeePriorityQueueType1Node* _tmp39_; + gboolean _tmp43_; + _tmp35_ = node; + _tmp36_ = _tmp35_->brothers_next; + _tmp37_ = _gee_priority_queue_node_ref0 (_tmp36_); + next = _tmp37_; + _tmp39_ = next; + if (_tmp39_ != NULL) { GeePriorityQueueType1Node* _tmp40_; - GeePriorityQueueType1Node* _tmp41_; - GeePriorityQueueType1Node* _tmp42_; - _tmp38_ = self->priv->_a; - _tmp38__length1 = self->priv->_a_length1; - _tmp39_ = degree; + gint _tmp41_ = 0; + gint _tmp42_; _tmp40_ = next; - _tmp41_ = _gee_priority_queue_node_ref0 (_tmp40_); - _gee_priority_queue_node_unref0 (_tmp38_[_tmp39_]); - _tmp38_[_tmp39_] = _tmp41_; - _tmp42_ = _tmp38_[_tmp39_]; + _tmp41_ = gee_priority_queue_node_degree ((GeePriorityQueueNode*) _tmp40_); + _tmp42_ = degree; + _tmp38_ = _tmp41_ == _tmp42_; + } else { + _tmp38_ = FALSE; + } + _tmp43_ = _tmp38_; + if (_tmp43_) { + GeePriorityQueueType1Node** _tmp44_; + gint _tmp44__length1; + gint _tmp45_; + GeePriorityQueueType1Node* _tmp46_; + GeePriorityQueueType1Node* _tmp47_; + GeePriorityQueueType1Node* _tmp48_; + _tmp44_ = self->priv->_a; + _tmp44__length1 = self->priv->_a_length1; + _tmp45_ = degree; + _tmp46_ = next; + _tmp47_ = _gee_priority_queue_node_ref0 (_tmp46_); + _gee_priority_queue_node_unref0 (_tmp44_[_tmp45_]); + _tmp44_[_tmp45_] = _tmp47_; + _tmp48_ = _tmp44_[_tmp45_]; } else { - GeePriorityQueueType1Node** _tmp43_; - gint _tmp43__length1; - gint _tmp44_; - GeePriorityQueueType1Node* _tmp45_; - GeePriorityQueueType1Node** _tmp46_; - gint _tmp46__length1; + GeePriorityQueueType1Node** _tmp49_; + gint _tmp49__length1; + gint _tmp50_; + GeePriorityQueueType1Node* _tmp51_; + GeePriorityQueueType1Node** _tmp52_; + gint _tmp52__length1; gint i; - gint _tmp54_; - gint _tmp55_ = 0; - gint _tmp56_; - gint _tmp57_ = 0; - _tmp43_ = self->priv->_a; - _tmp43__length1 = self->priv->_a_length1; - _tmp44_ = degree; - _gee_priority_queue_node_unref0 (_tmp43_[_tmp44_]); - _tmp43_[_tmp44_] = NULL; - _tmp45_ = _tmp43_[_tmp44_]; - _tmp46_ = self->priv->_a; - _tmp46__length1 = self->priv->_a_length1; - i = _tmp46__length1 - 1; + gint _tmp60_; + gint _tmp61_ = 0; + gint _tmp62_; + gint _tmp63_ = 0; + _tmp49_ = self->priv->_a; + _tmp49__length1 = self->priv->_a_length1; + _tmp50_ = degree; + _gee_priority_queue_node_unref0 (_tmp49_[_tmp50_]); + _tmp49_[_tmp50_] = NULL; + _tmp51_ = _tmp49_[_tmp50_]; + _tmp52_ = self->priv->_a; + _tmp52__length1 = self->priv->_a_length1; + i = _tmp52__length1 - 1; while (TRUE) { - gboolean _tmp47_ = FALSE; - gint _tmp48_; - gboolean _tmp52_; - gint _tmp53_; - _tmp48_ = i; - if (_tmp48_ >= 0) { - GeePriorityQueueType1Node** _tmp49_; - gint _tmp49__length1; - gint _tmp50_; - GeePriorityQueueType1Node* _tmp51_; - _tmp49_ = self->priv->_a; - _tmp49__length1 = self->priv->_a_length1; - _tmp50_ = i; - _tmp51_ = _tmp49_[_tmp50_]; - _tmp47_ = _tmp51_ == NULL; + gboolean _tmp53_ = FALSE; + gint _tmp54_; + gboolean _tmp58_; + gint _tmp59_; + _tmp54_ = i; + if (_tmp54_ >= 0) { + GeePriorityQueueType1Node** _tmp55_; + gint _tmp55__length1; + gint _tmp56_; + GeePriorityQueueType1Node* _tmp57_; + _tmp55_ = self->priv->_a; + _tmp55__length1 = self->priv->_a_length1; + _tmp56_ = i; + _tmp57_ = _tmp55_[_tmp56_]; + _tmp53_ = _tmp57_ == NULL; } else { - _tmp47_ = FALSE; + _tmp53_ = FALSE; } - _tmp52_ = _tmp47_; - if (!_tmp52_) { + _tmp58_ = _tmp53_; + if (!_tmp58_) { break; } - _tmp53_ = i; - i = _tmp53_ - 1; + _tmp59_ = i; + i = _tmp59_ - 1; } - _tmp54_ = i; - _tmp55_ = _tmp54_ + 1; - self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp54_ + 1); - (_tmp55_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp55_ - self->priv->_a_length1)) : NULL; - self->priv->_a_length1 = _tmp55_; - self->priv->__a_size_ = _tmp55_; - _tmp56_ = i; - _tmp57_ = _tmp56_ + 1; - self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp56_ + 1); - (_tmp57_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp57_ - self->priv->_b_length1)) : NULL; - self->priv->_b_length1 = _tmp57_; - self->priv->__b_size_ = _tmp57_; + _tmp60_ = i; + _tmp61_ = _tmp60_ + 1; + self->priv->_a = g_renew (GeePriorityQueueType1Node*, self->priv->_a, _tmp60_ + 1); + (_tmp61_ > self->priv->_a_length1) ? memset (self->priv->_a + self->priv->_a_length1, 0, sizeof (GeePriorityQueueType1Node*) * (_tmp61_ - self->priv->_a_length1)) : NULL; + self->priv->_a_length1 = _tmp61_; + self->priv->__a_size_ = _tmp61_; + _tmp62_ = i; + _tmp63_ = _tmp62_ + 1; + self->priv->_b = g_renew (gboolean, self->priv->_b, _tmp62_ + 1); + (_tmp63_ > self->priv->_b_length1) ? memset (self->priv->_b + self->priv->_b_length1, 0, sizeof (gboolean) * (_tmp63_ - self->priv->_b_length1)) : NULL; + self->priv->_b_length1 = _tmp63_; + self->priv->__b_size_ = _tmp63_; } _gee_priority_queue_node_unref0 (next); } - _tmp58_ = node; - _tmp59_ = _tmp58_->pair; - if (_tmp59_ != NULL) { - GeePriorityQueueType1Node* _tmp60_; - GeePriorityQueueNodePair* _tmp61_; - GeePriorityQueueNodePair* _tmp62_; - GeePriorityQueueNodePair* pair; - GeePriorityQueueType1Node* _tmp63_ = NULL; - GeePriorityQueueNodePair* _tmp64_; - GeePriorityQueueType1Node* _tmp65_; + _tmp64_ = node; + _tmp65_ = _tmp64_->pair; + if (_tmp65_ != NULL) { GeePriorityQueueType1Node* _tmp66_; + GeePriorityQueueNodePair* _tmp67_; + GeePriorityQueueNodePair* pair; + GeePriorityQueueType1Node* _tmp68_ = NULL; + GeePriorityQueueNodePair* _tmp69_; + GeePriorityQueueType1Node* _tmp70_; GeePriorityQueueType1Node* _tmp71_; - GeePriorityQueueType1Node* _tmp72_; + GeePriorityQueueType1Node* _tmp76_; + GeePriorityQueueType1Node* _tmp77_; GeePriorityQueueType1Node* other; - GeePriorityQueueType1Node* _tmp73_; - GeePriorityQueueType1Node* _tmp74_; - GeePriorityQueueNodePair* _tmp75_; - GeePriorityQueueNodePair* _tmp76_; - GeePriorityQueueNodePair* _tmp85_; - GeePriorityQueueNodePair* _tmp86_; - _tmp60_ = node; - _tmp61_ = _tmp60_->pair; - _tmp62_ = _gee_priority_queue_node_pair_ref0 (_tmp61_); - pair = _tmp62_; - _tmp64_ = pair; - _tmp65_ = _tmp64_->node1; + GeePriorityQueueType1Node* _tmp78_; + GeePriorityQueueType1Node* _tmp79_; + GeePriorityQueueNodePair* _tmp80_; + GeePriorityQueueNodePair* _tmp81_; + GeePriorityQueueNodePair* _tmp88_; + GeePriorityQueueNodePair* _tmp89_; _tmp66_ = node; - if (_tmp65_ == _tmp66_) { - GeePriorityQueueNodePair* _tmp67_; - GeePriorityQueueType1Node* _tmp68_; - _tmp67_ = pair; - _tmp68_ = _tmp67_->node2; - _tmp63_ = _tmp68_; + _tmp67_ = _tmp66_->pair; + pair = _tmp67_; + _tmp69_ = pair; + _tmp70_ = _tmp69_->node1; + _tmp71_ = node; + if (_tmp70_ == _tmp71_) { + GeePriorityQueueNodePair* _tmp72_; + GeePriorityQueueType1Node* _tmp73_; + _tmp72_ = pair; + _tmp73_ = _tmp72_->node2; + _tmp68_ = _tmp73_; } else { - GeePriorityQueueNodePair* _tmp69_; - GeePriorityQueueType1Node* _tmp70_; - _tmp69_ = pair; - _tmp70_ = _tmp69_->node1; - _tmp63_ = _tmp70_; + GeePriorityQueueNodePair* _tmp74_; + GeePriorityQueueType1Node* _tmp75_; + _tmp74_ = pair; + _tmp75_ = _tmp74_->node1; + _tmp68_ = _tmp75_; } - _tmp71_ = _tmp63_; - _tmp72_ = _gee_priority_queue_node_ref0 (_tmp71_); - other = _tmp72_; - _tmp73_ = node; - _tmp73_->pair = NULL; - _tmp74_ = other; - _tmp74_->pair = NULL; - _tmp75_ = pair; - _tmp76_ = _tmp75_->lp_prev; - if (_tmp76_ != NULL) { - GeePriorityQueueNodePair* _tmp77_; - GeePriorityQueueNodePair* _tmp78_; - GeePriorityQueueNodePair* _tmp79_; - GeePriorityQueueNodePair* _tmp80_; - GeePriorityQueueNodePair* _tmp81_; - _tmp77_ = pair; - _tmp78_ = _tmp77_->lp_prev; - _tmp79_ = pair; - _tmp80_ = _tmp79_->lp_next; - _tmp81_ = _gee_priority_queue_node_pair_ref0 (_tmp80_); - _gee_priority_queue_node_pair_unref0 (_tmp78_->lp_next); - _tmp78_->lp_next = _tmp81_; - } else { + _tmp76_ = _tmp68_; + _tmp77_ = _gee_priority_queue_node_ref0 (_tmp76_); + other = _tmp77_; + _tmp78_ = node; + _tmp78_->pair = NULL; + _tmp79_ = other; + _tmp79_->pair = NULL; + _tmp80_ = pair; + _tmp81_ = _tmp80_->lp_next; + if (_tmp81_ != NULL) { GeePriorityQueueNodePair* _tmp82_; GeePriorityQueueNodePair* _tmp83_; GeePriorityQueueNodePair* _tmp84_; + GeePriorityQueueNodePair* _tmp85_; _tmp82_ = pair; _tmp83_ = _tmp82_->lp_next; - _tmp84_ = _gee_priority_queue_node_pair_ref0 (_tmp83_); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_head); - self->priv->_lp_head = _tmp84_; - } - _tmp85_ = pair; - _tmp86_ = _tmp85_->lp_next; - if (_tmp86_ != NULL) { + _tmp84_ = pair; + _tmp85_ = _tmp84_->lp_prev; + _tmp83_->lp_prev = _tmp85_; + } else { + GeePriorityQueueNodePair* _tmp86_; GeePriorityQueueNodePair* _tmp87_; - GeePriorityQueueNodePair* _tmp88_; - GeePriorityQueueNodePair* _tmp89_; + _tmp86_ = pair; + _tmp87_ = _tmp86_->lp_prev; + self->priv->_lp_tail = _tmp87_; + } + _tmp88_ = pair; + _tmp89_ = _tmp88_->lp_prev; + if (_tmp89_ != NULL) { GeePriorityQueueNodePair* _tmp90_; - _tmp87_ = pair; - _tmp88_ = _tmp87_->lp_next; - _tmp89_ = pair; - _tmp90_ = _tmp89_->lp_prev; - _tmp88_->lp_prev = _tmp90_; - } else { GeePriorityQueueNodePair* _tmp91_; GeePriorityQueueNodePair* _tmp92_; GeePriorityQueueNodePair* _tmp93_; - _tmp91_ = pair; - _tmp92_ = _tmp91_->lp_prev; - _tmp93_ = _gee_priority_queue_node_pair_ref0 (_tmp92_); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_tail); - self->priv->_lp_tail = _tmp93_; + _tmp90_ = pair; + _tmp91_ = _tmp90_->lp_prev; + _tmp92_ = pair; + _tmp93_ = _tmp92_->lp_next; + _tmp92_->lp_next = NULL; + _gee_priority_queue_node_pair_free0 (_tmp91_->lp_next); + _tmp91_->lp_next = _tmp93_; + } else { + GeePriorityQueueNodePair* _tmp94_; + GeePriorityQueueNodePair* _tmp95_; + _tmp94_ = pair; + _tmp95_ = _tmp94_->lp_next; + _tmp94_->lp_next = NULL; + _gee_priority_queue_node_pair_free0 (self->priv->_lp_head); + self->priv->_lp_head = _tmp95_; } _gee_priority_queue_node_unref0 (other); - _gee_priority_queue_node_pair_unref0 (pair); } } @@ -2829,22 +2890,36 @@ static void _gee_priority_queue_remove_type2_node (GeePriorityQueue* self, GeePr } -GCompareFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self) { - GCompareFunc result; - GCompareFunc _tmp0_; +GCompareDataFunc gee_priority_queue_get_compare_func (GeePriorityQueue* self, gpointer* result_target) { + GCompareDataFunc result; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_compare_func; - result = _tmp0_; + _tmp0__target = self->priv->_compare_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareFunc value) { - GCompareFunc _tmp0_; +static void gee_priority_queue_set_compare_func (GeePriorityQueue* self, GCompareDataFunc value, gpointer value_target) { + GCompareDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL); + self->priv->_compare_func = NULL; + self->priv->_compare_func_target = NULL; + self->priv->_compare_func_target_destroy_notify = NULL; self->priv->_compare_func = _tmp0_; - g_object_notify ((GObject *) self, "compare-func"); + self->priv->_compare_func_target = _tmp0__target; + self->priv->_compare_func_target_destroy_notify = NULL; } @@ -2875,6 +2950,15 @@ static gboolean gee_priority_queue_real_get_is_full (GeeAbstractQueue* base) { } +static gboolean gee_priority_queue_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeePriorityQueue* self; + self = (GeePriorityQueue*) base; + result = FALSE; + return result; +} + + static gint gee_priority_queue_real_get_size (GeeAbstractCollection* base) { gint result; GeePriorityQueue* self; @@ -3340,200 +3424,33 @@ static GType gee_priority_queue_dummy_node_get_type (void) { } -static GeePriorityQueueNodePair* gee_priority_queue_node_pair_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2) { - GeePriorityQueueNodePair* self = NULL; +static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2) { + GeePriorityQueueNodePair* self; GeePriorityQueueType1Node* _tmp0_; GeePriorityQueueType1Node* _tmp1_; - GeePriorityQueueType1Node* _tmp2_; - GeePriorityQueueType1Node* _tmp3_; g_return_val_if_fail (node1 != NULL, NULL); g_return_val_if_fail (node2 != NULL, NULL); - self = (GeePriorityQueueNodePair*) g_type_create_instance (object_type); - self->priv->g_type = g_type; - self->priv->g_dup_func = g_dup_func; - self->priv->g_destroy_func = g_destroy_func; + self = g_slice_new0 (GeePriorityQueueNodePair); + gee_priority_queue_node_pair_instance_init (self); _tmp0_ = node1; - _tmp1_ = _gee_priority_queue_node_ref0 (_tmp0_); - _gee_priority_queue_node_unref0 (self->node1); - self->node1 = _tmp1_; - _tmp2_ = node2; - _tmp3_ = _gee_priority_queue_node_ref0 (_tmp2_); - _gee_priority_queue_node_unref0 (self->node2); - self->node2 = _tmp3_; + self->node1 = _tmp0_; + _tmp1_ = node2; + self->node2 = _tmp1_; return self; } -static GeePriorityQueueNodePair* gee_priority_queue_node_pair_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeePriorityQueueType1Node* node1, GeePriorityQueueType1Node* node2) { - return gee_priority_queue_node_pair_construct (GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, g_type, g_dup_func, g_destroy_func, node1, node2); -} - - -static void gee_priority_queue_value_node_pair_init (GValue* value) { - value->data[0].v_pointer = NULL; -} - - -static void gee_priority_queue_value_node_pair_free_value (GValue* value) { - if (value->data[0].v_pointer) { - gee_priority_queue_node_pair_unref (value->data[0].v_pointer); - } -} - - -static void gee_priority_queue_value_node_pair_copy_value (const GValue* src_value, GValue* dest_value) { - if (src_value->data[0].v_pointer) { - dest_value->data[0].v_pointer = gee_priority_queue_node_pair_ref (src_value->data[0].v_pointer); - } else { - dest_value->data[0].v_pointer = NULL; - } -} - - -static gpointer gee_priority_queue_value_node_pair_peek_pointer (const GValue* value) { - return value->data[0].v_pointer; -} - - -static gchar* gee_priority_queue_value_node_pair_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { - if (collect_values[0].v_pointer) { - GeePriorityQueueNodePair* object; - object = collect_values[0].v_pointer; - if (object->parent_instance.g_class == NULL) { - return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); - } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { - return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); - } - value->data[0].v_pointer = gee_priority_queue_node_pair_ref (object); - } else { - value->data[0].v_pointer = NULL; - } - return NULL; -} - - -static gchar* gee_priority_queue_value_node_pair_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { - GeePriorityQueueNodePair** object_p; - object_p = collect_values[0].v_pointer; - if (!object_p) { - return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); - } - if (!value->data[0].v_pointer) { - *object_p = NULL; - } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { - *object_p = value->data[0].v_pointer; - } else { - *object_p = gee_priority_queue_node_pair_ref (value->data[0].v_pointer); - } - return NULL; -} - - -static GParamSpec* gee_priority_queue_param_spec_node_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { - GeePriorityQueueParamSpecNodePair* spec; - g_return_val_if_fail (g_type_is_a (object_type, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR), NULL); - spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); - G_PARAM_SPEC (spec)->value_type = object_type; - return G_PARAM_SPEC (spec); -} - - -static gpointer gee_priority_queue_value_get_node_pair (const GValue* value) { - g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR), NULL); - return value->data[0].v_pointer; -} - - -static void gee_priority_queue_value_set_node_pair (GValue* value, gpointer v_object) { - GeePriorityQueueNodePair* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)); - old = value->data[0].v_pointer; - if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)); - g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); - value->data[0].v_pointer = v_object; - gee_priority_queue_node_pair_ref (value->data[0].v_pointer); - } else { - value->data[0].v_pointer = NULL; - } - if (old) { - gee_priority_queue_node_pair_unref (old); - } -} - - -static void gee_priority_queue_value_take_node_pair (GValue* value, gpointer v_object) { - GeePriorityQueueNodePair* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)); - old = value->data[0].v_pointer; - if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR)); - g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); - value->data[0].v_pointer = v_object; - } else { - value->data[0].v_pointer = NULL; - } - if (old) { - gee_priority_queue_node_pair_unref (old); - } -} - - -static void gee_priority_queue_node_pair_class_init (GeePriorityQueueNodePairClass * klass) { - gee_priority_queue_node_pair_parent_class = g_type_class_peek_parent (klass); - GEE_PRIORITY_QUEUE_NODE_PAIR_CLASS (klass)->finalize = gee_priority_queue_node_pair_finalize; - g_type_class_add_private (klass, sizeof (GeePriorityQueueNodePairPrivate)); -} - - static void gee_priority_queue_node_pair_instance_init (GeePriorityQueueNodePair * self) { - self->priv = GEE_PRIORITY_QUEUE_NODE_PAIR_GET_PRIVATE (self); self->lp_prev = NULL; self->lp_next = NULL; self->node1 = NULL; self->node2 = NULL; - self->ref_count = 1; -} - - -static void gee_priority_queue_node_pair_finalize (GeePriorityQueueNodePair* obj) { - GeePriorityQueueNodePair * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_PRIORITY_QUEUE_TYPE_NODE_PAIR, GeePriorityQueueNodePair); - _gee_priority_queue_node_pair_unref0 (self->lp_next); - _gee_priority_queue_node_unref0 (self->node1); - _gee_priority_queue_node_unref0 (self->node2); -} - - -static GType gee_priority_queue_node_pair_get_type (void) { - static volatile gsize gee_priority_queue_node_pair_type_id__volatile = 0; - if (g_once_init_enter (&gee_priority_queue_node_pair_type_id__volatile)) { - static const GTypeValueTable g_define_type_value_table = { gee_priority_queue_value_node_pair_init, gee_priority_queue_value_node_pair_free_value, gee_priority_queue_value_node_pair_copy_value, gee_priority_queue_value_node_pair_peek_pointer, "p", gee_priority_queue_value_node_pair_collect_value, "p", gee_priority_queue_value_node_pair_lcopy_value }; - static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueNodePairClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_node_pair_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueNodePair), 0, (GInstanceInitFunc) gee_priority_queue_node_pair_instance_init, &g_define_type_value_table }; - static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; - GType gee_priority_queue_node_pair_type_id; - gee_priority_queue_node_pair_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeePriorityQueueNodePair", &g_define_type_info, &g_define_type_fundamental_info, 0); - g_once_init_leave (&gee_priority_queue_node_pair_type_id__volatile, gee_priority_queue_node_pair_type_id); - } - return gee_priority_queue_node_pair_type_id__volatile; -} - - -static gpointer gee_priority_queue_node_pair_ref (gpointer instance) { - GeePriorityQueueNodePair* self; - self = instance; - g_atomic_int_inc (&self->ref_count); - return instance; } -static void gee_priority_queue_node_pair_unref (gpointer instance) { - GeePriorityQueueNodePair* self; - self = instance; - if (g_atomic_int_dec_and_test (&self->ref_count)) { - GEE_PRIORITY_QUEUE_NODE_PAIR_GET_CLASS (self)->finalize (self); - g_type_free_instance ((GTypeInstance *) self); - } +static void gee_priority_queue_node_pair_free (GeePriorityQueueNodePair* self) { + _gee_priority_queue_node_pair_free0 (self->lp_next); + g_slice_free (GeePriorityQueueNodePair, self); } @@ -3644,30 +3561,6 @@ static inline GeePriorityQueueNode* _gee_priority_queue_iterator_get_next_node ( } -static gboolean gee_priority_queue_iterator_real_first (GeeIterator* base) { - GeePriorityQueueIterator * self; - gboolean result = FALSE; - gint _tmp0_; - GeePriorityQueue* _tmp1_; - gint _tmp2_; - GeePriorityQueue* _tmp3_; - GeePriorityQueueNode* _tmp4_; - GeePriorityQueueNode* _tmp5_; - self = (GeePriorityQueueIterator*) base; - _tmp0_ = self->priv->stamp; - _tmp1_ = self->priv->queue; - _tmp2_ = _tmp1_->priv->_stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == queue._stamp"); - _tmp3_ = self->priv->queue; - _tmp4_ = _tmp3_->priv->_iter_head; - self->priv->position = _tmp4_; - self->priv->previous = NULL; - _tmp5_ = self->priv->position; - result = _tmp5_ != NULL; - return result; -} - - static gpointer gee_priority_queue_iterator_real_get (GeeIterator* base) { GeePriorityQueueIterator * self; gpointer result = NULL; @@ -3751,7 +3644,7 @@ static void gee_priority_queue_iterator_real_remove (GeeIterator* base) { } _tmp14_ = self->priv->queue; _tmp15_ = self->priv->position; - _gee_priority_queue_delete (_tmp14_, _tmp15_, NULL); + _gee_priority_queue_delete (_tmp14_, _tmp15_); self->priv->position = NULL; _tmp16_ = self->priv->previous; if (_tmp16_ != NULL) { @@ -3806,6 +3699,107 @@ static void gee_priority_queue_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_priority_queue_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeePriorityQueueIterator * self; + gboolean result = FALSE; + GeePriorityQueueNode* _tmp0_; + GeeForallFunc _tmp8_; + void* _tmp8__target; + GeePriorityQueueNode* _tmp9_; + gconstpointer _tmp10_; + gpointer _tmp11_; + gboolean _tmp12_ = FALSE; + self = (GeePriorityQueueIterator*) base; + _tmp0_ = self->priv->position; + if (_tmp0_ == NULL) { + GeePriorityQueueNode* _tmp1_ = NULL; + GeePriorityQueueNode* _tmp2_; + GeePriorityQueueNode* _tmp7_; + _tmp2_ = self->priv->previous; + if (_tmp2_ != NULL) { + GeePriorityQueueNode* _tmp3_; + GeePriorityQueueNode* _tmp4_; + _tmp3_ = self->priv->previous; + _tmp4_ = _tmp3_->iter_next; + _tmp1_ = _tmp4_; + } else { + GeePriorityQueue* _tmp5_; + GeePriorityQueueNode* _tmp6_; + _tmp5_ = self->priv->queue; + _tmp6_ = _tmp5_->priv->_iter_head; + _tmp1_ = _tmp6_; + } + _tmp7_ = _tmp1_; + self->priv->position = _tmp7_; + } + _tmp8_ = f; + _tmp8__target = f_target; + _tmp9_ = self->priv->position; + _tmp10_ = _tmp9_->data; + _tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_); + _tmp12_ = _tmp8_ (_tmp11_, _tmp8__target); + if (!_tmp12_) { + result = FALSE; + return result; + } + while (TRUE) { + GeePriorityQueueNode* _tmp13_; + GeePriorityQueueNode* _tmp14_; + GeePriorityQueueNode* _tmp15_; + GeePriorityQueueNode* _tmp16_; + GeePriorityQueueNode* _tmp17_; + GeeForallFunc _tmp18_; + void* _tmp18__target; + GeePriorityQueueNode* _tmp19_; + gconstpointer _tmp20_; + gpointer _tmp21_; + gboolean _tmp22_ = FALSE; + _tmp13_ = self->priv->position; + _tmp14_ = _tmp13_->iter_next; + if (!(_tmp14_ != NULL)) { + break; + } + _tmp15_ = self->priv->position; + self->priv->previous = _tmp15_; + _tmp16_ = self->priv->position; + _tmp17_ = _tmp16_->iter_next; + self->priv->position = _tmp17_; + _tmp18_ = f; + _tmp18__target = f_target; + _tmp19_ = self->priv->position; + _tmp20_ = _tmp19_->data; + _tmp21_ = ((_tmp20_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp20_) : ((gpointer) _tmp20_); + _tmp22_ = _tmp18_ (_tmp21_, _tmp18__target); + if (!_tmp22_) { + result = FALSE; + return result; + } + } + result = TRUE; + return result; +} + + +static gboolean gee_priority_queue_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeePriorityQueueIterator* self; + self = (GeePriorityQueueIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_priority_queue_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeePriorityQueueIterator* self; + GeePriorityQueueNode* _tmp0_; + self = (GeePriorityQueueIterator*) base; + _tmp0_ = self->priv->position; + result = _tmp0_ != NULL; + return result; +} + + static void gee_priority_queue_iterator_class_init (GeePriorityQueueIteratorClass * klass) { gee_priority_queue_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeePriorityQueueIteratorPrivate)); @@ -3815,6 +3809,32 @@ static void gee_priority_queue_iterator_class_init (GeePriorityQueueIteratorClas g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_priority_queue_iterator_gee_traversable_get_g_type (GeePriorityQueueIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_priority_queue_iterator_gee_traversable_get_g_dup_func (GeePriorityQueueIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_priority_queue_iterator_gee_traversable_get_g_destroy_func (GeePriorityQueueIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_priority_queue_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_priority_queue_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_priority_queue_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_priority_queue_iterator_gee_traversable_get_g_destroy_func; } @@ -3822,9 +3842,10 @@ static void gee_priority_queue_iterator_gee_iterator_interface_init (GeeIterator gee_priority_queue_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_priority_queue_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_priority_queue_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_priority_queue_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_priority_queue_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_priority_queue_iterator_real_remove; + iface->get_read_only = gee_priority_queue_iterator_real_get_read_only; + iface->get_valid = gee_priority_queue_iterator_real_get_valid; } @@ -3845,9 +3866,11 @@ static GType gee_priority_queue_iterator_get_type (void) { static volatile gsize gee_priority_queue_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_priority_queue_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeePriorityQueueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_priority_queue_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeePriorityQueueIterator), 0, (GInstanceInitFunc) gee_priority_queue_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_priority_queue_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_priority_queue_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_priority_queue_iterator_type_id; gee_priority_queue_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeePriorityQueueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_priority_queue_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_priority_queue_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_priority_queue_iterator_type_id__volatile, gee_priority_queue_iterator_type_id); } @@ -3859,6 +3882,12 @@ static void _vala_gee_priority_queue_iterator_get_property (GObject * object, gu GeePriorityQueueIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_PRIORITY_QUEUE_TYPE_ITERATOR, GeePriorityQueueIterator); switch (property_id) { + case GEE_PRIORITY_QUEUE_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_PRIORITY_QUEUE_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -3889,10 +3918,8 @@ static void _vala_gee_priority_queue_iterator_set_property (GObject * object, gu static void gee_priority_queue_class_init (GeePriorityQueueClass * klass) { gee_priority_queue_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeePriorityQueuePrivate)); - GEE_ABSTRACT_QUEUE_CLASS (klass)->offer = gee_priority_queue_real_offer; GEE_ABSTRACT_QUEUE_CLASS (klass)->peek = gee_priority_queue_real_peek; GEE_ABSTRACT_QUEUE_CLASS (klass)->poll = gee_priority_queue_real_poll; - GEE_ABSTRACT_QUEUE_CLASS (klass)->drain = gee_priority_queue_real_drain; GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_priority_queue_real_contains; GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_priority_queue_real_add; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_priority_queue_real_remove; @@ -3901,6 +3928,7 @@ static void gee_priority_queue_class_init (GeePriorityQueueClass * klass) { GEE_ABSTRACT_QUEUE_CLASS (klass)->get_capacity = gee_priority_queue_real_get_capacity; GEE_ABSTRACT_QUEUE_CLASS (klass)->get_remaining_capacity = gee_priority_queue_real_get_remaining_capacity; GEE_ABSTRACT_QUEUE_CLASS (klass)->get_is_full = gee_priority_queue_real_get_is_full; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_priority_queue_real_get_read_only; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_priority_queue_real_get_size; G_OBJECT_CLASS (klass)->get_property = _vala_gee_priority_queue_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_priority_queue_set_property; @@ -3908,10 +3936,6 @@ static void gee_priority_queue_class_init (GeePriorityQueueClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - /** - * The elements' comparator function. - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_COMPARE_FUNC, g_param_spec_pointer ("compare-func", "compare-func", "compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -3924,6 +3948,10 @@ static void gee_priority_queue_class_init (GeePriorityQueueClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_IS_FULL, g_param_spec_boolean ("is-full", "is-full", "is-full", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_PRIORITY_QUEUE_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -3962,14 +3990,17 @@ static void gee_priority_queue_instance_init (GeePriorityQueue * self) { static void gee_priority_queue_finalize (GObject* obj) { GeePriorityQueue * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue); + (self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL); + self->priv->_compare_func = NULL; + self->priv->_compare_func_target = NULL; + self->priv->_compare_func_target_destroy_notify = NULL; _gee_priority_queue_node_unref0 (self->priv->_r); _gee_priority_queue_node_unref0 (self->priv->_r_prime); _gee_priority_queue_node_unref0 (self->priv->_lm_head); _gee_priority_queue_node_unref0 (self->priv->_lm_tail); _gee_priority_queue_node_unref0 (self->priv->_p); self->priv->_a = (_vala_array_free (self->priv->_a, self->priv->_a_length1, (GDestroyNotify) gee_priority_queue_node_unref), NULL); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_head); - _gee_priority_queue_node_pair_unref0 (self->priv->_lp_tail); + _gee_priority_queue_node_pair_free0 (self->priv->_lp_head); self->priv->_b = (g_free (self->priv->_b), NULL); _gee_priority_queue_node_unref0 (self->priv->_ll_head); _gee_priority_queue_node_unref0 (self->priv->_ll_tail); @@ -4012,9 +4043,6 @@ static void _vala_gee_priority_queue_get_property (GObject * object, guint prope GeePriorityQueue * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue); switch (property_id) { - case GEE_PRIORITY_QUEUE_COMPARE_FUNC: - g_value_set_pointer (value, gee_priority_queue_get_compare_func (self)); - break; case GEE_PRIORITY_QUEUE_CAPACITY: g_value_set_int (value, gee_abstract_queue_get_capacity ((GeeAbstractQueue*) self)); break; @@ -4024,6 +4052,9 @@ static void _vala_gee_priority_queue_get_property (GObject * object, guint prope case GEE_PRIORITY_QUEUE_IS_FULL: g_value_set_boolean (value, gee_abstract_queue_get_is_full ((GeeAbstractQueue*) self)); break; + case GEE_PRIORITY_QUEUE_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; case GEE_PRIORITY_QUEUE_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; @@ -4038,9 +4069,6 @@ static void _vala_gee_priority_queue_set_property (GObject * object, guint prope GeePriorityQueue * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_PRIORITY_QUEUE, GeePriorityQueue); switch (property_id) { - case GEE_PRIORITY_QUEUE_COMPARE_FUNC: - gee_priority_queue_set_compare_func (self, g_value_get_pointer (value)); - break; case GEE_PRIORITY_QUEUE_G_TYPE: self->priv->g_type = g_value_get_gtype (value); break; diff --git a/gee/priorityqueue.vala b/gee/priorityqueue.vala index e31601c..d0c5d6b 100644 --- a/gee/priorityqueue.vala +++ b/gee/priorityqueue.vala @@ -1,6 +1,7 @@ /* priorityqueue.vala * * Copyright (C) 2009 Didier Villevalois + * Copyright (C) 2012 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -44,7 +45,8 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { /** * The elements' comparator function. */ - public CompareFunc compare_func { private set; get; } + [CCode (notify = false)] + public CompareDataFunc compare_func { private set; get; } private int _size = 0; private int _stamp = 0; @@ -59,7 +61,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { private Type1Node?[] _a = new Type1Node[0]; #endif private NodePair? _lp_head = null; - private NodePair? _lp_tail = null; + private unowned NodePair? _lp_tail = null; private bool[] _b = new bool[0]; private Type1Node? _ll_head = null; private Type1Node? _ll_tail = null; @@ -74,7 +76,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { * * @param compare_func an optional element comparator function */ - public PriorityQueue (CompareFunc? compare_func = null) { + public PriorityQueue (owned CompareDataFunc? compare_func = null) { if (compare_func == null) { compare_func = Functions.get_compare_func_for (typeof (G)); } @@ -101,11 +103,18 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { public override bool is_full { get { return false; } } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * {@inheritDoc} */ - public override bool offer (G element) { + public bool offer (G element) { #if DEBUG _dump ("Start offer: %s".printf ((string)element)); #endif @@ -233,9 +242,6 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { #endif // 4. Adjust(Q, P, P) - if (_p == null) { - _p = _r; - } _adjust (_p, _p); // For now we can't have type2 node other than R' (left for reference) @@ -273,7 +279,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { /** * {@inheritDoc} */ - public override int drain (Collection recipient, int amount = -1) { + public int drain (Collection recipient, int amount = -1) { if (amount == -1) { amount = this._size; } @@ -527,7 +533,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { #endif if (_lp_head != null) { - NodePair pair = _lp_head; + unowned NodePair pair = _lp_head; _link (pair.node1, pair.node2); return true; } @@ -589,7 +595,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { #endif } - private void _delete (Node n, out unowned Node prev = null) { + private void _delete (Node n) { // DecreaseKey(Q, N, infinite) _decrease_key (n); @@ -699,12 +705,12 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { node.brothers_next.pair = pair; node.pair = pair; if (_lp_head == null) { - _lp_head = pair; _lp_tail = pair; + _lp_head = (owned)pair; } else { pair.lp_prev = _lp_tail; - _lp_tail.lp_next = pair; - _lp_tail = pair; + _lp_tail.lp_next = (owned)pair; + _lp_tail = _lp_tail.lp_next; } // There is now an even number of child of such degree _b[degree] = false; @@ -764,7 +770,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { // Check whether removed node is P if (node == _p) { - _p = null; + _p = _r; } // Maintain brothers list @@ -791,6 +797,12 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { private void _updated_degree (Type1Node node, bool child_removed) { int degree = node.degree (); + // Ensure proper sizes of A and B + if (degree >= _a.length) { + _a.resize (degree + 1); + _b.resize (degree + 1); + } + // Maintain A and B if (child_removed && _a[degree - 1] == null) { _a[degree - 1] = node; @@ -816,20 +828,20 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { // Maintain LP if (node.pair != null) { - NodePair pair = node.pair; + unowned NodePair pair = node.pair; Type1Node other = (pair.node1 == node ? pair.node2 : pair.node1); node.pair = null; other.pair = null; - if (pair.lp_prev != null) { - pair.lp_prev.lp_next = pair.lp_next; - } else { - _lp_head = pair.lp_next; - } if (pair.lp_next != null) { pair.lp_next.lp_prev = pair.lp_prev; } else { _lp_tail = pair.lp_prev; } + if (pair.lp_prev != null) { + pair.lp_prev.lp_next = (owned)pair.lp_next; + } else { + _lp_head = (owned)pair.lp_next; + } } } @@ -1097,11 +1109,12 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { #endif } + [Compact] private class NodePair { - public weak NodePair? lp_prev = null; + public unowned NodePair? lp_prev = null; public NodePair? lp_next = null; - public Type1Node node1 = null; - public Type1Node node2 = null; + public unowned Type1Node node1 = null; + public unowned Type1Node node2 = null; public NodePair (Type1Node node1, Type1Node node2) { this.node1 = node1; @@ -1109,7 +1122,7 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { } } - private class Iterator : Object, Gee.Iterator { + private class Iterator : Object, Traversable, Gee.Iterator { private PriorityQueue queue; private unowned Node? position; private unowned Node? previous; @@ -1143,13 +1156,6 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { } } - public bool first () { - assert (stamp == queue._stamp); - position = queue._iter_head; - previous = null; - return position != null; - } - public new G get () { assert (stamp == queue._stamp); assert (position != null); @@ -1182,5 +1188,26 @@ public class Gee.PriorityQueue : Gee.AbstractQueue { stamp++; assert (stamp == queue._stamp); } + + public bool read_only { get { return false; } } + + public bool valid { get { return position != null; } } + + public bool foreach (ForallFunc f) { + if (position == null) { + position = (previous != null) ? previous.iter_next : queue._iter_head; + } + if (!f (position.data)) { + return false; + } + while (position.iter_next != null) { + previous = position; + position = position.iter_next; + if (!f (position.data)) { + return false; + } + } + return true; + } } } diff --git a/gee/queue.c b/gee/queue.c index 5971186..8f9a289 100644 --- a/gee/queue.c +++ b/gee/queue.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -59,23 +79,55 @@ typedef struct _GeeCollectionIface GeeCollectionIface; typedef struct _GeeQueue GeeQueue; typedef struct _GeeQueueIface GeeQueueIface; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -87,11 +139,15 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeQueueIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeQueue* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeQueue* self); + GDestroyNotify (*get_g_destroy_func) (GeeQueue* self); gboolean (*offer) (GeeQueue* self, gconstpointer element); gpointer (*peek) (GeeQueue* self); gpointer (*poll) (GeeQueue* self); @@ -103,14 +159,26 @@ struct _GeeQueueIface { +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_queue_get_type (void) G_GNUC_CONST; gboolean gee_queue_offer (GeeQueue* self, gconstpointer element); +static gboolean gee_queue_real_offer (GeeQueue* self, gconstpointer element); +gboolean gee_collection_add (GeeCollection* self, gconstpointer item); gpointer gee_queue_peek (GeeQueue* self); gpointer gee_queue_poll (GeeQueue* self); gint gee_queue_drain (GeeQueue* self, GeeCollection* recipient, gint amount); +static gint gee_queue_real_drain (GeeQueue* self, GeeCollection* recipient, gint amount); #define GEE_QUEUE_UNBOUNDED_CAPACITY (-1) gint gee_queue_get_capacity (GeeQueue* self); gint gee_queue_get_remaining_capacity (GeeQueue* self); @@ -124,6 +192,17 @@ gboolean gee_queue_get_is_full (GeeQueue* self); * * @return ``true`` if the element was added to the queue */ +static gboolean gee_queue_real_offer (GeeQueue* self, gconstpointer element) { + gboolean result = FALSE; + gconstpointer _tmp0_; + gboolean _tmp1_ = FALSE; + _tmp0_ = element; + _tmp1_ = gee_collection_add ((GeeCollection*) self, _tmp0_); + result = _tmp1_; + return result; +} + + gboolean gee_queue_offer (GeeQueue* self, gconstpointer element) { g_return_val_if_fail (self != NULL, FALSE); return GEE_QUEUE_GET_INTERFACE (self)->offer (self, element); @@ -163,6 +242,61 @@ gpointer gee_queue_poll (GeeQueue* self) { * * @return the amount of elements that were actually drained */ +static gint gee_queue_real_drain (GeeQueue* self, GeeCollection* recipient, gint amount) { + gint result = 0; + gpointer item; + gint drained; + g_return_val_if_fail (recipient != NULL, 0); + item = NULL; + drained = 0; + while (TRUE) { + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gint _tmp2_; + gboolean _tmp5_; + gboolean _tmp8_; + GeeCollection* _tmp9_; + gconstpointer _tmp10_; + gint _tmp11_; + _tmp2_ = amount; + if (_tmp2_ == (-1)) { + _tmp1_ = TRUE; + } else { + gint _tmp3_; + gint _tmp4_; + _tmp3_ = amount; + amount = _tmp3_ - 1; + _tmp4_ = amount; + _tmp1_ = _tmp4_ >= 0; + } + _tmp5_ = _tmp1_; + if (_tmp5_) { + gpointer _tmp6_ = NULL; + gconstpointer _tmp7_; + _tmp6_ = gee_queue_poll (self); + ((item == NULL) || (GEE_QUEUE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_QUEUE_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + item = _tmp6_; + _tmp7_ = item; + _tmp0_ = _tmp7_ != NULL; + } else { + _tmp0_ = FALSE; + } + _tmp8_ = _tmp0_; + if (!_tmp8_) { + break; + } + _tmp9_ = recipient; + _tmp10_ = item; + gee_collection_add (_tmp9_, _tmp10_); + _tmp11_ = drained; + drained = _tmp11_ + 1; + } + result = drained; + ((item == NULL) || (GEE_QUEUE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_QUEUE_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + return result; +} + + gint gee_queue_drain (GeeQueue* self, GeeCollection* recipient, gint amount) { g_return_val_if_fail (self != NULL, 0); return GEE_QUEUE_GET_INTERFACE (self)->drain (self, recipient, amount); @@ -204,6 +338,8 @@ static void gee_queue_base_init (GeeQueueIface * iface) { * Specifies whether this queue is full. */ g_object_interface_install_property (iface, g_param_spec_boolean ("is-full", "is-full", "is-full", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + iface->offer = gee_queue_real_offer; + iface->drain = gee_queue_real_drain; } } diff --git a/gee/queue.vala b/gee/queue.vala index 787f80a..3658e67 100644 --- a/gee/queue.vala +++ b/gee/queue.vala @@ -43,6 +43,7 @@ * inserted into a Queue, as ``null`` is also used as a special return value by * the poll method to indicate that the queue contains no elements. */ +[GenericAccessors] public interface Gee.Queue : Collection { /** @@ -73,7 +74,9 @@ public interface Gee.Queue : Collection { * * @return ``true`` if the element was added to the queue */ - public abstract bool offer (G element); + public virtual bool offer (G element) { + return add (element); + } /** * Peeks (retrieves, but not remove) an element from this queue. @@ -100,5 +103,13 @@ public interface Gee.Queue : Collection { * * @return the amount of elements that were actually drained */ - public abstract int drain (Collection recipient, int amount = -1); + public virtual int drain (Collection recipient, int amount = -1) { + G? item = null; + int drained = 0; + while((amount == -1 || --amount >= 0) && (item = poll ()) != null) { + recipient.add (item); + drained++; + } + return drained; + } } diff --git a/gee/readonlybidirlist.c b/gee/readonlybidirlist.c new file mode 100644 index 0000000..cbe4986 --- /dev/null +++ b/gee/readonlybidirlist.c @@ -0,0 +1,795 @@ +/* readonlybidirlist.c generated by valac 0.18.0, the Vala compiler + * generated from readonlybidirlist.vala, do not modify */ + +/* readonlybidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; + +#define GEE_TYPE_LIST (gee_list_get_type ()) +#define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList)) +#define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST)) +#define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface)) + +typedef struct _GeeList GeeList; +typedef struct _GeeListIface GeeListIface; + +#define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) +#define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) +#define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) +#define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface)) + +typedef struct _GeeListIterator GeeListIterator; +typedef struct _GeeListIteratorIface GeeListIteratorIface; + +#define GEE_TYPE_READ_ONLY_LIST (gee_read_only_list_get_type ()) +#define GEE_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyList)) +#define GEE_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) +#define GEE_IS_READ_ONLY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_IS_READ_ONLY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_LIST)) +#define GEE_READ_ONLY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_LIST, GeeReadOnlyListClass)) + +typedef struct _GeeReadOnlyList GeeReadOnlyList; +typedef struct _GeeReadOnlyListClass GeeReadOnlyListClass; +typedef struct _GeeReadOnlyListPrivate GeeReadOnlyListPrivate; + +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; + +#define GEE_TYPE_READ_ONLY_BIDIR_LIST (gee_read_only_bidir_list_get_type ()) +#define GEE_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirList)) +#define GEE_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) +#define GEE_IS_READ_ONLY_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_IS_READ_ONLY_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_LIST)) +#define GEE_READ_ONLY_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListClass)) + +typedef struct _GeeReadOnlyBidirList GeeReadOnlyBidirList; +typedef struct _GeeReadOnlyBidirListClass GeeReadOnlyBidirListClass; +typedef struct _GeeReadOnlyBidirListPrivate GeeReadOnlyBidirListPrivate; + +#define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ()) +#define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) + +typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator; +typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass; + +#define GEE_READ_ONLY_LIST_TYPE_ITERATOR (gee_read_only_list_iterator_get_type ()) +#define GEE_READ_ONLY_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIterator)) +#define GEE_READ_ONLY_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIteratorClass)) +#define GEE_READ_ONLY_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIteratorClass)) + +typedef struct _GeeReadOnlyListIterator GeeReadOnlyListIterator; +typedef struct _GeeReadOnlyListIteratorClass GeeReadOnlyListIteratorClass; + +#define GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR (gee_read_only_bidir_list_iterator_get_type ()) +#define GEE_READ_ONLY_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIterator)) +#define GEE_READ_ONLY_BIDIR_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIteratorClass)) +#define GEE_READ_ONLY_BIDIR_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIteratorClass)) + +typedef struct _GeeReadOnlyBidirListIterator GeeReadOnlyBidirListIterator; +typedef struct _GeeReadOnlyBidirListIteratorClass GeeReadOnlyBidirListIteratorClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _GeeReadOnlyCollectionIteratorPrivate GeeReadOnlyCollectionIteratorPrivate; +typedef struct _GeeReadOnlyListIteratorPrivate GeeReadOnlyListIteratorPrivate; +typedef struct _GeeReadOnlyBidirListIteratorPrivate GeeReadOnlyBidirListIteratorPrivate; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeReadOnlyCollection { + GObject parent_instance; + GeeReadOnlyCollectionPrivate * priv; + GeeCollection* _collection; +}; + +struct _GeeReadOnlyCollectionClass { + GObjectClass parent_class; + GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); +}; + +struct _GeeListIteratorIface { + GTypeInterface parent_iface; + void (*set) (GeeListIterator* self, gconstpointer item); + void (*add) (GeeListIterator* self, gconstpointer item); + gint (*index) (GeeListIterator* self); +}; + +struct _GeeListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); + GeeListIterator* (*list_iterator) (GeeList* self); + gpointer (*get) (GeeList* self, gint index); + void (*set) (GeeList* self, gint index, gconstpointer item); + gint (*index_of) (GeeList* self, gconstpointer item); + void (*insert) (GeeList* self, gint index, gconstpointer item); + gpointer (*remove_at) (GeeList* self, gint index); + GeeList* (*slice) (GeeList* self, gint start, gint stop); + gpointer (*first) (GeeList* self); + gpointer (*last) (GeeList* self); + void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); + GeeList* (*get_read_only_view) (GeeList* self); +}; + +struct _GeeReadOnlyList { + GeeReadOnlyCollection parent_instance; + GeeReadOnlyListPrivate * priv; +}; + +struct _GeeReadOnlyListClass { + GeeReadOnlyCollectionClass parent_class; + GeeList* (*get_read_only_view) (GeeReadOnlyList* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeReadOnlyBidirList { + GeeReadOnlyList parent_instance; + GeeReadOnlyBidirListPrivate * priv; +}; + +struct _GeeReadOnlyBidirListClass { + GeeReadOnlyListClass parent_class; + GeeBidirList* (*get_read_only_view) (GeeReadOnlyBidirList* self); +}; + +struct _GeeReadOnlyBidirListPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeReadOnlyCollectionIterator { + GObject parent_instance; + GeeReadOnlyCollectionIteratorPrivate * priv; + GeeIterator* _iter; +}; + +struct _GeeReadOnlyCollectionIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeReadOnlyListIterator { + GeeReadOnlyCollectionIterator parent_instance; + GeeReadOnlyListIteratorPrivate * priv; +}; + +struct _GeeReadOnlyListIteratorClass { + GeeReadOnlyCollectionIteratorClass parent_class; +}; + +struct _GeeReadOnlyBidirListIterator { + GeeReadOnlyListIterator parent_instance; + GeeReadOnlyBidirListIteratorPrivate * priv; +}; + +struct _GeeReadOnlyBidirListIteratorClass { + GeeReadOnlyListIteratorClass parent_class; +}; + +struct _GeeReadOnlyBidirListIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + + +static gpointer gee_read_only_bidir_list_parent_class = NULL; +static gpointer gee_read_only_bidir_list_iterator_parent_class = NULL; +static GeeBidirIteratorIface* gee_read_only_bidir_list_iterator_gee_bidir_iterator_parent_iface = NULL; +static GeeBidirListIteratorIface* gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_parent_iface = NULL; +static GeeBidirListIface* gee_read_only_bidir_list_gee_bidir_list_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_list_get_type (void) G_GNUC_CONST; +GType gee_read_only_list_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_list_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_BIDIR_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirListPrivate)) +enum { + GEE_READ_ONLY_BIDIR_LIST_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_LIST_G_TYPE, + GEE_READ_ONLY_BIDIR_LIST_G_DUP_FUNC, + GEE_READ_ONLY_BIDIR_LIST_G_DESTROY_FUNC, + GEE_READ_ONLY_BIDIR_LIST_READ_ONLY_VIEW +}; +GeeReadOnlyBidirList* gee_read_only_bidir_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GeeReadOnlyBidirList* gee_read_only_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list); +GeeReadOnlyList* gee_read_only_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list); +GeeReadOnlyList* gee_read_only_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list); +static GeeBidirListIterator* gee_read_only_bidir_list_real_bidir_list_iterator (GeeBidirList* base); +GeeBidirListIterator* gee_bidir_list_bidir_list_iterator (GeeBidirList* self); +static GeeReadOnlyBidirListIterator* gee_read_only_bidir_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +static GeeReadOnlyBidirListIterator* gee_read_only_bidir_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST; +GType gee_read_only_list_iterator_get_type (void) G_GNUC_CONST; +static GType gee_read_only_bidir_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +GeeBidirList* gee_read_only_bidir_list_get_read_only_view (GeeReadOnlyBidirList* self); +#define GEE_READ_ONLY_BIDIR_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIteratorPrivate)) +enum { + GEE_READ_ONLY_BIDIR_LIST_ITERATOR_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_TYPE, + GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DUP_FUNC, + GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DESTROY_FUNC +}; +GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +static gboolean gee_read_only_bidir_list_iterator_real_previous (GeeBidirIterator* base); +gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_list_iterator_real_has_previous (GeeBidirIterator* base); +gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_list_iterator_real_first (GeeBidirIterator* base); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_list_iterator_real_last (GeeBidirIterator* base); +gboolean gee_bidir_iterator_last (GeeBidirIterator* self); +static void gee_read_only_bidir_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item); +static void _vala_gee_read_only_bidir_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only list that mirrors the content of the specified + * list. + * + * @param list the list to decorate. + */ +GeeReadOnlyBidirList* gee_read_only_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list) { + GeeReadOnlyBidirList * self = NULL; + GeeBidirList* _tmp0_; + g_return_val_if_fail (list != NULL, NULL); + _tmp0_ = list; + self = (GeeReadOnlyBidirList*) gee_read_only_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeList*) _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeReadOnlyBidirList* gee_read_only_bidir_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirList* list) { + return gee_read_only_bidir_list_construct (GEE_TYPE_READ_ONLY_BIDIR_LIST, g_type, g_dup_func, g_destroy_func, list); +} + + +/** + * {@inheritDoc} + */ +static GeeBidirListIterator* gee_read_only_bidir_list_real_bidir_list_iterator (GeeBidirList* base) { + GeeReadOnlyBidirList * self; + GeeBidirListIterator* result = NULL; + GeeCollection* _tmp0_; + GeeBidirListIterator* _tmp1_ = NULL; + GeeBidirListIterator* _tmp2_; + GeeReadOnlyBidirListIterator* _tmp3_; + GeeBidirListIterator* _tmp4_; + self = (GeeReadOnlyBidirList*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = gee_bidir_list_bidir_list_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_LIST, GeeBidirList)); + _tmp2_ = _tmp1_; + _tmp3_ = gee_read_only_bidir_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, (GeeListIterator*) _tmp2_); + _tmp4_ = (GeeBidirListIterator*) _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; +} + + +GeeBidirList* gee_read_only_bidir_list_get_read_only_view (GeeReadOnlyBidirList* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_READ_ONLY_BIDIR_LIST_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeBidirList* gee_read_only_bidir_list_real_get_read_only_view (GeeReadOnlyBidirList* base) { + GeeBidirList* result; + GeeReadOnlyBidirList* self; + GeeBidirList* _tmp0_; + self = base; + _tmp0_ = _g_object_ref0 ((GeeBidirList*) self); + result = _tmp0_; + return result; +} + + +static GeeReadOnlyBidirListIterator* gee_read_only_bidir_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { + GeeReadOnlyBidirListIterator * self = NULL; + GeeListIterator* _tmp0_; + g_return_val_if_fail (iterator != NULL, NULL); + _tmp0_ = iterator; + self = (GeeReadOnlyBidirListIterator*) gee_read_only_list_iterator_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +static GeeReadOnlyBidirListIterator* gee_read_only_bidir_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { + return gee_read_only_bidir_list_iterator_construct (GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iterator); +} + + +static gboolean gee_read_only_bidir_list_iterator_real_previous (GeeBidirIterator* base) { + GeeReadOnlyBidirListIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirListIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_previous (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_list_iterator_real_has_previous (GeeBidirIterator* base) { + GeeReadOnlyBidirListIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirListIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_has_previous (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_list_iterator_real_first (GeeBidirIterator* base) { + GeeReadOnlyBidirListIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirListIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_first (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_list_iterator_real_last (GeeBidirIterator* base) { + GeeReadOnlyBidirListIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirListIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_last (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)); + result = _tmp1_; + return result; +} + + +static void gee_read_only_bidir_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item) { + GeeReadOnlyBidirListIterator * self; + self = (GeeReadOnlyBidirListIterator*) base; + g_assert_not_reached (); +} + + +static void gee_read_only_bidir_list_iterator_class_init (GeeReadOnlyBidirListIteratorClass * klass) { + gee_read_only_bidir_list_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirListIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_list_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_list_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_type (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_dup_func (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_destroy_func (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_bidir_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_read_only_bidir_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_real_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_real_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_real_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_iterator_get_g_destroy_func; +} + + +static GType gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_type (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_dup_func (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_destroy_func (GeeReadOnlyBidirListIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface) { + gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->insert = (void (*)(GeeBidirListIterator*, gconstpointer)) gee_read_only_bidir_list_iterator_real_insert; + iface->get_g_type = (GType(*)(GeeBidirListIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirListIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirListIterator*)) gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_get_g_destroy_func; +} + + +static void gee_read_only_bidir_list_iterator_instance_init (GeeReadOnlyBidirListIterator * self) { + self->priv = GEE_READ_ONLY_BIDIR_LIST_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_read_only_bidir_list_iterator_get_type (void) { + static volatile gsize gee_read_only_bidir_list_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_list_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirListIterator), 0, (GInstanceInitFunc) gee_read_only_bidir_list_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_read_only_bidir_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gee_read_only_bidir_list_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_list_iterator_type_id; + gee_read_only_bidir_list_iterator_type_id = g_type_register_static (GEE_READ_ONLY_LIST_TYPE_ITERATOR, "GeeReadOnlyBidirListIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_type_add_interface_static (gee_read_only_bidir_list_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info); + g_once_init_leave (&gee_read_only_bidir_list_iterator_type_id__volatile, gee_read_only_bidir_list_iterator_type_id); + } + return gee_read_only_bidir_list_iterator_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirListIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirListIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_LIST_TYPE_ITERATOR, GeeReadOnlyBidirListIterator); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_LIST_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void gee_read_only_bidir_list_class_init (GeeReadOnlyBidirListClass * klass) { + gee_read_only_bidir_list_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirListPrivate)); + GEE_READ_ONLY_BIDIR_LIST_CLASS (klass)->get_read_only_view = gee_read_only_bidir_list_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_list_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_list_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * The read-only view of this list. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_LIST_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_BIDIR_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_bidir_list_gee_bidir_list_get_g_type (GeeReadOnlyBidirList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_list_gee_bidir_list_get_g_dup_func (GeeReadOnlyBidirList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_list_gee_bidir_list_get_g_destroy_func (GeeReadOnlyBidirList* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_bidir_list_gee_bidir_list_interface_init (GeeBidirListIface * iface) { + gee_read_only_bidir_list_gee_bidir_list_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_list_iterator = (GeeBidirListIterator* (*)(GeeBidirList*)) gee_read_only_bidir_list_real_bidir_list_iterator; + iface->get_g_type = (GType(*)(GeeBidirList*)) gee_read_only_bidir_list_gee_bidir_list_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirList*)) gee_read_only_bidir_list_gee_bidir_list_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirList*)) gee_read_only_bidir_list_gee_bidir_list_get_g_destroy_func; + iface->get_read_only_view = (GeeBidirList* (*) (GeeBidirList *)) gee_read_only_bidir_list_get_read_only_view; +} + + +static void gee_read_only_bidir_list_instance_init (GeeReadOnlyBidirList * self) { + self->priv = GEE_READ_ONLY_BIDIR_LIST_GET_PRIVATE (self); +} + + +GType gee_read_only_bidir_list_get_type (void) { + static volatile gsize gee_read_only_bidir_list_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_list_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirList), 0, (GInstanceInitFunc) gee_read_only_bidir_list_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_list_info = { (GInterfaceInitFunc) gee_read_only_bidir_list_gee_bidir_list_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_list_type_id; + gee_read_only_bidir_list_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_LIST, "GeeReadOnlyBidirList", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_list_type_id, GEE_TYPE_BIDIR_LIST, &gee_bidir_list_info); + g_once_init_leave (&gee_read_only_bidir_list_type_id__volatile, gee_read_only_bidir_list_type_id); + } + return gee_read_only_bidir_list_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirList); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_LIST_READ_ONLY_VIEW: + g_value_take_object (value, gee_read_only_bidir_list_get_read_only_view (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirList * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_LIST, GeeReadOnlyBidirList); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_LIST_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_LIST_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_LIST_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlybidirlist.vala b/gee/readonlybidirlist.vala new file mode 100644 index 0000000..f516171 --- /dev/null +++ b/gee/readonlybidirlist.vala @@ -0,0 +1,73 @@ +/* readonlybidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +internal class Gee.ReadOnlyBidirList : Gee.ReadOnlyList, BidirList { + + /** + * Constructs a read-only list that mirrors the content of the specified + * list. + * + * @param list the list to decorate. + */ + public ReadOnlyBidirList (BidirList list) { + base (list); + } + + /** + * {@inheritDoc} + */ + public BidirListIterator bidir_list_iterator () { + return new Iterator (((Gee.BidirList) _collection).bidir_list_iterator ()); + } + + /** + * The read-only view of this list. + */ + public virtual new BidirList read_only_view { owned get { return this; } } + + private class Iterator : ReadOnlyList.Iterator, BidirIterator, BidirListIterator { + public Iterator (ListIterator iterator) { + base (iterator); + } + + public bool previous () { + return ((BidirIterator) _iter).previous (); + } + + public bool has_previous () { + return ((BidirIterator) _iter).has_previous (); + } + + public bool first () { + return ((BidirIterator) _iter).first (); + } + + public bool last () { + return ((BidirIterator) _iter).last (); + } + + public void insert (G item) { + assert_not_reached (); + } + } +} + diff --git a/gee/readonlybidirsortedmap.c b/gee/readonlybidirsortedmap.c new file mode 100644 index 0000000..fb7726c --- /dev/null +++ b/gee/readonlybidirsortedmap.c @@ -0,0 +1,879 @@ +/* readonlybidirsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from readonlybidirsortedmap.vala, do not modify */ + +/* readonlybidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ()) +#define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap)) +#define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) +#define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) + +typedef struct _GeeReadOnlyMap GeeReadOnlyMap; +typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; +typedef struct _GeeReadOnlyMapPrivate GeeReadOnlyMapPrivate; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ()) +#define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap)) +#define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) +#define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) + +typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap; +typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass; +typedef struct _GeeReadOnlySortedMapPrivate GeeReadOnlySortedMapPrivate; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP (gee_read_only_bidir_sorted_map_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMap)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapClass)) + +typedef struct _GeeReadOnlyBidirSortedMap GeeReadOnlyBidirSortedMap; +typedef struct _GeeReadOnlyBidirSortedMapClass GeeReadOnlyBidirSortedMapClass; +typedef struct _GeeReadOnlyBidirSortedMapPrivate GeeReadOnlyBidirSortedMapPrivate; + +#define GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR (gee_read_only_map_map_iterator_get_type ()) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIterator)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) + +typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator; +typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass; + +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR (gee_read_only_bidir_sorted_map_bidir_map_iterator_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIterator)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIteratorClass)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_IS_BIDIR_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIteratorClass)) + +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIterator GeeReadOnlyBidirSortedMapBidirMapIterator; +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIteratorClass GeeReadOnlyBidirSortedMapBidirMapIteratorClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _GeeReadOnlyMapMapIteratorPrivate GeeReadOnlyMapMapIteratorPrivate; +typedef struct _GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeReadOnlyMap { + GObject parent_instance; + GeeReadOnlyMapPrivate * priv; + GeeMap* _map; +}; + +struct _GeeReadOnlyMapClass { + GObjectClass parent_class; + GeeMap* (*get_read_only_view) (GeeReadOnlyMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeReadOnlySortedMap { + GeeReadOnlyMap parent_instance; + GeeReadOnlySortedMapPrivate * priv; +}; + +struct _GeeReadOnlySortedMapClass { + GeeReadOnlyMapClass parent_class; +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +struct _GeeReadOnlyBidirSortedMap { + GeeReadOnlySortedMap parent_instance; + GeeReadOnlyBidirSortedMapPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedMapClass { + GeeReadOnlySortedMapClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + +struct _GeeReadOnlyMapMapIterator { + GObject parent_instance; + GeeReadOnlyMapMapIteratorPrivate * priv; + GeeMapIterator* _iter; +}; + +struct _GeeReadOnlyMapMapIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedMapBidirMapIterator { + GeeReadOnlyMapMapIterator parent_instance; + GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedMapBidirMapIteratorClass { + GeeReadOnlyMapMapIteratorClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + + +static gpointer gee_read_only_bidir_sorted_map_parent_class = NULL; +static gpointer gee_read_only_bidir_sorted_map_bidir_map_iterator_parent_class = NULL; +static GeeBidirMapIteratorIface* gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_parent_iface = NULL; +static GeeBidirSortedMapIface* gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_map_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMapPrivate)) +enum { + GEE_READ_ONLY_BIDIR_SORTED_MAP_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_SORTED_MAP_K_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DESTROY_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_V_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DESTROY_FUNC +}; +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map); +GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +static GeeBidirMapIterator* gee_read_only_bidir_sorted_map_real_bidir_map_iterator (GeeBidirSortedMap* base); +GeeBidirMapIterator* gee_bidir_sorted_map_bidir_map_iterator (GeeBidirSortedMap* self); +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator); +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator); +GType gee_read_only_map_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_map_bidir_map_iterator_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate)) +enum { + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DESTROY_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DESTROY_FUNC +}; +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_first (GeeBidirMapIterator* base); +gboolean gee_bidir_map_iterator_first (GeeBidirMapIterator* self); +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_previous (GeeBidirMapIterator* base); +gboolean gee_bidir_map_iterator_previous (GeeBidirMapIterator* self); +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_has_previous (GeeBidirMapIterator* base); +gboolean gee_bidir_map_iterator_has_previous (GeeBidirMapIterator* self); +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_last (GeeBidirMapIterator* base); +gboolean gee_bidir_map_iterator_last (GeeBidirMapIterator* self); +static void _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +GeeMap* gee_read_only_map_get_read_only_view (GeeReadOnlyMap* self); +static void _vala_gee_read_only_bidir_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only map that mirrors the content of the specified map. + * + * @param set the set to decorate. + */ +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map) { + GeeReadOnlyBidirSortedMap * self = NULL; + GeeBidirSortedMap* _tmp0_; + g_return_val_if_fail (map != NULL, NULL); + _tmp0_ = map; + self = (GeeReadOnlyBidirSortedMap*) gee_read_only_sorted_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMap*) _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +GeeReadOnlyBidirSortedMap* gee_read_only_bidir_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirSortedMap* map) { + return gee_read_only_bidir_sorted_map_construct (GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +/** + * {@inheritDoc} + */ +static GeeBidirMapIterator* gee_read_only_bidir_sorted_map_real_bidir_map_iterator (GeeBidirSortedMap* base) { + GeeReadOnlyBidirSortedMap * self; + GeeBidirMapIterator* result = NULL; + GeeMap* _tmp0_; + GeeBidirMapIterator* _tmp1_ = NULL; + GeeBidirMapIterator* _tmp2_; + GeeReadOnlyBidirSortedMapBidirMapIterator* _tmp3_; + GeeBidirMapIterator* _tmp4_; + self = (GeeReadOnlyBidirSortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = gee_bidir_sorted_map_bidir_map_iterator (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp0_) : NULL); + _tmp2_ = _tmp1_; + _tmp3_ = gee_read_only_bidir_sorted_map_bidir_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + _tmp4_ = (GeeBidirMapIterator*) _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; +} + + +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self = NULL; + GeeBidirMapIterator* _tmp0_; + g_return_val_if_fail (iterator != NULL, NULL); + _tmp0_ = iterator; + self = (GeeReadOnlyBidirSortedMapBidirMapIterator*) gee_read_only_map_map_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMapIterator*) _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +GeeReadOnlyBidirSortedMapBidirMapIterator* gee_read_only_bidir_sorted_map_bidir_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeBidirMapIterator* iterator) { + return gee_read_only_bidir_sorted_map_bidir_map_iterator_construct (GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, iterator); +} + + +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_first (GeeBidirMapIterator* base) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + gboolean result = FALSE; + GeeMapIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedMapBidirMapIterator*) base; + _tmp0_ = ((GeeReadOnlyMapMapIterator*) self)->_iter; + _tmp1_ = gee_bidir_map_iterator_first (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_MAP_ITERATOR) ? ((GeeBidirMapIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_previous (GeeBidirMapIterator* base) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + gboolean result = FALSE; + GeeMapIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedMapBidirMapIterator*) base; + _tmp0_ = ((GeeReadOnlyMapMapIterator*) self)->_iter; + _tmp1_ = gee_bidir_map_iterator_previous (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_MAP_ITERATOR) ? ((GeeBidirMapIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_has_previous (GeeBidirMapIterator* base) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + gboolean result = FALSE; + GeeMapIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedMapBidirMapIterator*) base; + _tmp0_ = ((GeeReadOnlyMapMapIterator*) self)->_iter; + _tmp1_ = gee_bidir_map_iterator_has_previous (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_MAP_ITERATOR) ? ((GeeBidirMapIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_map_bidir_map_iterator_real_last (GeeBidirMapIterator* base) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + gboolean result = FALSE; + GeeMapIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedMapBidirMapIterator*) base; + _tmp0_ = ((GeeReadOnlyMapMapIterator*) self)->_iter; + _tmp1_ = gee_bidir_map_iterator_last (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_MAP_ITERATOR) ? ((GeeBidirMapIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static void gee_read_only_bidir_sorted_map_bidir_map_iterator_class_init (GeeReadOnlyBidirSortedMapBidirMapIteratorClass * klass) { + gee_read_only_bidir_sorted_map_bidir_map_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirSortedMapBidirMapIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_type (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_dup_func (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_destroy_func (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_type (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_dup_func (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_destroy_func (GeeReadOnlyBidirSortedMapBidirMapIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_interface_init (GeeBidirMapIteratorIface * iface) { + gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_real_first; + iface->previous = (gboolean (*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_real_previous; + iface->has_previous = (gboolean (*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_real_has_previous; + iface->last = (gboolean (*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_real_last; + iface->get_k_type = (GType(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_get_v_destroy_func; +} + + +static void gee_read_only_bidir_sorted_map_bidir_map_iterator_instance_init (GeeReadOnlyBidirSortedMapBidirMapIterator * self) { + self->priv = GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_GET_PRIVATE (self); +} + + +GType gee_read_only_bidir_sorted_map_bidir_map_iterator_get_type (void) { + static volatile gsize gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirSortedMapBidirMapIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_sorted_map_bidir_map_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirSortedMapBidirMapIterator), 0, (GInstanceInitFunc) gee_read_only_bidir_sorted_map_bidir_map_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_map_iterator_info = { (GInterfaceInitFunc) gee_read_only_bidir_sorted_map_bidir_map_iterator_gee_bidir_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id; + gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id = g_type_register_static (GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, "GeeReadOnlyBidirSortedMapBidirMapIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id, GEE_TYPE_BIDIR_MAP_ITERATOR, &gee_bidir_map_iterator_info); + g_once_init_leave (&gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id__volatile, gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id); + } + return gee_read_only_bidir_sorted_map_bidir_map_iterator_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_sorted_map_bidir_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedMapBidirMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_SORTED_MAP_TYPE_BIDIR_MAP_ITERATOR, GeeReadOnlyBidirSortedMapBidirMapIterator); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_BIDIR_MAP_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void gee_read_only_bidir_sorted_map_class_init (GeeReadOnlyBidirSortedMapClass * klass) { + gee_read_only_bidir_sorted_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirSortedMapPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_sorted_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_sorted_map_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_type (GeeReadOnlyBidirSortedMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_dup_func (GeeReadOnlyBidirSortedMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_destroy_func (GeeReadOnlyBidirSortedMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_type (GeeReadOnlyBidirSortedMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_dup_func (GeeReadOnlyBidirSortedMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_destroy_func (GeeReadOnlyBidirSortedMap* self) { + return self->priv->v_destroy_func; +} + + +static void gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_interface_init (GeeBidirSortedMapIface * iface) { + gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_map_iterator = (GeeBidirMapIterator* (*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_real_bidir_map_iterator; + iface->get_k_type = (GType(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeBidirSortedMap*)) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_get_v_destroy_func; + iface->get_read_only_view = (GeeBidirSortedMap* (*) (GeeBidirSortedMap *)) gee_read_only_map_get_read_only_view; +} + + +static void gee_read_only_bidir_sorted_map_instance_init (GeeReadOnlyBidirSortedMap * self) { + self->priv = GEE_READ_ONLY_BIDIR_SORTED_MAP_GET_PRIVATE (self); +} + + +/** + * Read-only view for {@link BidirSortedMap} collections. + * + * This class decorates any class which implements the {@link BidirSortedMap} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see BidirSortedMap + */ +GType gee_read_only_bidir_sorted_map_get_type (void) { + static volatile gsize gee_read_only_bidir_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirSortedMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_sorted_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirSortedMap), 0, (GInstanceInitFunc) gee_read_only_bidir_sorted_map_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_sorted_map_info = { (GInterfaceInitFunc) gee_read_only_bidir_sorted_map_gee_bidir_sorted_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_sorted_map_type_id; + gee_read_only_bidir_sorted_map_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_SORTED_MAP, "GeeReadOnlyBidirSortedMap", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_sorted_map_type_id, GEE_TYPE_BIDIR_SORTED_MAP, &gee_bidir_sorted_map_info); + g_once_init_leave (&gee_read_only_bidir_sorted_map_type_id__volatile, gee_read_only_bidir_sorted_map_type_id); + } + return gee_read_only_bidir_sorted_map_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMap); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_SORTED_MAP, GeeReadOnlyBidirSortedMap); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_SORTED_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlybidirsortedmap.vala b/gee/readonlybidirsortedmap.vala new file mode 100644 index 0000000..95c0327 --- /dev/null +++ b/gee/readonlybidirsortedmap.vala @@ -0,0 +1,71 @@ +/* readonlybidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Read-only view for {@link BidirSortedMap} collections. + * + * This class decorates any class which implements the {@link BidirSortedMap} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see BidirSortedMap + */ +internal class Gee.ReadOnlyBidirSortedMap : ReadOnlySortedMap, BidirSortedMap { + /** + * Constructs a read-only map that mirrors the content of the specified map. + * + * @param set the set to decorate. + */ + public ReadOnlyBidirSortedMap (BidirSortedMap map) { + base (map); + } + + /** + * {@inheritDoc} + */ + public Gee.BidirMapIterator bidir_map_iterator () { + return new BidirMapIterator ((_map as BidirSortedMap).bidir_map_iterator ()); + } + + protected class BidirMapIterator : Gee.ReadOnlyMap.MapIterator, Gee.BidirMapIterator { + public BidirMapIterator (Gee.BidirMapIterator iterator) { + base (iterator); + } + + public bool first () { + return (_iter as Gee.BidirMapIterator).first (); + } + + public bool previous () { + return (_iter as Gee.BidirMapIterator).previous (); + } + + public bool has_previous () { + return (_iter as Gee.BidirMapIterator).has_previous (); + } + + public bool last () { + return (_iter as Gee.BidirMapIterator).last (); + } + } +} + diff --git a/gee/readonlybidirsortedset.c b/gee/readonlybidirsortedset.c new file mode 100644 index 0000000..4977c02 --- /dev/null +++ b/gee/readonlybidirsortedset.c @@ -0,0 +1,719 @@ +/* readonlybidirsortedset.c generated by valac 0.18.0, the Vala compiler + * generated from readonlybidirsortedset.vala, do not modify */ + +/* readonlybidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ()) +#define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet)) +#define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) +#define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET)) +#define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET)) +#define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) + +typedef struct _GeeReadOnlySet GeeReadOnlySet; +typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; +typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ()) +#define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet)) +#define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) +#define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) + +typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet; +typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass; +typedef struct _GeeReadOnlySortedSetPrivate GeeReadOnlySortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET (gee_read_only_bidir_sorted_set_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSet)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_IS_READ_ONLY_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetClass)) + +typedef struct _GeeReadOnlyBidirSortedSet GeeReadOnlyBidirSortedSet; +typedef struct _GeeReadOnlyBidirSortedSetClass GeeReadOnlyBidirSortedSetClass; +typedef struct _GeeReadOnlyBidirSortedSetPrivate GeeReadOnlyBidirSortedSetPrivate; + +#define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ()) +#define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) + +typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator; +typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass; + +#define GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR (gee_read_only_bidir_sorted_set_bidir_iterator_get_type ()) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIterator)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIteratorClass)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_IS_BIDIR_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR)) +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIteratorClass)) + +typedef struct _GeeReadOnlyBidirSortedSetBidirIterator GeeReadOnlyBidirSortedSetBidirIterator; +typedef struct _GeeReadOnlyBidirSortedSetBidirIteratorClass GeeReadOnlyBidirSortedSetBidirIteratorClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _GeeReadOnlyCollectionIteratorPrivate GeeReadOnlyCollectionIteratorPrivate; +typedef struct _GeeReadOnlyBidirSortedSetBidirIteratorPrivate GeeReadOnlyBidirSortedSetBidirIteratorPrivate; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeReadOnlyCollection { + GObject parent_instance; + GeeReadOnlyCollectionPrivate * priv; + GeeCollection* _collection; +}; + +struct _GeeReadOnlyCollectionClass { + GObjectClass parent_class; + GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeReadOnlySet { + GeeReadOnlyCollection parent_instance; + GeeReadOnlySetPrivate * priv; +}; + +struct _GeeReadOnlySetClass { + GeeReadOnlyCollectionClass parent_class; + GeeSet* (*get_read_only_view) (GeeReadOnlySet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeReadOnlySortedSet { + GeeReadOnlySet parent_instance; + GeeReadOnlySortedSetPrivate * priv; +}; + +struct _GeeReadOnlySortedSetClass { + GeeReadOnlySetClass parent_class; +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeReadOnlyBidirSortedSet { + GeeReadOnlySortedSet parent_instance; + GeeReadOnlyBidirSortedSetPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedSetClass { + GeeReadOnlySortedSetClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + +struct _GeeReadOnlyCollectionIterator { + GObject parent_instance; + GeeReadOnlyCollectionIteratorPrivate * priv; + GeeIterator* _iter; +}; + +struct _GeeReadOnlyCollectionIteratorClass { + GObjectClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedSetBidirIterator { + GeeReadOnlyCollectionIterator parent_instance; + GeeReadOnlyBidirSortedSetBidirIteratorPrivate * priv; +}; + +struct _GeeReadOnlyBidirSortedSetBidirIteratorClass { + GeeReadOnlyCollectionIteratorClass parent_class; +}; + +struct _GeeReadOnlyBidirSortedSetBidirIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + + +static gpointer gee_read_only_bidir_sorted_set_parent_class = NULL; +static gpointer gee_read_only_bidir_sorted_set_bidir_iterator_parent_class = NULL; +static GeeBidirIteratorIface* gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_parent_iface = NULL; +static GeeBidirSortedSetIface* gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_set_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_BIDIR_SORTED_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSetPrivate)) +enum { + GEE_READ_ONLY_BIDIR_SORTED_SET_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_SORTED_SET_G_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_SET_G_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_SET_G_DESTROY_FUNC +}; +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set); +GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +static GeeBidirIterator* gee_read_only_bidir_sorted_set_real_bidir_iterator (GeeBidirSortedSet* base); +GeeBidirIterator* gee_bidir_sorted_set_bidir_iterator (GeeBidirSortedSet* self); +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator); +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator); +GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST; +GType gee_read_only_bidir_sorted_set_bidir_iterator_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIteratorPrivate)) +enum { + GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_DUMMY_PROPERTY, + GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_TYPE, + GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DUP_FUNC, + GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DESTROY_FUNC +}; +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_first (GeeBidirIterator* base); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_previous (GeeBidirIterator* base); +gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_has_previous (GeeBidirIterator* base); +gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_last (GeeBidirIterator* base); +gboolean gee_bidir_iterator_last (GeeBidirIterator* self); +static void _vala_gee_read_only_bidir_sorted_set_bidir_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_sorted_set_bidir_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); +static void _vala_gee_read_only_bidir_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_bidir_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only set that mirrors the content of the specified set. + * + * @param set the set to decorate. + */ +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set) { + GeeReadOnlyBidirSortedSet * self = NULL; + GeeBidirSortedSet* _tmp0_; + g_return_val_if_fail (set != NULL, NULL); + _tmp0_ = set; + self = (GeeReadOnlyBidirSortedSet*) gee_read_only_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeSortedSet*) _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeReadOnlyBidirSortedSet* gee_read_only_bidir_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirSortedSet* set) { + return gee_read_only_bidir_sorted_set_construct (GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, g_type, g_dup_func, g_destroy_func, set); +} + + +/** + * {@inheritDoc} + */ +static GeeBidirIterator* gee_read_only_bidir_sorted_set_real_bidir_iterator (GeeBidirSortedSet* base) { + GeeReadOnlyBidirSortedSet * self; + GeeBidirIterator* result = NULL; + GeeCollection* _tmp0_; + GeeBidirIterator* _tmp1_ = NULL; + GeeBidirIterator* _tmp2_; + GeeReadOnlyBidirSortedSetBidirIterator* _tmp3_; + GeeBidirIterator* _tmp4_; + self = (GeeReadOnlyBidirSortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = gee_bidir_sorted_set_bidir_iterator (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL); + _tmp2_ = _tmp1_; + _tmp3_ = gee_read_only_bidir_sorted_set_bidir_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp2_); + _tmp4_ = (GeeBidirIterator*) _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; +} + + +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator) { + GeeReadOnlyBidirSortedSetBidirIterator * self = NULL; + GeeBidirIterator* _tmp0_; + g_return_val_if_fail (iterator != NULL, NULL); + _tmp0_ = iterator; + self = (GeeReadOnlyBidirSortedSetBidirIterator*) gee_read_only_collection_iterator_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeIterator*) _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeReadOnlyBidirSortedSetBidirIterator* gee_read_only_bidir_sorted_set_bidir_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBidirIterator* iterator) { + return gee_read_only_bidir_sorted_set_bidir_iterator_construct (GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, g_type, g_dup_func, g_destroy_func, iterator); +} + + +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_first (GeeBidirIterator* base) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedSetBidirIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_first (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_ITERATOR) ? ((GeeBidirIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_previous (GeeBidirIterator* base) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedSetBidirIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_previous (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_ITERATOR) ? ((GeeBidirIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_has_previous (GeeBidirIterator* base) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedSetBidirIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_has_previous (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_ITERATOR) ? ((GeeBidirIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static gboolean gee_read_only_bidir_sorted_set_bidir_iterator_real_last (GeeBidirIterator* base) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + gboolean result = FALSE; + GeeIterator* _tmp0_; + gboolean _tmp1_ = FALSE; + self = (GeeReadOnlyBidirSortedSetBidirIterator*) base; + _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; + _tmp1_ = gee_bidir_iterator_last (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_ITERATOR) ? ((GeeBidirIterator*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +static void gee_read_only_bidir_sorted_set_bidir_iterator_class_init (GeeReadOnlyBidirSortedSetBidirIteratorClass * klass) { + gee_read_only_bidir_sorted_set_bidir_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirSortedSetBidirIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_sorted_set_bidir_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_sorted_set_bidir_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_type (GeeReadOnlyBidirSortedSetBidirIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_dup_func (GeeReadOnlyBidirSortedSetBidirIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_destroy_func (GeeReadOnlyBidirSortedSetBidirIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_real_first; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_real_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_real_has_previous; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_get_g_destroy_func; +} + + +static void gee_read_only_bidir_sorted_set_bidir_iterator_instance_init (GeeReadOnlyBidirSortedSetBidirIterator * self) { + self->priv = GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_GET_PRIVATE (self); +} + + +GType gee_read_only_bidir_sorted_set_bidir_iterator_get_type (void) { + static volatile gsize gee_read_only_bidir_sorted_set_bidir_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_sorted_set_bidir_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirSortedSetBidirIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_sorted_set_bidir_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirSortedSetBidirIterator), 0, (GInstanceInitFunc) gee_read_only_bidir_sorted_set_bidir_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_read_only_bidir_sorted_set_bidir_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_sorted_set_bidir_iterator_type_id; + gee_read_only_bidir_sorted_set_bidir_iterator_type_id = g_type_register_static (GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, "GeeReadOnlyBidirSortedSetBidirIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_sorted_set_bidir_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_read_only_bidir_sorted_set_bidir_iterator_type_id__volatile, gee_read_only_bidir_sorted_set_bidir_iterator_type_id); + } + return gee_read_only_bidir_sorted_set_bidir_iterator_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_sorted_set_bidir_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_sorted_set_bidir_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedSetBidirIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_BIDIR_SORTED_SET_TYPE_BIDIR_ITERATOR, GeeReadOnlyBidirSortedSetBidirIterator); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_SET_BIDIR_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void gee_read_only_bidir_sorted_set_class_init (GeeReadOnlyBidirSortedSetClass * klass) { + gee_read_only_bidir_sorted_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyBidirSortedSetPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_bidir_sorted_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_bidir_sorted_set_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_BIDIR_SORTED_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_type (GeeReadOnlyBidirSortedSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_dup_func (GeeReadOnlyBidirSortedSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_destroy_func (GeeReadOnlyBidirSortedSet* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_interface_init (GeeBidirSortedSetIface * iface) { + gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_parent_iface = g_type_interface_peek_parent (iface); + iface->bidir_iterator = (GeeBidirIterator* (*)(GeeBidirSortedSet*)) gee_read_only_bidir_sorted_set_real_bidir_iterator; + iface->get_g_type = (GType(*)(GeeBidirSortedSet*)) gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirSortedSet*)) gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirSortedSet*)) gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_get_g_destroy_func; + iface->get_read_only_view = (GeeBidirSortedSet* (*) (GeeBidirSortedSet *)) gee_sorted_set_get_read_only_view; +} + + +static void gee_read_only_bidir_sorted_set_instance_init (GeeReadOnlyBidirSortedSet * self) { + self->priv = GEE_READ_ONLY_BIDIR_SORTED_SET_GET_PRIVATE (self); +} + + +/** + * Read-only view for {@link BidirSortedSet} collections. + * + * This class decorates any class which implements the {@link BidirSortedSet} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see BidirSortedSet + */ +GType gee_read_only_bidir_sorted_set_get_type (void) { + static volatile gsize gee_read_only_bidir_sorted_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_bidir_sorted_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyBidirSortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_bidir_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyBidirSortedSet), 0, (GInstanceInitFunc) gee_read_only_bidir_sorted_set_instance_init, NULL }; + static const GInterfaceInfo gee_bidir_sorted_set_info = { (GInterfaceInitFunc) gee_read_only_bidir_sorted_set_gee_bidir_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_bidir_sorted_set_type_id; + gee_read_only_bidir_sorted_set_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_SORTED_SET, "GeeReadOnlyBidirSortedSet", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_bidir_sorted_set_type_id, GEE_TYPE_BIDIR_SORTED_SET, &gee_bidir_sorted_set_info); + g_once_init_leave (&gee_read_only_bidir_sorted_set_type_id__volatile, gee_read_only_bidir_sorted_set_type_id); + } + return gee_read_only_bidir_sorted_set_type_id__volatile; +} + + +static void _vala_gee_read_only_bidir_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSet); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_bidir_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyBidirSortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_BIDIR_SORTED_SET, GeeReadOnlyBidirSortedSet); + switch (property_id) { + case GEE_READ_ONLY_BIDIR_SORTED_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_BIDIR_SORTED_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlybidirsortedset.vala b/gee/readonlybidirsortedset.vala new file mode 100644 index 0000000..460ebbe --- /dev/null +++ b/gee/readonlybidirsortedset.vala @@ -0,0 +1,71 @@ +/* readonlybidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Read-only view for {@link BidirSortedSet} collections. + * + * This class decorates any class which implements the {@link BidirSortedSet} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see BidirSortedSet + */ +internal class Gee.ReadOnlyBidirSortedSet : ReadOnlySortedSet, BidirSortedSet { + /** + * Constructs a read-only set that mirrors the content of the specified set. + * + * @param set the set to decorate. + */ + public ReadOnlyBidirSortedSet (BidirSortedSet set) { + base (set); + } + + /** + * {@inheritDoc} + */ + public Gee.BidirIterator bidir_iterator () { + return new BidirIterator ((_collection as BidirSortedSet).bidir_iterator ()); + } + + protected class BidirIterator : Gee.ReadOnlyCollection.Iterator, Gee.BidirIterator { + public BidirIterator (Gee.BidirIterator iterator) { + base (iterator); + } + + public bool first () { + return (_iter as Gee.BidirIterator).first (); + } + + public bool previous () { + return (_iter as Gee.BidirIterator).previous (); + } + + public bool has_previous () { + return (_iter as Gee.BidirIterator).has_previous (); + } + + public bool last () { + return (_iter as Gee.BidirIterator).last (); + } + } +} + diff --git a/gee/readonlycollection.c b/gee/readonlycollection.c index ba291ce..a5cf070 100644 --- a/gee/readonlycollection.c +++ b/gee/readonlycollection.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -74,23 +94,55 @@ typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator; typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass; typedef struct _GeeReadOnlyCollectionIteratorPrivate GeeReadOnlyCollectionIteratorPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -102,6 +154,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -141,11 +194,22 @@ struct _GeeReadOnlyCollectionIteratorPrivate { static gpointer gee_read_only_collection_parent_class = NULL; static gpointer gee_read_only_collection_iterator_parent_class = NULL; +static GeeTraversableIface* gee_read_only_collection_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_read_only_collection_iterator_gee_iterator_parent_iface = NULL; +static GeeTraversableIface* gee_read_only_collection_gee_traversable_parent_iface = NULL; static GeeIterableIface* gee_read_only_collection_gee_iterable_parent_iface = NULL; static GeeCollectionIface* gee_read_only_collection_gee_collection_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_read_only_collection_get_type (void) G_GNUC_CONST; @@ -156,12 +220,19 @@ enum { GEE_READ_ONLY_COLLECTION_G_DUP_FUNC, GEE_READ_ONLY_COLLECTION_G_DESTROY_FUNC, GEE_READ_ONLY_COLLECTION_SIZE, - GEE_READ_ONLY_COLLECTION_IS_EMPTY, - GEE_READ_ONLY_COLLECTION_ELEMENT_TYPE, + GEE_READ_ONLY_COLLECTION_READ_ONLY, GEE_READ_ONLY_COLLECTION_READ_ONLY_VIEW }; GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); +static gboolean gee_read_only_collection_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static GeeIterator* gee_read_only_collection_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_read_only_collection_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify); +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +static GeeIterator* gee_read_only_collection_real_chop (GeeTraversable* base, gint offset, gint length); +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length); static GeeIterator* gee_read_only_collection_real_iterator (GeeIterable* base); GeeIterator* gee_iterable_iterator (GeeIterable* self); GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); @@ -187,22 +258,28 @@ enum { GEE_READ_ONLY_COLLECTION_ITERATOR_DUMMY_PROPERTY, GEE_READ_ONLY_COLLECTION_ITERATOR_G_TYPE, GEE_READ_ONLY_COLLECTION_ITERATOR_G_DUP_FUNC, - GEE_READ_ONLY_COLLECTION_ITERATOR_G_DESTROY_FUNC + GEE_READ_ONLY_COLLECTION_ITERATOR_G_DESTROY_FUNC, + GEE_READ_ONLY_COLLECTION_ITERATOR_VALID, + GEE_READ_ONLY_COLLECTION_ITERATOR_READ_ONLY }; static gboolean gee_read_only_collection_iterator_real_next (GeeIterator* base); gboolean gee_iterator_next (GeeIterator* self); static gboolean gee_read_only_collection_iterator_real_has_next (GeeIterator* base); gboolean gee_iterator_has_next (GeeIterator* self); -static gboolean gee_read_only_collection_iterator_real_first (GeeIterator* base); -gboolean gee_iterator_first (GeeIterator* self); static gpointer gee_read_only_collection_iterator_real_get (GeeIterator* base); gpointer gee_iterator_get (GeeIterator* self); static void gee_read_only_collection_iterator_real_remove (GeeIterator* base); +static gboolean gee_read_only_collection_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static GeeIterator* gee_read_only_collection_iterator_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_read_only_collection_iterator_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_read_only_collection_iterator_real_chop (GeeTraversable* base, gint offset, gint length); +gboolean gee_iterator_get_valid (GeeIterator* self); static void gee_read_only_collection_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_read_only (GeeIterator* self); static void _vala_gee_read_only_collection_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_read_only_collection_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_read_only_collection_finalize (GObject* obj); -GType gee_iterable_get_element_type (GeeIterable* self); +gboolean gee_collection_get_read_only (GeeCollection* self); static void _vala_gee_read_only_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_read_only_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -240,6 +317,100 @@ GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFun } +/** + * {@inheritDoc} + */ +static gboolean gee_read_only_collection_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeReadOnlyCollection * self; + gboolean result = FALSE; + GeeCollection* _tmp0_; + GeeForallFunc _tmp1_; + void* _tmp1__target; + gboolean _tmp2_ = FALSE; + self = (GeeReadOnlyCollection*) base; + _tmp0_ = self->_collection; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_read_only_collection_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeReadOnlyCollection * self; + GeeIterator* result = NULL; + GeeCollection* _tmp0_; + GeeStreamFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; + self = (GeeReadOnlyCollection*) base; + _tmp0_ = self->_collection; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_stream ((GeeTraversable*) _tmp0_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_read_only_collection_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeReadOnlyCollection * self; + GeeIterator* result = NULL; + GeeCollection* _tmp0_; + GeePredicate _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; + self = (GeeReadOnlyCollection*) base; + _tmp0_ = self->_collection; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_filter ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_read_only_collection_real_chop (GeeTraversable* base, gint offset, gint length) { + GeeReadOnlyCollection * self; + GeeIterator* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeIterator* _tmp3_ = NULL; + self = (GeeReadOnlyCollection*) base; + _tmp0_ = self->_collection; + _tmp1_ = offset; + _tmp2_ = length; + _tmp3_ = gee_traversable_chop ((GeeTraversable*) _tmp0_, _tmp1_, _tmp2_); + result = _tmp3_; + return result; +} + + /** * {@inheritDoc} */ @@ -427,7 +598,16 @@ static gboolean gee_read_only_collection_real_get_is_empty (GeeCollection* base) } -static GType gee_read_only_collection_real_get_element_type (GeeIterable* base) { +static gboolean gee_read_only_collection_real_get_read_only (GeeCollection* base) { + gboolean result; + GeeReadOnlyCollection* self; + self = (GeeReadOnlyCollection*) base; + result = TRUE; + return result; +} + + +static GType gee_read_only_collection_real_get_element_type (GeeTraversable* base) { GType result; GeeReadOnlyCollection* self; self = (GeeReadOnlyCollection*) base; @@ -501,36 +681,138 @@ static gboolean gee_read_only_collection_iterator_real_has_next (GeeIterator* ba } -static gboolean gee_read_only_collection_iterator_real_first (GeeIterator* base) { +static gpointer gee_read_only_collection_iterator_real_get (GeeIterator* base) { GeeReadOnlyCollectionIterator * self; - gboolean result = FALSE; + gpointer result = NULL; GeeIterator* _tmp0_; - gboolean _tmp1_ = FALSE; + gpointer _tmp1_ = NULL; self = (GeeReadOnlyCollectionIterator*) base; _tmp0_ = self->_iter; - _tmp1_ = gee_iterator_first (_tmp0_); + _tmp1_ = gee_iterator_get (_tmp0_); result = _tmp1_; return result; } -static gpointer gee_read_only_collection_iterator_real_get (GeeIterator* base) { +static void gee_read_only_collection_iterator_real_remove (GeeIterator* base) { GeeReadOnlyCollectionIterator * self; - gpointer result = NULL; + self = (GeeReadOnlyCollectionIterator*) base; + g_assert_not_reached (); +} + + +static gboolean gee_read_only_collection_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeReadOnlyCollectionIterator * self; + gboolean result = FALSE; GeeIterator* _tmp0_; - gpointer _tmp1_ = NULL; + GeeForallFunc _tmp1_; + void* _tmp1__target; + gboolean _tmp2_ = FALSE; self = (GeeReadOnlyCollectionIterator*) base; _tmp0_ = self->_iter; - _tmp1_ = gee_iterator_get (_tmp0_); - result = _tmp1_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target); + result = _tmp2_; return result; } -static void gee_read_only_collection_iterator_real_remove (GeeIterator* base) { +static GeeIterator* gee_read_only_collection_iterator_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { GeeReadOnlyCollectionIterator * self; + GeeIterator* result = NULL; + GeeIterator* _tmp0_; + GeeStreamFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; self = (GeeReadOnlyCollectionIterator*) base; - g_assert_not_reached (); + _tmp0_ = self->_iter; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_stream ((GeeTraversable*) _tmp0_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +static GeeIterator* gee_read_only_collection_iterator_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeReadOnlyCollectionIterator * self; + GeeIterator* result = NULL; + GeeIterator* _tmp0_; + GeePredicate _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; + self = (GeeReadOnlyCollectionIterator*) base; + _tmp0_ = self->_iter; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_filter ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +static GeeIterator* gee_read_only_collection_iterator_real_chop (GeeTraversable* base, gint offset, gint length) { + GeeReadOnlyCollectionIterator * self; + GeeIterator* result = NULL; + GeeIterator* _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeIterator* _tmp3_ = NULL; + self = (GeeReadOnlyCollectionIterator*) base; + _tmp0_ = self->_iter; + _tmp1_ = offset; + _tmp2_ = length; + _tmp3_ = gee_traversable_chop ((GeeTraversable*) _tmp0_, _tmp1_, _tmp2_); + result = _tmp3_; + return result; +} + + +static gboolean gee_read_only_collection_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeReadOnlyCollectionIterator* self; + GeeIterator* _tmp0_; + gboolean _tmp1_; + gboolean _tmp2_; + self = (GeeReadOnlyCollectionIterator*) base; + _tmp0_ = self->_iter; + _tmp1_ = gee_iterator_get_valid (_tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_read_only_collection_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeReadOnlyCollectionIterator* self; + self = (GeeReadOnlyCollectionIterator*) base; + result = TRUE; + return result; +} + + +static GType gee_read_only_collection_iterator_real_get_element_type (GeeTraversable* base) { + GType result; + GeeReadOnlyCollectionIterator* self; + self = (GeeReadOnlyCollectionIterator*) base; + result = self->priv->g_type; + return result; } @@ -543,6 +825,36 @@ static void gee_read_only_collection_iterator_class_init (GeeReadOnlyCollectionI g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_collection_iterator_gee_traversable_get_g_type (GeeReadOnlyCollectionIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_collection_iterator_gee_traversable_get_g_dup_func (GeeReadOnlyCollectionIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_collection_iterator_gee_traversable_get_g_destroy_func (GeeReadOnlyCollectionIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_collection_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_read_only_collection_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_read_only_collection_iterator_real_foreach; + iface->stream = (GeeIterator* (*)(GeeTraversable*, GType, GBoxedCopyFunc, GDestroyNotify, GeeStreamFunc, void*, GDestroyNotify)) gee_read_only_collection_iterator_real_stream; + iface->filter = (GeeIterator* (*)(GeeTraversable*, GeePredicate, void*, GDestroyNotify)) gee_read_only_collection_iterator_real_filter; + iface->chop = (GeeIterator* (*)(GeeTraversable*, gint, gint)) gee_read_only_collection_iterator_real_chop; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_read_only_collection_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_read_only_collection_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_read_only_collection_iterator_gee_traversable_get_g_destroy_func; + iface->get_element_type = gee_read_only_collection_iterator_real_get_element_type; } @@ -550,9 +862,10 @@ static void gee_read_only_collection_iterator_gee_iterator_interface_init (GeeIt gee_read_only_collection_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_read_only_collection_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_read_only_collection_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_read_only_collection_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_read_only_collection_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_read_only_collection_iterator_real_remove; + iface->get_valid = gee_read_only_collection_iterator_real_get_valid; + iface->get_read_only = gee_read_only_collection_iterator_real_get_read_only; } @@ -573,9 +886,11 @@ GType gee_read_only_collection_iterator_get_type (void) { static volatile gsize gee_read_only_collection_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_read_only_collection_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyCollectionIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_collection_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyCollectionIterator), 0, (GInstanceInitFunc) gee_read_only_collection_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_read_only_collection_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_read_only_collection_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_read_only_collection_iterator_type_id; gee_read_only_collection_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeReadOnlyCollectionIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_collection_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_read_only_collection_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_once_init_leave (&gee_read_only_collection_iterator_type_id__volatile, gee_read_only_collection_iterator_type_id); } @@ -587,6 +902,12 @@ static void _vala_gee_read_only_collection_iterator_get_property (GObject * obje GeeReadOnlyCollectionIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator); switch (property_id) { + case GEE_READ_ONLY_COLLECTION_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_READ_ONLY_COLLECTION_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -631,19 +952,75 @@ static void gee_read_only_collection_class_init (GeeReadOnlyCollectionClass * kl /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_ELEMENT_TYPE, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_COLLECTION_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_COLLECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } +static GType gee_read_only_collection_gee_traversable_get_g_type (GeeReadOnlyCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_collection_gee_traversable_get_g_dup_func (GeeReadOnlyCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_collection_gee_traversable_get_g_destroy_func (GeeReadOnlyCollection* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_collection_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_read_only_collection_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_read_only_collection_real_foreach; + iface->stream = (GeeIterator* (*)(GeeTraversable*, GType, GBoxedCopyFunc, GDestroyNotify, GeeStreamFunc, void*, GDestroyNotify)) gee_read_only_collection_real_stream; + iface->filter = (GeeIterator* (*)(GeeTraversable*, GeePredicate, void*, GDestroyNotify)) gee_read_only_collection_real_filter; + iface->chop = (GeeIterator* (*)(GeeTraversable*, gint, gint)) gee_read_only_collection_real_chop; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_read_only_collection_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_read_only_collection_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_read_only_collection_gee_traversable_get_g_destroy_func; + iface->get_element_type = gee_read_only_collection_real_get_element_type; +} + + +static GType gee_read_only_collection_gee_iterable_get_g_type (GeeReadOnlyCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_collection_gee_iterable_get_g_dup_func (GeeReadOnlyCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_collection_gee_iterable_get_g_destroy_func (GeeReadOnlyCollection* self) { + return self->priv->g_destroy_func; +} + + static void gee_read_only_collection_gee_iterable_interface_init (GeeIterableIface * iface) { gee_read_only_collection_gee_iterable_parent_iface = g_type_interface_peek_parent (iface); iface->iterator = (GeeIterator* (*)(GeeIterable*)) gee_read_only_collection_real_iterator; - iface->get_element_type = gee_read_only_collection_real_get_element_type; + iface->get_g_type = (GType(*)(GeeIterable*)) gee_read_only_collection_gee_iterable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeIterable*)) gee_read_only_collection_gee_iterable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeIterable*)) gee_read_only_collection_gee_iterable_get_g_destroy_func; +} + + +static GType gee_read_only_collection_gee_collection_get_g_type (GeeReadOnlyCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_collection_gee_collection_get_g_dup_func (GeeReadOnlyCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_collection_gee_collection_get_g_destroy_func (GeeReadOnlyCollection* self) { + return self->priv->g_destroy_func; } @@ -658,8 +1035,12 @@ static void gee_read_only_collection_gee_collection_interface_init (GeeCollectio iface->remove_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_read_only_collection_real_remove_all; iface->retain_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_read_only_collection_real_retain_all; iface->to_array = (gpointer* (*)(GeeCollection*, int*)) gee_read_only_collection_real_to_array; + iface->get_g_type = (GType(*)(GeeCollection*)) gee_read_only_collection_gee_collection_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeCollection*)) gee_read_only_collection_gee_collection_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeCollection*)) gee_read_only_collection_gee_collection_get_g_destroy_func; iface->get_size = gee_read_only_collection_real_get_size; iface->get_is_empty = gee_read_only_collection_real_get_is_empty; + iface->get_read_only = gee_read_only_collection_real_get_read_only; iface->get_read_only_view = (GeeCollection* (*) (GeeCollection *)) gee_read_only_collection_get_read_only_view; } @@ -690,10 +1071,12 @@ GType gee_read_only_collection_get_type (void) { static volatile gsize gee_read_only_collection_type_id__volatile = 0; if (g_once_init_enter (&gee_read_only_collection_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyCollection), 0, (GInstanceInitFunc) gee_read_only_collection_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_read_only_collection_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterable_info = { (GInterfaceInitFunc) gee_read_only_collection_gee_iterable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_collection_info = { (GInterfaceInitFunc) gee_read_only_collection_gee_collection_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_read_only_collection_type_id; gee_read_only_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeReadOnlyCollection", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_collection_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_read_only_collection_type_id, GEE_TYPE_ITERABLE, &gee_iterable_info); g_type_add_interface_static (gee_read_only_collection_type_id, GEE_TYPE_COLLECTION, &gee_collection_info); g_once_init_leave (&gee_read_only_collection_type_id__volatile, gee_read_only_collection_type_id); @@ -709,11 +1092,8 @@ static void _vala_gee_read_only_collection_get_property (GObject * object, guint case GEE_READ_ONLY_COLLECTION_SIZE: g_value_set_int (value, gee_collection_get_size ((GeeCollection*) self)); break; - case GEE_READ_ONLY_COLLECTION_IS_EMPTY: - g_value_set_boolean (value, gee_collection_get_is_empty ((GeeCollection*) self)); - break; - case GEE_READ_ONLY_COLLECTION_ELEMENT_TYPE: - g_value_set_gtype (value, gee_iterable_get_element_type ((GeeIterable*) self)); + case GEE_READ_ONLY_COLLECTION_READ_ONLY: + g_value_set_boolean (value, gee_collection_get_read_only ((GeeCollection*) self)); break; case GEE_READ_ONLY_COLLECTION_READ_ONLY_VIEW: g_value_take_object (value, gee_read_only_collection_get_read_only_view (self)); diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala index 54ff850..9f5823f 100644 --- a/gee/readonlycollection.vala +++ b/gee/readonlycollection.vala @@ -31,7 +31,7 @@ using GLib; * * @see Collection */ -internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { +internal class Gee.ReadOnlyCollection : Object, Traversable, Iterable, Collection { /** * {@inheritDoc} @@ -46,6 +46,13 @@ internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { public bool is_empty { get { return _collection.is_empty; } } + + /** + * {@inheritDoc} + */ + public bool read_only { + get { return true; } + } protected Collection _collection; @@ -59,6 +66,34 @@ internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { this._collection = collection; } + /** + * {@inheritDoc} + */ + public bool foreach (ForallFunc f) { + return _collection.foreach (f); + } + + /** + * {@inheritDoc} + */ + public Gee.Iterator stream (owned StreamFunc f) { + return _collection.stream ((owned)f); + } + + /** + * {@inheritDoc} + */ + public Gee.Iterator filter (owned Predicate f) { + return _collection.filter ((owned)f); + } + + /** + * {@inheritDoc} + */ + public Gee.Iterator chop (int offset, int length = -1) { + return _collection.chop (offset, length); + } + /** * {@inheritDoc} */ @@ -136,7 +171,7 @@ internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { return _collection.to_array (); } - protected class Iterator : Object, Gee.Iterator { + protected class Iterator : Object, Traversable, Gee.Iterator { protected Gee.Iterator _iter; public Iterator (Gee.Iterator iterator) { @@ -151,10 +186,6 @@ internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { return _iter.has_next (); } - public bool first () { - return _iter.first (); - } - public new G get () { return _iter.get (); } @@ -162,6 +193,38 @@ internal class Gee.ReadOnlyCollection : Object, Iterable, Collection { public void remove () { assert_not_reached (); } + + public bool valid { + get { + return _iter.valid; + } + } + + public bool read_only { + get { + return true; + } + } + + public Type element_type { + get { return typeof (G); } + } + + public bool foreach (ForallFunc f) { + return _iter.foreach (f); + } + + public Gee.Iterator stream (owned StreamFunc f) { + return _iter.stream ((owned)f); + } + + public Gee.Iterator filter (owned Predicate f) { + return _iter.filter ((owned)f); + } + + public Gee.Iterator chop (int offset, int length = -1) { + return _iter.chop ( offset, length); + } } public virtual Collection read_only_view { diff --git a/gee/readonlylist.c b/gee/readonlylist.c index df7d687..d880eea 100644 --- a/gee/readonlylist.c +++ b/gee/readonlylist.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -70,14 +90,6 @@ typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -120,23 +132,55 @@ typedef struct _GeeReadOnlyListIteratorClass GeeReadOnlyListIteratorClass; typedef struct _GeeReadOnlyCollectionIteratorPrivate GeeReadOnlyCollectionIteratorPrivate; typedef struct _GeeReadOnlyListIteratorPrivate GeeReadOnlyListIteratorPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -148,6 +192,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -162,23 +207,18 @@ struct _GeeReadOnlyCollectionClass { GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -189,7 +229,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -237,15 +277,22 @@ struct _GeeReadOnlyListIteratorPrivate { static gpointer gee_read_only_list_parent_class = NULL; static gpointer gee_read_only_list_iterator_parent_class = NULL; -static GeeBidirIteratorIface* gee_read_only_list_iterator_gee_bidir_iterator_parent_iface = NULL; static GeeListIteratorIface* gee_read_only_list_iterator_gee_list_iterator_parent_iface = NULL; static GeeListIface* gee_read_only_list_gee_list_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_read_only_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; GType gee_read_only_list_get_type (void) G_GNUC_CONST; @@ -263,10 +310,10 @@ GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFun GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); static GeeListIterator* gee_read_only_list_real_list_iterator (GeeList* base); GeeListIterator* gee_list_list_iterator (GeeList* self); -static GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); -static GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); +GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator); GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST; -static GType gee_read_only_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +GType gee_read_only_list_iterator_get_type (void) G_GNUC_CONST; static gint gee_read_only_list_real_index_of (GeeList* base, gconstpointer item); gint gee_list_index_of (GeeList* self, gconstpointer item); static void gee_read_only_list_real_insert (GeeList* base, gint index, gconstpointer item); @@ -275,12 +322,13 @@ static gpointer gee_read_only_list_real_get (GeeList* base, gint index); gpointer gee_list_get (GeeList* self, gint index); static void gee_read_only_list_real_set (GeeList* base, gint index, gconstpointer o); static GeeList* gee_read_only_list_real_slice (GeeList* base, gint start, gint stop); +GeeList* gee_list_slice (GeeList* self, gint start, gint stop); static gpointer gee_read_only_list_real_first (GeeList* base); gpointer gee_list_first (GeeList* self); static gpointer gee_read_only_list_real_last (GeeList* base); gpointer gee_list_last (GeeList* self); static void gee_read_only_list_real_insert_all (GeeList* base, gint index, GeeCollection* collection); -static void gee_read_only_list_real_sort (GeeList* base, GCompareFunc compare); +static void gee_read_only_list_real_sort (GeeList* base, GCompareDataFunc compare, void* compare_target, GDestroyNotify compare_target_destroy_notify); GeeList* gee_read_only_list_get_read_only_view (GeeReadOnlyList* self); #define GEE_READ_ONLY_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_READ_ONLY_LIST_TYPE_ITERATOR, GeeReadOnlyListIteratorPrivate)) enum { @@ -291,14 +339,7 @@ enum { }; GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); -static gboolean gee_read_only_list_iterator_real_previous (GeeBidirIterator* base); -gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); -static gboolean gee_read_only_list_iterator_real_has_previous (GeeBidirIterator* base); -gboolean gee_bidir_iterator_has_previous (GeeBidirIterator* self); -static gboolean gee_read_only_list_iterator_real_last (GeeBidirIterator* base); -gboolean gee_bidir_iterator_last (GeeBidirIterator* self); static void gee_read_only_list_iterator_real_set (GeeListIterator* base, gconstpointer item); -static void gee_read_only_list_iterator_real_insert (GeeListIterator* base, gconstpointer item); static void gee_read_only_list_iterator_real_add (GeeListIterator* base, gconstpointer item); static gint gee_read_only_list_iterator_real_index (GeeListIterator* base); gint gee_list_iterator_index (GeeListIterator* self); @@ -424,13 +465,21 @@ static void gee_read_only_list_real_set (GeeList* base, gint index, gconstpointe /** - * Unimplemented method (read only list). + * {@inheritDoc} */ static GeeList* gee_read_only_list_real_slice (GeeList* base, gint start, gint stop) { GeeReadOnlyList * self; GeeList* result = NULL; + GeeCollection* _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeList* _tmp3_ = NULL; self = (GeeReadOnlyList*) base; - g_assert_not_reached (); + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = start; + _tmp2_ = stop; + _tmp3_ = gee_list_slice (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList), _tmp1_, _tmp2_); + result = _tmp3_; return result; } @@ -481,10 +530,14 @@ static void gee_read_only_list_real_insert_all (GeeList* base, gint index, GeeCo /** * {@inheritDoc} */ -static void gee_read_only_list_real_sort (GeeList* base, GCompareFunc compare) { +static void gee_read_only_list_real_sort (GeeList* base, GCompareDataFunc compare, void* compare_target, GDestroyNotify compare_target_destroy_notify) { GeeReadOnlyList * self; self = (GeeReadOnlyList*) base; g_assert_not_reached (); + (compare_target_destroy_notify == NULL) ? NULL : (compare_target_destroy_notify (compare_target), NULL); + compare = NULL; + compare_target = NULL; + compare_target_destroy_notify = NULL; } @@ -510,7 +563,7 @@ static GeeList* gee_read_only_list_real_get_read_only_view (GeeReadOnlyList* bas } -static GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { +GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { GeeReadOnlyListIterator * self = NULL; GeeListIterator* _tmp0_; g_return_val_if_fail (iterator != NULL, NULL); @@ -523,50 +576,11 @@ static GeeReadOnlyListIterator* gee_read_only_list_iterator_construct (GType obj } -static GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { +GeeReadOnlyListIterator* gee_read_only_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeListIterator* iterator) { return gee_read_only_list_iterator_construct (GEE_READ_ONLY_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iterator); } -static gboolean gee_read_only_list_iterator_real_previous (GeeBidirIterator* base) { - GeeReadOnlyListIterator * self; - gboolean result = FALSE; - GeeIterator* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeReadOnlyListIterator*) base; - _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; - _tmp1_ = gee_bidir_iterator_previous ((GeeBidirIterator*) G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST_ITERATOR, GeeListIterator)); - result = _tmp1_; - return result; -} - - -static gboolean gee_read_only_list_iterator_real_has_previous (GeeBidirIterator* base) { - GeeReadOnlyListIterator * self; - gboolean result = FALSE; - GeeIterator* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeReadOnlyListIterator*) base; - _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; - _tmp1_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST_ITERATOR, GeeListIterator)); - result = _tmp1_; - return result; -} - - -static gboolean gee_read_only_list_iterator_real_last (GeeBidirIterator* base) { - GeeReadOnlyListIterator * self; - gboolean result = FALSE; - GeeIterator* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeReadOnlyListIterator*) base; - _tmp0_ = ((GeeReadOnlyCollectionIterator*) self)->_iter; - _tmp1_ = gee_bidir_iterator_last ((GeeBidirIterator*) G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST_ITERATOR, GeeListIterator)); - result = _tmp1_; - return result; -} - - static void gee_read_only_list_iterator_real_set (GeeListIterator* base, gconstpointer item) { GeeReadOnlyListIterator * self; self = (GeeReadOnlyListIterator*) base; @@ -574,13 +588,6 @@ static void gee_read_only_list_iterator_real_set (GeeListIterator* base, gconstp } -static void gee_read_only_list_iterator_real_insert (GeeListIterator* base, gconstpointer item) { - GeeReadOnlyListIterator * self; - self = (GeeReadOnlyListIterator*) base; - g_assert_not_reached (); -} - - static void gee_read_only_list_iterator_real_add (GeeListIterator* base, gconstpointer item) { GeeReadOnlyListIterator * self; self = (GeeReadOnlyListIterator*) base; @@ -612,18 +619,9 @@ static void gee_read_only_list_iterator_class_init (GeeReadOnlyListIteratorClass } -static void gee_read_only_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { - gee_read_only_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_list_iterator_real_previous; - iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_read_only_list_iterator_real_has_previous; - iface->last = (gboolean (*)(GeeBidirIterator*)) gee_read_only_list_iterator_real_last; -} - - static void gee_read_only_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) { gee_read_only_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_read_only_list_iterator_real_set; - iface->insert = (void (*)(GeeListIterator*, gconstpointer)) gee_read_only_list_iterator_real_insert; iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_read_only_list_iterator_real_add; iface->index = (gint (*)(GeeListIterator*)) gee_read_only_list_iterator_real_index; } @@ -634,15 +632,13 @@ static void gee_read_only_list_iterator_instance_init (GeeReadOnlyListIterator * } -static GType gee_read_only_list_iterator_get_type (void) { +GType gee_read_only_list_iterator_get_type (void) { static volatile gsize gee_read_only_list_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_read_only_list_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyListIterator), 0, (GInstanceInitFunc) gee_read_only_list_iterator_instance_init, NULL }; - static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_read_only_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_read_only_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_read_only_list_iterator_type_id; gee_read_only_list_iterator_type_id = g_type_register_static (GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, "GeeReadOnlyListIterator", &g_define_type_info, 0); - g_type_add_interface_static (gee_read_only_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); g_type_add_interface_static (gee_read_only_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info); g_once_init_leave (&gee_read_only_list_iterator_type_id__volatile, gee_read_only_list_iterator_type_id); } @@ -697,6 +693,21 @@ static void gee_read_only_list_class_init (GeeReadOnlyListClass * klass) { } +static GType gee_read_only_list_gee_list_get_g_type (GeeReadOnlyList* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_list_gee_list_get_g_dup_func (GeeReadOnlyList* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_list_gee_list_get_g_destroy_func (GeeReadOnlyList* self) { + return self->priv->g_destroy_func; +} + + static void gee_read_only_list_gee_list_interface_init (GeeListIface * iface) { gee_read_only_list_gee_list_parent_iface = g_type_interface_peek_parent (iface); iface->list_iterator = (GeeListIterator* (*)(GeeList*)) gee_read_only_list_real_list_iterator; @@ -709,7 +720,10 @@ static void gee_read_only_list_gee_list_interface_init (GeeListIface * iface) { iface->first = (gpointer (*)(GeeList*)) gee_read_only_list_real_first; iface->last = (gpointer (*)(GeeList*)) gee_read_only_list_real_last; iface->insert_all = (void (*)(GeeList*, gint, GeeCollection*)) gee_read_only_list_real_insert_all; - iface->sort = (void (*)(GeeList*, GCompareFunc)) gee_read_only_list_real_sort; + iface->sort = (void (*)(GeeList*, GCompareDataFunc, void*, GDestroyNotify)) gee_read_only_list_real_sort; + iface->get_g_type = (GType(*)(GeeList*)) gee_read_only_list_gee_list_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeList*)) gee_read_only_list_gee_list_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeList*)) gee_read_only_list_gee_list_get_g_destroy_func; iface->get_read_only_view = (GeeList* (*) (GeeList *)) gee_read_only_list_get_read_only_view; } diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala index 58d5e9a..8be3f27 100644 --- a/gee/readonlylist.vala +++ b/gee/readonlylist.vala @@ -86,10 +86,10 @@ internal class Gee.ReadOnlyList : Gee.ReadOnlyCollection, List { } /** - * Unimplemented method (read only list). + * {@inheritDoc} */ public List? slice (int start, int stop) { - assert_not_reached (); + return ((Gee.List) _collection).slice (start, stop); } /** @@ -116,7 +116,7 @@ internal class Gee.ReadOnlyList : Gee.ReadOnlyCollection, List { /** * {@inheritDoc} */ - public void sort (CompareFunc? compare = null) { + public void sort (owned CompareDataFunc? compare = null) { assert_not_reached (); } @@ -128,31 +128,15 @@ internal class Gee.ReadOnlyList : Gee.ReadOnlyCollection, List { } - private class Iterator : ReadOnlyCollection.Iterator, BidirIterator, ListIterator { + protected class Iterator : ReadOnlyCollection.Iterator, ListIterator { public Iterator (ListIterator iterator) { base (iterator); } - public bool previous () { - return ((ListIterator) _iter).previous (); - } - - public bool has_previous () { - return ((ListIterator) _iter).has_previous (); - } - - public bool last () { - return ((ListIterator) _iter).last (); - } - public new void set (G item) { assert_not_reached (); } - public void insert (G item) { - assert_not_reached (); - } - public void add (G item) { assert_not_reached (); } diff --git a/gee/readonlymap.c b/gee/readonlymap.c index 08ad4b2..eaeb7ce 100644 --- a/gee/readonlymap.c +++ b/gee/readonlymap.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -108,34 +128,78 @@ typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator; typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass; typedef struct _GeeReadOnlyMapMapIteratorPrivate GeeReadOnlyMapMapIteratorPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -147,43 +211,49 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeReadOnlyMap { GObject parent_instance; GeeReadOnlyMapPrivate * priv; + GeeMap* _map; }; struct _GeeReadOnlyMapClass { @@ -198,7 +268,6 @@ struct _GeeReadOnlyMapPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - GeeMap* _map; }; struct _GeeReadOnlyMapMapIterator { @@ -224,10 +293,20 @@ struct _GeeReadOnlyMapMapIteratorPrivate { static gpointer gee_read_only_map_parent_class = NULL; static gpointer gee_read_only_map_map_iterator_parent_class = NULL; static GeeMapIteratorIface* gee_read_only_map_map_iterator_gee_map_iterator_parent_iface = NULL; +static GeeTraversableIface* gee_read_only_map_gee_traversable_parent_iface = NULL; static GeeIterableIface* gee_read_only_map_gee_iterable_parent_iface = NULL; static GeeMapIface* gee_read_only_map_gee_map_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; @@ -245,27 +324,26 @@ enum { GEE_READ_ONLY_MAP_V_DUP_FUNC, GEE_READ_ONLY_MAP_V_DESTROY_FUNC, GEE_READ_ONLY_MAP_SIZE, - GEE_READ_ONLY_MAP_IS_EMPTY, + GEE_READ_ONLY_MAP_READ_ONLY, GEE_READ_ONLY_MAP_KEYS, GEE_READ_ONLY_MAP_VALUES, GEE_READ_ONLY_MAP_ENTRIES, GEE_READ_ONLY_MAP_READ_ONLY_VIEW, GEE_READ_ONLY_MAP_KEY_TYPE, - GEE_READ_ONLY_MAP_VALUE_TYPE, - GEE_READ_ONLY_MAP_ELEMENT_TYPE + GEE_READ_ONLY_MAP_VALUE_TYPE }; GeeReadOnlyMap* gee_read_only_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); GeeReadOnlyMap* gee_read_only_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); static gboolean gee_read_only_map_real_has_key (GeeMap* base, gconstpointer key); gboolean gee_map_has_key (GeeMap* self, gconstpointer key); -static gboolean gee_read_only_map_real_contains (GeeMap* base, gconstpointer key); +gboolean gee_read_only_map_contains (GeeReadOnlyMap* self, gconstpointer key); static gboolean gee_read_only_map_real_has (GeeMap* base, gconstpointer key, gconstpointer value); gboolean gee_map_has (GeeMap* self, gconstpointer key, gconstpointer value); static gpointer gee_read_only_map_real_get (GeeMap* base, gconstpointer key); gpointer gee_map_get (GeeMap* self, gconstpointer key); static void gee_read_only_map_real_set (GeeMap* base, gconstpointer key, gconstpointer value); static gboolean gee_read_only_map_real_unset (GeeMap* base, gconstpointer key, gpointer* value); -static gboolean gee_read_only_map_real_remove (GeeMap* base, gconstpointer key, gpointer* value); +gboolean gee_read_only_map_remove (GeeReadOnlyMap* self, gconstpointer key, gpointer* value); static void gee_read_only_map_real_clear (GeeMap* base); static GeeMapIterator* gee_read_only_map_real_map_iterator (GeeMap* base); GeeMapIterator* gee_map_map_iterator (GeeMap* self); @@ -274,18 +352,28 @@ GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_construct (GType objec GType gee_read_only_map_map_iterator_get_type (void) G_GNUC_CONST; static void gee_read_only_map_real_set_all (GeeMap* base, GeeMap* map); static gboolean gee_read_only_map_real_unset_all (GeeMap* base, GeeMap* map); -static gboolean gee_read_only_map_real_remove_all (GeeMap* base, GeeMap* map); +gboolean gee_read_only_map_remove_all (GeeReadOnlyMap* self, GeeMap* map); static gboolean gee_read_only_map_real_has_all (GeeMap* base, GeeMap* map); gboolean gee_map_has_all (GeeMap* self, GeeMap* map); -static gboolean gee_read_only_map_real_contains_all (GeeMap* base, GeeMap* map); +gboolean gee_read_only_map_contains_all (GeeReadOnlyMap* self, GeeMap* map); static GeeIterator* gee_read_only_map_real_iterator (GeeIterable* base); GeeSet* gee_map_get_entries (GeeMap* self); GeeIterator* gee_iterable_iterator (GeeIterable* self); +static gboolean gee_read_only_map_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +static GeeIterator* gee_read_only_map_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_read_only_map_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify); +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +static GeeIterator* gee_read_only_map_real_chop (GeeTraversable* base, gint offset, gint length); +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length); gint gee_map_get_size (GeeMap* self); gboolean gee_map_get_is_empty (GeeMap* self); GeeSet* gee_map_get_keys (GeeMap* self); GeeCollection* gee_map_get_values (GeeMap* self); GeeMap* gee_read_only_map_get_read_only_view (GeeReadOnlyMap* self); +GType gee_read_only_map_get_key_type (GeeReadOnlyMap* self); +GType gee_read_only_map_get_value_type (GeeReadOnlyMap* self); #define GEE_READ_ONLY_MAP_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorPrivate)) enum { GEE_READ_ONLY_MAP_MAP_ITERATOR_DUMMY_PROPERTY, @@ -294,27 +382,29 @@ enum { GEE_READ_ONLY_MAP_MAP_ITERATOR_K_DESTROY_FUNC, GEE_READ_ONLY_MAP_MAP_ITERATOR_V_TYPE, GEE_READ_ONLY_MAP_MAP_ITERATOR_V_DUP_FUNC, - GEE_READ_ONLY_MAP_MAP_ITERATOR_V_DESTROY_FUNC + GEE_READ_ONLY_MAP_MAP_ITERATOR_V_DESTROY_FUNC, + GEE_READ_ONLY_MAP_MAP_ITERATOR_READ_ONLY, + GEE_READ_ONLY_MAP_MAP_ITERATOR_MUTABLE, + GEE_READ_ONLY_MAP_MAP_ITERATOR_VALID }; static gboolean gee_read_only_map_map_iterator_real_next (GeeMapIterator* base); gboolean gee_map_iterator_next (GeeMapIterator* self); static gboolean gee_read_only_map_map_iterator_real_has_next (GeeMapIterator* base); gboolean gee_map_iterator_has_next (GeeMapIterator* self); -static gboolean gee_read_only_map_map_iterator_real_first (GeeMapIterator* base); -gboolean gee_map_iterator_first (GeeMapIterator* self); static gpointer gee_read_only_map_map_iterator_real_get_key (GeeMapIterator* base); gpointer gee_map_iterator_get_key (GeeMapIterator* self); static gpointer gee_read_only_map_map_iterator_real_get_value (GeeMapIterator* base); gpointer gee_map_iterator_get_value (GeeMapIterator* self); static void gee_read_only_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value); static void gee_read_only_map_map_iterator_real_unset (GeeMapIterator* base); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); static void gee_read_only_map_map_iterator_finalize (GObject* obj); +gboolean gee_map_iterator_get_read_only (GeeMapIterator* self); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); static void _vala_gee_read_only_map_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_read_only_map_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_read_only_map_finalize (GObject* obj); -GType gee_map_get_key_type (GeeMap* self); -GType gee_map_get_value_type (GeeMap* self); -GType gee_iterable_get_element_type (GeeIterable* self); +gboolean gee_map_get_read_only (GeeMap* self); static void _vala_gee_read_only_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_read_only_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -343,8 +433,8 @@ GeeReadOnlyMap* gee_read_only_map_construct (GType object_type, GType k_type, GB self->priv->v_destroy_func = v_destroy_func; _tmp0_ = map; _tmp1_ = _g_object_ref0 (_tmp0_); - _g_object_unref0 (self->priv->_map); - self->priv->_map = _tmp1_; + _g_object_unref0 (self->_map); + self->_map = _tmp1_; return self; } @@ -364,7 +454,7 @@ static gboolean gee_read_only_map_real_has_key (GeeMap* base, gconstpointer key) gconstpointer _tmp1_; gboolean _tmp2_ = FALSE; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = key; _tmp2_ = gee_map_has_key (_tmp0_, _tmp1_); result = _tmp2_; @@ -375,14 +465,13 @@ static gboolean gee_read_only_map_real_has_key (GeeMap* base, gconstpointer key) /** * {@inheritDoc} */ -static gboolean gee_read_only_map_real_contains (GeeMap* base, gconstpointer key) { - GeeReadOnlyMap * self; +gboolean gee_read_only_map_contains (GeeReadOnlyMap* self, gconstpointer key) { gboolean result = FALSE; GeeMap* _tmp0_; gconstpointer _tmp1_; gboolean _tmp2_ = FALSE; - self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->_map; _tmp1_ = key; _tmp2_ = gee_map_has_key (_tmp0_, _tmp1_); result = _tmp2_; @@ -401,7 +490,7 @@ static gboolean gee_read_only_map_real_has (GeeMap* base, gconstpointer key, gco gconstpointer _tmp2_; gboolean _tmp3_ = FALSE; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = key; _tmp2_ = value; _tmp3_ = gee_map_has (_tmp0_, _tmp1_, _tmp2_); @@ -420,7 +509,7 @@ static gpointer gee_read_only_map_real_get (GeeMap* base, gconstpointer key) { gconstpointer _tmp1_; gpointer _tmp2_ = NULL; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = key; _tmp2_ = gee_map_get (_tmp0_, _tmp1_); result = _tmp2_; @@ -459,11 +548,10 @@ static gboolean gee_read_only_map_real_unset (GeeMap* base, gconstpointer key, g /** * Unimplemented method (read only map). */ -static gboolean gee_read_only_map_real_remove (GeeMap* base, gconstpointer key, gpointer* value) { - GeeReadOnlyMap * self; +gboolean gee_read_only_map_remove (GeeReadOnlyMap* self, gconstpointer key, gpointer* value) { gpointer _vala_value = NULL; gboolean result = FALSE; - self = (GeeReadOnlyMap*) base; + g_return_val_if_fail (self != NULL, FALSE); g_assert_not_reached (); if (value) { *value = _vala_value; @@ -496,7 +584,7 @@ static GeeMapIterator* gee_read_only_map_real_map_iterator (GeeMap* base) { GeeReadOnlyMapMapIterator* _tmp3_; GeeMapIterator* _tmp4_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_map_iterator (_tmp0_); _tmp2_ = _tmp1_; _tmp3_ = gee_read_only_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); @@ -534,10 +622,9 @@ static gboolean gee_read_only_map_real_unset_all (GeeMap* base, GeeMap* map) { /** * Unimplemented method (read only map). */ -static gboolean gee_read_only_map_real_remove_all (GeeMap* base, GeeMap* map) { - GeeReadOnlyMap * self; +gboolean gee_read_only_map_remove_all (GeeReadOnlyMap* self, GeeMap* map) { gboolean result = FALSE; - self = (GeeReadOnlyMap*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (map != NULL, FALSE); g_assert_not_reached (); return result; @@ -555,7 +642,7 @@ static gboolean gee_read_only_map_real_has_all (GeeMap* base, GeeMap* map) { gboolean _tmp2_ = FALSE; self = (GeeReadOnlyMap*) base; g_return_val_if_fail (map != NULL, FALSE); - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = map; _tmp2_ = gee_map_has_all (_tmp0_, _tmp1_); result = _tmp2_; @@ -566,15 +653,14 @@ static gboolean gee_read_only_map_real_has_all (GeeMap* base, GeeMap* map) { /** * {@inheritDoc} */ -static gboolean gee_read_only_map_real_contains_all (GeeMap* base, GeeMap* map) { - GeeReadOnlyMap * self; +gboolean gee_read_only_map_contains_all (GeeReadOnlyMap* self, GeeMap* map) { gboolean result = FALSE; GeeMap* _tmp0_; GeeMap* _tmp1_; gboolean _tmp2_ = FALSE; - self = (GeeReadOnlyMap*) base; + g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (map != NULL, FALSE); - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = map; _tmp2_ = gee_map_has_all (_tmp0_, _tmp1_); result = _tmp2_; @@ -605,6 +691,94 @@ static GeeIterator* gee_read_only_map_real_iterator (GeeIterable* base) { } +/** + * {@inheritDoc} + */ +static gboolean gee_read_only_map_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeReadOnlyMap * self; + gboolean result = FALSE; + GeeMap* _tmp0_; + GeeForallFunc _tmp1_; + void* _tmp1__target; + gboolean _tmp2_ = FALSE; + self = (GeeReadOnlyMap*) base; + _tmp0_ = self->_map; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_read_only_map_real_stream (GeeTraversable* base, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeReadOnlyMap * self; + GeeIterator* result = NULL; + GeeMap* _tmp0_; + GeeStreamFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; + self = (GeeReadOnlyMap*) base; + _tmp0_ = self->_map; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_stream ((GeeTraversable*) _tmp0_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +static GeeIterator* gee_read_only_map_real_filter (GeeTraversable* base, GeePredicate f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeReadOnlyMap * self; + GeeIterator* result = NULL; + GeeMap* _tmp0_; + GeePredicate _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + GeeIterator* _tmp2_ = NULL; + self = (GeeReadOnlyMap*) base; + _tmp0_ = self->_map; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp1__target_destroy_notify = f_target_destroy_notify; + f_target_destroy_notify = NULL; + _tmp2_ = gee_traversable_filter ((GeeTraversable*) _tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify); + result = _tmp2_; + (f_target_destroy_notify == NULL) ? NULL : (f_target_destroy_notify (f_target), NULL); + f = NULL; + f_target = NULL; + f_target_destroy_notify = NULL; + return result; +} + + +static GeeIterator* gee_read_only_map_real_chop (GeeTraversable* base, gint offset, gint length) { + GeeReadOnlyMap * self; + GeeIterator* result = NULL; + GeeMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeIterator* _tmp3_ = NULL; + self = (GeeReadOnlyMap*) base; + _tmp0_ = self->_map; + _tmp1_ = offset; + _tmp2_ = length; + _tmp3_ = gee_traversable_chop ((GeeTraversable*) _tmp0_, _tmp1_, _tmp2_); + result = _tmp3_; + return result; +} + + static gint gee_read_only_map_real_get_size (GeeMap* base) { gint result; GeeReadOnlyMap* self; @@ -612,7 +786,7 @@ static gint gee_read_only_map_real_get_size (GeeMap* base) { gint _tmp1_; gint _tmp2_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_get_size (_tmp0_); _tmp2_ = _tmp1_; result = _tmp2_; @@ -627,7 +801,7 @@ static gboolean gee_read_only_map_real_get_is_empty (GeeMap* base) { gboolean _tmp1_; gboolean _tmp2_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_get_is_empty (_tmp0_); _tmp2_ = _tmp1_; result = _tmp2_; @@ -635,6 +809,15 @@ static gboolean gee_read_only_map_real_get_is_empty (GeeMap* base) { } +static gboolean gee_read_only_map_real_get_read_only (GeeMap* base) { + gboolean result; + GeeReadOnlyMap* self; + self = (GeeReadOnlyMap*) base; + result = TRUE; + return result; +} + + static GeeSet* gee_read_only_map_real_get_keys (GeeMap* base) { GeeSet* result; GeeReadOnlyMap* self; @@ -642,7 +825,7 @@ static GeeSet* gee_read_only_map_real_get_keys (GeeMap* base) { GeeSet* _tmp1_; GeeSet* _tmp2_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_get_keys (_tmp0_); _tmp2_ = _tmp1_; result = _tmp2_; @@ -657,7 +840,7 @@ static GeeCollection* gee_read_only_map_real_get_values (GeeMap* base) { GeeCollection* _tmp1_; GeeCollection* _tmp2_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_get_values (_tmp0_); _tmp2_ = _tmp1_; result = _tmp2_; @@ -672,7 +855,7 @@ static GeeSet* gee_read_only_map_real_get_entries (GeeMap* base) { GeeSet* _tmp1_; GeeSet* _tmp2_; self = (GeeReadOnlyMap*) base; - _tmp0_ = self->priv->_map; + _tmp0_ = self->_map; _tmp1_ = gee_map_get_entries (_tmp0_); _tmp2_ = _tmp1_; result = _tmp2_; @@ -697,25 +880,23 @@ static GeeMap* gee_read_only_map_real_get_read_only_view (GeeReadOnlyMap* base) } -static GType gee_read_only_map_real_get_key_type (GeeMap* base) { +GType gee_read_only_map_get_key_type (GeeReadOnlyMap* self) { GType result; - GeeReadOnlyMap* self; - self = (GeeReadOnlyMap*) base; + g_return_val_if_fail (self != NULL, 0UL); result = self->priv->k_type; return result; } -static GType gee_read_only_map_real_get_value_type (GeeMap* base) { +GType gee_read_only_map_get_value_type (GeeReadOnlyMap* self) { GType result; - GeeReadOnlyMap* self; - self = (GeeReadOnlyMap*) base; + g_return_val_if_fail (self != NULL, 0UL); result = self->priv->v_type; return result; } -static GType gee_read_only_map_real_get_element_type (GeeIterable* base) { +static GType gee_read_only_map_real_get_element_type (GeeTraversable* base) { GType result; GeeReadOnlyMap* self; self = (GeeReadOnlyMap*) base; @@ -775,19 +956,6 @@ static gboolean gee_read_only_map_map_iterator_real_has_next (GeeMapIterator* ba } -static gboolean gee_read_only_map_map_iterator_real_first (GeeMapIterator* base) { - GeeReadOnlyMapMapIterator * self; - gboolean result = FALSE; - GeeMapIterator* _tmp0_; - gboolean _tmp1_ = FALSE; - self = (GeeReadOnlyMapMapIterator*) base; - _tmp0_ = self->_iter; - _tmp1_ = gee_map_iterator_first (_tmp0_); - result = _tmp1_; - return result; -} - - static gpointer gee_read_only_map_map_iterator_real_get_key (GeeMapIterator* base) { GeeReadOnlyMapMapIterator * self; gpointer result = NULL; @@ -828,6 +996,39 @@ static void gee_read_only_map_map_iterator_real_unset (GeeMapIterator* base) { } +static gboolean gee_read_only_map_map_iterator_real_get_read_only (GeeMapIterator* base) { + gboolean result; + GeeReadOnlyMapMapIterator* self; + self = (GeeReadOnlyMapMapIterator*) base; + result = TRUE; + return result; +} + + +static gboolean gee_read_only_map_map_iterator_real_get_mutable (GeeMapIterator* base) { + gboolean result; + GeeReadOnlyMapMapIterator* self; + self = (GeeReadOnlyMapMapIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_read_only_map_map_iterator_real_get_valid (GeeMapIterator* base) { + gboolean result; + GeeReadOnlyMapMapIterator* self; + GeeMapIterator* _tmp0_; + gboolean _tmp1_; + gboolean _tmp2_; + self = (GeeReadOnlyMapMapIterator*) base; + _tmp0_ = self->_iter; + _tmp1_ = gee_map_iterator_get_valid (_tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + static void gee_read_only_map_map_iterator_class_init (GeeReadOnlyMapMapIteratorClass * klass) { gee_read_only_map_map_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeReadOnlyMapMapIteratorPrivate)); @@ -840,6 +1041,39 @@ static void gee_read_only_map_map_iterator_class_init (GeeReadOnlyMapMapIterator g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_MUTABLE, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_MAP_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_map_map_iterator_gee_map_iterator_get_k_type (GeeReadOnlyMapMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_read_only_map_map_iterator_gee_map_iterator_get_k_dup_func (GeeReadOnlyMapMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_read_only_map_map_iterator_gee_map_iterator_get_k_destroy_func (GeeReadOnlyMapMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_read_only_map_map_iterator_gee_map_iterator_get_v_type (GeeReadOnlyMapMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_read_only_map_map_iterator_gee_map_iterator_get_v_dup_func (GeeReadOnlyMapMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_read_only_map_map_iterator_gee_map_iterator_get_v_destroy_func (GeeReadOnlyMapMapIterator* self) { + return self->priv->v_destroy_func; } @@ -847,11 +1081,19 @@ static void gee_read_only_map_map_iterator_gee_map_iterator_interface_init (GeeM gee_read_only_map_map_iterator_gee_map_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_next; iface->has_next = (gboolean (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_has_next; - iface->first = (gboolean (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_first; iface->get_key = (gpointer (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_get_key; iface->get_value = (gpointer (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_get_value; iface->set_value = (void (*)(GeeMapIterator*, gconstpointer)) gee_read_only_map_map_iterator_real_set_value; iface->unset = (void (*)(GeeMapIterator*)) gee_read_only_map_map_iterator_real_unset; + iface->get_k_type = (GType(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_read_only_map_map_iterator_gee_map_iterator_get_v_destroy_func; + iface->get_read_only = gee_read_only_map_map_iterator_real_get_read_only; + iface->get_mutable = gee_read_only_map_map_iterator_real_get_mutable; + iface->get_valid = gee_read_only_map_map_iterator_real_get_valid; } @@ -886,6 +1128,15 @@ static void _vala_gee_read_only_map_map_iterator_get_property (GObject * object, GeeReadOnlyMapMapIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIterator); switch (property_id) { + case GEE_READ_ONLY_MAP_MAP_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_map_iterator_get_read_only ((GeeMapIterator*) self)); + break; + case GEE_READ_ONLY_MAP_MAP_ITERATOR_MUTABLE: + g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self)); + break; + case GEE_READ_ONLY_MAP_MAP_ITERATOR_VALID: + g_value_set_boolean (value, gee_map_iterator_get_valid ((GeeMapIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -942,7 +1193,7 @@ static void gee_read_only_map_class_init (GeeReadOnlyMapClass * klass) { /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -964,44 +1215,116 @@ static void gee_read_only_map_class_init (GeeReadOnlyMapClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_VALUE_TYPE, g_param_spec_gtype ("value-type", "value-type", "value-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MAP_ELEMENT_TYPE, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_map_gee_traversable_get_g_type (GeeReadOnlyMap* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_read_only_map_gee_traversable_get_g_dup_func (GeeReadOnlyMap* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_read_only_map_gee_traversable_get_g_destroy_func (GeeReadOnlyMap* self) { + return g_object_unref; +} + + +static void gee_read_only_map_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_read_only_map_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_read_only_map_real_foreach; + iface->stream = (GeeIterator* (*)(GeeTraversable*, GType, GBoxedCopyFunc, GDestroyNotify, GeeStreamFunc, void*, GDestroyNotify)) gee_read_only_map_real_stream; + iface->filter = (GeeIterator* (*)(GeeTraversable*, GeePredicate, void*, GDestroyNotify)) gee_read_only_map_real_filter; + iface->chop = (GeeIterator* (*)(GeeTraversable*, gint, gint)) gee_read_only_map_real_chop; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_read_only_map_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_read_only_map_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_read_only_map_gee_traversable_get_g_destroy_func; + iface->get_element_type = gee_read_only_map_real_get_element_type; +} + + +static GType gee_read_only_map_gee_iterable_get_g_type (GeeReadOnlyMap* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_read_only_map_gee_iterable_get_g_dup_func (GeeReadOnlyMap* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_read_only_map_gee_iterable_get_g_destroy_func (GeeReadOnlyMap* self) { + return g_object_unref; } static void gee_read_only_map_gee_iterable_interface_init (GeeIterableIface * iface) { gee_read_only_map_gee_iterable_parent_iface = g_type_interface_peek_parent (iface); iface->iterator = (GeeIterator* (*)(GeeIterable*)) gee_read_only_map_real_iterator; - iface->get_element_type = gee_read_only_map_real_get_element_type; + iface->get_g_type = (GType(*)(GeeIterable*)) gee_read_only_map_gee_iterable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeIterable*)) gee_read_only_map_gee_iterable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeIterable*)) gee_read_only_map_gee_iterable_get_g_destroy_func; +} + + +static GType gee_read_only_map_gee_map_get_k_type (GeeReadOnlyMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_read_only_map_gee_map_get_k_dup_func (GeeReadOnlyMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_read_only_map_gee_map_get_k_destroy_func (GeeReadOnlyMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_read_only_map_gee_map_get_v_type (GeeReadOnlyMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_read_only_map_gee_map_get_v_dup_func (GeeReadOnlyMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_read_only_map_gee_map_get_v_destroy_func (GeeReadOnlyMap* self) { + return self->priv->v_destroy_func; } static void gee_read_only_map_gee_map_interface_init (GeeMapIface * iface) { gee_read_only_map_gee_map_parent_iface = g_type_interface_peek_parent (iface); iface->has_key = (gboolean (*)(GeeMap*, gconstpointer)) gee_read_only_map_real_has_key; - iface->contains = (gboolean (*)(GeeMap*, gconstpointer)) gee_read_only_map_real_contains; iface->has = (gboolean (*)(GeeMap*, gconstpointer, gconstpointer)) gee_read_only_map_real_has; iface->get = (gpointer (*)(GeeMap*, gconstpointer)) gee_read_only_map_real_get; iface->set = (void (*)(GeeMap*, gconstpointer, gconstpointer)) gee_read_only_map_real_set; iface->unset = (gboolean (*)(GeeMap*, gconstpointer, gpointer*)) gee_read_only_map_real_unset; - iface->remove = (gboolean (*)(GeeMap*, gconstpointer, gpointer*)) gee_read_only_map_real_remove; iface->clear = (void (*)(GeeMap*)) gee_read_only_map_real_clear; iface->map_iterator = (GeeMapIterator* (*)(GeeMap*)) gee_read_only_map_real_map_iterator; iface->set_all = (void (*)(GeeMap*, GeeMap*)) gee_read_only_map_real_set_all; iface->unset_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_read_only_map_real_unset_all; - iface->remove_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_read_only_map_real_remove_all; iface->has_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_read_only_map_real_has_all; - iface->contains_all = (gboolean (*)(GeeMap*, GeeMap*)) gee_read_only_map_real_contains_all; + iface->get_k_type = (GType(*)(GeeMap*)) gee_read_only_map_gee_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMap*)) gee_read_only_map_gee_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMap*)) gee_read_only_map_gee_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMap*)) gee_read_only_map_gee_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMap*)) gee_read_only_map_gee_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMap*)) gee_read_only_map_gee_map_get_v_destroy_func; iface->get_size = gee_read_only_map_real_get_size; iface->get_is_empty = gee_read_only_map_real_get_is_empty; + iface->get_read_only = gee_read_only_map_real_get_read_only; iface->get_keys = gee_read_only_map_real_get_keys; iface->get_values = gee_read_only_map_real_get_values; iface->get_entries = gee_read_only_map_real_get_entries; iface->get_read_only_view = (GeeMap* (*) (GeeMap *)) gee_read_only_map_get_read_only_view; - iface->get_key_type = gee_read_only_map_real_get_key_type; - iface->get_value_type = gee_read_only_map_real_get_value_type; } @@ -1013,7 +1336,7 @@ static void gee_read_only_map_instance_init (GeeReadOnlyMap * self) { static void gee_read_only_map_finalize (GObject* obj) { GeeReadOnlyMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap); - _g_object_unref0 (self->priv->_map); + _g_object_unref0 (self->_map); G_OBJECT_CLASS (gee_read_only_map_parent_class)->finalize (obj); } @@ -1031,10 +1354,12 @@ GType gee_read_only_map_get_type (void) { static volatile gsize gee_read_only_map_type_id__volatile = 0; if (g_once_init_enter (&gee_read_only_map_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyMap), 0, (GInstanceInitFunc) gee_read_only_map_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_read_only_map_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterable_info = { (GInterfaceInitFunc) gee_read_only_map_gee_iterable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_map_info = { (GInterfaceInitFunc) gee_read_only_map_gee_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_read_only_map_type_id; gee_read_only_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeReadOnlyMap", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_map_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_read_only_map_type_id, GEE_TYPE_ITERABLE, &gee_iterable_info); g_type_add_interface_static (gee_read_only_map_type_id, GEE_TYPE_MAP, &gee_map_info); g_once_init_leave (&gee_read_only_map_type_id__volatile, gee_read_only_map_type_id); @@ -1050,8 +1375,8 @@ static void _vala_gee_read_only_map_get_property (GObject * object, guint proper case GEE_READ_ONLY_MAP_SIZE: g_value_set_int (value, gee_map_get_size ((GeeMap*) self)); break; - case GEE_READ_ONLY_MAP_IS_EMPTY: - g_value_set_boolean (value, gee_map_get_is_empty ((GeeMap*) self)); + case GEE_READ_ONLY_MAP_READ_ONLY: + g_value_set_boolean (value, gee_map_get_read_only ((GeeMap*) self)); break; case GEE_READ_ONLY_MAP_KEYS: g_value_take_object (value, gee_map_get_keys ((GeeMap*) self)); @@ -1066,13 +1391,10 @@ static void _vala_gee_read_only_map_get_property (GObject * object, guint proper g_value_take_object (value, gee_read_only_map_get_read_only_view (self)); break; case GEE_READ_ONLY_MAP_KEY_TYPE: - g_value_set_gtype (value, gee_map_get_key_type ((GeeMap*) self)); + g_value_set_gtype (value, gee_read_only_map_get_key_type (self)); break; case GEE_READ_ONLY_MAP_VALUE_TYPE: - g_value_set_gtype (value, gee_map_get_value_type ((GeeMap*) self)); - break; - case GEE_READ_ONLY_MAP_ELEMENT_TYPE: - g_value_set_gtype (value, gee_iterable_get_element_type ((GeeIterable*) self)); + g_value_set_gtype (value, gee_read_only_map_get_value_type (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala index 87b0ffc..f916d85 100644 --- a/gee/readonlymap.vala +++ b/gee/readonlymap.vala @@ -31,7 +31,7 @@ using GLib; * * @see Map */ -internal class Gee.ReadOnlyMap : Object, Iterable>, Map { +internal class Gee.ReadOnlyMap : Object, Traversable>, Iterable>, Map { /** * {@inheritDoc} @@ -47,6 +47,13 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map get { return _map.is_empty; } } + /** + * {@inheritDoc} + */ + public bool read_only { + get { return true; } + } + /** * {@inheritDoc} */ @@ -74,7 +81,7 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map } } - private Map _map; + protected Map _map; /** * Constructs a read-only map that mirrors the content of the specified map. @@ -205,7 +212,7 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map * {@inheritDoc} */ public Type element_type { - get { return typeof (Map.Entry); } + get { return typeof (Map.Entry); } } /** @@ -215,7 +222,29 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map return entries.iterator (); } - protected class MapIterator : Object, Gee.MapIterator { + /** + * {@inheritDoc} + */ + public bool foreach (ForallFunc> f) { + return _map.foreach (f); + } + + /** + * {@inheritDoc} + */ + public Iterator stream (owned StreamFunc, A> f) { + return _map.stream ((owned) f); + } + + public Iterator> filter (owned Predicate> f) { + return _map.filter ((owned)f); + } + + public Iterator> chop (int offset, int length = -1) { + return _map.chop (offset, length); + } + + internal class MapIterator : Object, Gee.MapIterator { protected Gee.MapIterator _iter; public MapIterator (Gee.MapIterator iterator) { @@ -230,10 +259,6 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map return _iter.has_next (); } - public bool first () { - return _iter.first (); - } - public K get_key () { return _iter.get_key (); } @@ -249,6 +274,24 @@ internal class Gee.ReadOnlyMap : Object, Iterable>, Map public void unset () { assert_not_reached (); } + + public bool read_only { + get { + return true; + } + } + + public bool mutable { + get { + return false; + } + } + + public bool valid { + get { + return _iter.valid; + } + } } } diff --git a/gee/readonlymultimap.c b/gee/readonlymultimap.c new file mode 100644 index 0000000..01d82b5 --- /dev/null +++ b/gee/readonlymultimap.c @@ -0,0 +1,725 @@ +/* readonlymultimap.c generated by valac 0.18.0, the Vala compiler + * generated from readonlymultimap.vala, do not modify */ + +/* readonlymultimap.vala + * + * Copyright (C) 2013 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_MULTI_MAP (gee_multi_map_get_type ()) +#define GEE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMap)) +#define GEE_IS_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_MAP)) +#define GEE_MULTI_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMapIface)) + +typedef struct _GeeMultiMap GeeMultiMap; +typedef struct _GeeMultiMapIface GeeMultiMapIface; + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_MULTI_SET (gee_multi_set_get_type ()) +#define GEE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_SET, GeeMultiSet)) +#define GEE_IS_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_SET)) +#define GEE_MULTI_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_SET, GeeMultiSetIface)) + +typedef struct _GeeMultiSet GeeMultiSet; +typedef struct _GeeMultiSetIface GeeMultiSetIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_READ_ONLY_MULTI_MAP (gee_read_only_multi_map_get_type ()) +#define GEE_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap)) +#define GEE_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) +#define GEE_IS_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_IS_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP)) +#define GEE_READ_ONLY_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass)) + +typedef struct _GeeReadOnlyMultiMap GeeReadOnlyMultiMap; +typedef struct _GeeReadOnlyMultiMapClass GeeReadOnlyMultiMapClass; +typedef struct _GeeReadOnlyMultiMapPrivate GeeReadOnlyMultiMapPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR (gee_read_only_map_map_iterator_get_type ()) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIterator)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR)) +#define GEE_READ_ONLY_MAP_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass)) + +typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator; +typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMultiSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); + gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeMultiMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); + GeeSet* (*get_keys) (GeeMultiMap* self); + GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); + GeeCollection* (*get_values) (GeeMultiMap* self); + gboolean (*contains) (GeeMultiMap* self, gconstpointer key); + GeeCollection* (*get) (GeeMultiMap* self, gconstpointer key); + void (*set) (GeeMultiMap* self, gconstpointer key, gconstpointer value); + gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); + gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); + void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); + gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); +}; + +struct _GeeReadOnlyMultiMap { + GObject parent_instance; + GeeReadOnlyMultiMapPrivate * priv; +}; + +struct _GeeReadOnlyMultiMapClass { + GObjectClass parent_class; + GeeMultiMap* (*get_read_only_view) (GeeReadOnlyMultiMap* self); +}; + +struct _GeeReadOnlyMultiMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeMultiMap* _multimap; +}; + + +static gpointer gee_read_only_multi_map_parent_class = NULL; +static GeeMultiMapIface* gee_read_only_multi_map_gee_multi_map_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_multi_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_multi_map_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_MULTI_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapPrivate)) +enum { + GEE_READ_ONLY_MULTI_MAP_DUMMY_PROPERTY, + GEE_READ_ONLY_MULTI_MAP_K_TYPE, + GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC, + GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC, + GEE_READ_ONLY_MULTI_MAP_V_TYPE, + GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC, + GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC, + GEE_READ_ONLY_MULTI_MAP_SIZE, + GEE_READ_ONLY_MULTI_MAP_READ_ONLY +}; +GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +GeeReadOnlyMultiMap* gee_read_only_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap); +static GeeSet* gee_read_only_multi_map_real_get_keys (GeeMultiMap* base); +GeeSet* gee_multi_map_get_keys (GeeMultiMap* self); +static GeeMultiSet* gee_read_only_multi_map_real_get_all_keys (GeeMultiMap* base); +GeeMultiSet* gee_multi_map_get_all_keys (GeeMultiMap* self); +static GeeCollection* gee_read_only_multi_map_real_get_values (GeeMultiMap* base); +GeeCollection* gee_multi_map_get_values (GeeMultiMap* self); +static gboolean gee_read_only_multi_map_real_contains (GeeMultiMap* base, gconstpointer key); +gboolean gee_multi_map_contains (GeeMultiMap* self, gconstpointer key); +static GeeCollection* gee_read_only_multi_map_real_get (GeeMultiMap* base, gconstpointer key); +GeeCollection* gee_multi_map_get (GeeMultiMap* self, gconstpointer key); +static void gee_read_only_multi_map_real_set (GeeMultiMap* base, gconstpointer key, gconstpointer value); +static gboolean gee_read_only_multi_map_real_remove (GeeMultiMap* base, gconstpointer key, gconstpointer value); +static gboolean gee_read_only_multi_map_real_remove_all (GeeMultiMap* base, gconstpointer key); +static void gee_read_only_multi_map_real_clear (GeeMultiMap* base); +static GeeMapIterator* gee_read_only_multi_map_real_map_iterator (GeeMultiMap* base); +GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self); +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator); +GType gee_read_only_map_map_iterator_get_type (void) G_GNUC_CONST; +gint gee_multi_map_get_size (GeeMultiMap* self); +GeeMultiMap* gee_read_only_multi_map_get_read_only_view (GeeReadOnlyMultiMap* self); +static void gee_read_only_multi_map_finalize (GObject* obj); +gboolean gee_multi_map_get_read_only (GeeMultiMap* self); +static void _vala_gee_read_only_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only multi-set that mirrors the content of the specified + * list. + * + * @param multiset the multi-set to decorate. + */ +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +GeeReadOnlyMultiMap* gee_read_only_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap) { + GeeReadOnlyMultiMap * self = NULL; + GeeMultiMap* _tmp0_; + GeeMultiMap* _tmp1_; + g_return_val_if_fail (multimap != NULL, NULL); + self = (GeeReadOnlyMultiMap*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = multimap; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_multimap); + self->priv->_multimap = _tmp1_; + return self; +} + + +GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap) { + return gee_read_only_multi_map_construct (GEE_TYPE_READ_ONLY_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, multimap); +} + + +/** + * {@inheritDoc} + */ +static GeeSet* gee_read_only_multi_map_real_get_keys (GeeMultiMap* base) { + GeeReadOnlyMultiMap * self; + GeeSet* result = NULL; + GeeMultiMap* _tmp0_; + GeeSet* _tmp1_ = NULL; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = gee_multi_map_get_keys (_tmp0_); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeMultiSet* gee_read_only_multi_map_real_get_all_keys (GeeMultiMap* base) { + GeeReadOnlyMultiMap * self; + GeeMultiSet* result = NULL; + GeeMultiMap* _tmp0_; + GeeMultiSet* _tmp1_ = NULL; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = gee_multi_map_get_all_keys (_tmp0_); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeCollection* gee_read_only_multi_map_real_get_values (GeeMultiMap* base) { + GeeReadOnlyMultiMap * self; + GeeCollection* result = NULL; + GeeMultiMap* _tmp0_; + GeeCollection* _tmp1_ = NULL; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = gee_multi_map_get_values (_tmp0_); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_read_only_multi_map_real_contains (GeeMultiMap* base, gconstpointer key) { + GeeReadOnlyMultiMap * self; + gboolean result = FALSE; + GeeMultiMap* _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = key; + _tmp2_ = gee_multi_map_contains (_tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeCollection* gee_read_only_multi_map_real_get (GeeMultiMap* base, gconstpointer key) { + GeeReadOnlyMultiMap * self; + GeeCollection* result = NULL; + GeeMultiMap* _tmp0_; + gconstpointer _tmp1_; + GeeCollection* _tmp2_ = NULL; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = key; + _tmp2_ = gee_multi_map_get (_tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static void gee_read_only_multi_map_real_set (GeeMultiMap* base, gconstpointer key, gconstpointer value) { + GeeReadOnlyMultiMap * self; + self = (GeeReadOnlyMultiMap*) base; + g_assert_not_reached (); +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_read_only_multi_map_real_remove (GeeMultiMap* base, gconstpointer key, gconstpointer value) { + GeeReadOnlyMultiMap * self; + gboolean result = FALSE; + self = (GeeReadOnlyMultiMap*) base; + g_assert_not_reached (); + return result; +} + + +/** + * {@inheritDoc} + */ +static gboolean gee_read_only_multi_map_real_remove_all (GeeMultiMap* base, gconstpointer key) { + GeeReadOnlyMultiMap * self; + gboolean result = FALSE; + self = (GeeReadOnlyMultiMap*) base; + g_assert_not_reached (); + return result; +} + + +/** + * {@inheritDoc} + */ +static void gee_read_only_multi_map_real_clear (GeeMultiMap* base) { + GeeReadOnlyMultiMap * self; + self = (GeeReadOnlyMultiMap*) base; + g_assert_not_reached (); +} + + +/** + * {@inheritDoc} + */ +static GeeMapIterator* gee_read_only_multi_map_real_map_iterator (GeeMultiMap* base) { + GeeReadOnlyMultiMap * self; + GeeMapIterator* result = NULL; + GeeMultiMap* _tmp0_; + GeeMapIterator* _tmp1_ = NULL; + GeeMapIterator* _tmp2_; + GeeReadOnlyMapMapIterator* _tmp3_; + GeeMapIterator* _tmp4_; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = gee_multi_map_map_iterator (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = gee_read_only_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + _tmp4_ = (GeeMapIterator*) _tmp3_; + _g_object_unref0 (_tmp2_); + result = _tmp4_; + return result; +} + + +static gint gee_read_only_multi_map_real_get_size (GeeMultiMap* base) { + gint result; + GeeReadOnlyMultiMap* self; + GeeMultiMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeReadOnlyMultiMap*) base; + _tmp0_ = self->priv->_multimap; + _tmp1_ = gee_multi_map_get_size (_tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_read_only_multi_map_real_get_read_only (GeeMultiMap* base) { + gboolean result; + GeeReadOnlyMultiMap* self; + self = (GeeReadOnlyMultiMap*) base; + result = TRUE; + return result; +} + + +GeeMultiMap* gee_read_only_multi_map_get_read_only_view (GeeReadOnlyMultiMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_READ_ONLY_MULTI_MAP_GET_CLASS (self)->get_read_only_view (self); +} + + +static GeeMultiMap* gee_read_only_multi_map_real_get_read_only_view (GeeReadOnlyMultiMap* base) { + GeeMultiMap* result; + GeeReadOnlyMultiMap* self; + GeeMultiMap* _tmp0_; + self = base; + _tmp0_ = _g_object_ref0 ((GeeMultiMap*) self); + result = _tmp0_; + return result; +} + + +static void gee_read_only_multi_map_class_init (GeeReadOnlyMultiMapClass * klass) { + gee_read_only_multi_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyMultiMapPrivate)); + GEE_READ_ONLY_MULTI_MAP_CLASS (klass)->get_read_only_view = gee_read_only_multi_map_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_multi_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_multi_map_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_read_only_multi_map_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_multi_map_gee_multi_map_get_k_type (GeeReadOnlyMultiMap* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_k_dup_func (GeeReadOnlyMultiMap* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_k_destroy_func (GeeReadOnlyMultiMap* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_read_only_multi_map_gee_multi_map_get_v_type (GeeReadOnlyMultiMap* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_v_dup_func (GeeReadOnlyMultiMap* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_v_destroy_func (GeeReadOnlyMultiMap* self) { + return self->priv->v_destroy_func; +} + + +static void gee_read_only_multi_map_gee_multi_map_interface_init (GeeMultiMapIface * iface) { + gee_read_only_multi_map_gee_multi_map_parent_iface = g_type_interface_peek_parent (iface); + iface->get_keys = (GeeSet* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_keys; + iface->get_all_keys = (GeeMultiSet* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_all_keys; + iface->get_values = (GeeCollection* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_values; + iface->contains = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_contains; + iface->get = (GeeCollection* (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_get; + iface->set = (void (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_read_only_multi_map_real_set; + iface->remove = (gboolean (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_read_only_multi_map_real_remove; + iface->remove_all = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_remove_all; + iface->clear = (void (*)(GeeMultiMap*)) gee_read_only_multi_map_real_clear; + iface->map_iterator = (GeeMapIterator* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_map_iterator; + iface->get_k_type = (GType(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_destroy_func; + iface->get_size = gee_read_only_multi_map_real_get_size; + iface->get_read_only = gee_read_only_multi_map_real_get_read_only; + iface->get_read_only_view = (GeeMultiMap* (*) (GeeMultiMap *)) gee_read_only_multi_map_get_read_only_view; +} + + +static void gee_read_only_multi_map_instance_init (GeeReadOnlyMultiMap * self) { + self->priv = GEE_READ_ONLY_MULTI_MAP_GET_PRIVATE (self); +} + + +static void gee_read_only_multi_map_finalize (GObject* obj) { + GeeReadOnlyMultiMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap); + _g_object_unref0 (self->priv->_multimap); + G_OBJECT_CLASS (gee_read_only_multi_map_parent_class)->finalize (obj); +} + + +/** + * Read-only view for {@link MultiMap} collections. + * + * This class decorates any class which implements the {@link MultiMap} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see MultiMap + */ +GType gee_read_only_multi_map_get_type (void) { + static volatile gsize gee_read_only_multi_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_multi_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyMultiMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_multi_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyMultiMap), 0, (GInstanceInitFunc) gee_read_only_multi_map_instance_init, NULL }; + static const GInterfaceInfo gee_multi_map_info = { (GInterfaceInitFunc) gee_read_only_multi_map_gee_multi_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_multi_map_type_id; + gee_read_only_multi_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeReadOnlyMultiMap", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_multi_map_type_id, GEE_TYPE_MULTI_MAP, &gee_multi_map_info); + g_once_init_leave (&gee_read_only_multi_map_type_id__volatile, gee_read_only_multi_map_type_id); + } + return gee_read_only_multi_map_type_id__volatile; +} + + +static void _vala_gee_read_only_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyMultiMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap); + switch (property_id) { + case GEE_READ_ONLY_MULTI_MAP_SIZE: + g_value_set_int (value, gee_multi_map_get_size ((GeeMultiMap*) self)); + break; + case GEE_READ_ONLY_MULTI_MAP_READ_ONLY: + g_value_set_boolean (value, gee_multi_map_get_read_only ((GeeMultiMap*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyMultiMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap); + switch (property_id) { + case GEE_READ_ONLY_MULTI_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_MULTI_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlymultimap.vala b/gee/readonlymultimap.vala new file mode 100644 index 0000000..214f28e --- /dev/null +++ b/gee/readonlymultimap.vala @@ -0,0 +1,131 @@ +/* readonlymultimap.vala + * + * Copyright (C) 2013 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using GLib; + +/** + * Read-only view for {@link MultiMap} collections. + * + * This class decorates any class which implements the {@link MultiMap} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see MultiMap + */ +internal class Gee.ReadOnlyMultiMap : Object, MultiMap { + /** + * Constructs a read-only multi-set that mirrors the content of the specified + * list. + * + * @param multiset the multi-set to decorate. + */ + public ReadOnlyMultiMap (MultiMap multimap) { + this._multimap = multimap; + } + + /** + * {@inheritDoc} + */ + public int size { get { return _multimap.size; } } + + /** + * {@inheritDoc} + */ + public bool read_only { get { return true; } } + + /** + * {@inheritDoc} + */ + public Set get_keys () { + return _multimap.get_keys (); + } + + /** + * {@inheritDoc} + */ + public MultiSet get_all_keys () { + return _multimap.get_all_keys (); + } + + /** + * {@inheritDoc} + */ + public Collection get_values () { + return _multimap.get_values (); + } + + /** + * {@inheritDoc} + */ + public bool contains (K key) { + return _multimap.contains (key); + } + + /** + * {@inheritDoc} + */ + public new Collection get (K key) { + return _multimap.get (key); + } + + /** + * {@inheritDoc} + */ + public new void set (K key, V value) { + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public bool remove (K key, V value) { + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public bool remove_all (K key) { + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public void clear () { + assert_not_reached (); + } + + /** + * {@inheritDoc} + */ + public MapIterator map_iterator () { + return new ReadOnlyMap.MapIterator (_multimap.map_iterator ()); + } + + /** + * {@inheritDoc} + */ + public virtual new MultiMap read_only_view { owned get { return this; } } + + private MultiMap _multimap; +} diff --git a/gee/readonlymultiset.c b/gee/readonlymultiset.c new file mode 100644 index 0000000..20125f8 --- /dev/null +++ b/gee/readonlymultiset.c @@ -0,0 +1,401 @@ +/* readonlymultiset.c generated by valac 0.18.0, the Vala compiler + * generated from readonlymultiset.vala, do not modify */ + +/* readonlymultiset.vala + * + * Copyright (C) 2013 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; + +#define GEE_TYPE_MULTI_SET (gee_multi_set_get_type ()) +#define GEE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_SET, GeeMultiSet)) +#define GEE_IS_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_SET)) +#define GEE_MULTI_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_SET, GeeMultiSetIface)) + +typedef struct _GeeMultiSet GeeMultiSet; +typedef struct _GeeMultiSetIface GeeMultiSetIface; + +#define GEE_TYPE_READ_ONLY_MULTI_SET (gee_read_only_multi_set_get_type ()) +#define GEE_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet)) +#define GEE_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) +#define GEE_IS_READ_ONLY_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_IS_READ_ONLY_MULTI_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_SET)) +#define GEE_READ_ONLY_MULTI_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetClass)) + +typedef struct _GeeReadOnlyMultiSet GeeReadOnlyMultiSet; +typedef struct _GeeReadOnlyMultiSetClass GeeReadOnlyMultiSetClass; +typedef struct _GeeReadOnlyMultiSetPrivate GeeReadOnlyMultiSetPrivate; + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeReadOnlyCollection { + GObject parent_instance; + GeeReadOnlyCollectionPrivate * priv; + GeeCollection* _collection; +}; + +struct _GeeReadOnlyCollectionClass { + GObjectClass parent_class; + GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); +}; + +struct _GeeMultiSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); + gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +struct _GeeReadOnlyMultiSet { + GeeReadOnlyCollection parent_instance; + GeeReadOnlyMultiSetPrivate * priv; +}; + +struct _GeeReadOnlyMultiSetClass { + GeeReadOnlyCollectionClass parent_class; + GeeMultiSet* (*get_read_only_view) (GeeReadOnlyMultiSet* self); +}; + +struct _GeeReadOnlyMultiSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + + +static gpointer gee_read_only_multi_set_parent_class = NULL; +static GeeMultiSetIface* gee_read_only_multi_set_gee_multi_set_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_multi_set_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_MULTI_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSetPrivate)) +enum { + GEE_READ_ONLY_MULTI_SET_DUMMY_PROPERTY, + GEE_READ_ONLY_MULTI_SET_G_TYPE, + GEE_READ_ONLY_MULTI_SET_G_DUP_FUNC, + GEE_READ_ONLY_MULTI_SET_G_DESTROY_FUNC +}; +GeeReadOnlyMultiSet* gee_read_only_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeReadOnlyMultiSet* gee_read_only_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset); +GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); +GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); +static gint gee_read_only_multi_set_real_count (GeeMultiSet* base, gconstpointer item); +gint gee_multi_set_count (GeeMultiSet* self, gconstpointer item); +GeeMultiSet* gee_read_only_multi_set_get_read_only_view (GeeReadOnlyMultiSet* self); +static void _vala_gee_read_only_multi_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_multi_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only multi-set that mirrors the content of the specified + * list. + * + * @param multiset the multi-set to decorate. + */ +GeeReadOnlyMultiSet* gee_read_only_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset) { + GeeReadOnlyMultiSet * self = NULL; + GeeMultiSet* _tmp0_; + g_return_val_if_fail (multiset != NULL, NULL); + _tmp0_ = multiset; + self = (GeeReadOnlyMultiSet*) gee_read_only_collection_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeCollection*) _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeReadOnlyMultiSet* gee_read_only_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMultiSet* multiset) { + return gee_read_only_multi_set_construct (GEE_TYPE_READ_ONLY_MULTI_SET, g_type, g_dup_func, g_destroy_func, multiset); +} + + +/** + * {@inheritDoc} + */ +static gint gee_read_only_multi_set_real_count (GeeMultiSet* base, gconstpointer item) { + GeeReadOnlyMultiSet * self; + gint result = 0; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + self = (GeeReadOnlyMultiSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = item; + _tmp2_ = gee_multi_set_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_MULTI_SET, GeeMultiSet), _tmp1_); + result = _tmp2_; + return result; +} + + +GeeMultiSet* gee_read_only_multi_set_get_read_only_view (GeeReadOnlyMultiSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_READ_ONLY_MULTI_SET_GET_CLASS (self)->get_read_only_view (self); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeMultiSet* gee_read_only_multi_set_real_get_read_only_view (GeeReadOnlyMultiSet* base) { + GeeMultiSet* result; + GeeReadOnlyMultiSet* self; + GeeMultiSet* _tmp0_; + self = base; + _tmp0_ = _g_object_ref0 ((GeeMultiSet*) self); + result = _tmp0_; + return result; +} + + +static void gee_read_only_multi_set_class_init (GeeReadOnlyMultiSetClass * klass) { + gee_read_only_multi_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlyMultiSetPrivate)); + GEE_READ_ONLY_MULTI_SET_CLASS (klass)->get_read_only_view = gee_read_only_multi_set_real_get_read_only_view; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_multi_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_multi_set_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_read_only_multi_set_gee_multi_set_get_g_type (GeeReadOnlyMultiSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_multi_set_gee_multi_set_get_g_dup_func (GeeReadOnlyMultiSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_multi_set_gee_multi_set_get_g_destroy_func (GeeReadOnlyMultiSet* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_multi_set_gee_multi_set_interface_init (GeeMultiSetIface * iface) { + gee_read_only_multi_set_gee_multi_set_parent_iface = g_type_interface_peek_parent (iface); + iface->count = (gint (*)(GeeMultiSet*, gconstpointer)) gee_read_only_multi_set_real_count; + iface->get_g_type = (GType(*)(GeeMultiSet*)) gee_read_only_multi_set_gee_multi_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeMultiSet*)) gee_read_only_multi_set_gee_multi_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeMultiSet*)) gee_read_only_multi_set_gee_multi_set_get_g_destroy_func; + iface->get_read_only_view = (GeeMultiSet* (*) (GeeMultiSet *)) gee_read_only_multi_set_get_read_only_view; +} + + +static void gee_read_only_multi_set_instance_init (GeeReadOnlyMultiSet * self) { + self->priv = GEE_READ_ONLY_MULTI_SET_GET_PRIVATE (self); +} + + +/** + * Read-only view for {@link MultiSet} collections. + * + * This class decorates any class which implements the {@link Collection} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see MultiSet + */ +GType gee_read_only_multi_set_get_type (void) { + static volatile gsize gee_read_only_multi_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_multi_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyMultiSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_multi_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyMultiSet), 0, (GInstanceInitFunc) gee_read_only_multi_set_instance_init, NULL }; + static const GInterfaceInfo gee_multi_set_info = { (GInterfaceInitFunc) gee_read_only_multi_set_gee_multi_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_multi_set_type_id; + gee_read_only_multi_set_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_COLLECTION, "GeeReadOnlyMultiSet", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_multi_set_type_id, GEE_TYPE_MULTI_SET, &gee_multi_set_info); + g_once_init_leave (&gee_read_only_multi_set_type_id__volatile, gee_read_only_multi_set_type_id); + } + return gee_read_only_multi_set_type_id__volatile; +} + + +static void _vala_gee_read_only_multi_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlyMultiSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_multi_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlyMultiSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_SET, GeeReadOnlyMultiSet); + switch (property_id) { + case GEE_READ_ONLY_MULTI_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_MULTI_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_MULTI_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlymultiset.vala b/gee/readonlymultiset.vala new file mode 100644 index 0000000..b6404f1 --- /dev/null +++ b/gee/readonlymultiset.vala @@ -0,0 +1,57 @@ +/* readonlymultiset.vala + * + * Copyright (C) 2013 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using GLib; + +/** + * Read-only view for {@link MultiSet} collections. + * + * This class decorates any class which implements the {@link Collection} + * interface by making it read only. Any method which normally modify data will + * throw an error. + * + * @see MultiSet + */ +internal class Gee.ReadOnlyMultiSet : Gee.ReadOnlyCollection, MultiSet { + /** + * Constructs a read-only multi-set that mirrors the content of the specified + * list. + * + * @param multiset the multi-set to decorate. + */ + public ReadOnlyMultiSet (MultiSet multiset) { + base (multiset); + } + + /** + * {@inheritDoc} + */ + public int count (G item) { + return ((Gee.MultiSet) _collection).count (item); + } + + /** + * {@inheritDoc} + */ + public virtual new MultiSet read_only_view { owned get { return this; } } +} + diff --git a/gee/readonlyset.c b/gee/readonlyset.c index e6ab12a..312d3c2 100644 --- a/gee/readonlyset.c +++ b/gee/readonlyset.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -81,23 +101,55 @@ typedef struct _GeeReadOnlySet GeeReadOnlySet; typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -109,6 +161,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -125,6 +178,9 @@ struct _GeeReadOnlyCollectionClass { struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; @@ -148,7 +204,16 @@ struct _GeeReadOnlySetPrivate { static gpointer gee_read_only_set_parent_class = NULL; static GeeSetIface* gee_read_only_set_gee_set_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_read_only_collection_get_type (void) G_GNUC_CONST; @@ -229,8 +294,26 @@ static void gee_read_only_set_class_init (GeeReadOnlySetClass * klass) { } +static GType gee_read_only_set_gee_set_get_g_type (GeeReadOnlySet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_set_gee_set_get_g_dup_func (GeeReadOnlySet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_set_gee_set_get_g_destroy_func (GeeReadOnlySet* self) { + return self->priv->g_destroy_func; +} + + static void gee_read_only_set_gee_set_interface_init (GeeSetIface * iface) { gee_read_only_set_gee_set_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeSet*)) gee_read_only_set_gee_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeSet*)) gee_read_only_set_gee_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeSet*)) gee_read_only_set_gee_set_get_g_destroy_func; iface->get_read_only_view = (GeeSet* (*) (GeeSet *)) gee_read_only_set_get_read_only_view; } diff --git a/gee/readonlysortedmap.c b/gee/readonlysortedmap.c new file mode 100644 index 0000000..6a319ce --- /dev/null +++ b/gee/readonlysortedmap.c @@ -0,0 +1,645 @@ +/* readonlysortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from readonlysortedmap.vala, do not modify */ + +/* readonlysortedmap.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ()) +#define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap)) +#define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) +#define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP)) +#define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass)) + +typedef struct _GeeReadOnlyMap GeeReadOnlyMap; +typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass; +typedef struct _GeeReadOnlyMapPrivate GeeReadOnlyMapPrivate; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ()) +#define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap)) +#define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) +#define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP)) +#define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass)) + +typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap; +typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass; +typedef struct _GeeReadOnlySortedMapPrivate GeeReadOnlySortedMapPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeReadOnlyMap { + GObject parent_instance; + GeeReadOnlyMapPrivate * priv; + GeeMap* _map; +}; + +struct _GeeReadOnlyMapClass { + GObjectClass parent_class; + GeeMap* (*get_read_only_view) (GeeReadOnlyMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeReadOnlySortedMap { + GeeReadOnlyMap parent_instance; + GeeReadOnlySortedMapPrivate * priv; +}; + +struct _GeeReadOnlySortedMapClass { + GeeReadOnlyMapClass parent_class; +}; + +struct _GeeReadOnlySortedMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + + +static gpointer gee_read_only_sorted_map_parent_class = NULL; +static GeeSortedMapIface* gee_read_only_sorted_map_gee_sorted_map_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_SORTED_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapPrivate)) +enum { + GEE_READ_ONLY_SORTED_MAP_DUMMY_PROPERTY, + GEE_READ_ONLY_SORTED_MAP_K_TYPE, + GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC, + GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC, + GEE_READ_ONLY_SORTED_MAP_V_TYPE, + GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC, + GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC, + GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS, + GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES +}; +GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlyMap* gee_read_only_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +GeeReadOnlyMap* gee_read_only_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map); +static GeeSortedMap* gee_read_only_sorted_map_real_head_map (GeeSortedMap* base, gconstpointer before); +GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self, gconstpointer before); +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self); +static GeeSortedMap* gee_read_only_sorted_map_real_tail_map (GeeSortedMap* base, gconstpointer after); +GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self, gconstpointer after); +static GeeSortedMap* gee_read_only_sorted_map_real_sub_map (GeeSortedMap* base, gconstpointer from, gconstpointer to); +GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self, gconstpointer before, gconstpointer after); +GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); +GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self); +GeeMap* gee_read_only_map_get_read_only_view (GeeReadOnlyMap* self); +static void _vala_gee_read_only_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only map that mirrors the content of the specified map. + * + * @param map the map to decorate. + */ +GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map) { + GeeReadOnlySortedMap * self = NULL; + GeeMap* _tmp0_; + g_return_val_if_fail (map != NULL, NULL); + _tmp0_ = map; + self = (GeeReadOnlySortedMap*) gee_read_only_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* map) { + return gee_read_only_sorted_map_construct (GEE_TYPE_READ_ONLY_SORTED_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_read_only_sorted_map_real_head_map (GeeSortedMap* base, gconstpointer before) { + GeeReadOnlySortedMap * self; + GeeSortedMap* result = NULL; + GeeMap* _tmp0_; + gconstpointer _tmp1_; + GeeSortedMap* _tmp2_ = NULL; + GeeSortedMap* _tmp3_; + GeeSortedMap* _tmp4_; + GeeSortedMap* _tmp5_; + GeeSortedMap* _tmp6_; + self = (GeeReadOnlySortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = before; + _tmp2_ = gee_sorted_map_head_map (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_map_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_read_only_sorted_map_real_tail_map (GeeSortedMap* base, gconstpointer after) { + GeeReadOnlySortedMap * self; + GeeSortedMap* result = NULL; + GeeMap* _tmp0_; + gconstpointer _tmp1_; + GeeSortedMap* _tmp2_ = NULL; + GeeSortedMap* _tmp3_; + GeeSortedMap* _tmp4_; + GeeSortedMap* _tmp5_; + GeeSortedMap* _tmp6_; + self = (GeeReadOnlySortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = after; + _tmp2_ = gee_sorted_map_tail_map (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_map_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_read_only_sorted_map_real_sub_map (GeeSortedMap* base, gconstpointer from, gconstpointer to) { + GeeReadOnlySortedMap * self; + GeeSortedMap* result = NULL; + GeeMap* _tmp0_; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + GeeSortedMap* _tmp3_ = NULL; + GeeSortedMap* _tmp4_; + GeeSortedMap* _tmp5_; + GeeSortedMap* _tmp6_; + GeeSortedMap* _tmp7_; + self = (GeeReadOnlySortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = from; + _tmp2_ = to; + _tmp3_ = gee_sorted_map_sub_map (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_sorted_map_get_read_only_view (_tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = _tmp6_; + _g_object_unref0 (_tmp4_); + result = _tmp7_; + return result; +} + + +static GeeSortedSet* gee_read_only_sorted_map_real_get_ascending_keys (GeeSortedMap* base) { + GeeSortedSet* result; + GeeReadOnlySortedMap* self; + GeeMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeReadOnlySortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = gee_sorted_map_get_ascending_keys (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +static GeeSortedSet* gee_read_only_sorted_map_real_get_ascending_entries (GeeSortedMap* base) { + GeeSortedSet* result; + GeeReadOnlySortedMap* self; + GeeMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeReadOnlySortedMap*) base; + _tmp0_ = ((GeeReadOnlyMap*) self)->_map; + _tmp1_ = gee_sorted_map_get_ascending_entries (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +static void gee_read_only_sorted_map_class_init (GeeReadOnlySortedMapClass * klass) { + gee_read_only_sorted_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlySortedMapPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_sorted_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_sorted_map_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS, g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES, g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_read_only_sorted_map_gee_sorted_map_interface_init (GeeSortedMapIface * iface) { + gee_read_only_sorted_map_gee_sorted_map_parent_iface = g_type_interface_peek_parent (iface); + iface->head_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer)) gee_read_only_sorted_map_real_head_map; + iface->tail_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer)) gee_read_only_sorted_map_real_tail_map; + iface->sub_map = (GeeSortedMap* (*)(GeeSortedMap*, gconstpointer, gconstpointer)) gee_read_only_sorted_map_real_sub_map; + iface->get_ascending_keys = gee_read_only_sorted_map_real_get_ascending_keys; + iface->get_ascending_entries = gee_read_only_sorted_map_real_get_ascending_entries; + iface->get_read_only_view = (GeeSortedMap* (*) (GeeSortedMap *)) gee_read_only_map_get_read_only_view; +} + + +static void gee_read_only_sorted_map_instance_init (GeeReadOnlySortedMap * self) { + self->priv = GEE_READ_ONLY_SORTED_MAP_GET_PRIVATE (self); +} + + +/** + * Read-only view for {@link SortedMap} collections. + * + * This class decorates any class which implements the {@link SortedMap} interface + * by making it read only. Any method which normally modify data will throw an + * error. + * + * @see SortedMap + */ +GType gee_read_only_sorted_map_get_type (void) { + static volatile gsize gee_read_only_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlySortedMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_sorted_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlySortedMap), 0, (GInstanceInitFunc) gee_read_only_sorted_map_instance_init, NULL }; + static const GInterfaceInfo gee_sorted_map_info = { (GInterfaceInitFunc) gee_read_only_sorted_map_gee_sorted_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_sorted_map_type_id; + gee_read_only_sorted_map_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_MAP, "GeeReadOnlySortedMap", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_sorted_map_type_id, GEE_TYPE_SORTED_MAP, &gee_sorted_map_info); + g_once_init_leave (&gee_read_only_sorted_map_type_id__volatile, gee_read_only_sorted_map_type_id); + } + return gee_read_only_sorted_map_type_id__volatile; +} + + +static void _vala_gee_read_only_sorted_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlySortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap); + switch (property_id) { + case GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS: + g_value_take_object (value, gee_sorted_map_get_ascending_keys ((GeeSortedMap*) self)); + break; + case GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES: + g_value_take_object (value, gee_sorted_map_get_ascending_entries ((GeeSortedMap*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_sorted_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlySortedMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap); + switch (property_id) { + case GEE_READ_ONLY_SORTED_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_SORTED_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlysortedmap.vala b/gee/readonlysortedmap.vala new file mode 100644 index 0000000..56d7fb6 --- /dev/null +++ b/gee/readonlysortedmap.vala @@ -0,0 +1,81 @@ +/* readonlysortedmap.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Read-only view for {@link SortedMap} collections. + * + * This class decorates any class which implements the {@link SortedMap} interface + * by making it read only. Any method which normally modify data will throw an + * error. + * + * @see SortedMap + */ +internal class Gee.ReadOnlySortedMap : ReadOnlyMap, SortedMap { + /** + * Constructs a read-only map that mirrors the content of the specified map. + * + * @param map the map to decorate. + */ + public ReadOnlySortedMap (Map map) { + base (map); + } + + /** + * {@inheritDoc} + */ + public SortedMap head_map (K before) { + return (_map as SortedMap).head_map (before).read_only_view; + } + + /** + * {@inheritDoc} + */ + public SortedMap tail_map (K after) { + return (_map as SortedMap).tail_map (after).read_only_view; + } + + /** + * {@inheritDoc} + */ + public SortedMap sub_map (K from, K to) { + return (_map as SortedMap).sub_map (from, to).read_only_view; + } + + /** + * {@inheritDoc} + */ + public SortedSet ascending_keys { + owned get { + return (_map as SortedMap).ascending_keys.read_only_view; + } + } + + /** + * {@inheritDoc} + */ + public SortedSet> ascending_entries { + owned get { + return (_map as SortedMap).ascending_entries.read_only_view; + } + } +} + diff --git a/gee/readonlysortedset.c b/gee/readonlysortedset.c new file mode 100644 index 0000000..68c0a4f --- /dev/null +++ b/gee/readonlysortedset.c @@ -0,0 +1,694 @@ +/* readonlysortedset.c generated by valac 0.18.0, the Vala compiler + * generated from readonlysortedset.vala, do not modify */ + +/* readonlysortedset.vala + * + * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) +#define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) +#define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) +#define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION)) +#define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass)) + +typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; +typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ()) +#define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet)) +#define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) +#define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET)) +#define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET)) +#define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass)) + +typedef struct _GeeReadOnlySet GeeReadOnlySet; +typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass; +typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ()) +#define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet)) +#define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) +#define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET)) +#define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass)) + +typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet; +typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass; +typedef struct _GeeReadOnlySortedSetPrivate GeeReadOnlySortedSetPrivate; + +#define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ()) +#define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR)) +#define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass)) + +typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator; +typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeReadOnlyCollection { + GObject parent_instance; + GeeReadOnlyCollectionPrivate * priv; + GeeCollection* _collection; +}; + +struct _GeeReadOnlyCollectionClass { + GObjectClass parent_class; + GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeReadOnlySet { + GeeReadOnlyCollection parent_instance; + GeeReadOnlySetPrivate * priv; +}; + +struct _GeeReadOnlySetClass { + GeeReadOnlyCollectionClass parent_class; + GeeSet* (*get_read_only_view) (GeeReadOnlySet* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeReadOnlySortedSet { + GeeReadOnlySet parent_instance; + GeeReadOnlySortedSetPrivate * priv; +}; + +struct _GeeReadOnlySortedSetClass { + GeeReadOnlySetClass parent_class; +}; + +struct _GeeReadOnlySortedSetPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; +}; + + +static gpointer gee_read_only_sorted_set_parent_class = NULL; +static GeeSortedSetIface* gee_read_only_sorted_set_gee_sorted_set_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_read_only_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST; +#define GEE_READ_ONLY_SORTED_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetPrivate)) +enum { + GEE_READ_ONLY_SORTED_SET_DUMMY_PROPERTY, + GEE_READ_ONLY_SORTED_SET_G_TYPE, + GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC, + GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC, + GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW +}; +GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set); +GeeReadOnlySet* gee_read_only_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set); +GeeReadOnlySet* gee_read_only_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set); +static gpointer gee_read_only_sorted_set_real_first (GeeSortedSet* base); +gpointer gee_sorted_set_first (GeeSortedSet* self); +static gpointer gee_read_only_sorted_set_real_last (GeeSortedSet* base); +gpointer gee_sorted_set_last (GeeSortedSet* self); +static GeeIterator* gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base, gconstpointer element); +GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); +GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST; +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator); +static gpointer gee_read_only_sorted_set_real_lower (GeeSortedSet* base, gconstpointer element); +gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element); +static gpointer gee_read_only_sorted_set_real_higher (GeeSortedSet* base, gconstpointer element); +gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element); +static gpointer gee_read_only_sorted_set_real_floor (GeeSortedSet* base, gconstpointer element); +gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element); +static gpointer gee_read_only_sorted_set_real_ceil (GeeSortedSet* base, gconstpointer element); +gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element); +static GeeSortedSet* gee_read_only_sorted_set_real_head_set (GeeSortedSet* base, gconstpointer before); +GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self, gconstpointer before); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); +static GeeSortedSet* gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base, gconstpointer after); +GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self, gconstpointer after); +static GeeSortedSet* gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base, gconstpointer from, gconstpointer to); +GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gconstpointer to); +static void _vala_gee_read_only_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_read_only_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +/** + * Constructs a read-only set that mirrors the content of the specified set. + * + * @param set the set to decorate. + */ +GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set) { + GeeReadOnlySortedSet * self = NULL; + GeeSortedSet* _tmp0_; + g_return_val_if_fail (set != NULL, NULL); + _tmp0_ = set; + self = (GeeReadOnlySortedSet*) gee_read_only_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeSet*) _tmp0_); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + return self; +} + + +GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set) { + return gee_read_only_sorted_set_construct (GEE_TYPE_READ_ONLY_SORTED_SET, g_type, g_dup_func, g_destroy_func, set); +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_first (GeeSortedSet* base) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gpointer _tmp1_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = gee_sorted_set_first (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_last (GeeSortedSet* base) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gpointer _tmp1_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = gee_sorted_set_last (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); + result = _tmp1_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeIterator* gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base, gconstpointer element) { + GeeReadOnlySortedSet * self; + GeeIterator* result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* iter; + GeeReadOnlyCollectionIterator* _tmp3_ = NULL; + GeeIterator* _tmp4_; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = element; + _tmp2_ = gee_sorted_set_iterator_at (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + iter = _tmp2_; + _tmp4_ = iter; + if (_tmp4_ != NULL) { + GeeIterator* _tmp5_; + GeeReadOnlyCollectionIterator* _tmp6_; + _tmp5_ = iter; + _tmp6_ = gee_read_only_collection_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_); + _g_object_unref0 (_tmp3_); + _tmp3_ = _tmp6_; + } else { + _g_object_unref0 (_tmp3_); + _tmp3_ = NULL; + } + result = (GeeIterator*) _tmp3_; + _g_object_unref0 (iter); + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_lower (GeeSortedSet* base, gconstpointer element) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = element; + _tmp2_ = gee_sorted_set_lower (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_higher (GeeSortedSet* base, gconstpointer element) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = element; + _tmp2_ = gee_sorted_set_higher (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_floor (GeeSortedSet* base, gconstpointer element) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = element; + _tmp2_ = gee_sorted_set_floor (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static gpointer gee_read_only_sorted_set_real_ceil (GeeSortedSet* base, gconstpointer element) { + GeeReadOnlySortedSet * self; + gpointer result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_ = NULL; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = element; + _tmp2_ = gee_sorted_set_ceil (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + result = _tmp2_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_read_only_sorted_set_real_head_set (GeeSortedSet* base, gconstpointer before) { + GeeReadOnlySortedSet * self; + GeeSortedSet* result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + GeeSortedSet* _tmp2_ = NULL; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = before; + _tmp2_ = gee_sorted_set_head_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base, gconstpointer after) { + GeeReadOnlySortedSet * self; + GeeSortedSet* result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + GeeSortedSet* _tmp2_ = NULL; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = after; + _tmp2_ = gee_sorted_set_tail_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp3_); + result = _tmp6_; + return result; +} + + +/** + * {@inheritDoc} + */ +static GeeSortedSet* gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base, gconstpointer from, gconstpointer to) { + GeeReadOnlySortedSet * self; + GeeSortedSet* result = NULL; + GeeCollection* _tmp0_; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + GeeSortedSet* _tmp3_ = NULL; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection; + _tmp1_ = from; + _tmp2_ = to; + _tmp3_ = gee_sorted_set_sub_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_sorted_set_get_read_only_view (_tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = _tmp6_; + _g_object_unref0 (_tmp4_); + result = _tmp7_; + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeSortedSet* gee_read_only_sorted_set_real_get_read_only_view (GeeSortedSet* base) { + GeeSortedSet* result; + GeeReadOnlySortedSet* self; + GeeSortedSet* _tmp0_; + self = (GeeReadOnlySortedSet*) base; + _tmp0_ = _g_object_ref0 ((GeeSortedSet*) self); + result = _tmp0_; + return result; +} + + +static void gee_read_only_sorted_set_class_init (GeeReadOnlySortedSetClass * klass) { + gee_read_only_sorted_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeReadOnlySortedSetPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_sorted_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_sorted_set_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + /** + * {@inheritDoc} + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_read_only_sorted_set_gee_sorted_set_get_g_type (GeeReadOnlySortedSet* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func (GeeReadOnlySortedSet* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func (GeeReadOnlySortedSet* self) { + return self->priv->g_destroy_func; +} + + +static void gee_read_only_sorted_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface) { + gee_read_only_sorted_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gpointer (*)(GeeSortedSet*)) gee_read_only_sorted_set_real_first; + iface->last = (gpointer (*)(GeeSortedSet*)) gee_read_only_sorted_set_real_last; + iface->iterator_at = (GeeIterator* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_iterator_at; + iface->lower = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_lower; + iface->higher = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_higher; + iface->floor = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_floor; + iface->ceil = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_ceil; + iface->head_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_head_set; + iface->tail_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_tail_set; + iface->sub_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer, gconstpointer)) gee_read_only_sorted_set_real_sub_set; + iface->get_g_type = (GType(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func; + iface->get_read_only_view = gee_read_only_sorted_set_real_get_read_only_view; +} + + +static void gee_read_only_sorted_set_instance_init (GeeReadOnlySortedSet * self) { + self->priv = GEE_READ_ONLY_SORTED_SET_GET_PRIVATE (self); +} + + +/** + * Read-only view for {@link SortedSet} collections. + * + * This class decorates any class which implements the {@link SortedSet} interface + * by making it read only. Any method which normally modify data will throw an + * error. + * + * @see SortedSet + */ +GType gee_read_only_sorted_set_get_type (void) { + static volatile gsize gee_read_only_sorted_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_read_only_sorted_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlySortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlySortedSet), 0, (GInstanceInitFunc) gee_read_only_sorted_set_instance_init, NULL }; + static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_read_only_sorted_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_read_only_sorted_set_type_id; + gee_read_only_sorted_set_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_SET, "GeeReadOnlySortedSet", &g_define_type_info, 0); + g_type_add_interface_static (gee_read_only_sorted_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info); + g_once_init_leave (&gee_read_only_sorted_set_type_id__volatile, gee_read_only_sorted_set_type_id); + } + return gee_read_only_sorted_set_type_id__volatile; +} + + +static void _vala_gee_read_only_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeReadOnlySortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet); + switch (property_id) { + case GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW: + g_value_take_object (value, gee_sorted_set_get_read_only_view ((GeeSortedSet*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_read_only_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeReadOnlySortedSet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet); + switch (property_id) { + case GEE_READ_ONLY_SORTED_SET_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/readonlysortedset.vala b/gee/readonlysortedset.vala new file mode 100644 index 0000000..de60b4c --- /dev/null +++ b/gee/readonlysortedset.vala @@ -0,0 +1,123 @@ +/* readonlysortedset.vala + * + * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +/** + * Read-only view for {@link SortedSet} collections. + * + * This class decorates any class which implements the {@link SortedSet} interface + * by making it read only. Any method which normally modify data will throw an + * error. + * + * @see SortedSet + */ +internal class Gee.ReadOnlySortedSet : ReadOnlySet, SortedSet { + /** + * Constructs a read-only set that mirrors the content of the specified set. + * + * @param set the set to decorate. + */ + public ReadOnlySortedSet (SortedSet set) { + base (set); + } + + /** + * {@inheritDoc} + */ + public G first () { + return (_collection as SortedSet).first (); + } + + /** + * {@inheritDoc} + */ + public G last () { + return (_collection as SortedSet).last (); + } + + /** + * {@inheritDoc} + */ + public Gee.Iterator? iterator_at (G element) { + var iter = (_collection as SortedSet).iterator_at (element); + return (iter != null) ? new Iterator (iter) : null; + } + + /** + * {@inheritDoc} + */ + public G? lower (G element) { + return (_collection as SortedSet).lower (element); + } + + /** + * {@inheritDoc} + */ + public G? higher (G element) { + return (_collection as SortedSet).higher (element); + } + + /** + * {@inheritDoc} + */ + public G? floor (G element) { + return (_collection as SortedSet).floor (element); + } + + /** + * {@inheritDoc} + */ + public G? ceil (G element) { + return (_collection as SortedSet).ceil (element); + } + + /** + * {@inheritDoc} + */ + public SortedSet head_set (G before) { + return (_collection as SortedSet).head_set (before).read_only_view; + } + + /** + * {@inheritDoc} + */ + public SortedSet tail_set (G after) { + return(_collection as SortedSet).tail_set (after).read_only_view; + } + + /** + * {@inheritDoc} + */ + public SortedSet sub_set (G from, G to) { + return (_collection as SortedSet).sub_set (from, to).read_only_view; + } + + /** + * {@inheritDoc} + */ + public new SortedSet read_only_view { + owned get { + return this; + } + } +} + diff --git a/gee/set.c b/gee/set.c index 266eb33..2cac2cc 100644 --- a/gee/set.c +++ b/gee/set.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -90,23 +110,55 @@ typedef struct _GeeHashSet GeeHashSet; typedef struct _GeeHashSetClass GeeHashSetClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -118,23 +170,38 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; +typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data); +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); -GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashFunc hash_func, GEqualFunc equal_func); +GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); +GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; GType gee_hash_set_get_type (void) G_GNUC_CONST; @@ -154,7 +221,7 @@ GeeSet* gee_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g GeeSet* _tmp2_; GeeSet* _tmp3_; GeeSet* _tmp4_; - _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL); + _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL); _tmp1_ = _tmp0_; _tmp2_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp1_); _tmp3_ = _tmp2_; diff --git a/gee/set.vala b/gee/set.vala index eec4175..179c377 100644 --- a/gee/set.vala +++ b/gee/set.vala @@ -23,6 +23,7 @@ /** * A collection without duplicate elements. */ +[GenericAccessors] public interface Gee.Set : Collection { /** diff --git a/gee/sortedmap.c b/gee/sortedmap.c new file mode 100644 index 0000000..fcb2ea8 --- /dev/null +++ b/gee/sortedmap.c @@ -0,0 +1,500 @@ +/* sortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from sortedmap.vala, do not modify */ + +/* sortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + +#define GEE_TYPE_MAP (gee_map_get_type ()) +#define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) +#define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) +#define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface)) + +typedef struct _GeeMap GeeMap; +typedef struct _GeeMapIface GeeMapIface; + +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + +#define GEE_TYPE_COLLECTION (gee_collection_get_type ()) +#define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) +#define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) +#define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface)) + +typedef struct _GeeCollection GeeCollection; +typedef struct _GeeCollectionIface GeeCollectionIface; + +#define GEE_TYPE_SET (gee_set_get_type ()) +#define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet)) +#define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET)) +#define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface)) + +typedef struct _GeeSet GeeSet; +typedef struct _GeeSetIface GeeSetIface; + +#define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) +#define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) +#define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) +#define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY)) +#define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) + +typedef struct _GeeMapEntry GeeMapEntry; +typedef struct _GeeMapEntryClass GeeMapEntryClass; + +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_MAP (gee_abstract_map_get_type ()) +#define GEE_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap)) +#define GEE_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) +#define GEE_IS_ABSTRACT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_IS_ABSTRACT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_MAP)) +#define GEE_ABSTRACT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_MAP, GeeAbstractMapClass)) + +typedef struct _GeeAbstractMap GeeAbstractMap; +typedef struct _GeeAbstractMapClass GeeAbstractMapClass; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; + +#define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) +#define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) +#define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) +#define GEE_IS_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_MAP)) +#define GEE_IS_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_MAP)) +#define GEE_TREE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) + +typedef struct _GeeTreeMap GeeTreeMap; +typedef struct _GeeTreeMapClass GeeTreeMapClass; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); +}; + +struct _GeeCollectionIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); + gboolean (*contains) (GeeCollection* self, gconstpointer item); + gboolean (*add) (GeeCollection* self, gconstpointer item); + gboolean (*remove) (GeeCollection* self, gconstpointer item); + void (*clear) (GeeCollection* self); + gboolean (*add_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection); + gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection); + gpointer* (*to_array) (GeeCollection* self, int* result_length1); + gint (*get_size) (GeeCollection* self); + gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); + GeeCollection* (*get_read_only_view) (GeeCollection* self); +}; + +struct _GeeSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); + GeeSet* (*get_read_only_view) (GeeSet* self); +}; + +struct _GeeMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); + gboolean (*has_key) (GeeMap* self, gconstpointer key); + gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); + gpointer (*get) (GeeMap* self, gconstpointer key); + void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); + gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); + void (*clear) (GeeMap* self); + GeeMapIterator* (*map_iterator) (GeeMap* self); + void (*set_all) (GeeMap* self, GeeMap* map); + gboolean (*unset_all) (GeeMap* self, GeeMap* map); + gboolean (*has_all) (GeeMap* self, GeeMap* map); + gint (*get_size) (GeeMap* self); + gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); + GeeSet* (*get_keys) (GeeMap* self); + GeeCollection* (*get_values) (GeeMap* self); + GeeSet* (*get_entries) (GeeMap* self); + GeeMap* (*get_read_only_view) (GeeMap* self); +}; + +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_iterable_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_collection_get_type (void) G_GNUC_CONST; +GType gee_set_get_type (void) G_GNUC_CONST; +GType gee_map_entry_get_type (void) G_GNUC_CONST; +GType gee_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self, gconstpointer before); +GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self, gconstpointer after); +GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self, gconstpointer before, gconstpointer after); +GeeMap* gee_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_tree_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GeeBidirSortedMap* gee_abstract_bidir_sorted_map_get_read_only_view (GeeAbstractBidirSortedMap* self); +GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self); +GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self); +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self); + + +/** + * Returns map containing pairs with key strictly lower the the argument. + */ +GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self, gconstpointer before) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->head_map (self, before); +} + + +/** + * Returns map containing pairs with key equal or larger then the argument. + */ +GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self, gconstpointer after) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->tail_map (self, after); +} + + +/** + * Returns right-open map (i.e. containing all pair which key is strictly + * lower then the second argument and equal or bigger then the first one). + * + * Null as one parameter means that it should include all from this side. + */ +GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self, gconstpointer before, gconstpointer after) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->sub_map (self, before, after); +} + + +/** + * Returns an immutable empty map. + * + * @return an immutable empty map + */ +GeeMap* gee_sorted_map_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func) { + GeeMap* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeBidirSortedMap* _tmp2_; + GeeBidirSortedMap* _tmp3_; + GeeMap* _tmp4_; + _tmp0_ = gee_tree_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL); + _tmp1_ = _tmp0_; + _tmp2_ = gee_abstract_bidir_sorted_map_get_read_only_view ((GeeAbstractBidirSortedMap*) _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = (GeeMap*) _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + return result; +} + + +GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->get_ascending_keys (self); +} + + +GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->get_ascending_entries (self); +} + + +GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_MAP_GET_INTERFACE (self)->get_read_only_view (self); +} + + +static void gee_sorted_map_base_init (GeeSortedMapIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + /** + * Returns the keys in ascending order. + */ + g_object_interface_install_property (iface, g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * Returns the entries in ascending order. + */ + g_object_interface_install_property (iface, g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + /** + * The read-only view this map. + */ + g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + } +} + + +GType gee_sorted_map_get_type (void) { + static volatile gsize gee_sorted_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_sorted_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeSortedMapIface), (GBaseInitFunc) gee_sorted_map_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_sorted_map_type_id; + gee_sorted_map_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeSortedMap", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_sorted_map_type_id, GEE_TYPE_MAP); + g_once_init_leave (&gee_sorted_map_type_id__volatile, gee_sorted_map_type_id); + } + return gee_sorted_map_type_id__volatile; +} + + + diff --git a/gee/sortedmap.vala b/gee/sortedmap.vala new file mode 100644 index 0000000..ef5904e --- /dev/null +++ b/gee/sortedmap.vala @@ -0,0 +1,66 @@ +/* sortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +public interface Gee.SortedMap : Gee.Map { + /** + * Returns map containing pairs with key strictly lower the the argument. + */ + public abstract SortedMap head_map (K before); + + /** + * Returns map containing pairs with key equal or larger then the argument. + */ + public abstract SortedMap tail_map (K after); + + /** + * Returns right-open map (i.e. containing all pair which key is strictly + * lower then the second argument and equal or bigger then the first one). + * + * Null as one parameter means that it should include all from this side. + */ + public abstract SortedMap sub_map (K before, K after); + + /** + * Returns the keys in ascending order. + */ + public abstract SortedSet ascending_keys { owned get; } + + /** + * Returns the entries in ascending order. + */ + public abstract SortedSet> ascending_entries { owned get; } + + /** + * The read-only view this map. + */ + public new abstract SortedMap read_only_view { owned get; } + + /** + * Returns an immutable empty map. + * + * @return an immutable empty map + */ + public static Map empty () { + return new TreeMap ().read_only_view; + } +} + diff --git a/gee/sortedset.c b/gee/sortedset.c index 92e0bc0..07fe628 100644 --- a/gee/sortedset.c +++ b/gee/sortedset.c @@ -4,6 +4,7 @@ /* sortedset.vala * * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -67,6 +88,64 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeSortedSet GeeSortedSet; typedef struct _GeeSortedSetIface GeeSortedSetIface; +#define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ()) +#define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection)) +#define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) +#define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION)) +#define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass)) + +typedef struct _GeeAbstractCollection GeeAbstractCollection; +typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; + +#define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ()) +#define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet)) +#define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) +#define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET)) +#define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET)) +#define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass)) + +typedef struct _GeeAbstractSet GeeAbstractSet; +typedef struct _GeeAbstractSetClass GeeAbstractSetClass; + +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; + +#define GEE_TYPE_TREE_SET (gee_tree_set_get_type ()) +#define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet)) +#define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass)) +#define GEE_IS_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TREE_SET)) +#define GEE_IS_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TREE_SET)) +#define GEE_TREE_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TREE_SET, GeeTreeSetClass)) + +typedef struct _GeeTreeSet GeeTreeSet; +typedef struct _GeeTreeSetClass GeeTreeSetClass; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + #define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) #define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) #define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) @@ -74,24 +153,57 @@ typedef struct _GeeSortedSetIface GeeSortedSetIface; typedef struct _GeeBidirIterator GeeBidirIterator; typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -103,27 +215,26 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeSortedSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); gpointer (*first) (GeeSortedSet* self); gpointer (*last) (GeeSortedSet* self); - GeeBidirIterator* (*bidir_iterator) (GeeSortedSet* self); - GeeBidirIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); gpointer (*lower) (GeeSortedSet* self, gconstpointer element); gpointer (*higher) (GeeSortedSet* self, gconstpointer element); gpointer (*floor) (GeeSortedSet* self, gconstpointer element); @@ -131,20 +242,48 @@ struct _GeeSortedSetIface { GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); }; +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_sorted_set_get_type (void) G_GNUC_CONST; gpointer gee_sorted_set_first (GeeSortedSet* self); gpointer gee_sorted_set_last (GeeSortedSet* self); -GeeBidirIterator* gee_sorted_set_bidir_iterator (GeeSortedSet* self); -GeeBidirIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); +GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element); gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element); @@ -152,6 +291,18 @@ gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element); GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self, gconstpointer before); GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self, gconstpointer after); GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gconstpointer to); +GeeSortedSet* gee_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GType gee_abstract_collection_get_type (void) G_GNUC_CONST; +GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_tree_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GeeBidirSortedSet* gee_abstract_bidir_sorted_set_get_read_only_view (GeeAbstractBidirSortedSet* self); +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self); /** @@ -176,18 +327,6 @@ gpointer gee_sorted_set_last (GeeSortedSet* self) { } -/** - * Returns a {@link BidirIterator} that can be used for bi-directional - * iteration over this sorted set. - * - * @return a {@link BidirIterator} over this sorted set - */ -GeeBidirIterator* gee_sorted_set_bidir_iterator (GeeSortedSet* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_SORTED_SET_GET_INTERFACE (self)->bidir_iterator (self); -} - - /** * Returns a {@link BidirIterator} initialy pointed at the specified * element. @@ -197,7 +336,7 @@ GeeBidirIterator* gee_sorted_set_bidir_iterator (GeeSortedSet* self) { * @return a {@link BidirIterator} over this sorted set, or null if * the specified element is not in this set */ -GeeBidirIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element) { +GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element) { g_return_val_if_fail (self != NULL, NULL); return GEE_SORTED_SET_GET_INTERFACE (self)->iterator_at (self, element); } @@ -301,10 +440,43 @@ GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gc } +/** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ +GeeSortedSet* gee_sorted_set_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) { + GeeSortedSet* result = NULL; + GeeTreeSet* _tmp0_; + GeeTreeSet* _tmp1_; + GeeBidirSortedSet* _tmp2_; + GeeBidirSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + _tmp0_ = gee_tree_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL); + _tmp1_ = _tmp0_; + _tmp2_ = gee_abstract_bidir_sorted_set_get_read_only_view ((GeeAbstractBidirSortedSet*) _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = (GeeSortedSet*) _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; + return result; +} + + +GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_SORTED_SET_GET_INTERFACE (self)->get_read_only_view (self); +} + + static void gee_sorted_set_base_init (GeeSortedSetIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; + /** + * The read-only view of this set. + */ + g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } } diff --git a/gee/sortedset.vala b/gee/sortedset.vala index cbec01c..d95c792 100644 --- a/gee/sortedset.vala +++ b/gee/sortedset.vala @@ -1,6 +1,7 @@ /* sortedset.vala * * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka + * Copyright (C) 2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +24,7 @@ /** * A sorted set, which you can navigate over and get sub-sets of. */ +[GenericAccessors] public interface Gee.SortedSet : Gee.Set { /** * Returns the first element of the sorted set. Set must not be empty. @@ -38,14 +40,6 @@ public interface Gee.SortedSet : Gee.Set { */ public abstract G last (); - /** - * Returns a {@link BidirIterator} that can be used for bi-directional - * iteration over this sorted set. - * - * @return a {@link BidirIterator} over this sorted set - */ - public abstract BidirIterator bidir_iterator (); - /** * Returns a {@link BidirIterator} initialy pointed at the specified * element. @@ -55,7 +49,7 @@ public interface Gee.SortedSet : Gee.Set { * @return a {@link BidirIterator} over this sorted set, or null if * the specified element is not in this set */ - public abstract BidirIterator? iterator_at (G element); + public abstract Iterator? iterator_at (G element); /** * Returns the element which is strictly lower than the specified element. @@ -126,4 +120,18 @@ public interface Gee.SortedSet : Gee.Set { * @return the corresponding sub-set of this sorted set */ public abstract SortedSet sub_set (G from, G to); + + /** + * The read-only view of this set. + */ + public abstract new SortedSet read_only_view { owned get; } + + /** + * Returns an immutable empty sorted set. + * + * @return an immutable empty sorted set + */ + public static SortedSet empty () { + return new TreeSet ().read_only_view; + } } diff --git a/gee/timsort.c b/gee/timsort.c index a237aa6..e0bcf18 100644 --- a/gee/timsort.c +++ b/gee/timsort.c @@ -39,13 +39,25 @@ typedef struct _GeeTimSort GeeTimSort; typedef struct _GeeTimSortClass GeeTimSortClass; typedef struct _GeeTimSortPrivate GeeTimSortPrivate; -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -55,6 +67,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -71,14 +91,6 @@ typedef struct _GeeCollectionIface GeeCollectionIface; typedef struct _GeeList GeeList; typedef struct _GeeListIface GeeListIface; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) - -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; - #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ()) #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator)) #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR)) @@ -109,6 +121,16 @@ typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractList GeeAbstractList; typedef struct _GeeAbstractListClass GeeAbstractListClass; +#define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ()) +#define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList)) +#define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) +#define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST)) +#define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass)) + +typedef struct _GeeAbstractBidirList GeeAbstractBidirList; +typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass; + #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ()) #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList)) #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass)) @@ -121,6 +143,31 @@ typedef struct _GeeArrayListClass GeeArrayListClass; #define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL))) typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate; + +#define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ()) +#define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList)) +#define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST)) +#define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface)) + +typedef struct _GeeBidirList GeeBidirList; +typedef struct _GeeBidirListIface GeeBidirListIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; + +#define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ()) +#define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator)) +#define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR)) +#define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface)) + +typedef struct _GeeBidirListIterator GeeBidirListIterator; +typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface; +typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate; typedef struct _GeeArrayListPrivate GeeArrayListPrivate; #define _gee_tim_sort_slice_free0(var) ((var == NULL) ? NULL : (var = (gee_tim_sort_slice_free (var), NULL))) #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); @@ -134,23 +181,55 @@ struct _GeeTimSortClass { GObjectClass parent_class; }; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -162,26 +241,22 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeListIteratorIface { GTypeInterface parent_iface; void (*set) (GeeListIterator* self, gconstpointer item); - void (*insert) (GeeListIterator* self, gconstpointer item); void (*add) (GeeListIterator* self, gconstpointer item); gint (*index) (GeeListIterator* self); }; struct _GeeListIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeList* self); + GDestroyNotify (*get_g_destroy_func) (GeeList* self); GeeListIterator* (*list_iterator) (GeeList* self); gpointer (*get) (GeeList* self, gint index); void (*set) (GeeList* self, gint index, gconstpointer item); @@ -192,7 +267,7 @@ struct _GeeListIface { gpointer (*first) (GeeList* self); gpointer (*last) (GeeList* self); void (*insert_all) (GeeList* self, gint index, GeeCollection* collection); - void (*sort) (GeeList* self, GCompareFunc compare_func); + void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GeeList* (*get_read_only_view) (GeeList* self); }; @@ -211,10 +286,9 @@ struct _GeeTimSortPrivate { gint pending_length1; gint _pending_size_; gint minimum_gallop; - GCompareFunc compare; - GCompareDataFunc compare_data; - gpointer compare_data_target; - GDestroyNotify compare_data_target_destroy_notify; + GCompareDataFunc compare; + gpointer compare_target; + GDestroyNotify compare_target_destroy_notify; }; struct _GeeAbstractCollection { @@ -228,14 +302,20 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; @@ -253,14 +333,70 @@ struct _GeeAbstractListClass { void (*insert) (GeeAbstractList* self, gint index, gconstpointer item); gpointer (*remove_at) (GeeAbstractList* self, gint index); GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop); - gpointer (*first) (GeeAbstractList* self); - gpointer (*last) (GeeAbstractList* self); - void (*insert_all) (GeeAbstractList* self, gint index, GeeCollection* collection); + void (*reserved0) (GeeAbstractList* self); + void (*reserved1) (GeeAbstractList* self); + void (*reserved2) (GeeAbstractList* self); + void (*reserved3) (GeeAbstractList* self); + void (*reserved4) (GeeAbstractList* self); + void (*reserved5) (GeeAbstractList* self); + void (*reserved6) (GeeAbstractList* self); + void (*reserved7) (GeeAbstractList* self); + void (*reserved8) (GeeAbstractList* self); + void (*reserved9) (GeeAbstractList* self); GeeList* (*get_read_only_view) (GeeAbstractList* self); }; -struct _GeeArrayList { +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirListIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirListIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self); + void (*insert) (GeeBidirListIterator* self, gconstpointer item); +}; + +struct _GeeBidirListIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirList* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self); + GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeBidirList* self); +}; + +struct _GeeAbstractBidirList { GeeAbstractList parent_instance; + GeeAbstractBidirListPrivate * priv; +}; + +struct _GeeAbstractBidirListClass { + GeeAbstractListClass parent_class; + GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self); + void (*reserved0) (GeeAbstractBidirList* self); + void (*reserved1) (GeeAbstractBidirList* self); + void (*reserved2) (GeeAbstractBidirList* self); + void (*reserved3) (GeeAbstractBidirList* self); + void (*reserved4) (GeeAbstractBidirList* self); + void (*reserved5) (GeeAbstractBidirList* self); + void (*reserved6) (GeeAbstractBidirList* self); + void (*reserved7) (GeeAbstractBidirList* self); + void (*reserved8) (GeeAbstractBidirList* self); + void (*reserved9) (GeeAbstractBidirList* self); + GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self); +}; + +struct _GeeArrayList { + GeeAbstractBidirList parent_instance; GeeArrayListPrivate * priv; gpointer* _items; gint _items_length1; @@ -269,7 +405,7 @@ struct _GeeArrayList { }; struct _GeeArrayListClass { - GeeAbstractListClass parent_class; + GeeAbstractBidirListClass parent_class; }; struct _GeeTimSortSlice { @@ -284,10 +420,18 @@ typedef gboolean (*GeeTimSortLowerFunc) (gconstpointer left, gconstpointer right static gpointer gee_tim_sort_parent_class = NULL; GType gee_tim_sort_get_type (void) G_GNUC_CONST; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_list_iterator_get_type (void) G_GNUC_CONST; GType gee_list_get_type (void) G_GNUC_CONST; static void gee_tim_sort_slice_free (GeeTimSortSlice* self); @@ -299,13 +443,13 @@ enum { GEE_TIM_SORT_G_DESTROY_FUNC }; #define GEE_TIM_SORT_MINIMUM_GALLOP 7 -void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare); +void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_list_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST; GType gee_array_list_get_type (void) G_GNUC_CONST; -static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareFunc compare, GCompareDataFunc compare_data, void* compare_data_target); -static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare, GCompareDataFunc compare_data, void* compare_data_target); -void gee_tim_sort_sort_with_data (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare_data, void* compare_data_target); +static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target); +static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target); GeeTimSort* gee_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); GeeTimSort* gee_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1); @@ -313,6 +457,9 @@ gint gee_collection_get_size (GeeCollection* self); static void gee_tim_sort_do_sort (GeeTimSort* self); void gee_collection_clear (GeeCollection* self); gboolean gee_collection_add (GeeCollection* self, gconstpointer item); +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_list_get_type (void) G_GNUC_CONST; static GeeTimSortSlice* gee_tim_sort_slice_new (void** list, gint index, gint length); static GeeTimSortSlice* gee_tim_sort_slice_new (void** list, gint index, gint length); static gint gee_tim_sort_compute_minimum_run_length (GeeTimSort* self, gint length); @@ -348,27 +495,7 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length); -void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare) { - GeeList* _tmp0_; - g_return_if_fail (list != NULL); - _tmp0_ = list; - if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST)) { - GeeList* _tmp1_; - GCompareFunc _tmp2_; - _tmp1_ = list; - _tmp2_ = compare; - gee_tim_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ARRAY_LIST, GeeArrayList), _tmp2_, NULL, NULL); - } else { - GeeList* _tmp3_; - GCompareFunc _tmp4_; - _tmp3_ = list; - _tmp4_ = compare; - gee_tim_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_, NULL, NULL); - } -} - - -void gee_tim_sort_sort_with_data (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare_data, void* compare_data_target) { +void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) { GeeList* _tmp0_; g_return_if_fail (list != NULL); _tmp0_ = list; @@ -377,17 +504,17 @@ void gee_tim_sort_sort_with_data (GType g_type, GBoxedCopyFunc g_dup_func, GDest GCompareDataFunc _tmp2_; void* _tmp2__target; _tmp1_ = list; - _tmp2_ = compare_data; - _tmp2__target = compare_data_target; - gee_tim_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ARRAY_LIST, GeeArrayList), NULL, _tmp2_, _tmp2__target); + _tmp2_ = compare; + _tmp2__target = compare_target; + gee_tim_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ARRAY_LIST, GeeArrayList), _tmp2_, _tmp2__target); } else { GeeList* _tmp3_; GCompareDataFunc _tmp4_; void* _tmp4__target; _tmp3_ = list; - _tmp4_ = compare_data; - _tmp4__target = compare_data_target; - gee_tim_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, NULL, _tmp4_, _tmp4__target); + _tmp4_ = compare; + _tmp4__target = compare_target; + gee_tim_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_, _tmp4__target); } } @@ -397,115 +524,95 @@ static gpointer _g_object_ref0 (gpointer self) { } -static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareFunc compare, GCompareDataFunc compare_data, void* compare_data_target) { - gboolean _tmp0_ = FALSE; - GCompareFunc _tmp1_; - gboolean _tmp3_; - GeeTimSort* _tmp4_; +static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) { + GeeTimSort* _tmp0_; GeeTimSort* helper; - GeeTimSort* _tmp5_; - GeeList* _tmp6_; - GeeList* _tmp7_; + GeeTimSort* _tmp1_; + GeeList* _tmp2_; + GeeList* _tmp3_; + GeeTimSort* _tmp4_; + GeeList* _tmp5_; + gint _tmp6_ = 0; + gpointer* _tmp7_ = NULL; GeeTimSort* _tmp8_; - GeeList* _tmp9_; - gint _tmp10_ = 0; - gpointer* _tmp11_ = NULL; + GeeTimSort* _tmp9_; + gpointer* _tmp10_; + gint _tmp10__length1; + GeeTimSort* _tmp11_; GeeTimSort* _tmp12_; - GeeTimSort* _tmp13_; - gpointer* _tmp14_; - gint _tmp14__length1; - GeeTimSort* _tmp15_; + GeeList* _tmp13_; + gint _tmp14_; + gint _tmp15_; GeeTimSort* _tmp16_; - GeeList* _tmp17_; - gint _tmp18_; - gint _tmp19_; + GCompareDataFunc _tmp17_; + void* _tmp17__target; + GeeTimSort* _tmp18_; + GeeList* _tmp19_; GeeTimSort* _tmp20_; - GCompareFunc _tmp21_; - GeeTimSort* _tmp22_; - GCompareDataFunc _tmp23_; - void* _tmp23__target; - GeeTimSort* _tmp24_; - GeeList* _tmp25_; - GeeTimSort* _tmp26_; - gpointer* _tmp27_; - gint _tmp27__length1; + gpointer* _tmp21_; + gint _tmp21__length1; g_return_if_fail (list != NULL); - _tmp1_ = compare; - if (_tmp1_ != NULL) { - _tmp0_ = TRUE; - } else { - GCompareDataFunc _tmp2_; - void* _tmp2__target; - _tmp2_ = compare_data; - _tmp2__target = compare_data_target; - _tmp0_ = _tmp2_ != NULL; - } - _tmp3_ = _tmp0_; - _vala_assert (_tmp3_, "compare != null || compare_data != null"); - _tmp4_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); - helper = _tmp4_; - _tmp5_ = helper; - _tmp6_ = list; - _tmp7_ = _g_object_ref0 (_tmp6_); - _g_object_unref0 (_tmp5_->priv->list_collection); - _tmp5_->priv->list_collection = _tmp7_; + _tmp0_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + helper = _tmp0_; + _tmp1_ = helper; + _tmp2_ = list; + _tmp3_ = _g_object_ref0 (_tmp2_); + _g_object_unref0 (_tmp1_->priv->list_collection); + _tmp1_->priv->list_collection = _tmp3_; + _tmp4_ = helper; + _tmp5_ = list; + _tmp7_ = gee_collection_to_array ((GeeCollection*) _tmp5_, &_tmp6_); + _tmp4_->priv->array = (_vala_array_free (_tmp4_->priv->array, _tmp4_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL); + _tmp4_->priv->array = _tmp7_; + _tmp4_->priv->array_length1 = _tmp6_; + _tmp4_->priv->_array_size_ = _tmp4_->priv->array_length1; _tmp8_ = helper; - _tmp9_ = list; - _tmp11_ = gee_collection_to_array ((GeeCollection*) _tmp9_, &_tmp10_); - _tmp8_->priv->array = (_vala_array_free (_tmp8_->priv->array, _tmp8_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL); - _tmp8_->priv->array = _tmp11_; - _tmp8_->priv->array_length1 = _tmp10_; - _tmp8_->priv->_array_size_ = _tmp8_->priv->array_length1; + _tmp9_ = helper; + _tmp10_ = _tmp9_->priv->array; + _tmp10__length1 = _tmp9_->priv->array_length1; + _tmp8_->priv->list = _tmp10_; + _tmp11_ = helper; + _tmp11_->priv->index = 0; _tmp12_ = helper; - _tmp13_ = helper; - _tmp14_ = _tmp13_->priv->array; - _tmp14__length1 = _tmp13_->priv->array_length1; - _tmp12_->priv->list = _tmp14_; - _tmp15_ = helper; - _tmp15_->priv->index = 0; + _tmp13_ = list; + _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + _tmp12_->priv->size = _tmp15_; _tmp16_ = helper; - _tmp17_ = list; - _tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_); - _tmp19_ = _tmp18_; - _tmp16_->priv->size = _tmp19_; + _tmp17_ = compare; + _tmp17__target = compare_target; + (_tmp16_->priv->compare_target_destroy_notify == NULL) ? NULL : (_tmp16_->priv->compare_target_destroy_notify (_tmp16_->priv->compare_target), NULL); + _tmp16_->priv->compare = NULL; + _tmp16_->priv->compare_target = NULL; + _tmp16_->priv->compare_target_destroy_notify = NULL; + _tmp16_->priv->compare = _tmp17_; + _tmp16_->priv->compare_target = _tmp17__target; + _tmp16_->priv->compare_target_destroy_notify = NULL; + _tmp18_ = helper; + gee_tim_sort_do_sort (_tmp18_); + _tmp19_ = list; + gee_collection_clear ((GeeCollection*) _tmp19_); _tmp20_ = helper; - _tmp21_ = compare; - _tmp20_->priv->compare = _tmp21_; - _tmp22_ = helper; - _tmp23_ = compare_data; - _tmp23__target = compare_data_target; - (_tmp22_->priv->compare_data_target_destroy_notify == NULL) ? NULL : (_tmp22_->priv->compare_data_target_destroy_notify (_tmp22_->priv->compare_data_target), NULL); - _tmp22_->priv->compare_data = NULL; - _tmp22_->priv->compare_data_target = NULL; - _tmp22_->priv->compare_data_target_destroy_notify = NULL; - _tmp22_->priv->compare_data = _tmp23_; - _tmp22_->priv->compare_data_target = _tmp23__target; - _tmp22_->priv->compare_data_target_destroy_notify = NULL; - _tmp24_ = helper; - gee_tim_sort_do_sort (_tmp24_); - _tmp25_ = list; - gee_collection_clear ((GeeCollection*) _tmp25_); - _tmp26_ = helper; - _tmp27_ = _tmp26_->priv->array; - _tmp27__length1 = _tmp26_->priv->array_length1; + _tmp21_ = _tmp20_->priv->array; + _tmp21__length1 = _tmp20_->priv->array_length1; { gpointer* item_collection = NULL; gint item_collection_length1 = 0; gint _item_collection_size_ = 0; gint item_it = 0; - item_collection = _tmp27_; - item_collection_length1 = _tmp27__length1; - for (item_it = 0; item_it < _tmp27__length1; item_it = item_it + 1) { - gpointer _tmp28_; + item_collection = _tmp21_; + item_collection_length1 = _tmp21__length1; + for (item_it = 0; item_it < _tmp21__length1; item_it = item_it + 1) { + gpointer _tmp22_; gpointer item = NULL; - _tmp28_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]); - item = _tmp28_; + _tmp22_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]); + item = _tmp22_; { - GeeList* _tmp29_; - gconstpointer _tmp30_; - _tmp29_ = list; - _tmp30_ = item; - gee_collection_add ((GeeCollection*) _tmp29_, _tmp30_); + GeeList* _tmp23_; + gconstpointer _tmp24_; + _tmp23_ = list; + _tmp24_ = item; + gee_collection_add ((GeeCollection*) _tmp23_, _tmp24_); _g_destroy_func0 (item); } } @@ -514,60 +621,42 @@ static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDe } -static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareFunc compare, GCompareDataFunc compare_data, void* compare_data_target) { - gboolean _tmp0_ = FALSE; - GCompareFunc _tmp1_; - gboolean _tmp3_; - GeeTimSort* _tmp4_; +static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target) { + GeeTimSort* _tmp0_; GeeTimSort* helper; + GeeArrayList* _tmp1_; + GeeList* _tmp2_; + GeeArrayList* _tmp3_; + gpointer* _tmp4_; + gint _tmp4__length1; GeeArrayList* _tmp5_; - GeeList* _tmp6_; - GeeArrayList* _tmp7_; - gpointer* _tmp8_; - gint _tmp8__length1; - GeeArrayList* _tmp9_; - gint _tmp10_; - GCompareFunc _tmp11_; - GCompareDataFunc _tmp12_; - void* _tmp12__target; + gint _tmp6_; + GCompareDataFunc _tmp7_; + void* _tmp7__target; g_return_if_fail (list != NULL); - _tmp1_ = compare; - if (_tmp1_ != NULL) { - _tmp0_ = TRUE; - } else { - GCompareDataFunc _tmp2_; - void* _tmp2__target; - _tmp2_ = compare_data; - _tmp2__target = compare_data_target; - _tmp0_ = _tmp2_ != NULL; - } - _tmp3_ = _tmp0_; - _vala_assert (_tmp3_, "compare != null || compare_data != null"); - _tmp4_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); - helper = _tmp4_; - _tmp5_ = list; - _tmp6_ = _g_object_ref0 ((GeeList*) _tmp5_); + _tmp0_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + helper = _tmp0_; + _tmp1_ = list; + _tmp2_ = _g_object_ref0 ((GeeList*) _tmp1_); _g_object_unref0 (helper->priv->list_collection); - helper->priv->list_collection = _tmp6_; - _tmp7_ = list; - _tmp8_ = _tmp7_->_items; - _tmp8__length1 = _tmp7_->_items_length1; - helper->priv->list = _tmp8_; + helper->priv->list_collection = _tmp2_; + _tmp3_ = list; + _tmp4_ = _tmp3_->_items; + _tmp4__length1 = _tmp3_->_items_length1; + helper->priv->list = _tmp4_; helper->priv->index = 0; - _tmp9_ = list; - _tmp10_ = _tmp9_->_size; - helper->priv->size = _tmp10_; - _tmp11_ = compare; - helper->priv->compare = _tmp11_; - _tmp12_ = compare_data; - _tmp12__target = compare_data_target; - (helper->priv->compare_data_target_destroy_notify == NULL) ? NULL : (helper->priv->compare_data_target_destroy_notify (helper->priv->compare_data_target), NULL); - helper->priv->compare_data = NULL; - helper->priv->compare_data_target = NULL; - helper->priv->compare_data_target_destroy_notify = NULL; - helper->priv->compare_data = _tmp12_; - helper->priv->compare_data_target = _tmp12__target; - helper->priv->compare_data_target_destroy_notify = NULL; + _tmp5_ = list; + _tmp6_ = _tmp5_->_size; + helper->priv->size = _tmp6_; + _tmp7_ = compare; + _tmp7__target = compare_target; + (helper->priv->compare_target_destroy_notify == NULL) ? NULL : (helper->priv->compare_target_destroy_notify (helper->priv->compare_target), NULL); + helper->priv->compare = NULL; + helper->priv->compare_target = NULL; + helper->priv->compare_target_destroy_notify = NULL; + helper->priv->compare = _tmp7_; + helper->priv->compare_target = _tmp7__target; + helper->priv->compare_target_destroy_notify = NULL; gee_tim_sort_do_sort (helper); _g_object_unref0 (helper); } @@ -726,67 +815,37 @@ static void gee_tim_sort_do_sort (GeeTimSort* self) { static inline gboolean gee_tim_sort_lower_than (GeeTimSort* self, gconstpointer left, gconstpointer right) { gboolean result = FALSE; - GCompareFunc _tmp0_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->priv->compare; - if (_tmp0_ != NULL) { - GCompareFunc _tmp1_; - gconstpointer _tmp2_; - gconstpointer _tmp3_; - gint _tmp4_ = 0; - _tmp1_ = self->priv->compare; - _tmp2_ = left; - _tmp3_ = right; - _tmp4_ = _tmp1_ (_tmp2_, _tmp3_); - result = _tmp4_ < 0; - return result; - } else { - GCompareDataFunc _tmp5_; - void* _tmp5__target; - gconstpointer _tmp6_; - gconstpointer _tmp7_; - gint _tmp8_ = 0; - _tmp5_ = self->priv->compare_data; - _tmp5__target = self->priv->compare_data_target; - _tmp6_ = left; - _tmp7_ = right; - _tmp8_ = _tmp5_ (_tmp6_, _tmp7_, _tmp5__target); - result = _tmp8_ < 0; - return result; - } + _tmp0__target = self->priv->compare_target; + _tmp1_ = left; + _tmp2_ = right; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); + result = _tmp3_ < 0; + return result; } static inline gboolean gee_tim_sort_lower_than_or_equal_to (GeeTimSort* self, gconstpointer left, gconstpointer right) { gboolean result = FALSE; - GCompareFunc _tmp0_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gconstpointer _tmp2_; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->priv->compare; - if (_tmp0_ != NULL) { - GCompareFunc _tmp1_; - gconstpointer _tmp2_; - gconstpointer _tmp3_; - gint _tmp4_ = 0; - _tmp1_ = self->priv->compare; - _tmp2_ = left; - _tmp3_ = right; - _tmp4_ = _tmp1_ (_tmp2_, _tmp3_); - result = _tmp4_ <= 0; - return result; - } else { - GCompareDataFunc _tmp5_; - void* _tmp5__target; - gconstpointer _tmp6_; - gconstpointer _tmp7_; - gint _tmp8_ = 0; - _tmp5_ = self->priv->compare_data; - _tmp5__target = self->priv->compare_data_target; - _tmp6_ = left; - _tmp7_ = right; - _tmp8_ = _tmp5_ (_tmp6_, _tmp7_, _tmp5__target); - result = _tmp8_ <= 0; - return result; - } + _tmp0__target = self->priv->compare_target; + _tmp1_ = left; + _tmp2_ = right; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); + result = _tmp3_ <= 0; + return result; } @@ -3765,10 +3824,10 @@ static void gee_tim_sort_finalize (GObject* obj) { _g_object_unref0 (self->priv->list_collection); self->priv->array = (_vala_array_free (self->priv->array, self->priv->array_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); self->priv->pending = (_vala_array_free (self->priv->pending, self->priv->pending_length1, (GDestroyNotify) gee_tim_sort_slice_free), NULL); - (self->priv->compare_data_target_destroy_notify == NULL) ? NULL : (self->priv->compare_data_target_destroy_notify (self->priv->compare_data_target), NULL); - self->priv->compare_data = NULL; - self->priv->compare_data_target = NULL; - self->priv->compare_data_target_destroy_notify = NULL; + (self->priv->compare_target_destroy_notify == NULL) ? NULL : (self->priv->compare_target_destroy_notify (self->priv->compare_target), NULL); + self->priv->compare = NULL; + self->priv->compare_target = NULL; + self->priv->compare_target_destroy_notify = NULL; G_OBJECT_CLASS (gee_tim_sort_parent_class)->finalize (obj); } diff --git a/gee/timsort.vala b/gee/timsort.vala index b1d8cc6..a5b9778 100644 --- a/gee/timsort.vala +++ b/gee/timsort.vala @@ -46,7 +46,7 @@ */ internal class Gee.TimSort : Object { - public static void sort (List list, CompareFunc compare) { + public static void sort (List list, CompareDataFunc compare) { if (list is ArrayList) { TimSort.sort_arraylist ((ArrayList) list, compare); } else { @@ -54,17 +54,7 @@ internal class Gee.TimSort : Object { } } - public static void sort_with_data (List list, CompareDataFunc compare_data) { - if (list is ArrayList) { - TimSort.sort_arraylist ((ArrayList) list, null, compare_data); - } else { - TimSort.sort_list (list, null, compare_data); - } - } - - private static void sort_list (List list, CompareFunc? compare, CompareDataFunc? compare_data = null) { - assert (compare != null || compare_data != null); - + private static void sort_list (List list, CompareDataFunc compare) { TimSort helper = new TimSort (); helper.list_collection = list; @@ -73,7 +63,6 @@ internal class Gee.TimSort : Object { helper.index = 0; helper.size = list.size; helper.compare = compare; - helper.compare_data = compare_data; helper.do_sort (); @@ -84,9 +73,7 @@ internal class Gee.TimSort : Object { } } - private static void sort_arraylist (ArrayList list, CompareFunc? compare, CompareDataFunc? compare_data = null) { - assert (compare != null || compare_data != null); - + private static void sort_arraylist (ArrayList list, CompareDataFunc compare) { TimSort helper = new TimSort (); helper.list_collection = list; @@ -94,7 +81,6 @@ internal class Gee.TimSort : Object { helper.index = 0; helper.size = list._size; helper.compare = compare; - helper.compare_data = compare_data; helper.do_sort (); } @@ -108,8 +94,7 @@ internal class Gee.TimSort : Object { private int size; private Slice[] pending; private int minimum_gallop; - private CompareFunc compare; - private CompareDataFunc compare_data; + private CompareDataFunc compare; private void do_sort () { if (size < 2) { @@ -165,19 +150,11 @@ internal class Gee.TimSort : Object { private delegate bool LowerFunc (G left, G right); private inline bool lower_than (G left, G right) { - if (compare != null) { return compare (left, right) < 0; - } else { - return compare_data (left, right) < 0; - } } private inline bool lower_than_or_equal_to (G left, G right) { - if (compare != null) { return compare (left, right) <= 0; - } else { - return compare_data (left, right) <= 0; - } } private int compute_minimum_run_length (int length) { diff --git a/gee/traversable.c b/gee/traversable.c new file mode 100644 index 0000000..d9cc28e --- /dev/null +++ b/gee/traversable.c @@ -0,0 +1,1901 @@ +/* traversable.c generated by valac 0.18.0, the Vala compiler + * generated from traversable.vala, do not modify */ + +/* traversable.vala + * + * Copyright (C) 2011-2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; +typedef struct _Block7Data Block7Data; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _Block8Data Block8Data; +#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL))) +typedef struct _Block9Data Block9Data; +#define _a_destroy_func0(var) (((var == NULL) || (a_destroy_func == NULL)) ? NULL : (var = (a_destroy_func (var), NULL))) +typedef struct _Block10Data Block10Data; +typedef struct _Block11Data Block11Data; +typedef struct _Block12Data Block12Data; +typedef struct _Block13Data Block13Data; +typedef struct _Block14Data Block14Data; +typedef struct _Block15Data Block15Data; +typedef struct _Block16Data Block16Data; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _Block7Data { + int _ref_count_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeIterator* _self_; + GeeStreamFunc f; + gpointer f_target; + GDestroyNotify f_target_destroy_notify; +}; + +struct _GeeIterableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); + GeeIterator* (*iterator) (GeeIterable* self); +}; + +struct _Block8Data { + int _ref_count_; + Block7Data * _data7_; + GeeTraversableStream str; + gboolean need_next; +}; + +typedef gpointer (*GeeLazyFunc) (void* user_data); +struct _Block9Data { + int _ref_count_; + Block8Data * _data8_; +}; + +struct _Block10Data { + int _ref_count_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeFoldFunc f; + gpointer f_target; + gpointer seed; +}; + +struct _Block11Data { + int _ref_count_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeMapFunc f; + gpointer f_target; +}; + +struct _Block12Data { + int _ref_count_; + Block11Data * _data11_; + GeeLazy* item; +}; + +struct _Block13Data { + int _ref_count_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gboolean seed_emitted; + GeeFoldFunc f; + gpointer f_target; + gpointer seed; +}; + +struct _Block14Data { + int _ref_count_; + Block13Data * _data13_; + GeeLazy* item; +}; + +struct _Block15Data { + int _ref_count_; + GeeTraversable * self; + GeePredicate pred; + gpointer pred_target; + GDestroyNotify pred_target_destroy_notify; +}; + +struct _Block16Data { + int _ref_count_; + GeeTraversable * self; + gint offset; + gint length; +}; + + + +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static GeeIterator* gee_traversable_real_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); +static Block7Data* block7_data_ref (Block7Data* _data7_); +static void block7_data_unref (void * _userdata_); +GType gee_iterable_get_type (void) G_GNUC_CONST; +static Block8Data* block8_data_ref (Block8Data* _data8_); +static void block8_data_unref (void * _userdata_); +gboolean gee_iterator_get_valid (GeeIterator* self); +static gpointer _____lambda3_ (Block8Data* _data8_); +gpointer gee_iterator_get (GeeIterator* self); +static gpointer ______lambda3__gee_lazy_func (gpointer self); +GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify); +GeeIterator* gee_iterator_unfold (GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeUnfoldFunc f, void* f_target, GDestroyNotify f_target_destroy_notify, GeeLazy* current); +static GeeLazy* ______lambda4_ (Block8Data* _data8_); +static GeeLazy* _______lambda4__gee_unfold_func (gpointer self); +static GeeLazy* ____lambda5_ (Block8Data* _data8_); +static GeeLazy* _____lambda5__gee_unfold_func (gpointer self); +static GeeLazy* ___lambda6_ (Block8Data* _data8_); +static Block9Data* block9_data_ref (Block9Data* _data9_); +static void block9_data_unref (void * _userdata_); +gboolean gee_iterator_next (GeeIterator* self); +static gpointer ___lambda7_ (Block9Data* _data9_); +static gpointer ____lambda7__gee_lazy_func (gpointer self); +static GeeLazy* ____lambda6__gee_unfold_func (gpointer self); +GeeIterator* gee_iterable_iterator (GeeIterable* self); +gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +static gpointer gee_traversable_real_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +static Block10Data* block10_data_ref (Block10Data* _data10_); +static void block10_data_unref (void * _userdata_); +static gboolean __lambda8_ (Block10Data* _data10_, gpointer item); +static gboolean ___lambda8__gee_forall_func (gpointer g, gpointer self); +GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); +static GeeIterator* gee_traversable_real_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); +static Block11Data* block11_data_ref (Block11Data* _data11_); +static void block11_data_unref (void * _userdata_); +static GeeTraversableStream __lambda9_ (Block11Data* _data11_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val); +static Block12Data* block12_data_ref (Block12Data* _data12_); +static void block12_data_unref (void * _userdata_); +static gpointer ___lambda10_ (Block12Data* _data12_); +gpointer gee_lazy_get (GeeLazy* self); +static gpointer ____lambda10__gee_lazy_func (gpointer self); +static GeeTraversableStream ___lambda9__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self); +GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +static GeeIterator* gee_traversable_real_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); +static Block13Data* block13_data_ref (Block13Data* _data13_); +static void block13_data_unref (void * _userdata_); +static GeeTraversableStream __lambda11_ (Block13Data* _data13_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val); +static Block14Data* block14_data_ref (Block14Data* _data14_); +static void block14_data_unref (void * _userdata_); +GeeLazy* gee_lazy_new_from_value (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +GeeLazy* gee_lazy_construct_from_value (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer item); +static gpointer ___lambda12_ (Block14Data* _data14_); +static gpointer ____lambda12__gee_lazy_func (gpointer self); +static GeeTraversableStream ___lambda11__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self); +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +static GeeIterator* gee_traversable_real_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); +static Block15Data* block15_data_ref (Block15Data* _data15_); +static void block15_data_unref (void * _userdata_); +static GeeTraversableStream __lambda13_ (Block15Data* _data15_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val); +static GeeTraversableStream ___lambda13__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self); +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length); +static GeeIterator* gee_traversable_real_chop (GeeTraversable* self, gint offset, gint length); +static Block16Data* block16_data_ref (Block16Data* _data16_); +static void block16_data_unref (void * _userdata_); +static GeeTraversableStream __lambda14_ (Block16Data* _data16_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val); +static GeeTraversableStream ___lambda14__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self); +GType gee_traversable_get_element_type (GeeTraversable* self); + + +GType gee_traversable_stream_get_type (void) { + static volatile gsize gee_traversable_stream_type_id__volatile = 0; + if (g_once_init_enter (&gee_traversable_stream_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_TRAVERSABLE_STREAM_YIELD, "GEE_TRAVERSABLE_STREAM_YIELD", "yield"}, {GEE_TRAVERSABLE_STREAM_CONTINUE, "GEE_TRAVERSABLE_STREAM_CONTINUE", "continue"}, {GEE_TRAVERSABLE_STREAM_END, "GEE_TRAVERSABLE_STREAM_END", "end"}, {0, NULL, NULL}}; + GType gee_traversable_stream_type_id; + gee_traversable_stream_type_id = g_enum_register_static ("GeeTraversableStream", values); + g_once_init_leave (&gee_traversable_stream_type_id__volatile, gee_traversable_stream_type_id); + } + return gee_traversable_stream_type_id__volatile; +} + + +/** + * Apply function to each element returned by iterator untill last element + * or function return ''false''. + * + * ''{@link Iterator} implementation:'' Operation moves the iterator + * to last element in iteration or the first element that returned ''false''. + * If iterator points at some element it will be included in iteration. + * + * @param f function applied to every element of the collection + * + * @return ''false'' if the argument returned ''false'' at last invocation and + * ''true'' otherwise. + */ +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->foreach (self, f, f_target); +} + + +/** + * Stream function is an abstract function allowing writing many + * operations. + * + * The stream function accepts three parameter: + * + * 1. state. It is usually the last returned value from function but + * it may be {@link Stream.END} when {@link Stream.CONTINUE} was + * returned and there was no more elements. + * 1. input. It is valid only if first argument is + * {@link Stream.CONTINUE} + * 1. output. It is valid only if result is Stream.YIELD + * + * It may return one of 3 results: + * + * 1. {@link Stream.YIELD}. It means that value was yielded and can + * be passed to outgoing iterator. + * 1. {@link Stream.CONTINUE}. It means that the function needs to be + * called with next element or with {@link Stream.END} if it is + * end of stream). If the state element was Stream.END during the + * current iteration function ''must not'' return {@link Stream.CONTINUE} + * 1. Stream.END. It means that the last argument was yielded. + * + * If the function yields the value immediately then the returning iterator + * is {@link Iterator.valid} and points to this value as well as in case when the + * parent iterator is {@link Iterator.valid} and function yields + * after consuming 1 input. In other case returned iterator is invalid. + * + * Note: In {@link Iterator} implementation: if iterator is + * {@link Iterator.valid} the current value should be fed + * immediately to function if during initial call function returns + * {@link Stream.CONTINUE}. The parent iterator cannot be used before + * the functions return {@link Stream.END} afterwards it points on the + * last element consumed. + * + * @param f function generating stream + * @return iterator containing values yielded by stream + */ +static Block7Data* block7_data_ref (Block7Data* _data7_) { + g_atomic_int_inc (&_data7_->_ref_count_); + return _data7_; +} + + +static void block7_data_unref (void * _userdata_) { + Block7Data* _data7_; + _data7_ = (Block7Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + _g_object_unref0 (_data7_->_self_); + (_data7_->f_target_destroy_notify == NULL) ? NULL : (_data7_->f_target_destroy_notify (_data7_->f_target), NULL); + _data7_->f = NULL; + _data7_->f_target = NULL; + _data7_->f_target_destroy_notify = NULL; + _g_object_unref0 (self); + g_slice_free (Block7Data, _data7_); + } +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static Block8Data* block8_data_ref (Block8Data* _data8_) { + g_atomic_int_inc (&_data8_->_ref_count_); + return _data8_; +} + + +static void block8_data_unref (void * _userdata_) { + Block8Data* _data8_; + _data8_ = (Block8Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data8_->_data7_->self; + a_type = _data8_->_data7_->a_type; + a_dup_func = _data8_->_data7_->a_dup_func; + a_destroy_func = _data8_->_data7_->a_destroy_func; + block7_data_unref (_data8_->_data7_); + _data8_->_data7_ = NULL; + g_slice_free (Block8Data, _data8_); + } +} + + +static gpointer _____lambda3_ (Block8Data* _data8_) { + Block7Data* _data7_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gpointer result = NULL; + GeeIterator* _tmp0_; + gpointer _tmp1_ = NULL; + _data7_ = _data8_->_data7_; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + _tmp0_ = _data7_->_self_; + _tmp1_ = gee_iterator_get (_tmp0_); + result = _tmp1_; + return result; +} + + +static gpointer ______lambda3__gee_lazy_func (gpointer self) { + gpointer result; + result = _____lambda3_ (self); + return result; +} + + +static GeeLazy* ______lambda4_ (Block8Data* _data8_) { + Block7Data* _data7_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeLazy* result = NULL; + _data7_ = _data8_->_data7_; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + result = NULL; + return result; +} + + +static GeeLazy* _______lambda4__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = ______lambda4_ (self); + return result; +} + + +static GeeLazy* ____lambda5_ (Block8Data* _data8_) { + Block7Data* _data7_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeLazy* result = NULL; + _data7_ = _data8_->_data7_; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + result = NULL; + return result; +} + + +static GeeLazy* _____lambda5__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = ____lambda5_ (self); + return result; +} + + +static Block9Data* block9_data_ref (Block9Data* _data9_) { + g_atomic_int_inc (&_data9_->_ref_count_); + return _data9_; +} + + +static void block9_data_unref (void * _userdata_) { + Block9Data* _data9_; + _data9_ = (Block9Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data9_->_data8_->_data7_->self; + a_type = _data9_->_data8_->_data7_->a_type; + a_dup_func = _data9_->_data8_->_data7_->a_dup_func; + a_destroy_func = _data9_->_data8_->_data7_->a_destroy_func; + block8_data_unref (_data9_->_data8_); + _data9_->_data8_ = NULL; + g_slice_free (Block9Data, _data9_); + } +} + + +static gpointer ___lambda7_ (Block9Data* _data9_) { + Block8Data* _data8_; + Block7Data* _data7_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gpointer result = NULL; + GeeIterator* _tmp0_; + gpointer _tmp1_ = NULL; + _data8_ = _data9_->_data8_; + _data7_ = _data8_->_data7_; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + _tmp0_ = _data7_->_self_; + _tmp1_ = gee_iterator_get (_tmp0_); + result = _tmp1_; + return result; +} + + +static gpointer ____lambda7__gee_lazy_func (gpointer self) { + gpointer result; + result = ___lambda7_ (self); + return result; +} + + +static GeeLazy* ___lambda6_ (Block8Data* _data8_) { + Block7Data* _data7_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeLazy* result = NULL; + Block9Data* _data9_; + GeeLazy* val; + GeeTraversableStream _tmp0_; + GeeTraversableStream _tmp16_; + _data7_ = _data8_->_data7_; + self = _data7_->self; + a_type = _data7_->a_type; + a_dup_func = _data7_->a_dup_func; + a_destroy_func = _data7_->a_destroy_func; + _data9_ = g_slice_new0 (Block9Data); + _data9_->_ref_count_ = 1; + _data9_->_data8_ = block8_data_ref (_data8_); + val = NULL; + _tmp0_ = _data8_->str; + if (_tmp0_ != GEE_TRAVERSABLE_STREAM_CONTINUE) { + GeeStreamFunc _tmp1_; + void* _tmp1__target; + GeeLazy* _tmp2_ = NULL; + GeeTraversableStream _tmp3_ = 0; + _tmp1_ = _data7_->f; + _tmp1__target = _data7_->f_target; + _tmp3_ = _tmp1_ (GEE_TRAVERSABLE_STREAM_YIELD, NULL, &_tmp2_, _tmp1__target); + _gee_lazy_unref0 (val); + val = _tmp2_; + _data8_->str = _tmp3_; + } + while (TRUE) { + GeeTraversableStream _tmp4_; + gboolean _tmp5_; + GeeStreamFunc _tmp12_; + void* _tmp12__target; + GeeLazy* _tmp13_; + GeeLazy* _tmp14_ = NULL; + GeeTraversableStream _tmp15_ = 0; + _tmp4_ = _data8_->str; + if (!(_tmp4_ == GEE_TRAVERSABLE_STREAM_CONTINUE)) { + break; + } + _tmp5_ = _data8_->need_next; + if (_tmp5_) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp6_ = _data7_->_self_; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + GeeStreamFunc _tmp8_; + void* _tmp8__target; + GeeLazy* _tmp9_ = NULL; + GeeTraversableStream _tmp10_ = 0; + GeeTraversableStream _tmp11_; + _tmp8_ = _data7_->f; + _tmp8__target = _data7_->f_target; + _tmp10_ = _tmp8_ (GEE_TRAVERSABLE_STREAM_END, NULL, &_tmp9_, _tmp8__target); + _gee_lazy_unref0 (val); + val = _tmp9_; + _data8_->str = _tmp10_; + _tmp11_ = _data8_->str; + _vala_assert (_tmp11_ != GEE_TRAVERSABLE_STREAM_CONTINUE, "str != Traversable.Stream.CONTINUE"); + break; + } + } else { + _data8_->need_next = TRUE; + } + _tmp12_ = _data7_->f; + _tmp12__target = _data7_->f_target; + _tmp13_ = gee_lazy_new (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ____lambda7__gee_lazy_func, block9_data_ref (_data9_), block9_data_unref); + _tmp15_ = _tmp12_ (GEE_TRAVERSABLE_STREAM_CONTINUE, _tmp13_, &_tmp14_, _tmp12__target); + _gee_lazy_unref0 (val); + val = _tmp14_; + _data8_->str = _tmp15_; + } + _tmp16_ = _data8_->str; + switch (_tmp16_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + { + result = val; + block9_data_unref (_data9_); + _data9_ = NULL; + return result; + } + case GEE_TRAVERSABLE_STREAM_END: + { + result = NULL; + _gee_lazy_unref0 (val); + block9_data_unref (_data9_); + _data9_ = NULL; + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_lazy_unref0 (val); + block9_data_unref (_data9_); + _data9_ = NULL; +} + + +static GeeLazy* ____lambda6__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = ___lambda6_ (self); + return result; +} + + +static gpointer _gee_lazy_ref0 (gpointer self) { + return self ? gee_lazy_ref (self) : NULL; +} + + +static GeeIterator* gee_traversable_real_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + GeeIterator* result = NULL; + Block7Data* _data7_; + GeeStreamFunc _tmp0_; + void* _tmp0__target; + GeeIterable* iself = NULL; + GeeIterator* _tmp1_; + GeeIterator* _tmp2_; + _data7_ = g_slice_new0 (Block7Data); + _data7_->_ref_count_ = 1; + _data7_->self = g_object_ref (self); + _data7_->a_type = a_type; + _data7_->a_dup_func = a_dup_func; + _data7_->a_destroy_func = a_destroy_func; + _tmp0_ = f; + _tmp0__target = f_target; + (_data7_->f_target_destroy_notify == NULL) ? NULL : (_data7_->f_target_destroy_notify (_data7_->f_target), NULL); + _data7_->f = NULL; + _data7_->f_target = NULL; + _data7_->f_target_destroy_notify = NULL; + _data7_->f = _tmp0_; + _data7_->f_target = _tmp0__target; + _data7_->f_target_destroy_notify = f_target_destroy_notify; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERATOR) ? ((GeeIterator*) self) : NULL); + _g_object_unref0 (_data7_->_self_); + _data7_->_self_ = _tmp1_; + _tmp2_ = _data7_->_self_; + if (_tmp2_ != NULL) { + Block8Data* _data8_; + GeeLazy* initial; + GeeStreamFunc _tmp3_; + void* _tmp3__target; + GeeLazy* _tmp4_ = NULL; + GeeTraversableStream _tmp5_ = 0; + GeeTraversableStream _tmp6_; + GeeLazy* _tmp20_; + GeeLazy* _tmp21_; + GeeIterator* _tmp22_ = NULL; + _data8_ = g_slice_new0 (Block8Data); + _data8_->_ref_count_ = 1; + _data8_->_data7_ = block7_data_ref (_data7_); + initial = NULL; + _data8_->need_next = TRUE; + _tmp3_ = _data7_->f; + _tmp3__target = _data7_->f_target; + _tmp5_ = _tmp3_ (GEE_TRAVERSABLE_STREAM_YIELD, NULL, &_tmp4_, _tmp3__target); + _gee_lazy_unref0 (initial); + initial = _tmp4_; + _data8_->str = _tmp5_; + _tmp6_ = _data8_->str; + switch (_tmp6_) { + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + GeeIterator* _tmp7_; + gboolean _tmp8_; + gboolean _tmp9_; + _tmp7_ = _data7_->_self_; + _tmp8_ = gee_iterator_get_valid (_tmp7_); + _tmp9_ = _tmp8_; + if (_tmp9_) { + GeeStreamFunc _tmp10_; + void* _tmp10__target; + GeeLazy* _tmp11_; + GeeLazy* _tmp12_ = NULL; + GeeTraversableStream _tmp13_ = 0; + GeeTraversableStream _tmp14_; + _tmp10_ = _data7_->f; + _tmp10__target = _data7_->f_target; + _tmp11_ = gee_lazy_new (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ______lambda3__gee_lazy_func, block8_data_ref (_data8_), block8_data_unref); + _tmp13_ = _tmp10_ (GEE_TRAVERSABLE_STREAM_CONTINUE, _tmp11_, &_tmp12_, _tmp10__target); + _gee_lazy_unref0 (initial); + initial = _tmp12_; + _data8_->str = _tmp13_; + _tmp14_ = _data8_->str; + switch (_tmp14_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + break; + } + case GEE_TRAVERSABLE_STREAM_END: + { + GeeIterator* _tmp15_ = NULL; + _tmp15_ = gee_iterator_unfold (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _______lambda4__gee_unfold_func, block8_data_ref (_data8_), block8_data_unref, NULL); + result = _tmp15_; + _gee_lazy_unref0 (initial); + block8_data_unref (_data8_); + _data8_ = NULL; + _g_object_unref0 (iself); + block7_data_unref (_data7_); + _data7_ = NULL; + return result; + } + default: + { + g_assert_not_reached (); + } + } + } + break; + } + case GEE_TRAVERSABLE_STREAM_YIELD: + { + GeeIterator* _tmp16_; + gboolean _tmp17_; + gboolean _tmp18_; + _tmp16_ = _data7_->_self_; + _tmp17_ = gee_iterator_get_valid (_tmp16_); + _tmp18_ = _tmp17_; + if (_tmp18_) { + _data8_->need_next = FALSE; + } + break; + } + case GEE_TRAVERSABLE_STREAM_END: + { + GeeIterator* _tmp19_ = NULL; + _tmp19_ = gee_iterator_unfold (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _____lambda5__gee_unfold_func, block8_data_ref (_data8_), block8_data_unref, NULL); + result = _tmp19_; + _gee_lazy_unref0 (initial); + block8_data_unref (_data8_); + _data8_ = NULL; + _g_object_unref0 (iself); + block7_data_unref (_data7_); + _data7_ = NULL; + return result; + } + default: + { + g_assert_not_reached (); + } + } + _tmp20_ = initial; + _tmp21_ = _gee_lazy_ref0 (_tmp20_); + _tmp22_ = gee_iterator_unfold (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ____lambda6__gee_unfold_func, block8_data_ref (_data8_), block8_data_unref, _tmp21_); + result = _tmp22_; + _gee_lazy_unref0 (initial); + block8_data_unref (_data8_); + _data8_ = NULL; + _g_object_unref0 (iself); + block7_data_unref (_data7_); + _data7_ = NULL; + return result; + } else { + GeeIterable* _tmp23_; + GeeIterable* _tmp24_; + _tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (self, GEE_TYPE_ITERABLE) ? ((GeeIterable*) self) : NULL); + _g_object_unref0 (iself); + iself = _tmp23_; + _tmp24_ = iself; + if (_tmp24_ != NULL) { + GeeIterable* _tmp25_; + GeeIterator* _tmp26_ = NULL; + GeeIterator* _tmp27_; + GeeStreamFunc _tmp28_; + void* _tmp28__target; + GDestroyNotify _tmp28__target_destroy_notify; + GeeIterator* _tmp29_ = NULL; + GeeIterator* _tmp30_; + _tmp25_ = iself; + _tmp26_ = gee_iterable_iterator (_tmp25_); + _tmp27_ = _tmp26_; + _tmp28_ = _data7_->f; + _tmp28__target = _data7_->f_target; + _tmp28__target_destroy_notify = _data7_->f_target_destroy_notify; + _data7_->f_target_destroy_notify = NULL; + _tmp29_ = gee_traversable_stream ((GeeTraversable*) _tmp27_, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp28_, _tmp28__target, _tmp28__target_destroy_notify); + _tmp30_ = _tmp29_; + _g_object_unref0 (_tmp27_); + result = _tmp30_; + _g_object_unref0 (iself); + block7_data_unref (_data7_); + _data7_ = NULL; + return result; + } else { + g_assert_not_reached (); + } + } + _g_object_unref0 (iself); + block7_data_unref (_data7_); + _data7_ = NULL; +} + + +GeeIterator* gee_traversable_stream (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->stream (self, a_type, a_dup_func, a_destroy_func, f, f_target, f_target_destroy_notify); +} + + +/** + * Standard aggregation function. + * + * It takes a function, seed and first element, returns the new seed and + * progress to next element when the operation repeats. + * + * Note: Default implementation uses {@link foreach}. + * + * Note: In {@link Iterator} implementation operation moves the + * iterator to last element in iteration. If iterator is + * {@link Iterator.valid} the current element will be considered + * as well. + * + */ +static Block10Data* block10_data_ref (Block10Data* _data10_) { + g_atomic_int_inc (&_data10_->_ref_count_); + return _data10_; +} + + +static void block10_data_unref (void * _userdata_) { + Block10Data* _data10_; + _data10_ = (Block10Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data10_->self; + a_type = _data10_->a_type; + a_dup_func = _data10_->a_dup_func; + a_destroy_func = _data10_->a_destroy_func; + _a_destroy_func0 (_data10_->seed); + _g_object_unref0 (self); + g_slice_free (Block10Data, _data10_); + } +} + + +static gboolean __lambda8_ (Block10Data* _data10_, gpointer item) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gboolean result = FALSE; + GeeFoldFunc _tmp0_; + void* _tmp0__target; + gpointer _tmp1_; + gpointer _tmp2_; + gpointer _tmp3_ = NULL; + self = _data10_->self; + a_type = _data10_->a_type; + a_dup_func = _data10_->a_dup_func; + a_destroy_func = _data10_->a_destroy_func; + _tmp0_ = _data10_->f; + _tmp0__target = _data10_->f_target; + _tmp1_ = item; + item = NULL; + _tmp2_ = _data10_->seed; + _data10_->seed = NULL; + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); + _a_destroy_func0 (_data10_->seed); + _data10_->seed = _tmp3_; + result = TRUE; + ((item == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL)); + return result; +} + + +static gboolean ___lambda8__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda8_ (self, g); + return result; +} + + +static gpointer gee_traversable_real_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) { + gpointer result = NULL; + Block10Data* _data10_; + GeeFoldFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + gpointer _tmp2_; + _data10_ = g_slice_new0 (Block10Data); + _data10_->_ref_count_ = 1; + _data10_->self = g_object_ref (self); + _data10_->a_type = a_type; + _data10_->a_dup_func = a_dup_func; + _data10_->a_destroy_func = a_destroy_func; + _tmp0_ = f; + _tmp0__target = f_target; + _data10_->f = _tmp0_; + _data10_->f_target = _tmp0__target; + _tmp1_ = seed; + _a_destroy_func0 (_data10_->seed); + _data10_->seed = _tmp1_; + gee_traversable_foreach (self, ___lambda8__gee_forall_func, _data10_); + _tmp2_ = _data10_->seed; + _data10_->seed = NULL; + result = _tmp2_; + block10_data_unref (_data10_); + _data10_ = NULL; + return result; +} + + +gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->fold (self, a_type, a_dup_func, a_destroy_func, f, f_target, seed); +} + + +/** + * Produces an iterator pointing at elements generated by function passed. + * + * Iterator is lazy evaluated but value is force-evaluated when + * iterator moves to next element. ({@link Iterator.next}) + * + * Note: Default implementation uses {@link stream}. + * + * Note: In {@link Iterator} implementation if the parent iterator is + * {@link Iterator.valid} so is the returned one. Using the parent + * iterator is not allowed before the inner iterator {@link Iterator.next} + * return false and then it points on its last element. + * The resulting iterator is {@link Iterator.valid} if the parent + * iterator is. + * + * @param f Mapping function + * @return Iterator listing mapped value + */ +static Block11Data* block11_data_ref (Block11Data* _data11_) { + g_atomic_int_inc (&_data11_->_ref_count_); + return _data11_; +} + + +static void block11_data_unref (void * _userdata_) { + Block11Data* _data11_; + _data11_ = (Block11Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data11_->self; + a_type = _data11_->a_type; + a_dup_func = _data11_->a_dup_func; + a_destroy_func = _data11_->a_destroy_func; + _g_object_unref0 (self); + g_slice_free (Block11Data, _data11_); + } +} + + +static Block12Data* block12_data_ref (Block12Data* _data12_) { + g_atomic_int_inc (&_data12_->_ref_count_); + return _data12_; +} + + +static void block12_data_unref (void * _userdata_) { + Block12Data* _data12_; + _data12_ = (Block12Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data12_->_data11_->self; + a_type = _data12_->_data11_->a_type; + a_dup_func = _data12_->_data11_->a_dup_func; + a_destroy_func = _data12_->_data11_->a_destroy_func; + _gee_lazy_unref0 (_data12_->item); + block11_data_unref (_data12_->_data11_); + _data12_->_data11_ = NULL; + g_slice_free (Block12Data, _data12_); + } +} + + +static gpointer ___lambda10_ (Block12Data* _data12_) { + Block11Data* _data11_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gpointer result = NULL; + GeeLazy* _tmp0_; + gpointer _tmp1_ = NULL; + gpointer tmp; + GeeMapFunc _tmp2_; + void* _tmp2__target; + gpointer _tmp3_; + gpointer _tmp4_ = NULL; + _data11_ = _data12_->_data11_; + self = _data11_->self; + a_type = _data11_->a_type; + a_dup_func = _data11_->a_dup_func; + a_destroy_func = _data11_->a_destroy_func; + _tmp0_ = _data12_->item; + _tmp1_ = gee_lazy_get (_tmp0_); + tmp = _tmp1_; + _gee_lazy_unref0 (_data12_->item); + _data12_->item = NULL; + _tmp2_ = _data11_->f; + _tmp2__target = _data11_->f_target; + _tmp3_ = tmp; + tmp = NULL; + _tmp4_ = _tmp2_ (_tmp3_, _tmp2__target); + result = _tmp4_; + _a_destroy_func0 (tmp); + return result; +} + + +static gpointer ____lambda10__gee_lazy_func (gpointer self) { + gpointer result; + result = ___lambda10_ (self); + return result; +} + + +static GeeTraversableStream __lambda9_ (Block11Data* _data11_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeLazy* _vala_val = NULL; + GeeTraversableStream result = 0; + Block12Data* _data12_; + GeeLazy* _tmp0_; + GeeTraversableStream _tmp1_; + self = _data11_->self; + a_type = _data11_->a_type; + a_dup_func = _data11_->a_dup_func; + a_destroy_func = _data11_->a_destroy_func; + _data12_ = g_slice_new0 (Block12Data); + _data12_->_ref_count_ = 1; + _data12_->_data11_ = block11_data_ref (_data11_); + _tmp0_ = item; + _gee_lazy_unref0 (_data12_->item); + _data12_->item = _tmp0_; + _tmp1_ = state; + switch (_tmp1_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + block12_data_unref (_data12_); + _data12_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + GeeLazy* _tmp2_; + _tmp2_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ____lambda10__gee_lazy_func, block12_data_ref (_data12_), block12_data_unref); + _gee_lazy_unref0 (_vala_val); + _vala_val = _tmp2_; + result = GEE_TRAVERSABLE_STREAM_YIELD; + block12_data_unref (_data12_); + _data12_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + case GEE_TRAVERSABLE_STREAM_END: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_END; + block12_data_unref (_data12_); + _data12_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + default: + { + g_assert_not_reached (); + } + } + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + block12_data_unref (_data12_); + _data12_ = NULL; +} + + +static GeeTraversableStream ___lambda9__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) { + GeeTraversableStream result; + result = __lambda9_ (self, state, g, lazy); + return result; +} + + +static GeeIterator* gee_traversable_real_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target) { + GeeIterator* result = NULL; + Block11Data* _data11_; + GeeMapFunc _tmp0_; + void* _tmp0__target; + GeeIterator* _tmp1_ = NULL; + _data11_ = g_slice_new0 (Block11Data); + _data11_->_ref_count_ = 1; + _data11_->self = g_object_ref (self); + _data11_->a_type = a_type; + _data11_->a_dup_func = a_dup_func; + _data11_->a_destroy_func = a_destroy_func; + _tmp0_ = f; + _tmp0__target = f_target; + _data11_->f = _tmp0_; + _data11_->f_target = _tmp0__target; + _tmp1_ = gee_traversable_stream (self, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ___lambda9__gee_stream_func, block11_data_ref (_data11_), block11_data_unref); + result = _tmp1_; + block11_data_unref (_data11_); + _data11_ = NULL; + return result; +} + + +GeeIterator* gee_traversable_map (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->map (self, a_type, a_dup_func, a_destroy_func, f, f_target); +} + + +/** + * Creates a new iterator that is initially pointing to seed. Then + * subsequent values are obtained after applying the function to previous + * value and the subsequent items. + * + * The resulting iterator is always valid and it contains the seed value. + * + * Note: Default implementation uses {@link stream}. + * + * Note: When the method is called on {@link Iterator} using the parent + * iterator is not allowed befor the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. The resulting iterator is {@link Iterator.valid}. + * + * @param f Folding function + * @param seed original seed value + * @return Iterator containing values of subsequent values of seed + */ +static Block13Data* block13_data_ref (Block13Data* _data13_) { + g_atomic_int_inc (&_data13_->_ref_count_); + return _data13_; +} + + +static void block13_data_unref (void * _userdata_) { + Block13Data* _data13_; + _data13_ = (Block13Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data13_->self; + a_type = _data13_->a_type; + a_dup_func = _data13_->a_dup_func; + a_destroy_func = _data13_->a_destroy_func; + _a_destroy_func0 (_data13_->seed); + _g_object_unref0 (self); + g_slice_free (Block13Data, _data13_); + } +} + + +static Block14Data* block14_data_ref (Block14Data* _data14_) { + g_atomic_int_inc (&_data14_->_ref_count_); + return _data14_; +} + + +static void block14_data_unref (void * _userdata_) { + Block14Data* _data14_; + _data14_ = (Block14Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + self = _data14_->_data13_->self; + a_type = _data14_->_data13_->a_type; + a_dup_func = _data14_->_data13_->a_dup_func; + a_destroy_func = _data14_->_data13_->a_destroy_func; + _gee_lazy_unref0 (_data14_->item); + block13_data_unref (_data14_->_data13_); + _data14_->_data13_ = NULL; + g_slice_free (Block14Data, _data14_); + } +} + + +static gpointer ___lambda12_ (Block14Data* _data14_) { + Block13Data* _data13_; + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + gpointer result = NULL; + GeeLazy* _tmp0_; + gpointer _tmp1_ = NULL; + gpointer tmp; + GeeFoldFunc _tmp2_; + void* _tmp2__target; + gpointer _tmp3_; + gpointer _tmp4_; + gpointer _tmp5_ = NULL; + gconstpointer _tmp6_; + gpointer _tmp7_; + _data13_ = _data14_->_data13_; + self = _data13_->self; + a_type = _data13_->a_type; + a_dup_func = _data13_->a_dup_func; + a_destroy_func = _data13_->a_destroy_func; + _tmp0_ = _data14_->item; + _tmp1_ = gee_lazy_get (_tmp0_); + tmp = _tmp1_; + _gee_lazy_unref0 (_data14_->item); + _data14_->item = NULL; + _tmp2_ = _data13_->f; + _tmp2__target = _data13_->f_target; + _tmp3_ = tmp; + tmp = NULL; + _tmp4_ = _data13_->seed; + _data13_->seed = NULL; + _tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target); + _a_destroy_func0 (_data13_->seed); + _data13_->seed = _tmp5_; + _tmp6_ = _data13_->seed; + _tmp7_ = ((_tmp6_ != NULL) && (a_dup_func != NULL)) ? a_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + result = _tmp7_; + _a_destroy_func0 (tmp); + return result; +} + + +static gpointer ____lambda12__gee_lazy_func (gpointer self) { + gpointer result; + result = ___lambda12_ (self); + return result; +} + + +static GeeTraversableStream __lambda11_ (Block13Data* _data13_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) { + GeeTraversable * self; + GType a_type; + GBoxedCopyFunc a_dup_func; + GDestroyNotify a_destroy_func; + GeeLazy* _vala_val = NULL; + GeeTraversableStream result = 0; + Block14Data* _data14_; + GeeLazy* _tmp0_; + GeeTraversableStream _tmp1_; + self = _data13_->self; + a_type = _data13_->a_type; + a_dup_func = _data13_->a_dup_func; + a_destroy_func = _data13_->a_destroy_func; + _data14_ = g_slice_new0 (Block14Data); + _data14_->_ref_count_ = 1; + _data14_->_data13_ = block13_data_ref (_data13_); + _tmp0_ = item; + _gee_lazy_unref0 (_data14_->item); + _data14_->item = _tmp0_; + _tmp1_ = state; + switch (_tmp1_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + { + if (_data13_->seed_emitted) { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + block14_data_unref (_data14_); + _data14_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + gconstpointer _tmp2_; + GeeLazy* _tmp3_; + _tmp2_ = _data13_->seed; + _tmp3_ = gee_lazy_new_from_value (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, _tmp2_); + _gee_lazy_unref0 (_vala_val); + _vala_val = _tmp3_; + _data13_->seed_emitted = TRUE; + result = GEE_TRAVERSABLE_STREAM_YIELD; + block14_data_unref (_data14_); + _data14_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + } + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + GeeLazy* _tmp4_; + _tmp4_ = gee_lazy_new (a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ____lambda12__gee_lazy_func, block14_data_ref (_data14_), block14_data_unref); + _gee_lazy_unref0 (_vala_val); + _vala_val = _tmp4_; + result = GEE_TRAVERSABLE_STREAM_YIELD; + block14_data_unref (_data14_); + _data14_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + case GEE_TRAVERSABLE_STREAM_END: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_END; + block14_data_unref (_data14_); + _data14_ = NULL; + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + default: + { + g_assert_not_reached (); + } + } + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + block14_data_unref (_data14_); + _data14_ = NULL; +} + + +static GeeTraversableStream ___lambda11__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) { + GeeTraversableStream result; + result = __lambda11_ (self, state, g, lazy); + return result; +} + + +static GeeIterator* gee_traversable_real_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) { + GeeIterator* result = NULL; + Block13Data* _data13_; + GeeFoldFunc _tmp0_; + void* _tmp0__target; + gconstpointer _tmp1_; + GeeIterator* _tmp2_ = NULL; + _data13_ = g_slice_new0 (Block13Data); + _data13_->_ref_count_ = 1; + _data13_->self = g_object_ref (self); + _data13_->a_type = a_type; + _data13_->a_dup_func = a_dup_func; + _data13_->a_destroy_func = a_destroy_func; + _tmp0_ = f; + _tmp0__target = f_target; + _data13_->f = _tmp0_; + _data13_->f_target = _tmp0__target; + _tmp1_ = seed; + _a_destroy_func0 (_data13_->seed); + _data13_->seed = _tmp1_; + _data13_->seed_emitted = FALSE; + _tmp2_ = gee_traversable_stream (self, a_type, (GBoxedCopyFunc) a_dup_func, a_destroy_func, ___lambda11__gee_stream_func, block13_data_ref (_data13_), block13_data_unref); + result = _tmp2_; + block13_data_unref (_data13_); + _data13_ = NULL; + return result; +} + + +GeeIterator* gee_traversable_scan (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->scan (self, a_type, a_dup_func, a_destroy_func, f, f_target, seed); +} + + +/** + * Creates a new iterator that contains only values that fullfills the + * predicate. + * + * Note: When the method is called on {@link Iterator} using the parent + * iterator is not allowed befor the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. The resulting iterator is {@link Iterator.valid} if parent + * iterator is {@link Iterator.valid} and value it is pointing on + * fullfills the predicate. + * + * @param pred predicate to check should the value be retained + * @return Iterator containing values of subsequent values of seed + */ +static Block15Data* block15_data_ref (Block15Data* _data15_) { + g_atomic_int_inc (&_data15_->_ref_count_); + return _data15_; +} + + +static void block15_data_unref (void * _userdata_) { + Block15Data* _data15_; + _data15_ = (Block15Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) { + GeeTraversable * self; + self = _data15_->self; + (_data15_->pred_target_destroy_notify == NULL) ? NULL : (_data15_->pred_target_destroy_notify (_data15_->pred_target), NULL); + _data15_->pred = NULL; + _data15_->pred_target = NULL; + _data15_->pred_target_destroy_notify = NULL; + _g_object_unref0 (self); + g_slice_free (Block15Data, _data15_); + } +} + + +static GeeTraversableStream __lambda13_ (Block15Data* _data15_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) { + GeeTraversable * self; + GeeLazy* _vala_val = NULL; + GeeTraversableStream result = 0; + GeeTraversableStream _tmp0_; + self = _data15_->self; + _tmp0_ = state; + switch (_tmp0_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + GeeLazy* _tmp1_; + gpointer _tmp2_ = NULL; + gpointer g; + GeePredicate _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + gboolean _tmp5_ = FALSE; + _tmp1_ = item; + _tmp2_ = gee_lazy_get (_tmp1_); + g = _tmp2_; + _tmp3_ = _data15_->pred; + _tmp3__target = _data15_->pred_target; + _tmp4_ = g; + _tmp5_ = _tmp3_ (_tmp4_, _tmp3__target); + if (_tmp5_) { + GeeLazy* _tmp6_; + GeeLazy* _tmp7_; + _tmp6_ = item; + _tmp7_ = _gee_lazy_ref0 (_tmp6_); + _gee_lazy_unref0 (_vala_val); + _vala_val = _tmp7_; + result = GEE_TRAVERSABLE_STREAM_YIELD; + ((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL)); + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + ((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL)); + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + ((g == NULL) || (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (g = (GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self) (g), NULL)); + } + case GEE_TRAVERSABLE_STREAM_END: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_END; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } +} + + +static GeeTraversableStream ___lambda13__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) { + GeeTraversableStream result; + result = __lambda13_ (self, state, g, lazy); + return result; +} + + +static GeeIterator* gee_traversable_real_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify) { + GeeIterator* result = NULL; + Block15Data* _data15_; + GeePredicate _tmp0_; + void* _tmp0__target; + GeeIterator* _tmp1_ = NULL; + _data15_ = g_slice_new0 (Block15Data); + _data15_->_ref_count_ = 1; + _data15_->self = g_object_ref (self); + _tmp0_ = pred; + _tmp0__target = pred_target; + (_data15_->pred_target_destroy_notify == NULL) ? NULL : (_data15_->pred_target_destroy_notify (_data15_->pred_target), NULL); + _data15_->pred = NULL; + _data15_->pred_target = NULL; + _data15_->pred_target_destroy_notify = NULL; + _data15_->pred = _tmp0_; + _data15_->pred_target = _tmp0__target; + _data15_->pred_target_destroy_notify = pred_target_destroy_notify; + _tmp1_ = gee_traversable_stream (self, GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ___lambda13__gee_stream_func, block15_data_ref (_data15_), block15_data_unref); + result = _tmp1_; + block15_data_unref (_data15_); + _data15_ = NULL; + return result; +} + + +GeeIterator* gee_traversable_filter (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->filter (self, pred, pred_target, pred_target_destroy_notify); +} + + +/** + * Creates a new iterator which contains elements from iterable. The + * first argument states the offset i.e. number of elements the iterator + * skips by default. + * + * Note: In {@link Iterator} implementation resulting iterator is + * {@link Iterator.valid} when parent iterator is + * {@link Iterator.valid} and the offset is 0. Using the parent + * iterator is not allowed before the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. + * + * @param offset the offset to first element the iterator is pointing to + * @param length maximum number of elements iterator may return. Negative + * value means that the number is unbounded + */ +static Block16Data* block16_data_ref (Block16Data* _data16_) { + g_atomic_int_inc (&_data16_->_ref_count_); + return _data16_; +} + + +static void block16_data_unref (void * _userdata_) { + Block16Data* _data16_; + _data16_ = (Block16Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) { + GeeTraversable * self; + self = _data16_->self; + _g_object_unref0 (self); + g_slice_free (Block16Data, _data16_); + } +} + + +static GeeTraversableStream __lambda14_ (Block16Data* _data16_, GeeTraversableStream state, GeeLazy* item, GeeLazy** val) { + GeeTraversable * self; + GeeLazy* _vala_val = NULL; + GeeTraversableStream result = 0; + GeeTraversableStream _tmp0_; + self = _data16_->self; + _tmp0_ = state; + switch (_tmp0_) { + case GEE_TRAVERSABLE_STREAM_YIELD: + { + gint _tmp1_; + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + _tmp1_ = _data16_->offset; + if (_tmp1_ > 0) { + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + gint _tmp2_; + _tmp2_ = _data16_->length; + if (_tmp2_ > 0) { + GeeTraversableStream _tmp3_ = 0; + gint _tmp4_; + GeeTraversableStream _tmp5_; + _tmp4_ = _data16_->length; + if (_tmp4_ != 0) { + _tmp3_ = GEE_TRAVERSABLE_STREAM_CONTINUE; + } else { + _tmp3_ = GEE_TRAVERSABLE_STREAM_END; + } + _tmp5_ = _tmp3_; + result = _tmp5_; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + gint _tmp6_; + _tmp6_ = _data16_->length; + if (_tmp6_ == 0) { + result = GEE_TRAVERSABLE_STREAM_END; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + } + } + } + case GEE_TRAVERSABLE_STREAM_CONTINUE: + { + gint _tmp7_; + _tmp7_ = _data16_->offset; + if (_tmp7_ == 0) { + GeeLazy* _tmp8_; + GeeLazy* _tmp9_; + gint _tmp10_; + _tmp8_ = item; + _tmp9_ = _gee_lazy_ref0 (_tmp8_); + _gee_lazy_unref0 (_vala_val); + _vala_val = _tmp9_; + _tmp10_ = _data16_->length; + _data16_->length = _tmp10_ - 1; + result = GEE_TRAVERSABLE_STREAM_YIELD; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } else { + gint _tmp11_; + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + _tmp11_ = _data16_->offset; + _data16_->offset = _tmp11_ - 1; + result = GEE_TRAVERSABLE_STREAM_CONTINUE; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + } + case GEE_TRAVERSABLE_STREAM_END: + { + _gee_lazy_unref0 (_vala_val); + _vala_val = NULL; + result = GEE_TRAVERSABLE_STREAM_END; + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } + return result; + } + default: + { + g_assert_not_reached (); + } + } + _gee_lazy_unref0 (item); + if (val) { + *val = _vala_val; + } else { + _gee_lazy_unref0 (_vala_val); + } +} + + +static GeeTraversableStream ___lambda14__gee_stream_func (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, gpointer self) { + GeeTraversableStream result; + result = __lambda14_ (self, state, g, lazy); + return result; +} + + +static GeeIterator* gee_traversable_real_chop (GeeTraversable* self, gint offset, gint length) { + GeeIterator* result = NULL; + Block16Data* _data16_; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeIterator* _tmp3_ = NULL; + _data16_ = g_slice_new0 (Block16Data); + _data16_->_ref_count_ = 1; + _data16_->self = g_object_ref (self); + _tmp0_ = offset; + _data16_->offset = _tmp0_; + _tmp1_ = length; + _data16_->length = _tmp1_; + _tmp2_ = _data16_->offset; + _vala_assert (_tmp2_ >= 0, "offset >= 0"); + _tmp3_ = gee_traversable_stream (self, GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self), (GBoxedCopyFunc) GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_dup_func (self), GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_destroy_func (self), ___lambda14__gee_stream_func, block16_data_ref (_data16_), block16_data_unref); + result = _tmp3_; + block16_data_unref (_data16_); + _data16_ = NULL; + return result; +} + + +GeeIterator* gee_traversable_chop (GeeTraversable* self, gint offset, gint length) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->chop (self, offset, length); +} + + +GType gee_traversable_get_element_type (GeeTraversable* self) { + g_return_val_if_fail (self != NULL, 0UL); + return GEE_TRAVERSABLE_GET_INTERFACE (self)->get_element_type (self); +} + + +static GType gee_traversable_real_get_element_type (GeeTraversable* base) { + GType result; + GeeTraversable* self; + self = base; + result = GEE_TRAVERSABLE_GET_INTERFACE (self)->get_g_type (self); + return result; +} + + +static void gee_traversable_base_init (GeeTraversableIface * iface) { + static gboolean initialized = FALSE; + if (!initialized) { + initialized = TRUE; + iface->stream = gee_traversable_real_stream; + iface->fold = gee_traversable_real_fold; + iface->map = gee_traversable_real_map; + iface->scan = gee_traversable_real_scan; + iface->filter = gee_traversable_real_filter; + iface->chop = gee_traversable_real_chop; + iface->get_element_type = gee_traversable_real_get_element_type; + } +} + + +/** + * It's a common interface for {@link Iterator} and {@link Iterable}. It + * provides a fast, high level functions. + * + * ''{@link Iterator} implementation:'' Please note that most of the functions + * affect the state of the iterator by moving it forward. + * Even if the iterator is {@link BidirIterator} it ''must not'' + * rewind the state. + * + * ''{@link Iterable} implementation:'' validy ({@link Iterator.valid}) + * of returned iterator is the same as for invalid + * iterator. In other words the following code is semantically equivalent: + * + * {{{ + * var x = iterable.function (args); + * var x = iterable.iterator ().function(args); + * }}} + * + * @since 0.7.0 + */ +GType gee_traversable_get_type (void) { + static volatile gsize gee_traversable_type_id__volatile = 0; + if (g_once_init_enter (&gee_traversable_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTraversableIface), (GBaseInitFunc) gee_traversable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; + GType gee_traversable_type_id; + gee_traversable_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeTraversable", &g_define_type_info, 0); + g_type_interface_add_prerequisite (gee_traversable_type_id, G_TYPE_OBJECT); + g_once_init_leave (&gee_traversable_type_id__volatile, gee_traversable_type_id); + } + return gee_traversable_type_id__volatile; +} + + + diff --git a/gee/traversable.vala b/gee/traversable.vala new file mode 100644 index 0000000..e9ead40 --- /dev/null +++ b/gee/traversable.vala @@ -0,0 +1,381 @@ +/* traversable.vala + * + * Copyright (C) 2011-2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +namespace Gee { + public delegate A FoldFunc (owned G g, owned A a); + public delegate bool ForallFunc (owned G g); + public delegate Lazy? UnfoldFunc (); + public delegate Traversable.Stream StreamFunc (Traversable.Stream state, owned Lazy? g, out Lazy? lazy); + public delegate A MapFunc (owned G g); + public delegate bool Predicate (G g); +} + +/** + * It's a common interface for {@link Iterator} and {@link Iterable}. It + * provides a fast, high level functions. + * + * ''{@link Iterator} implementation:'' Please note that most of the functions + * affect the state of the iterator by moving it forward. + * Even if the iterator is {@link BidirIterator} it ''must not'' + * rewind the state. + * + * ''{@link Iterable} implementation:'' validy ({@link Iterator.valid}) + * of returned iterator is the same as for invalid + * iterator. In other words the following code is semantically equivalent: + * + * {{{ + * var x = iterable.function (args); + * var x = iterable.iterator ().function(args); + * }}} + * + * @since 0.7.0 + */ +[GenericAccessors] +public interface Gee.Traversable : Object { + /** + * Apply function to each element returned by iterator untill last element + * or function return ''false''. + * + * ''{@link Iterator} implementation:'' Operation moves the iterator + * to last element in iteration or the first element that returned ''false''. + * If iterator points at some element it will be included in iteration. + * + * @param f function applied to every element of the collection + * + * @return ''false'' if the argument returned ''false'' at last invocation and + * ''true'' otherwise. + */ + public new abstract bool foreach (ForallFunc f); + + /** + * Stream function is an abstract function allowing writing many + * operations. + * + * The stream function accepts three parameter: + * + * 1. state. It is usually the last returned value from function but + * it may be {@link Stream.END} when {@link Stream.CONTINUE} was + * returned and there was no more elements. + * 1. input. It is valid only if first argument is + * {@link Stream.CONTINUE} + * 1. output. It is valid only if result is Stream.YIELD + * + * It may return one of 3 results: + * + * 1. {@link Stream.YIELD}. It means that value was yielded and can + * be passed to outgoing iterator. + * 1. {@link Stream.CONTINUE}. It means that the function needs to be + * called with next element or with {@link Stream.END} if it is + * end of stream). If the state element was Stream.END during the + * current iteration function ''must not'' return {@link Stream.CONTINUE} + * 1. Stream.END. It means that the last argument was yielded. + * + * If the function yields the value immediately then the returning iterator + * is {@link Iterator.valid} and points to this value as well as in case when the + * parent iterator is {@link Iterator.valid} and function yields + * after consuming 1 input. In other case returned iterator is invalid. + * + * Note: In {@link Iterator} implementation: if iterator is + * {@link Iterator.valid} the current value should be fed + * immediately to function if during initial call function returns + * {@link Stream.CONTINUE}. The parent iterator cannot be used before + * the functions return {@link Stream.END} afterwards it points on the + * last element consumed. + * + * @param f function generating stream + * @return iterator containing values yielded by stream + */ + public virtual Iterator stream (owned StreamFunc f) { + Iterator? self; + Iterable? iself; + // Yes - I've heard of polimorphism ;) but I don't want users to need to implement the method. + if ((self = this as Iterator) != null) { + Traversable.Stream str; + Lazy? initial = null; + bool need_next = true; + str = f (Stream.YIELD, null, out initial); + switch (str) { + case Stream.CONTINUE: + if (self.valid) { + str = f (Stream.CONTINUE, new Lazy (() => {return self.get ();}), out initial); + switch (str) { + case Stream.YIELD: + case Stream.CONTINUE: + break; + case Stream.END: + return Iterator.unfold (() => {return null;}); + default: + assert_not_reached (); + } + } + break; + case Stream.YIELD: + if (self.valid) + need_next = false; + break; + case Stream.END: + return Iterator.unfold (() => {return null;}); + default: + assert_not_reached (); + } + return Iterator.unfold (() => { + Lazy? val = null; + if (str != Stream.CONTINUE) + str = f (Traversable.Stream.YIELD, null, out val); + while (str == Stream.CONTINUE) { + if (need_next) { + if (!self.next ()) { + str = f (Traversable.Stream.END, null, out val); + assert (str != Traversable.Stream.CONTINUE); + break; + } + } else { + need_next = true; + } + str = f (Stream.CONTINUE, new Lazy (() => {return self.get ();}), out val); + } + switch (str) { + case Stream.YIELD: + return val; + case Stream.END: + return null; + default: + assert_not_reached (); + } + }, initial); + } else if ((iself = this as Iterable) != null) { + return iself.iterator().stream ((owned) f); + } else { + assert_not_reached (); + } + } + + /** + * Standard aggregation function. + * + * It takes a function, seed and first element, returns the new seed and + * progress to next element when the operation repeats. + * + * Note: Default implementation uses {@link foreach}. + * + * Note: In {@link Iterator} implementation operation moves the + * iterator to last element in iteration. If iterator is + * {@link Iterator.valid} the current element will be considered + * as well. + * + */ + public virtual A fold (FoldFunc f, owned A seed) + { + this.foreach ((item) => {seed = f ((owned) item, (owned) seed); return true; }); + return (owned) seed; + } + + /** + * Produces an iterator pointing at elements generated by function passed. + * + * Iterator is lazy evaluated but value is force-evaluated when + * iterator moves to next element. ({@link Iterator.next}) + * + * Note: Default implementation uses {@link stream}. + * + * Note: In {@link Iterator} implementation if the parent iterator is + * {@link Iterator.valid} so is the returned one. Using the parent + * iterator is not allowed before the inner iterator {@link Iterator.next} + * return false and then it points on its last element. + * The resulting iterator is {@link Iterator.valid} if the parent + * iterator is. + * + * @param f Mapping function + * @return Iterator listing mapped value + */ + public virtual Iterator map (MapFunc f) { + return stream((state, item, out val) => { + switch (state) { + case Stream.YIELD: + val = null; + return Stream.CONTINUE; + case Stream.CONTINUE: + val = new Lazy(() => { + A tmp = item.get (); + item = null; + return (f ((owned)tmp)); + }); + return Stream.YIELD; + case Stream.END: + val = null; + return Stream.END; + default: + assert_not_reached (); + } + }); + } + + /** + * Creates a new iterator that is initially pointing to seed. Then + * subsequent values are obtained after applying the function to previous + * value and the subsequent items. + * + * The resulting iterator is always valid and it contains the seed value. + * + * Note: Default implementation uses {@link stream}. + * + * Note: When the method is called on {@link Iterator} using the parent + * iterator is not allowed befor the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. The resulting iterator is {@link Iterator.valid}. + * + * @param f Folding function + * @param seed original seed value + * @return Iterator containing values of subsequent values of seed + */ + public virtual Iterator scan (FoldFunc f, owned A seed) { + bool seed_emitted = false; + return stream((state, item, out val) => { + switch (state) { + case Stream.YIELD: + if (seed_emitted) { + val = null; + return Stream.CONTINUE; + } else { + val = new Lazy.from_value (seed); + seed_emitted = true; + return Stream.YIELD; + } + case Stream.CONTINUE: + val = new Lazy (() => { + A tmp = item.get (); + item = null; + seed = f ((owned) tmp, (owned) seed); + return seed; + }); + return Stream.YIELD; + case Stream.END: + val = null; + return Stream.END; + default: + assert_not_reached (); + } + }); + } + + /** + * Creates a new iterator that contains only values that fullfills the + * predicate. + * + * Note: When the method is called on {@link Iterator} using the parent + * iterator is not allowed befor the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. The resulting iterator is {@link Iterator.valid} if parent + * iterator is {@link Iterator.valid} and value it is pointing on + * fullfills the predicate. + * + * @param pred predicate to check should the value be retained + * @return Iterator containing values of subsequent values of seed + */ + public virtual Iterator filter (owned Predicate pred) { + return stream ((state, item, out val) => { + switch (state) { + case Stream.YIELD: + val = null; + return Stream.CONTINUE; + case Stream.CONTINUE: + G g = item.get (); + if (pred (g)) { + val = item; + return Stream.YIELD; + } else { + val = null; + return Stream.CONTINUE; + } + case Stream.END: + val = null; + return Stream.END; + default: + assert_not_reached (); + }; + }); + } + + /** + * Creates a new iterator which contains elements from iterable. The + * first argument states the offset i.e. number of elements the iterator + * skips by default. + * + * Note: In {@link Iterator} implementation resulting iterator is + * {@link Iterator.valid} when parent iterator is + * {@link Iterator.valid} and the offset is 0. Using the parent + * iterator is not allowed before the inner iterator + * {@link Iterator.next} return false and then it points on its last + * element. + * + * @param offset the offset to first element the iterator is pointing to + * @param length maximum number of elements iterator may return. Negative + * value means that the number is unbounded + */ + public virtual Iterator chop (int offset, int length = -1) { + assert (offset >= 0); + return stream ((state, item, out val) => { + switch (state) { + case Stream.YIELD: + val = null; + if (offset > 0) { + return Stream.CONTINUE; + } else if (length > 0) { + return length != 0 ? Stream.CONTINUE : Stream.END; + } else if (length == 0) { + return Stream.END; + } else { + return Stream.CONTINUE; + } + case Stream.CONTINUE: + if (offset == 0) { + val = item; + length--; + return Stream.YIELD; + } else { + val = null; + offset--; + return Stream.CONTINUE; + } + case Stream.END: + val = null; + return Stream.END; + default: + assert_not_reached (); + }; + }); + } + + + /** + * The type of the elements in this collection. + */ + public virtual Type element_type { get { return typeof (G); } } + + public enum Stream { + YIELD, + CONTINUE, + END + } + +} + diff --git a/gee/treemap.c b/gee/treemap.c index 3836303..11e36fd 100644 --- a/gee/treemap.c +++ b/gee/treemap.c @@ -3,7 +3,7 @@ /* treemap.vala * - * Copyright (C) 2009 Maciej Piechotka + * Copyright (C) 2009-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,15 +25,28 @@ #include #include +#include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_MAP (gee_map_get_type ()) #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap)) #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP)) @@ -96,6 +117,60 @@ typedef struct _GeeAbstractMap GeeAbstractMap; typedef struct _GeeAbstractMapClass GeeAbstractMapClass; typedef struct _GeeAbstractMapPrivate GeeAbstractMapPrivate; +#define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ()) +#define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap)) +#define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP)) +#define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface)) + +typedef struct _GeeSortedMap GeeSortedMap; +typedef struct _GeeSortedMapIface GeeSortedMapIface; + +#define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ()) +#define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet)) +#define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET)) +#define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface)) + +typedef struct _GeeSortedSet GeeSortedSet; +typedef struct _GeeSortedSetIface GeeSortedSetIface; + +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; +typedef struct _GeeAbstractSortedMapPrivate GeeAbstractSortedMapPrivate; + +#define GEE_TYPE_BIDIR_SORTED_MAP (gee_bidir_sorted_map_get_type ()) +#define GEE_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMap)) +#define GEE_IS_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_MAP)) +#define GEE_BIDIR_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_MAP, GeeBidirSortedMapIface)) + +typedef struct _GeeBidirSortedMap GeeBidirSortedMap; +typedef struct _GeeBidirSortedMapIface GeeBidirSortedMapIface; + +#define GEE_TYPE_BIDIR_MAP_ITERATOR (gee_bidir_map_iterator_get_type ()) +#define GEE_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIterator)) +#define GEE_IS_BIDIR_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR)) +#define GEE_BIDIR_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_MAP_ITERATOR, GeeBidirMapIteratorIface)) + +typedef struct _GeeBidirMapIterator GeeBidirMapIterator; +typedef struct _GeeBidirMapIteratorIface GeeBidirMapIteratorIface; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; +typedef struct _GeeAbstractBidirSortedMapPrivate GeeAbstractBidirSortedMapPrivate; + #define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) #define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) #define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) @@ -107,10 +182,33 @@ typedef struct _GeeTreeMap GeeTreeMap; typedef struct _GeeTreeMapClass GeeTreeMapClass; typedef struct _GeeTreeMapPrivate GeeTreeMapPrivate; typedef struct _GeeTreeMapNode GeeTreeMapNode; + +#define GEE_TREE_MAP_TYPE_RANGE_TYPE (gee_tree_map_range_type_get_type ()) #define _gee_tree_map_node_free0(var) ((var == NULL) ? NULL : (var = (gee_tree_map_node_free (var), NULL))) #define GEE_TREE_MAP_NODE_TYPE_COLOR (gee_tree_map_node_color_get_type ()) +#define GEE_TREE_MAP_TYPE_RANGE (gee_tree_map_range_get_type ()) +#define GEE_TREE_MAP_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_RANGE, GeeTreeMapRange)) +#define GEE_TREE_MAP_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_RANGE, GeeTreeMapRangeClass)) +#define GEE_TREE_MAP_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_RANGE)) +#define GEE_TREE_MAP_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_RANGE)) +#define GEE_TREE_MAP_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_RANGE, GeeTreeMapRangeClass)) + +typedef struct _GeeTreeMapRange GeeTreeMapRange; +typedef struct _GeeTreeMapRangeClass GeeTreeMapRangeClass; + +#define GEE_TREE_MAP_TYPE_SUB_MAP (gee_tree_map_sub_map_get_type ()) +#define GEE_TREE_MAP_SUB_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMap)) +#define GEE_TREE_MAP_SUB_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMapClass)) +#define GEE_TREE_MAP_IS_SUB_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_MAP)) +#define GEE_TREE_MAP_IS_SUB_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_MAP)) +#define GEE_TREE_MAP_SUB_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMapClass)) + +typedef struct _GeeTreeMapSubMap GeeTreeMapSubMap; +typedef struct _GeeTreeMapSubMapClass GeeTreeMapSubMapClass; +#define _gee_tree_map_range_unref0(var) ((var == NULL) ? NULL : (var = (gee_tree_map_range_unref (var), NULL))) + #define GEE_TREE_MAP_TYPE_NODE_ITERATOR (gee_tree_map_node_iterator_get_type ()) #define GEE_TREE_MAP_NODE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator)) #define GEE_TREE_MAP_NODE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIteratorClass)) @@ -151,6 +249,26 @@ typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractSet GeeAbstractSet; typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; + #define GEE_TREE_MAP_TYPE_KEY_SET (gee_tree_map_key_set_get_type ()) #define GEE_TREE_MAP_KEY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet)) #define GEE_TREE_MAP_KEY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySetClass)) @@ -193,8 +311,80 @@ typedef struct _GeeMapEntryPrivate GeeMapEntryPrivate; typedef struct _GeeTreeMapEntry GeeTreeMapEntry; typedef struct _GeeTreeMapEntryClass GeeTreeMapEntryClass; typedef struct _GeeTreeMapEntryPrivate GeeTreeMapEntryPrivate; +typedef struct _GeeTreeMapRangePrivate GeeTreeMapRangePrivate; +#define _k_destroy_func0(var) (((var == NULL) || (k_destroy_func == NULL)) ? NULL : (var = (k_destroy_func (var), NULL))) +typedef struct _GeeTreeMapParamSpecRange GeeTreeMapParamSpecRange; +typedef struct _GeeTreeMapSubMapPrivate GeeTreeMapSubMapPrivate; + +#define GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR (gee_tree_map_sub_node_iterator_get_type ()) +#define GEE_TREE_MAP_SUB_NODE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIterator)) +#define GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIteratorClass)) +#define GEE_TREE_MAP_IS_SUB_NODE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR)) +#define GEE_TREE_MAP_IS_SUB_NODE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR)) +#define GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIteratorClass)) + +typedef struct _GeeTreeMapSubNodeIterator GeeTreeMapSubNodeIterator; +typedef struct _GeeTreeMapSubNodeIteratorClass GeeTreeMapSubNodeIteratorClass; + +#define GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR (gee_tree_map_sub_map_iterator_get_type ()) +#define GEE_TREE_MAP_SUB_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIterator)) +#define GEE_TREE_MAP_SUB_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIteratorClass)) +#define GEE_TREE_MAP_IS_SUB_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR)) +#define GEE_TREE_MAP_IS_SUB_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR)) +#define GEE_TREE_MAP_SUB_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIteratorClass)) + +typedef struct _GeeTreeMapSubMapIterator GeeTreeMapSubMapIterator; +typedef struct _GeeTreeMapSubMapIteratorClass GeeTreeMapSubMapIteratorClass; + +#define GEE_TREE_MAP_TYPE_SUB_KEY_SET (gee_tree_map_sub_key_set_get_type ()) +#define GEE_TREE_MAP_SUB_KEY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySet)) +#define GEE_TREE_MAP_SUB_KEY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySetClass)) +#define GEE_TREE_MAP_IS_SUB_KEY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_SET)) +#define GEE_TREE_MAP_IS_SUB_KEY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_KEY_SET)) +#define GEE_TREE_MAP_SUB_KEY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySetClass)) + +typedef struct _GeeTreeMapSubKeySet GeeTreeMapSubKeySet; +typedef struct _GeeTreeMapSubKeySetClass GeeTreeMapSubKeySetClass; + +#define GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION (gee_tree_map_sub_value_collection_get_type ()) +#define GEE_TREE_MAP_SUB_VALUE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollection)) +#define GEE_TREE_MAP_SUB_VALUE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollectionClass)) +#define GEE_TREE_MAP_IS_SUB_VALUE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION)) +#define GEE_TREE_MAP_IS_SUB_VALUE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION)) +#define GEE_TREE_MAP_SUB_VALUE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollectionClass)) + +typedef struct _GeeTreeMapSubValueCollection GeeTreeMapSubValueCollection; +typedef struct _GeeTreeMapSubValueCollectionClass GeeTreeMapSubValueCollectionClass; + +#define GEE_TREE_MAP_TYPE_SUB_ENTRY_SET (gee_tree_map_sub_entry_set_get_type ()) +#define GEE_TREE_MAP_SUB_ENTRY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySet)) +#define GEE_TREE_MAP_SUB_ENTRY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySetClass)) +#define GEE_TREE_MAP_IS_SUB_ENTRY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET)) +#define GEE_TREE_MAP_IS_SUB_ENTRY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET)) +#define GEE_TREE_MAP_SUB_ENTRY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySetClass)) + +typedef struct _GeeTreeMapSubEntrySet GeeTreeMapSubEntrySet; +typedef struct _GeeTreeMapSubEntrySetClass GeeTreeMapSubEntrySetClass; typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + +#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) +#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) +#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) +#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) + +typedef struct _GeeBidirIterator GeeBidirIterator; +typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; +typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate; typedef struct _GeeTreeMapKeySetPrivate GeeTreeMapKeySetPrivate; #define GEE_TREE_MAP_TYPE_KEY_ITERATOR (gee_tree_map_key_iterator_get_type ()) @@ -206,6 +396,17 @@ typedef struct _GeeTreeMapKeySetPrivate GeeTreeMapKeySetPrivate; typedef struct _GeeTreeMapKeyIterator GeeTreeMapKeyIterator; typedef struct _GeeTreeMapKeyIteratorClass GeeTreeMapKeyIteratorClass; +typedef struct _GeeTreeMapSubKeySetPrivate GeeTreeMapSubKeySetPrivate; + +#define GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR (gee_tree_map_sub_key_iterator_get_type ()) +#define GEE_TREE_MAP_SUB_KEY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIterator)) +#define GEE_TREE_MAP_SUB_KEY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIteratorClass)) +#define GEE_TREE_MAP_IS_SUB_KEY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR)) +#define GEE_TREE_MAP_IS_SUB_KEY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR)) +#define GEE_TREE_MAP_SUB_KEY_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIteratorClass)) + +typedef struct _GeeTreeMapSubKeyIterator GeeTreeMapSubKeyIterator; +typedef struct _GeeTreeMapSubKeyIteratorClass GeeTreeMapSubKeyIteratorClass; typedef struct _GeeTreeMapValueCollectionPrivate GeeTreeMapValueCollectionPrivate; #define GEE_TREE_MAP_TYPE_VALUE_ITERATOR (gee_tree_map_value_iterator_get_type ()) @@ -217,6 +418,17 @@ typedef struct _GeeTreeMapValueCollectionPrivate GeeTreeMapValueCollectionPrivat typedef struct _GeeTreeMapValueIterator GeeTreeMapValueIterator; typedef struct _GeeTreeMapValueIteratorClass GeeTreeMapValueIteratorClass; +typedef struct _GeeTreeMapSubValueCollectionPrivate GeeTreeMapSubValueCollectionPrivate; + +#define GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR (gee_tree_map_sub_value_iterator_get_type ()) +#define GEE_TREE_MAP_SUB_VALUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIterator)) +#define GEE_TREE_MAP_SUB_VALUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIteratorClass)) +#define GEE_TREE_MAP_IS_SUB_VALUE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR)) +#define GEE_TREE_MAP_IS_SUB_VALUE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR)) +#define GEE_TREE_MAP_SUB_VALUE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIteratorClass)) + +typedef struct _GeeTreeMapSubValueIterator GeeTreeMapSubValueIterator; +typedef struct _GeeTreeMapSubValueIteratorClass GeeTreeMapSubValueIteratorClass; typedef struct _GeeTreeMapEntrySetPrivate GeeTreeMapEntrySetPrivate; #define GEE_TREE_MAP_TYPE_ENTRY_ITERATOR (gee_tree_map_entry_iterator_get_type ()) @@ -228,49 +440,101 @@ typedef struct _GeeTreeMapEntrySetPrivate GeeTreeMapEntrySetPrivate; typedef struct _GeeTreeMapEntryIterator GeeTreeMapEntryIterator; typedef struct _GeeTreeMapEntryIteratorClass GeeTreeMapEntryIteratorClass; -typedef struct _GeeTreeMapNodeIteratorPrivate GeeTreeMapNodeIteratorPrivate; +typedef struct _GeeTreeMapSubEntrySetPrivate GeeTreeMapSubEntrySetPrivate; -#define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) -#define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) -#define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) -#define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface)) +#define GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR (gee_tree_map_sub_entry_iterator_get_type ()) +#define GEE_TREE_MAP_SUB_ENTRY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIterator)) +#define GEE_TREE_MAP_SUB_ENTRY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIteratorClass)) +#define GEE_TREE_MAP_IS_SUB_ENTRY_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR)) +#define GEE_TREE_MAP_IS_SUB_ENTRY_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR)) +#define GEE_TREE_MAP_SUB_ENTRY_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIteratorClass)) -typedef struct _GeeBidirIterator GeeBidirIterator; -typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; +typedef struct _GeeTreeMapSubEntryIterator GeeTreeMapSubEntryIterator; +typedef struct _GeeTreeMapSubEntryIteratorClass GeeTreeMapSubEntryIteratorClass; +typedef struct _GeeTreeMapNodeIteratorPrivate GeeTreeMapNodeIteratorPrivate; +typedef struct _GeeTreeMapSubNodeIteratorPrivate GeeTreeMapSubNodeIteratorPrivate; typedef struct _GeeTreeMapKeyIteratorPrivate GeeTreeMapKeyIteratorPrivate; +typedef struct _GeeTreeMapSubKeyIteratorPrivate GeeTreeMapSubKeyIteratorPrivate; typedef struct _GeeTreeMapValueIteratorPrivate GeeTreeMapValueIteratorPrivate; +typedef struct _GeeTreeMapSubValueIteratorPrivate GeeTreeMapSubValueIteratorPrivate; typedef struct _GeeTreeMapEntryIteratorPrivate GeeTreeMapEntryIteratorPrivate; +typedef struct _GeeTreeMapSubEntryIteratorPrivate GeeTreeMapSubEntryIteratorPrivate; typedef struct _GeeTreeMapMapIteratorPrivate GeeTreeMapMapIteratorPrivate; +typedef struct _GeeTreeMapSubMapIteratorPrivate GeeTreeMapSubMapIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -282,38 +546,43 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMap { @@ -330,26 +599,135 @@ struct _GeeAbstractMapClass { gboolean (*unset) (GeeAbstractMap* self, gconstpointer key, gpointer* value); GeeMapIterator* (*map_iterator) (GeeAbstractMap* self); void (*clear) (GeeAbstractMap* self); - void (*set_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*unset_all) (GeeAbstractMap* self, GeeMap* map); - gboolean (*has_all) (GeeAbstractMap* self, GeeMap* map); + gboolean (*foreach) (GeeAbstractMap* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeAbstractMap* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + void (*reserved0) (GeeAbstractMap* self); + void (*reserved1) (GeeAbstractMap* self); + void (*reserved2) (GeeAbstractMap* self); + void (*reserved3) (GeeAbstractMap* self); + void (*reserved4) (GeeAbstractMap* self); + void (*reserved5) (GeeAbstractMap* self); + void (*reserved6) (GeeAbstractMap* self); + void (*reserved7) (GeeAbstractMap* self); + void (*reserved8) (GeeAbstractMap* self); + void (*reserved9) (GeeAbstractMap* self); gint (*get_size) (GeeAbstractMap* self); - gboolean (*get_is_empty) (GeeAbstractMap* self); + gboolean (*get_read_only) (GeeAbstractMap* self); GeeSet* (*get_keys) (GeeAbstractMap* self); GeeCollection* (*get_values) (GeeAbstractMap* self); GeeSet* (*get_entries) (GeeAbstractMap* self); GeeMap* (*get_read_only_view) (GeeAbstractMap* self); }; -struct _GeeTreeMap { +struct _GeeSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); + gpointer (*first) (GeeSortedSet* self); + gpointer (*last) (GeeSortedSet* self); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); +}; + +struct _GeeSortedMapIface { + GTypeInterface parent_iface; + GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after); + GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self); + GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self); +}; + +struct _GeeAbstractSortedMap { GeeAbstractMap parent_instance; + GeeAbstractSortedMapPrivate * priv; +}; + +struct _GeeAbstractSortedMapClass { + GeeAbstractMapClass parent_class; + GeeSortedMap* (*head_map) (GeeAbstractSortedMap* self, gconstpointer before); + GeeSortedMap* (*tail_map) (GeeAbstractSortedMap* self, gconstpointer after); + GeeSortedMap* (*sub_map) (GeeAbstractSortedMap* self, gconstpointer before, gconstpointer after); + void (*reserved0) (GeeAbstractSortedMap* self); + void (*reserved1) (GeeAbstractSortedMap* self); + void (*reserved2) (GeeAbstractSortedMap* self); + void (*reserved3) (GeeAbstractSortedMap* self); + void (*reserved4) (GeeAbstractSortedMap* self); + void (*reserved5) (GeeAbstractSortedMap* self); + void (*reserved6) (GeeAbstractSortedMap* self); + void (*reserved7) (GeeAbstractSortedMap* self); + void (*reserved8) (GeeAbstractSortedMap* self); + void (*reserved9) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_keys) (GeeAbstractSortedMap* self); + GeeSortedSet* (*get_ascending_entries) (GeeAbstractSortedMap* self); +}; + +struct _GeeBidirMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirMapIterator* self); + GType (*get_v_type) (GeeBidirMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirMapIterator* self); + gboolean (*previous) (GeeBidirMapIterator* self); + gboolean (*has_previous) (GeeBidirMapIterator* self); + gboolean (*first) (GeeBidirMapIterator* self); + gboolean (*last) (GeeBidirMapIterator* self); +}; + +struct _GeeBidirSortedMapIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeBidirSortedMap* self); + GType (*get_v_type) (GeeBidirSortedMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeBidirSortedMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeBidirSortedMap* self); + GeeBidirMapIterator* (*bidir_map_iterator) (GeeBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeBidirSortedMap* self); +}; + +struct _GeeAbstractBidirSortedMap { + GeeAbstractSortedMap parent_instance; + GeeAbstractBidirSortedMapPrivate * priv; +}; + +struct _GeeAbstractBidirSortedMapClass { + GeeAbstractSortedMapClass parent_class; + GeeBidirMapIterator* (*bidir_map_iterator) (GeeAbstractBidirSortedMap* self); + void (*reserved0) (GeeAbstractBidirSortedMap* self); + void (*reserved1) (GeeAbstractBidirSortedMap* self); + void (*reserved2) (GeeAbstractBidirSortedMap* self); + void (*reserved3) (GeeAbstractBidirSortedMap* self); + void (*reserved4) (GeeAbstractBidirSortedMap* self); + void (*reserved5) (GeeAbstractBidirSortedMap* self); + void (*reserved6) (GeeAbstractBidirSortedMap* self); + void (*reserved7) (GeeAbstractBidirSortedMap* self); + void (*reserved8) (GeeAbstractBidirSortedMap* self); + void (*reserved9) (GeeAbstractBidirSortedMap* self); + GeeBidirSortedMap* (*get_read_only_view) (GeeAbstractBidirSortedMap* self); +}; + +struct _GeeTreeMap { + GeeAbstractBidirSortedMap parent_instance; GeeTreeMapPrivate * priv; }; struct _GeeTreeMapClass { - GeeAbstractMapClass parent_class; + GeeAbstractBidirSortedMapClass parent_class; }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeTreeMapPrivate { GType k_type; GBoxedCopyFunc k_dup_func; @@ -357,18 +735,29 @@ struct _GeeTreeMapPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - GCompareFunc _key_compare_func; - GEqualFunc _value_equal_func; + GCompareDataFunc _key_compare_func; + gpointer _key_compare_func_target; + GDestroyNotify _key_compare_func_target_destroy_notify; + GeeEqualDataFunc _value_equal_func; + gpointer _value_equal_func_target; + GDestroyNotify _value_equal_func_target_destroy_notify; gint _size; - GeeSet* _keys; + GeeSortedSet* _keys; GeeCollection* _values; - GeeSet* _entries; + GeeSortedSet* _entries; GeeTreeMapNode* root; GeeTreeMapNode* first; GeeTreeMapNode* last; gint stamp; }; +typedef enum { + GEE_TREE_MAP_RANGE_TYPE_HEAD, + GEE_TREE_MAP_RANGE_TYPE_TAIL, + GEE_TREE_MAP_RANGE_TYPE_EMPTY, + GEE_TREE_MAP_RANGE_TYPE_BOUNDED +} GeeTreeMapRangeType; + typedef enum { GEE_TREE_MAP_NODE_COLOR_RED, GEE_TREE_MAP_NODE_COLOR_BLACK @@ -395,6 +784,7 @@ struct _GeeMapEntryClass { gconstpointer (*get_key) (GeeMapEntry* self); gconstpointer (*get_value) (GeeMapEntry* self); void (*set_value) (GeeMapEntry* self, gconstpointer value); + gboolean (*get_read_only) (GeeMapEntry* self); }; struct _GeeTreeMapEntry { @@ -416,6 +806,57 @@ struct _GeeTreeMapEntryPrivate { GeeTreeMapNode* _node; }; +struct _GeeTreeMapRange { + GTypeInstance parent_instance; + volatile int ref_count; + GeeTreeMapRangePrivate * priv; +}; + +struct _GeeTreeMapRangeClass { + GTypeClass parent_class; + void (*finalize) (GeeTreeMapRange *self); +}; + +struct _GeeTreeMapRangePrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeTreeMap* map; + gpointer after; + gpointer before; + GeeTreeMapRangeType type; +}; + +struct _GeeTreeMapParamSpecRange { + GParamSpec parent_instance; +}; + +struct _GeeTreeMapSubMap { + GeeAbstractBidirSortedMap parent_instance; + GeeTreeMapSubMapPrivate * priv; +}; + +struct _GeeTreeMapSubMapClass { + GeeAbstractBidirSortedMapClass parent_class; +}; + +struct _GeeTreeMapSubMapPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeSortedSet* _keys; + GeeCollection* _values; + GeeSortedSet* _entries; + GeeTreeMap* map; + GeeTreeMapRange* range; +}; + struct _GeeAbstractCollection { GObject parent_instance; GeeAbstractCollectionPrivate * priv; @@ -427,14 +868,20 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; @@ -445,16 +892,97 @@ struct _GeeAbstractSet { struct _GeeAbstractSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); GeeSet* (*get_read_only_view) (GeeAbstractSet* self); }; -struct _GeeTreeMapKeySet { +struct _GeeAbstractSortedSet { GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSet { + GeeAbstractSortedSet parent_instance; + GeeAbstractBidirSortedSetPrivate * priv; +}; + +struct _GeeAbstractBidirSortedSetClass { + GeeAbstractSortedSetClass parent_class; + GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self); + void (*reserved0) (GeeAbstractBidirSortedSet* self); + void (*reserved1) (GeeAbstractBidirSortedSet* self); + void (*reserved2) (GeeAbstractBidirSortedSet* self); + void (*reserved3) (GeeAbstractBidirSortedSet* self); + void (*reserved4) (GeeAbstractBidirSortedSet* self); + void (*reserved5) (GeeAbstractBidirSortedSet* self); + void (*reserved6) (GeeAbstractBidirSortedSet* self); + void (*reserved7) (GeeAbstractBidirSortedSet* self); + void (*reserved8) (GeeAbstractBidirSortedSet* self); + void (*reserved9) (GeeAbstractBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self); +}; + +struct _GeeTreeMapKeySet { + GeeAbstractBidirSortedSet parent_instance; GeeTreeMapKeySetPrivate * priv; }; struct _GeeTreeMapKeySetClass { - GeeAbstractSetClass parent_class; + GeeAbstractBidirSortedSetClass parent_class; }; struct _GeeTreeMapKeySetPrivate { @@ -467,6 +995,26 @@ struct _GeeTreeMapKeySetPrivate { GeeTreeMap* _map; }; +struct _GeeTreeMapSubKeySet { + GeeAbstractBidirSortedSet parent_instance; + GeeTreeMapSubKeySetPrivate * priv; +}; + +struct _GeeTreeMapSubKeySetClass { + GeeAbstractBidirSortedSetClass parent_class; +}; + +struct _GeeTreeMapSubKeySetPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeTreeMap* _map; + GeeTreeMapRange* _range; +}; + struct _GeeTreeMapValueCollection { GeeAbstractCollection parent_instance; GeeTreeMapValueCollectionPrivate * priv; @@ -486,13 +1034,33 @@ struct _GeeTreeMapValueCollectionPrivate { GeeTreeMap* _map; }; +struct _GeeTreeMapSubValueCollection { + GeeAbstractCollection parent_instance; + GeeTreeMapSubValueCollectionPrivate * priv; +}; + +struct _GeeTreeMapSubValueCollectionClass { + GeeAbstractCollectionClass parent_class; +}; + +struct _GeeTreeMapSubValueCollectionPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeTreeMap* _map; + GeeTreeMapRange* _range; +}; + struct _GeeTreeMapEntrySet { - GeeAbstractSet parent_instance; + GeeAbstractBidirSortedSet parent_instance; GeeTreeMapEntrySetPrivate * priv; }; struct _GeeTreeMapEntrySetClass { - GeeAbstractSetClass parent_class; + GeeAbstractBidirSortedSetClass parent_class; }; struct _GeeTreeMapEntrySetPrivate { @@ -505,11 +1073,32 @@ struct _GeeTreeMapEntrySetPrivate { GeeTreeMap* _map; }; +struct _GeeTreeMapSubEntrySet { + GeeAbstractBidirSortedSet parent_instance; + GeeTreeMapSubEntrySetPrivate * priv; +}; + +struct _GeeTreeMapSubEntrySetClass { + GeeAbstractBidirSortedSetClass parent_class; +}; + +struct _GeeTreeMapSubEntrySetPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; + GeeTreeMap* _map; + GeeTreeMapRange* _range; +}; + struct _GeeTreeMapNodeIterator { GObject parent_instance; GeeTreeMapNodeIteratorPrivate * priv; GeeTreeMap* _map; gint stamp; + gboolean started; GeeTreeMapNode* current; GeeTreeMapNode* _next; GeeTreeMapNode* _prev; @@ -517,6 +1106,7 @@ struct _GeeTreeMapNodeIterator { struct _GeeTreeMapNodeIteratorClass { GObjectClass parent_class; + gboolean (*get_read_only) (GeeTreeMapNodeIterator* self); }; struct _GeeTreeMapNodeIteratorPrivate { @@ -528,11 +1118,29 @@ struct _GeeTreeMapNodeIteratorPrivate { GDestroyNotify v_destroy_func; }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); +struct _GeeTreeMapSubNodeIterator { + GObject parent_instance; + GeeTreeMapSubNodeIteratorPrivate * priv; + GeeTreeMap* _map; + GeeTreeMapRange* range; + GeeTreeMapNodeIterator* iterator; +}; + +struct _GeeTreeMapSubNodeIteratorClass { + GObjectClass parent_class; + gboolean (*first) (GeeTreeMapSubNodeIterator* self); + gboolean (*last) (GeeTreeMapSubNodeIterator* self); + GeeTreeMapNodeIterator* (*iterator_pointing_at) (GeeTreeMapSubNodeIterator* self, GeeTreeMapNode* node); + gboolean (*get_read_only) (GeeTreeMapSubNodeIterator* self); +}; + +struct _GeeTreeMapSubNodeIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; }; struct _GeeTreeMapKeyIterator { @@ -553,6 +1161,24 @@ struct _GeeTreeMapKeyIteratorPrivate { GDestroyNotify v_destroy_func; }; +struct _GeeTreeMapSubKeyIterator { + GeeTreeMapSubNodeIterator parent_instance; + GeeTreeMapSubKeyIteratorPrivate * priv; +}; + +struct _GeeTreeMapSubKeyIteratorClass { + GeeTreeMapSubNodeIteratorClass parent_class; +}; + +struct _GeeTreeMapSubKeyIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + struct _GeeTreeMapValueIterator { GeeTreeMapNodeIterator parent_instance; GeeTreeMapValueIteratorPrivate * priv; @@ -571,6 +1197,24 @@ struct _GeeTreeMapValueIteratorPrivate { GDestroyNotify v_destroy_func; }; +struct _GeeTreeMapSubValueIterator { + GeeTreeMapSubNodeIterator parent_instance; + GeeTreeMapSubValueIteratorPrivate * priv; +}; + +struct _GeeTreeMapSubValueIteratorClass { + GeeTreeMapSubNodeIteratorClass parent_class; +}; + +struct _GeeTreeMapSubValueIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + struct _GeeTreeMapEntryIterator { GeeTreeMapNodeIterator parent_instance; GeeTreeMapEntryIteratorPrivate * priv; @@ -589,6 +1233,24 @@ struct _GeeTreeMapEntryIteratorPrivate { GDestroyNotify v_destroy_func; }; +struct _GeeTreeMapSubEntryIterator { + GeeTreeMapSubNodeIterator parent_instance; + GeeTreeMapSubEntryIteratorPrivate * priv; +}; + +struct _GeeTreeMapSubEntryIteratorClass { + GeeTreeMapSubNodeIteratorClass parent_class; +}; + +struct _GeeTreeMapSubEntryIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + struct _GeeTreeMapMapIterator { GeeTreeMapNodeIterator parent_instance; GeeTreeMapMapIteratorPrivate * priv; @@ -607,26 +1269,78 @@ struct _GeeTreeMapMapIteratorPrivate { GDestroyNotify v_destroy_func; }; +struct _GeeTreeMapSubMapIterator { + GeeTreeMapSubNodeIterator parent_instance; + GeeTreeMapSubMapIteratorPrivate * priv; +}; + +struct _GeeTreeMapSubMapIteratorClass { + GeeTreeMapSubNodeIteratorClass parent_class; +}; + +struct _GeeTreeMapSubMapIteratorPrivate { + GType k_type; + GBoxedCopyFunc k_dup_func; + GDestroyNotify k_destroy_func; + GType v_type; + GBoxedCopyFunc v_dup_func; + GDestroyNotify v_destroy_func; +}; + static gpointer gee_tree_map_parent_class = NULL; static gpointer gee_tree_map_entry_parent_class = NULL; +static gpointer gee_tree_map_range_parent_class = NULL; +static gpointer gee_tree_map_sub_map_parent_class = NULL; static gpointer gee_tree_map_key_set_parent_class = NULL; +static gpointer gee_tree_map_sub_key_set_parent_class = NULL; static gpointer gee_tree_map_value_collection_parent_class = NULL; +static gpointer gee_tree_map_sub_value_collection_parent_class = NULL; static gpointer gee_tree_map_entry_set_parent_class = NULL; +static gpointer gee_tree_map_sub_entry_set_parent_class = NULL; static gpointer gee_tree_map_node_iterator_parent_class = NULL; +static gpointer gee_tree_map_sub_node_iterator_parent_class = NULL; static gpointer gee_tree_map_key_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_key_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_tree_map_key_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_tree_map_key_iterator_gee_bidir_iterator_parent_iface = NULL; +static gpointer gee_tree_map_sub_key_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_sub_key_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_tree_map_sub_key_iterator_gee_iterator_parent_iface = NULL; +static GeeBidirIteratorIface* gee_tree_map_sub_key_iterator_gee_bidir_iterator_parent_iface = NULL; static gpointer gee_tree_map_value_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_value_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_tree_map_value_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_tree_map_value_iterator_gee_bidir_iterator_parent_iface = NULL; +static gpointer gee_tree_map_sub_value_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_sub_value_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_tree_map_sub_value_iterator_gee_iterator_parent_iface = NULL; +static GeeBidirIteratorIface* gee_tree_map_sub_value_iterator_gee_bidir_iterator_parent_iface = NULL; static gpointer gee_tree_map_entry_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_entry_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_tree_map_entry_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_tree_map_entry_iterator_gee_bidir_iterator_parent_iface = NULL; +static gpointer gee_tree_map_sub_entry_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_map_sub_entry_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_tree_map_sub_entry_iterator_gee_iterator_parent_iface = NULL; +static GeeBidirIteratorIface* gee_tree_map_sub_entry_iterator_gee_bidir_iterator_parent_iface = NULL; static gpointer gee_tree_map_map_iterator_parent_class = NULL; static GeeMapIteratorIface* gee_tree_map_map_iterator_gee_map_iterator_parent_iface = NULL; - +static GeeBidirMapIteratorIface* gee_tree_map_map_iterator_gee_bidir_map_iterator_parent_iface = NULL; +static gpointer gee_tree_map_sub_map_iterator_parent_class = NULL; +static GeeMapIteratorIface* gee_tree_map_sub_map_iterator_gee_map_iterator_parent_iface = NULL; +static GeeBidirMapIteratorIface* gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; @@ -634,6 +1348,12 @@ GType gee_set_get_type (void) G_GNUC_CONST; GType gee_map_entry_get_type (void) G_GNUC_CONST; GType gee_map_get_type (void) G_GNUC_CONST; GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_bidir_map_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; GType gee_tree_map_get_type (void) G_GNUC_CONST; static void gee_tree_map_node_free (GeeTreeMapNode* self); #define GEE_TREE_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_TREE_MAP, GeeTreeMapPrivate)) @@ -646,31 +1366,34 @@ enum { GEE_TREE_MAP_V_DUP_FUNC, GEE_TREE_MAP_V_DESTROY_FUNC, GEE_TREE_MAP_SIZE, + GEE_TREE_MAP_READ_ONLY, GEE_TREE_MAP_KEYS, GEE_TREE_MAP_VALUES, GEE_TREE_MAP_ENTRIES, - GEE_TREE_MAP_KEY_COMPARE_FUNC, - GEE_TREE_MAP_VALUE_EQUAL_FUNC + GEE_TREE_MAP_ASCENDING_KEYS, + GEE_TREE_MAP_ASCENDING_ENTRIES }; -GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GeeAbstractMap* gee_abstract_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); -GCompareFunc gee_functions_get_compare_func_for (GType t); -GEqualFunc gee_functions_get_equal_func_for (GType t); -static void gee_tree_map_set_key_compare_func (GeeTreeMap* self, GCompareFunc value); -static void gee_tree_map_set_value_equal_func (GeeTreeMap* self, GEqualFunc value); +void gee_abstract_map_clear (GeeAbstractMap* self); +static GType gee_tree_map_range_type_get_type (void) G_GNUC_UNUSED; +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeAbstractBidirSortedMap* gee_abstract_bidir_sorted_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_tree_map_set_key_compare_func (GeeTreeMap* self, GCompareDataFunc value, gpointer value_target); +static void gee_tree_map_set_value_equal_func (GeeTreeMap* self, GeeEqualDataFunc value, gpointer value_target); static void gee_tree_map_rotate_right (GeeTreeMap* self, GeeTreeMapNode** root); GType gee_tree_map_node_color_get_type (void) G_GNUC_CONST; static void gee_tree_map_rotate_left (GeeTreeMap* self, GeeTreeMapNode** root); static gboolean gee_tree_map_is_red (GeeTreeMap* self, GeeTreeMapNode* n); static gboolean gee_tree_map_is_black (GeeTreeMap* self, GeeTreeMapNode* n); static gboolean gee_tree_map_real_has_key (GeeAbstractMap* base, gconstpointer key); -GCompareFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self); +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target); static gboolean gee_tree_map_real_has (GeeAbstractMap* base, gconstpointer key, gconstpointer value); gpointer gee_abstract_map_get (GeeAbstractMap* self, gconstpointer key); -GEqualFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self); +GeeEqualDataFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self, gpointer* result_target); static gpointer gee_tree_map_real_get (GeeAbstractMap* base, gconstpointer key); -static void gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, gconstpointer key, gconstpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next); +static gboolean gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, gconstpointer key, gconstpointer value, gpointer* old_value, GeeTreeMapNode* prev, GeeTreeMapNode* next); static GeeTreeMapNode* gee_tree_map_node_new (gpointer key, gpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next); static GeeTreeMapNode* gee_tree_map_node_new (gpointer key, gpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next); static void gee_tree_map_fix_up (GeeTreeMap* self, GeeTreeMapNode** node); @@ -684,15 +1407,46 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* static gboolean gee_tree_map_real_unset (GeeAbstractMap* base, gconstpointer key, gpointer* value); static inline void gee_tree_map_clear_subtree (GeeTreeMap* self, GeeTreeMapNode* node); static void gee_tree_map_real_clear (GeeAbstractMap* base); +static GeeSortedMap* gee_tree_map_real_head_map (GeeAbstractSortedMap* base, gconstpointer before); +static GeeTreeMapRange* gee_tree_map_range_new_head (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer before); +static GeeTreeMapRange* gee_tree_map_range_construct_head (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer before); +static gpointer gee_tree_map_range_ref (gpointer instance); +static void gee_tree_map_range_unref (gpointer instance); +static GParamSpec* gee_tree_map_param_spec_range (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; +static void gee_tree_map_value_set_range (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static void gee_tree_map_value_take_range (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static gpointer gee_tree_map_value_get_range (const GValue* value) G_GNUC_UNUSED; +static GType gee_tree_map_range_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeTreeMapSubMap* gee_tree_map_sub_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubMap* gee_tree_map_sub_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_map_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeSortedMap* gee_tree_map_real_tail_map (GeeAbstractSortedMap* base, gconstpointer after); +static GeeTreeMapRange* gee_tree_map_range_new_tail (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after); +static GeeTreeMapRange* gee_tree_map_range_construct_tail (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after); +static GeeSortedMap* gee_tree_map_real_sub_map (GeeAbstractSortedMap* base, gconstpointer after, gconstpointer before); +static GeeTreeMapRange* gee_tree_map_range_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after, gconstpointer before); +static GeeTreeMapRange* gee_tree_map_range_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after, gconstpointer before); static GeeMapIterator* gee_tree_map_real_map_iterator (GeeAbstractMap* base); static GeeTreeMapMapIterator* gee_tree_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GeeTreeMapMapIterator* gee_tree_map_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GType gee_tree_map_node_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GType gee_tree_map_map_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeBidirMapIterator* gee_tree_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* base); +static inline gpointer gee_tree_map_min (GeeTreeMap* self, gconstpointer a, gconstpointer b); +static inline gpointer gee_tree_map_max (GeeTreeMap* self, gconstpointer a, gconstpointer b); +static inline GeeTreeMapNode* gee_tree_map_find_node (GeeTreeMap* self, gconstpointer key); +static inline GeeTreeMapNode* gee_tree_map_find_nearest (GeeTreeMap* self, gconstpointer key); +static inline GeeTreeMapNode* gee_tree_map_find_lower (GeeTreeMap* self, gconstpointer key); +static inline GeeTreeMapNode* gee_tree_map_find_higher (GeeTreeMap* self, gconstpointer key); +static inline GeeTreeMapNode* gee_tree_map_find_floor (GeeTreeMap* self, gconstpointer key); +static inline GeeTreeMapNode* gee_tree_map_find_ceil (GeeTreeMap* self, gconstpointer key); +static inline gpointer gee_tree_map_lift_null_key (GeeTreeMap* self, GeeTreeMapNode* node); static GeeTreeMapKeySet* gee_tree_map_key_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GeeTreeMapKeySet* gee_tree_map_key_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; static GType gee_tree_map_key_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; static GeeTreeMapValueCollection* gee_tree_map_value_collection_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GeeTreeMapValueCollection* gee_tree_map_value_collection_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); @@ -713,7 +1467,8 @@ enum { GEE_TREE_MAP_ENTRY_V_DUP_FUNC, GEE_TREE_MAP_ENTRY_V_DESTROY_FUNC, GEE_TREE_MAP_ENTRY_KEY, - GEE_TREE_MAP_ENTRY_VALUE + GEE_TREE_MAP_ENTRY_VALUE, + GEE_TREE_MAP_ENTRY_READ_ONLY }; static GeeMapEntry* gee_tree_map_entry_entry_for (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node); static GeeTreeMapEntry* gee_tree_map_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node); @@ -722,21 +1477,102 @@ GeeMapEntry* gee_map_entry_construct (GType object_type, GType k_type, GBoxedCop static void gee_tree_map_entry_finalize (GObject* obj); gconstpointer gee_map_entry_get_key (GeeMapEntry* self); gconstpointer gee_map_entry_get_value (GeeMapEntry* self); +gboolean gee_map_entry_get_read_only (GeeMapEntry* self); static void _vala_gee_tree_map_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); void gee_map_entry_set_value (GeeMapEntry* self, gconstpointer value); static void _vala_gee_tree_map_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); -#define GEE_TREE_MAP_KEY_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySetPrivate)) +#define GEE_TREE_MAP_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_RANGE, GeeTreeMapRangePrivate)) enum { - GEE_TREE_MAP_KEY_SET_DUMMY_PROPERTY, - GEE_TREE_MAP_KEY_SET_K_TYPE, - GEE_TREE_MAP_KEY_SET_K_DUP_FUNC, - GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC, - GEE_TREE_MAP_KEY_SET_V_TYPE, + GEE_TREE_MAP_RANGE_DUMMY_PROPERTY +}; +static GeeTreeMapRange* gee_tree_map_range_new_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); +static GeeTreeMapRange* gee_tree_map_range_construct_empty (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); +static GeeTreeMapRange* gee_tree_map_range_cut_head (GeeTreeMapRange* self, gconstpointer after); +static GeeTreeMapRange* gee_tree_map_range_cut_tail (GeeTreeMapRange* self, gconstpointer before); +static GeeTreeMapRange* gee_tree_map_range_cut (GeeTreeMapRange* self, gconstpointer after, gconstpointer before); +static gboolean gee_tree_map_range_in_range (GeeTreeMapRange* self, gconstpointer key); +static gint gee_tree_map_range_compare_range (GeeTreeMapRange* self, gconstpointer key); +static gboolean gee_tree_map_range_empty_submap (GeeTreeMapRange* self); +static GeeTreeMapNode* gee_tree_map_range_first (GeeTreeMapRange* self); +static GeeTreeMapNode* gee_tree_map_range_last (GeeTreeMapRange* self); +static void gee_tree_map_range_finalize (GeeTreeMapRange* obj); +#define GEE_TREE_MAP_SUB_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMapPrivate)) +enum { + GEE_TREE_MAP_SUB_MAP_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_MAP_K_TYPE, + GEE_TREE_MAP_SUB_MAP_K_DUP_FUNC, + GEE_TREE_MAP_SUB_MAP_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_MAP_V_TYPE, + GEE_TREE_MAP_SUB_MAP_V_DUP_FUNC, + GEE_TREE_MAP_SUB_MAP_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_MAP_SIZE, + GEE_TREE_MAP_SUB_MAP_IS_EMPTY, + GEE_TREE_MAP_SUB_MAP_KEYS, + GEE_TREE_MAP_SUB_MAP_VALUES, + GEE_TREE_MAP_SUB_MAP_ENTRIES, + GEE_TREE_MAP_SUB_MAP_READ_ONLY, + GEE_TREE_MAP_SUB_MAP_ASCENDING_KEYS, + GEE_TREE_MAP_SUB_MAP_ASCENDING_ENTRIES +}; +static gboolean gee_tree_map_sub_map_real_has_key (GeeAbstractMap* base, gconstpointer key); +gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); +static gboolean gee_tree_map_sub_map_real_has (GeeAbstractMap* base, gconstpointer key, gconstpointer value); +gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); +static gpointer gee_tree_map_sub_map_real_get (GeeAbstractMap* base, gconstpointer key); +static void gee_tree_map_sub_map_real_set (GeeAbstractMap* base, gconstpointer key, gconstpointer value); +void gee_abstract_map_set (GeeAbstractMap* self, gconstpointer key, gconstpointer value); +static gboolean gee_tree_map_sub_map_real_unset (GeeAbstractMap* base, gconstpointer key, gpointer* value); +gboolean gee_abstract_map_unset (GeeAbstractMap* self, gconstpointer key, gpointer* value); +static void gee_tree_map_sub_map_real_clear (GeeAbstractMap* base); +GeeMapIterator* gee_abstract_map_map_iterator (GeeAbstractMap* self); +gboolean gee_map_iterator_next (GeeMapIterator* self); +void gee_map_iterator_unset (GeeMapIterator* self); +static GeeMapIterator* gee_tree_map_sub_map_real_map_iterator (GeeAbstractMap* base); +static GeeTreeMapSubMapIterator* gee_tree_map_sub_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubMapIterator* gee_tree_map_sub_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_node_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GType gee_tree_map_sub_map_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeBidirMapIterator* gee_tree_map_sub_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* base); +static GeeSortedMap* gee_tree_map_sub_map_real_head_map (GeeAbstractSortedMap* base, gconstpointer before); +static GeeSortedMap* gee_tree_map_sub_map_real_tail_map (GeeAbstractSortedMap* base, gconstpointer after); +static GeeSortedMap* gee_tree_map_sub_map_real_sub_map (GeeAbstractSortedMap* base, gconstpointer after, gconstpointer before); +GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); +gint gee_collection_get_size (GeeCollection* self); +static gboolean gee_tree_map_sub_map_get_is_empty (GeeTreeMapSubMap* self); +gboolean gee_collection_get_is_empty (GeeCollection* self); +static GeeTreeMapSubKeySet* gee_tree_map_sub_key_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubKeySet* gee_tree_map_sub_key_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_key_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeTreeMapSubValueCollection* gee_tree_map_sub_value_collection_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubValueCollection* gee_tree_map_sub_value_collection_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_value_collection_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static GeeTreeMapSubEntrySet* gee_tree_map_sub_entry_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubEntrySet* gee_tree_map_sub_entry_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_entry_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static void gee_tree_map_sub_map_finalize (GObject* obj); +gint gee_abstract_map_get_size (GeeAbstractMap* self); +GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); +GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); +gboolean gee_abstract_map_get_read_only (GeeAbstractMap* self); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_keys (GeeAbstractSortedMap* self); +GeeSortedSet* gee_abstract_sorted_map_get_ascending_entries (GeeAbstractSortedMap* self); +static void _vala_gee_tree_map_sub_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +#define GEE_TREE_MAP_KEY_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySetPrivate)) +enum { + GEE_TREE_MAP_KEY_SET_DUMMY_PROPERTY, + GEE_TREE_MAP_KEY_SET_K_TYPE, + GEE_TREE_MAP_KEY_SET_K_DUP_FUNC, + GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC, + GEE_TREE_MAP_KEY_SET_V_TYPE, GEE_TREE_MAP_KEY_SET_V_DUP_FUNC, GEE_TREE_MAP_KEY_SET_V_DESTROY_FUNC, - GEE_TREE_MAP_KEY_SET_SIZE + GEE_TREE_MAP_KEY_SET_SIZE, + GEE_TREE_MAP_KEY_SET_READ_ONLY }; -GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static GeeIterator* gee_tree_map_key_set_real_iterator (GeeAbstractCollection* base); static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); @@ -745,15 +1581,72 @@ static gboolean gee_tree_map_key_set_real_add (GeeAbstractCollection* base, gcon static void gee_tree_map_key_set_real_clear (GeeAbstractCollection* base); static gboolean gee_tree_map_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key); static gboolean gee_tree_map_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key); -gboolean gee_abstract_map_has_key (GeeAbstractMap* self, gconstpointer key); -static gboolean gee_tree_map_key_set_real_add_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_tree_map_key_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_tree_map_key_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection); -gint gee_abstract_map_get_size (GeeAbstractMap* self); +static gpointer gee_tree_map_key_set_real_first (GeeAbstractSortedSet* base); +static gpointer gee_tree_map_key_set_real_last (GeeAbstractSortedSet* base); +static GeeBidirIterator* gee_tree_map_key_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); +static GeeSortedSet* gee_tree_map_key_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); +static GeeSortedSet* gee_tree_map_key_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); +static GeeSortedSet* gee_tree_map_key_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before); +static GeeIterator* gee_tree_map_key_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item); +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); +static gpointer gee_tree_map_key_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_map_key_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_map_key_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_map_key_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item); static void gee_tree_map_key_set_finalize (GObject* obj); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_tree_map_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_KEY_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySetPrivate)) +enum { + GEE_TREE_MAP_SUB_KEY_SET_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_KEY_SET_K_TYPE, + GEE_TREE_MAP_SUB_KEY_SET_K_DUP_FUNC, + GEE_TREE_MAP_SUB_KEY_SET_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_KEY_SET_V_TYPE, + GEE_TREE_MAP_SUB_KEY_SET_V_DUP_FUNC, + GEE_TREE_MAP_SUB_KEY_SET_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_KEY_SET_MAP, + GEE_TREE_MAP_SUB_KEY_SET_RANGE, + GEE_TREE_MAP_SUB_KEY_SET_SIZE, + GEE_TREE_MAP_SUB_KEY_SET_READ_ONLY, + GEE_TREE_MAP_SUB_KEY_SET_IS_EMPTY +}; +static void gee_tree_map_sub_key_set_set_map (GeeTreeMapSubKeySet* self, GeeTreeMap* value); +static void gee_tree_map_sub_key_set_set_range (GeeTreeMapSubKeySet* self, GeeTreeMapRange* value); +static GeeIterator* gee_tree_map_sub_key_set_real_iterator (GeeAbstractCollection* base); +static GeeTreeMap* gee_tree_map_sub_key_set_get_map (GeeTreeMapSubKeySet* self); +static GeeTreeMapRange* gee_tree_map_sub_key_set_get_range (GeeTreeMapSubKeySet* self); +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_key_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_tree_map_sub_key_set_real_add (GeeAbstractCollection* base, gconstpointer key); +static void gee_tree_map_sub_key_set_real_clear (GeeAbstractCollection* base); +static gboolean gee_tree_map_sub_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_tree_map_sub_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key); +static GeeBidirIterator* gee_tree_map_sub_key_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); +static gpointer gee_tree_map_sub_key_set_real_first (GeeAbstractSortedSet* base); +static gpointer gee_tree_map_sub_key_set_real_last (GeeAbstractSortedSet* base); +static GeeSortedSet* gee_tree_map_sub_key_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); +static GeeSortedSet* gee_tree_map_sub_key_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); +static GeeSortedSet* gee_tree_map_sub_key_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before); +static GeeIterator* gee_tree_map_sub_key_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer key); +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static gpointer gee_tree_map_sub_key_set_real_lower (GeeAbstractSortedSet* base, gconstpointer key); +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +static gpointer gee_tree_map_sub_key_set_real_higher (GeeAbstractSortedSet* base, gconstpointer key); +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +static gpointer gee_tree_map_sub_key_set_real_floor (GeeAbstractSortedSet* base, gconstpointer key); +static gpointer gee_tree_map_sub_key_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer key); +GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); +gboolean gee_iterator_next (GeeIterator* self); +static gboolean gee_tree_map_sub_key_set_get_is_empty (GeeTreeMapSubKeySet* self); +static void gee_tree_map_sub_key_set_finalize (GObject* obj); +static void _vala_gee_tree_map_sub_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_VALUE_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollectionPrivate)) enum { GEE_TREE_MAP_VALUE_COLLECTION_DUMMY_PROPERTY, @@ -763,7 +1656,8 @@ enum { GEE_TREE_MAP_VALUE_COLLECTION_V_TYPE, GEE_TREE_MAP_VALUE_COLLECTION_V_DUP_FUNC, GEE_TREE_MAP_VALUE_COLLECTION_V_DESTROY_FUNC, - GEE_TREE_MAP_VALUE_COLLECTION_SIZE + GEE_TREE_MAP_VALUE_COLLECTION_SIZE, + GEE_TREE_MAP_VALUE_COLLECTION_READ_ONLY }; GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); static GeeIterator* gee_tree_map_value_collection_real_iterator (GeeAbstractCollection* base); @@ -774,15 +1668,41 @@ static gboolean gee_tree_map_value_collection_real_add (GeeAbstractCollection* b static void gee_tree_map_value_collection_real_clear (GeeAbstractCollection* base); static gboolean gee_tree_map_value_collection_real_remove (GeeAbstractCollection* base, gconstpointer key); static gboolean gee_tree_map_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key); -GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); -gboolean gee_iterator_next (GeeIterator* self); gpointer gee_iterator_get (GeeIterator* self); -static gboolean gee_tree_map_value_collection_real_add_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_tree_map_value_collection_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection); -static gboolean gee_tree_map_value_collection_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection); static void gee_tree_map_value_collection_finalize (GObject* obj); static void _vala_gee_tree_map_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_VALUE_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollectionPrivate)) +enum { + GEE_TREE_MAP_SUB_VALUE_COLLECTION_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_TYPE, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DUP_FUNC, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_TYPE, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DUP_FUNC, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_MAP, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_RANGE, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_READ_ONLY, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_SIZE, + GEE_TREE_MAP_SUB_VALUE_COLLECTION_IS_EMPTY +}; +static void gee_tree_map_sub_value_collection_set_map (GeeTreeMapSubValueCollection* self, GeeTreeMap* value); +static void gee_tree_map_sub_value_collection_set_range (GeeTreeMapSubValueCollection* self, GeeTreeMapRange* value); +static GeeIterator* gee_tree_map_sub_value_collection_real_iterator (GeeAbstractCollection* base); +static GeeTreeMap* gee_tree_map_sub_value_collection_get_map (GeeTreeMapSubValueCollection* self); +static GeeTreeMapRange* gee_tree_map_sub_value_collection_get_range (GeeTreeMapSubValueCollection* self); +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_value_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_tree_map_sub_value_collection_real_add (GeeAbstractCollection* base, gconstpointer key); +static void gee_tree_map_sub_value_collection_real_clear (GeeAbstractCollection* base); +static gboolean gee_tree_map_sub_value_collection_real_remove (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_tree_map_sub_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key); +static gboolean gee_tree_map_sub_value_collection_get_is_empty (GeeTreeMapSubValueCollection* self); +static void gee_tree_map_sub_value_collection_finalize (GObject* obj); +static void _vala_gee_tree_map_sub_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_ENTRY_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySetPrivate)) enum { GEE_TREE_MAP_ENTRY_SET_DUMMY_PROPERTY, @@ -792,7 +1712,8 @@ enum { GEE_TREE_MAP_ENTRY_SET_V_TYPE, GEE_TREE_MAP_ENTRY_SET_V_DUP_FUNC, GEE_TREE_MAP_ENTRY_SET_V_DESTROY_FUNC, - GEE_TREE_MAP_ENTRY_SET_SIZE + GEE_TREE_MAP_ENTRY_SET_SIZE, + GEE_TREE_MAP_ENTRY_SET_READ_ONLY }; static GeeIterator* gee_tree_map_entry_set_real_iterator (GeeAbstractCollection* base); static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); @@ -802,13 +1723,66 @@ static gboolean gee_tree_map_entry_set_real_add (GeeAbstractCollection* base, Ge static void gee_tree_map_entry_set_real_clear (GeeAbstractCollection* base); static gboolean gee_tree_map_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry); static gboolean gee_tree_map_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry); -gboolean gee_abstract_map_has (GeeAbstractMap* self, gconstpointer key, gconstpointer value); -static gboolean gee_tree_map_entry_set_real_add_all (GeeAbstractCollection* base, GeeCollection* entries); -static gboolean gee_tree_map_entry_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* entries); -static gboolean gee_tree_map_entry_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* entries); +static GeeMapEntry* gee_tree_map_entry_set_real_first (GeeAbstractSortedSet* base); +static GeeMapEntry* gee_tree_map_entry_set_real_last (GeeAbstractSortedSet* base); +static GeeBidirIterator* gee_tree_map_entry_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); +static GeeSortedSet* gee_tree_map_entry_set_real_head_set (GeeAbstractSortedSet* base, GeeMapEntry* before); +static GeeSortedSet* gee_tree_map_entry_set_real_tail_set (GeeAbstractSortedSet* base, GeeMapEntry* after); +static GeeSortedSet* gee_tree_map_entry_set_real_sub_set (GeeAbstractSortedSet* base, GeeMapEntry* after, GeeMapEntry* before); +static GeeIterator* gee_tree_map_entry_set_real_iterator_at (GeeAbstractSortedSet* base, GeeMapEntry* item); +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* node); +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* node); +static GeeMapEntry* gee_tree_map_entry_set_real_lower (GeeAbstractSortedSet* base, GeeMapEntry* item); +static GeeMapEntry* gee_tree_map_entry_set_real_higher (GeeAbstractSortedSet* base, GeeMapEntry* item); +static GeeMapEntry* gee_tree_map_entry_set_real_floor (GeeAbstractSortedSet* base, GeeMapEntry* item); +static GeeMapEntry* gee_tree_map_entry_set_real_ceil (GeeAbstractSortedSet* base, GeeMapEntry* item); static void gee_tree_map_entry_set_finalize (GObject* obj); static void _vala_gee_tree_map_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_ENTRY_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySetPrivate)) +enum { + GEE_TREE_MAP_SUB_ENTRY_SET_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_ENTRY_SET_K_TYPE, + GEE_TREE_MAP_SUB_ENTRY_SET_K_DUP_FUNC, + GEE_TREE_MAP_SUB_ENTRY_SET_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_ENTRY_SET_V_TYPE, + GEE_TREE_MAP_SUB_ENTRY_SET_V_DUP_FUNC, + GEE_TREE_MAP_SUB_ENTRY_SET_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_ENTRY_SET_MAP, + GEE_TREE_MAP_SUB_ENTRY_SET_RANGE, + GEE_TREE_MAP_SUB_ENTRY_SET_SIZE, + GEE_TREE_MAP_SUB_ENTRY_SET_READ_ONLY, + GEE_TREE_MAP_SUB_ENTRY_SET_IS_EMPTY +}; +static void gee_tree_map_sub_entry_set_set_map (GeeTreeMapSubEntrySet* self, GeeTreeMap* value); +static void gee_tree_map_sub_entry_set_set_range (GeeTreeMapSubEntrySet* self, GeeTreeMapRange* value); +static GeeIterator* gee_tree_map_sub_entry_set_real_iterator (GeeAbstractCollection* base); +static GeeTreeMap* gee_tree_map_sub_entry_set_get_map (GeeTreeMapSubEntrySet* self); +static GeeTreeMapRange* gee_tree_map_sub_entry_set_get_range (GeeTreeMapSubEntrySet* self); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GType gee_tree_map_sub_entry_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static gboolean gee_tree_map_sub_entry_set_real_add (GeeAbstractCollection* base, GeeMapEntry* entry); +static void gee_tree_map_sub_entry_set_real_clear (GeeAbstractCollection* base); +static gboolean gee_tree_map_sub_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry); +static gboolean gee_tree_map_sub_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry); +static GeeBidirIterator* gee_tree_map_sub_entry_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_first (GeeAbstractSortedSet* base); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_last (GeeAbstractSortedSet* base); +static GeeSortedSet* gee_tree_map_sub_entry_set_real_head_set (GeeAbstractSortedSet* base, GeeMapEntry* before); +static GeeSortedSet* gee_tree_map_sub_entry_set_real_tail_set (GeeAbstractSortedSet* base, GeeMapEntry* after); +static GeeSortedSet* gee_tree_map_sub_entry_set_real_sub_set (GeeAbstractSortedSet* base, GeeMapEntry* after, GeeMapEntry* before); +static GeeIterator* gee_tree_map_sub_entry_set_real_iterator_at (GeeAbstractSortedSet* base, GeeMapEntry* entry); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_lower (GeeAbstractSortedSet* base, GeeMapEntry* entry); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_higher (GeeAbstractSortedSet* base, GeeMapEntry* entry); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_floor (GeeAbstractSortedSet* base, GeeMapEntry* entry); +static GeeMapEntry* gee_tree_map_sub_entry_set_real_ceil (GeeAbstractSortedSet* base, GeeMapEntry* entry); +static gboolean gee_tree_map_sub_entry_set_get_is_empty (GeeTreeMapSubEntrySet* self); +static void gee_tree_map_sub_entry_set_finalize (GObject* obj); +static void _vala_gee_tree_map_sub_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_NODE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIteratorPrivate)) enum { GEE_TREE_MAP_NODE_ITERATOR_DUMMY_PROPERTY, @@ -817,10 +1791,14 @@ enum { GEE_TREE_MAP_NODE_ITERATOR_K_DESTROY_FUNC, GEE_TREE_MAP_NODE_ITERATOR_V_TYPE, GEE_TREE_MAP_NODE_ITERATOR_V_DUP_FUNC, - GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC + GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC, + GEE_TREE_MAP_NODE_ITERATOR_READ_ONLY, + GEE_TREE_MAP_NODE_ITERATOR_VALID }; static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map); +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); static gboolean gee_tree_map_node_iterator_next (GeeTreeMapNodeIterator* self); static gboolean gee_tree_map_node_iterator_has_next (GeeTreeMapNodeIterator* self); static gboolean gee_tree_map_node_iterator_first (GeeTreeMapNodeIterator* self); @@ -829,10 +1807,46 @@ static gboolean gee_tree_map_node_iterator_has_previous (GeeTreeMapNodeIterator* static gboolean gee_tree_map_node_iterator_last (GeeTreeMapNodeIterator* self); static void gee_tree_map_node_iterator_remove (GeeTreeMapNodeIterator* self); static void gee_tree_map_node_iterator_unset (GeeTreeMapNodeIterator* self); +static GeeTreeMapNode* gee_tree_map_node_iterator_safe_next_get (GeeTreeMapNodeIterator* self); +static GeeTreeMapNode* gee_tree_map_node_iterator_safe_previous_get (GeeTreeMapNodeIterator* self); +static gboolean gee_tree_map_node_iterator_get_read_only (GeeTreeMapNodeIterator* self); +static gboolean gee_tree_map_node_iterator_get_valid (GeeTreeMapNodeIterator* self); static void gee_tree_map_node_iterator_finalize (GObject* obj); static void _vala_gee_tree_map_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +#define GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIteratorPrivate)) +enum { + GEE_TREE_MAP_SUB_NODE_ITERATOR_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_NODE_ITERATOR_K_TYPE, + GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DUP_FUNC, + GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_NODE_ITERATOR_V_TYPE, + GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DUP_FUNC, + GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_NODE_ITERATOR_READ_ONLY, + GEE_TREE_MAP_SUB_NODE_ITERATOR_VALID +}; +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range); +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static gboolean gee_tree_map_sub_node_iterator_next (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_first (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_has_next (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_real_first (GeeTreeMapSubNodeIterator* self); +static GeeTreeMapNodeIterator* gee_tree_map_sub_node_iterator_iterator_pointing_at (GeeTreeMapSubNodeIterator* self, GeeTreeMapNode* node); +static gboolean gee_tree_map_sub_node_iterator_previous (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_has_previous (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_last (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_real_last (GeeTreeMapSubNodeIterator* self); +static void gee_tree_map_sub_node_iterator_remove (GeeTreeMapSubNodeIterator* self); +static gboolean gee_tree_map_sub_node_iterator_get_valid (GeeTreeMapSubNodeIterator* self); +static void gee_tree_map_sub_node_iterator_unset (GeeTreeMapSubNodeIterator* self); +static GeeTreeMapNodeIterator* gee_tree_map_sub_node_iterator_real_iterator_pointing_at (GeeTreeMapSubNodeIterator* self, GeeTreeMapNode* node); +static gboolean gee_tree_map_sub_node_iterator_get_read_only (GeeTreeMapSubNodeIterator* self); +static void gee_tree_map_sub_node_iterator_finalize (GObject* obj); +static void _vala_gee_tree_map_sub_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_KEY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_KEY_ITERATOR, GeeTreeMapKeyIteratorPrivate)) enum { GEE_TREE_MAP_KEY_ITERATOR_DUMMY_PROPERTY, @@ -844,8 +1858,24 @@ enum { GEE_TREE_MAP_KEY_ITERATOR_V_DESTROY_FUNC }; static gpointer gee_tree_map_key_iterator_real_get (GeeIterator* base); +static gboolean gee_tree_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_tree_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_KEY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIteratorPrivate)) +enum { + GEE_TREE_MAP_SUB_KEY_ITERATOR_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_KEY_ITERATOR_K_TYPE, + GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DUP_FUNC, + GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_KEY_ITERATOR_V_TYPE, + GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DUP_FUNC, + GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DESTROY_FUNC +}; +static gpointer gee_tree_map_sub_key_iterator_real_get (GeeIterator* base); +gboolean gee_iterator_get_valid (GeeIterator* self); +static gboolean gee_tree_map_sub_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static void _vala_gee_tree_map_sub_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_VALUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_VALUE_ITERATOR, GeeTreeMapValueIteratorPrivate)) enum { GEE_TREE_MAP_VALUE_ITERATOR_DUMMY_PROPERTY, @@ -856,9 +1886,28 @@ enum { GEE_TREE_MAP_VALUE_ITERATOR_V_DUP_FUNC, GEE_TREE_MAP_VALUE_ITERATOR_V_DESTROY_FUNC }; +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current); static gpointer gee_tree_map_value_iterator_real_get (GeeIterator* base); +static gboolean gee_tree_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_tree_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_VALUE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIteratorPrivate)) +enum { + GEE_TREE_MAP_SUB_VALUE_ITERATOR_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_TYPE, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DUP_FUNC, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_TYPE, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DUP_FUNC, + GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DESTROY_FUNC +}; +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node); +static gpointer gee_tree_map_sub_value_iterator_real_get (GeeIterator* base); +static gboolean gee_tree_map_sub_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static void _vala_gee_tree_map_sub_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_ENTRY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, GeeTreeMapEntryIteratorPrivate)) enum { GEE_TREE_MAP_ENTRY_ITERATOR_DUMMY_PROPERTY, @@ -870,8 +1919,25 @@ enum { GEE_TREE_MAP_ENTRY_ITERATOR_V_DESTROY_FUNC }; static GeeMapEntry* gee_tree_map_entry_iterator_real_get (GeeIterator* base); +static void gee_tree_map_entry_iterator_real_remove (GeeIterator* base); +static gboolean gee_tree_map_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void _vala_gee_tree_map_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_ENTRY_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIteratorPrivate)) +enum { + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_TYPE, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DUP_FUNC, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_TYPE, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DUP_FUNC, + GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DESTROY_FUNC +}; +static GeeMapEntry* gee_tree_map_sub_entry_iterator_real_get (GeeIterator* base); +static void gee_tree_map_sub_entry_iterator_real_remove (GeeIterator* base); +static gboolean gee_tree_map_sub_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static void _vala_gee_tree_map_sub_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_MAP_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_MAP_ITERATOR, GeeTreeMapMapIteratorPrivate)) enum { GEE_TREE_MAP_MAP_ITERATOR_DUMMY_PROPERTY, @@ -880,21 +1946,51 @@ enum { GEE_TREE_MAP_MAP_ITERATOR_K_DESTROY_FUNC, GEE_TREE_MAP_MAP_ITERATOR_V_TYPE, GEE_TREE_MAP_MAP_ITERATOR_V_DUP_FUNC, - GEE_TREE_MAP_MAP_ITERATOR_V_DESTROY_FUNC + GEE_TREE_MAP_MAP_ITERATOR_V_DESTROY_FUNC, + GEE_TREE_MAP_MAP_ITERATOR_READ_ONLY, + GEE_TREE_MAP_MAP_ITERATOR_MUTABLE }; static gpointer gee_tree_map_map_iterator_real_get_key (GeeMapIterator* base); +gboolean gee_map_iterator_get_valid (GeeMapIterator* self); static gpointer gee_tree_map_map_iterator_real_get_value (GeeMapIterator* base); static void gee_tree_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value); +gboolean gee_map_iterator_get_mutable (GeeMapIterator* self); static void _vala_gee_tree_map_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +#define GEE_TREE_MAP_SUB_MAP_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIteratorPrivate)) +enum { + GEE_TREE_MAP_SUB_MAP_ITERATOR_DUMMY_PROPERTY, + GEE_TREE_MAP_SUB_MAP_ITERATOR_K_TYPE, + GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DUP_FUNC, + GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DESTROY_FUNC, + GEE_TREE_MAP_SUB_MAP_ITERATOR_V_TYPE, + GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DUP_FUNC, + GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DESTROY_FUNC, + GEE_TREE_MAP_SUB_MAP_ITERATOR_READ_ONLY, + GEE_TREE_MAP_SUB_MAP_ITERATOR_MUTABLE +}; +static gpointer gee_tree_map_sub_map_iterator_real_get_key (GeeMapIterator* base); +static gpointer gee_tree_map_sub_map_iterator_real_get_value (GeeMapIterator* base); +static void gee_tree_map_sub_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value); +static void _vala_gee_tree_map_sub_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_tree_map_sub_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void gee_tree_map_finalize (GObject* obj); -GeeSet* gee_abstract_map_get_keys (GeeAbstractMap* self); -GeeCollection* gee_abstract_map_get_values (GeeAbstractMap* self); -GeeSet* gee_abstract_map_get_entries (GeeAbstractMap* self); static void _vala_gee_tree_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static GType gee_tree_map_range_type_get_type (void) { + static volatile gsize gee_tree_map_range_type_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_range_type_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_TREE_MAP_RANGE_TYPE_HEAD, "GEE_TREE_MAP_RANGE_TYPE_HEAD", "head"}, {GEE_TREE_MAP_RANGE_TYPE_TAIL, "GEE_TREE_MAP_RANGE_TYPE_TAIL", "tail"}, {GEE_TREE_MAP_RANGE_TYPE_EMPTY, "GEE_TREE_MAP_RANGE_TYPE_EMPTY", "empty"}, {GEE_TREE_MAP_RANGE_TYPE_BOUNDED, "GEE_TREE_MAP_RANGE_TYPE_BOUNDED", "bounded"}, {0, NULL, NULL}}; + GType gee_tree_map_range_type_type_id; + gee_tree_map_range_type_type_id = g_enum_register_static ("GeeTreeMapRangeType", values); + g_once_init_leave (&gee_tree_map_range_type_type_id__volatile, gee_tree_map_range_type_type_id); + } + return gee_tree_map_range_type_type_id__volatile; +} + + /** * Constructs a new, empty tree map sorted according to the specified * comparator function. @@ -905,13 +2001,17 @@ static void _vala_gee_tree_map_set_property (GObject * object, guint property_id * @param key_compare_func an optional key comparator function * @param value_equal_func an optional values equality testing function */ -GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func) { +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { GeeTreeMap * self = NULL; - GCompareFunc _tmp0_; - GEqualFunc _tmp2_; - GCompareFunc _tmp4_; - GEqualFunc _tmp5_; - self = (GeeTreeMap*) gee_abstract_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp8_; + void* _tmp8__target; + GeeEqualDataFunc _tmp9_; + void* _tmp9__target; + self = (GeeTreeMap*) gee_abstract_bidir_sorted_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; @@ -919,27 +2019,55 @@ GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyF self->priv->v_dup_func = v_dup_func; self->priv->v_destroy_func = v_destroy_func; _tmp0_ = key_compare_func; + _tmp0__target = key_compare_func_target; if (_tmp0_ == NULL) { - GCompareFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_compare_func_for (k_type); - key_compare_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GCompareDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_compare_func_for (k_type, &_tmp1_, &_tmp2_); + (key_compare_func_target_destroy_notify == NULL) ? NULL : (key_compare_func_target_destroy_notify (key_compare_func_target), NULL); + key_compare_func = NULL; + key_compare_func_target = NULL; + key_compare_func_target_destroy_notify = NULL; + key_compare_func = _tmp3_; + key_compare_func_target = _tmp1_; + key_compare_func_target_destroy_notify = _tmp2_; } - _tmp2_ = value_equal_func; - if (_tmp2_ == NULL) { - GEqualFunc _tmp3_ = NULL; - _tmp3_ = gee_functions_get_equal_func_for (v_type); - value_equal_func = _tmp3_; - } - _tmp4_ = key_compare_func; - gee_tree_map_set_key_compare_func (self, _tmp4_); - _tmp5_ = value_equal_func; - gee_tree_map_set_value_equal_func (self, _tmp5_); + _tmp4_ = value_equal_func; + _tmp4__target = value_equal_func_target; + if (_tmp4_ == NULL) { + void* _tmp5_ = NULL; + GDestroyNotify _tmp6_ = NULL; + GeeEqualDataFunc _tmp7_ = NULL; + _tmp7_ = gee_functions_get_equal_func_for (v_type, &_tmp5_, &_tmp6_); + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; + value_equal_func = _tmp7_; + value_equal_func_target = _tmp5_; + value_equal_func_target_destroy_notify = _tmp6_; + } + _tmp8_ = key_compare_func; + _tmp8__target = key_compare_func_target; + gee_tree_map_set_key_compare_func (self, _tmp8_, _tmp8__target); + _tmp9_ = value_equal_func; + _tmp9__target = value_equal_func_target; + gee_tree_map_set_value_equal_func (self, _tmp9_, _tmp9__target); + (key_compare_func_target_destroy_notify == NULL) ? NULL : (key_compare_func_target_destroy_notify (key_compare_func_target), NULL); + key_compare_func = NULL; + key_compare_func_target = NULL; + key_compare_func_target_destroy_notify = NULL; + (value_equal_func_target_destroy_notify == NULL) ? NULL : (value_equal_func_target_destroy_notify (value_equal_func_target), NULL); + value_equal_func = NULL; + value_equal_func_target = NULL; + value_equal_func_target_destroy_notify = NULL; return self; } -GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func) { - return gee_tree_map_construct (GEE_TYPE_TREE_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_compare_func, value_equal_func); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify) { + return gee_tree_map_construct (GEE_TYPE_TREE_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_compare_func, key_compare_func_target, key_compare_func_target_destroy_notify, value_equal_func, value_equal_func_target, value_equal_func_target_destroy_notify); } @@ -1090,8 +2218,10 @@ static gboolean gee_tree_map_real_has_key (GeeAbstractMap* base, gconstpointer k cur = _tmp0_; while (TRUE) { GeeTreeMapNode* _tmp1_; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; gconstpointer _tmp4_; GeeTreeMapNode* _tmp5_; gconstpointer _tmp6_; @@ -1102,12 +2232,13 @@ static gboolean gee_tree_map_real_has_key (GeeAbstractMap* base, gconstpointer k if (!(_tmp1_ != NULL)) { break; } - _tmp2_ = gee_tree_map_get_key_compare_func (self); + _tmp2_ = gee_tree_map_get_key_compare_func (self, &_tmp2__target); _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; _tmp4_ = key; _tmp5_ = cur; _tmp6_ = _tmp5_->key; - _tmp7_ = _tmp3_ (_tmp4_, _tmp6_); + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); res = _tmp7_; _tmp8_ = res; if (_tmp8_ == 0) { @@ -1154,16 +2285,19 @@ static gboolean gee_tree_map_real_has (GeeAbstractMap* base, gconstpointer key, own_value = _tmp1_; _tmp3_ = own_value; if (_tmp3_ != NULL) { - GEqualFunc _tmp4_; - GEqualFunc _tmp5_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; gconstpointer _tmp6_; gconstpointer _tmp7_; gboolean _tmp8_ = FALSE; - _tmp4_ = gee_tree_map_get_value_equal_func (self); + _tmp4_ = gee_tree_map_get_value_equal_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = own_value; _tmp7_ = value; - _tmp8_ = _tmp5_ (_tmp6_, _tmp7_); + _tmp8_ = _tmp5_ (_tmp6_, _tmp7_, _tmp5__target); _tmp2_ = _tmp8_; } else { _tmp2_ = FALSE; @@ -1188,8 +2322,10 @@ static gpointer gee_tree_map_real_get (GeeAbstractMap* base, gconstpointer key) cur = _tmp0_; while (TRUE) { GeeTreeMapNode* _tmp1_; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; gconstpointer _tmp4_; GeeTreeMapNode* _tmp5_; gconstpointer _tmp6_; @@ -1200,12 +2336,13 @@ static gpointer gee_tree_map_real_get (GeeAbstractMap* base, gconstpointer key) if (!(_tmp1_ != NULL)) { break; } - _tmp2_ = gee_tree_map_get_key_compare_func (self); + _tmp2_ = gee_tree_map_get_key_compare_func (self, &_tmp2__target); _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; _tmp4_ = key; _tmp5_ = cur; _tmp6_ = _tmp5_->key; - _tmp7_ = _tmp3_ (_tmp4_, _tmp6_); + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); res = _tmp7_; _tmp8_ = res; if (_tmp8_ == 0) { @@ -1240,17 +2377,22 @@ static gpointer gee_tree_map_real_get (GeeAbstractMap* base, gconstpointer key) } -static void gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, gconstpointer key, gconstpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next) { +static gboolean gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, gconstpointer key, gconstpointer value, gpointer* old_value, GeeTreeMapNode* prev, GeeTreeMapNode* next) { + gpointer _vala_old_value = NULL; + gboolean result = FALSE; GeeTreeMapNode* _tmp0_; - GCompareFunc _tmp13_; - GCompareFunc _tmp14_; + GCompareDataFunc _tmp13_; + void* _tmp13__target; + GCompareDataFunc _tmp14_; + void* _tmp14__target; gconstpointer _tmp15_; GeeTreeMapNode* _tmp16_; gconstpointer _tmp17_; gint _tmp18_ = 0; gint cmp; + gboolean changed = FALSE; gint _tmp19_; - g_return_if_fail (self != NULL); + g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = *node; if (_tmp0_ == NULL) { gconstpointer _tmp1_; @@ -1263,6 +2405,8 @@ static void gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, g GeeTreeMapNode* _tmp8_; GeeTreeMapNode* _tmp10_; gint _tmp12_; + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + _vala_old_value = NULL; _tmp1_ = key; _tmp2_ = ((_tmp1_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); _tmp3_ = value; @@ -1286,58 +2430,112 @@ static void gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, g } _tmp12_ = self->priv->_size; self->priv->_size = _tmp12_ + 1; + result = TRUE; + if (old_value) { + *old_value = _vala_old_value; + } else { + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + } + return result; } - _tmp13_ = gee_tree_map_get_key_compare_func (self); + _tmp13_ = gee_tree_map_get_key_compare_func (self, &_tmp13__target); _tmp14_ = _tmp13_; + _tmp14__target = _tmp13__target; _tmp15_ = key; _tmp16_ = *node; _tmp17_ = _tmp16_->key; - _tmp18_ = _tmp14_ (_tmp15_, _tmp17_); + _tmp18_ = _tmp14_ (_tmp15_, _tmp17_, _tmp14__target); cmp = _tmp18_; _tmp19_ = cmp; if (_tmp19_ == 0) { - GeeTreeMapNode* _tmp20_; - gconstpointer _tmp21_; - gpointer _tmp22_; - _tmp20_ = *node; - _tmp21_ = value; - _tmp22_ = ((_tmp21_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp21_) : ((gpointer) _tmp21_); - ((_tmp20_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp20_->value = (self->priv->v_destroy_func (_tmp20_->value), NULL)); - _tmp20_->value = _tmp22_; - } else { - gint _tmp23_; - _tmp23_ = cmp; - if (_tmp23_ < 0) { - GeeTreeMapNode* _tmp24_; - gconstpointer _tmp25_; - gconstpointer _tmp26_; - GeeTreeMapNode* _tmp27_; - GeeTreeMapNode* _tmp28_; - GeeTreeMapNode* _tmp29_; - _tmp24_ = *node; - _tmp25_ = key; - _tmp26_ = value; - _tmp27_ = *node; - _tmp28_ = _tmp27_->prev; - _tmp29_ = *node; - gee_tree_map_set_to_node (self, &_tmp24_->left, _tmp25_, _tmp26_, _tmp28_, _tmp29_); + GeeEqualDataFunc _tmp20_; + void* _tmp20__target; + GeeEqualDataFunc _tmp21_; + void* _tmp21__target; + gconstpointer _tmp22_; + GeeTreeMapNode* _tmp23_; + gconstpointer _tmp24_; + gboolean _tmp25_ = FALSE; + _tmp20_ = gee_tree_map_get_value_equal_func (self, &_tmp20__target); + _tmp21_ = _tmp20_; + _tmp21__target = _tmp20__target; + _tmp22_ = value; + _tmp23_ = *node; + _tmp24_ = _tmp23_->value; + _tmp25_ = _tmp21_ (_tmp22_, _tmp24_, _tmp21__target); + if (_tmp25_) { + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + _vala_old_value = NULL; + changed = FALSE; } else { - GeeTreeMapNode* _tmp30_; - gconstpointer _tmp31_; - gconstpointer _tmp32_; - GeeTreeMapNode* _tmp33_; - GeeTreeMapNode* _tmp34_; + GeeTreeMapNode* _tmp26_; + gpointer _tmp27_; + GeeTreeMapNode* _tmp28_; + gconstpointer _tmp29_; + gpointer _tmp30_; + _tmp26_ = *node; + _tmp27_ = _tmp26_->value; + _tmp26_->value = NULL; + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + _vala_old_value = _tmp27_; + _tmp28_ = *node; + _tmp29_ = value; + _tmp30_ = ((_tmp29_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp29_) : ((gpointer) _tmp29_); + ((_tmp28_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp28_->value = (self->priv->v_destroy_func (_tmp28_->value), NULL)); + _tmp28_->value = _tmp30_; + changed = TRUE; + } + } else { + gint _tmp31_; + _tmp31_ = cmp; + if (_tmp31_ < 0) { + GeeTreeMapNode* _tmp32_; + gconstpointer _tmp33_; + gconstpointer _tmp34_; GeeTreeMapNode* _tmp35_; - _tmp30_ = *node; - _tmp31_ = key; - _tmp32_ = value; - _tmp33_ = *node; - _tmp34_ = *node; - _tmp35_ = _tmp34_->next; - gee_tree_map_set_to_node (self, &_tmp30_->right, _tmp31_, _tmp32_, _tmp33_, _tmp35_); + GeeTreeMapNode* _tmp36_; + GeeTreeMapNode* _tmp37_; + gpointer _tmp38_ = NULL; + gboolean _tmp39_ = FALSE; + _tmp32_ = *node; + _tmp33_ = key; + _tmp34_ = value; + _tmp35_ = *node; + _tmp36_ = _tmp35_->prev; + _tmp37_ = *node; + _tmp39_ = gee_tree_map_set_to_node (self, &_tmp32_->left, _tmp33_, _tmp34_, &_tmp38_, _tmp36_, _tmp37_); + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + _vala_old_value = _tmp38_; + changed = _tmp39_; + } else { + GeeTreeMapNode* _tmp40_; + gconstpointer _tmp41_; + gconstpointer _tmp42_; + GeeTreeMapNode* _tmp43_; + GeeTreeMapNode* _tmp44_; + GeeTreeMapNode* _tmp45_; + gpointer _tmp46_ = NULL; + gboolean _tmp47_ = FALSE; + _tmp40_ = *node; + _tmp41_ = key; + _tmp42_ = value; + _tmp43_ = *node; + _tmp44_ = *node; + _tmp45_ = _tmp44_->next; + _tmp47_ = gee_tree_map_set_to_node (self, &_tmp40_->right, _tmp41_, _tmp42_, &_tmp46_, _tmp43_, _tmp45_); + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + _vala_old_value = _tmp46_; + changed = _tmp47_; } } gee_tree_map_fix_up (self, node); + result = changed; + if (old_value) { + *old_value = _vala_old_value; + } else { + ((_vala_old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_old_value = (self->priv->v_destroy_func (_vala_old_value), NULL)); + } + return result; } @@ -1346,18 +2544,23 @@ static void gee_tree_map_set_to_node (GeeTreeMap* self, GeeTreeMapNode** node, g */ static void gee_tree_map_real_set (GeeAbstractMap* base, gconstpointer key, gconstpointer value) { GeeTreeMap * self; + gpointer old_value = NULL; gconstpointer _tmp0_; gconstpointer _tmp1_; - GeeTreeMapNode* _tmp2_; - gint _tmp3_; + gpointer _tmp2_ = NULL; + GeeTreeMapNode* _tmp3_; + gint _tmp4_; self = (GeeTreeMap*) base; _tmp0_ = key; _tmp1_ = value; - gee_tree_map_set_to_node (self, &self->priv->root, _tmp0_, _tmp1_, NULL, NULL); - _tmp2_ = self->priv->root; - _tmp2_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; - _tmp3_ = self->priv->stamp; - self->priv->stamp = _tmp3_ + 1; + gee_tree_map_set_to_node (self, &self->priv->root, _tmp0_, _tmp1_, &_tmp2_, NULL, NULL); + ((old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (old_value = (self->priv->v_destroy_func (old_value), NULL)); + old_value = _tmp2_; + _tmp3_ = self->priv->root; + _tmp3_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; + _tmp4_ = self->priv->stamp; + self->priv->stamp = _tmp4_ + 1; + ((old_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (old_value = (self->priv->v_destroy_func (old_value), NULL)); } @@ -1415,85 +2618,76 @@ static void gee_tree_map_fix_removal (GeeTreeMap* self, GeeTreeMapNode** node, g gpointer _vala_value = NULL; GeeTreeMapNode* _tmp0_; GeeTreeMapNode* n; + GeeTreeMapNode* _tmp1_; + gpointer _tmp2_; + GeeTreeMapNode* _tmp3_; + gpointer _tmp4_; + GeeTreeMapNode* _tmp5_; GeeTreeMapNode* _tmp6_; - GeeTreeMapNode* _tmp7_; + GeeTreeMapNode* _tmp13_; GeeTreeMapNode* _tmp14_; - GeeTreeMapNode* _tmp15_; - GeeTreeMapNode* _tmp22_; - gint _tmp23_; + GeeTreeMapNode* _tmp21_; + gint _tmp22_; g_return_if_fail (self != NULL); g_return_if_fail (*node != NULL); _tmp0_ = *node; *node = NULL; n = _tmp0_; - if ((&_vala_key) != NULL) { - GeeTreeMapNode* _tmp1_; - gpointer _tmp2_; - _tmp1_ = n; - _tmp2_ = _tmp1_->key; - _tmp1_->key = NULL; - ((_vala_key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->k_destroy_func (_vala_key), NULL)); - _vala_key = _tmp2_; - } else { - GeeTreeMapNode* _tmp3_; - _tmp3_ = n; - ((_tmp3_->key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp3_->key = (self->priv->k_destroy_func (_tmp3_->key), NULL)); - _tmp3_->key = NULL; - } - if ((&_vala_value) != NULL) { - GeeTreeMapNode* _tmp4_; - gpointer _tmp5_; - _tmp4_ = n; - _tmp5_ = _tmp4_->value; - _tmp4_->value = NULL; - ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); - _vala_value = _tmp5_; - } - _tmp6_ = n; - _tmp7_ = _tmp6_->prev; - if (_tmp7_ != NULL) { + _tmp1_ = n; + _tmp2_ = _tmp1_->key; + _tmp1_->key = NULL; + ((_vala_key == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->k_destroy_func (_vala_key), NULL)); + _vala_key = _tmp2_; + _tmp3_ = n; + _tmp4_ = _tmp3_->value; + _tmp3_->value = NULL; + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = _tmp4_; + _tmp5_ = n; + _tmp6_ = _tmp5_->prev; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; GeeTreeMapNode* _tmp8_; GeeTreeMapNode* _tmp9_; GeeTreeMapNode* _tmp10_; - GeeTreeMapNode* _tmp11_; - _tmp8_ = n; - _tmp9_ = _tmp8_->prev; - _tmp10_ = n; - _tmp11_ = _tmp10_->next; - _tmp9_->next = _tmp11_; + _tmp7_ = n; + _tmp8_ = _tmp7_->prev; + _tmp9_ = n; + _tmp10_ = _tmp9_->next; + _tmp8_->next = _tmp10_; } else { + GeeTreeMapNode* _tmp11_; GeeTreeMapNode* _tmp12_; - GeeTreeMapNode* _tmp13_; - _tmp12_ = n; - _tmp13_ = _tmp12_->next; - self->priv->first = _tmp13_; + _tmp11_ = n; + _tmp12_ = _tmp11_->next; + self->priv->first = _tmp12_; } - _tmp14_ = n; - _tmp15_ = _tmp14_->next; - if (_tmp15_ != NULL) { + _tmp13_ = n; + _tmp14_ = _tmp13_->next; + if (_tmp14_ != NULL) { + GeeTreeMapNode* _tmp15_; GeeTreeMapNode* _tmp16_; GeeTreeMapNode* _tmp17_; GeeTreeMapNode* _tmp18_; - GeeTreeMapNode* _tmp19_; - _tmp16_ = n; - _tmp17_ = _tmp16_->next; - _tmp18_ = n; - _tmp19_ = _tmp18_->prev; - _tmp17_->prev = _tmp19_; + _tmp15_ = n; + _tmp16_ = _tmp15_->next; + _tmp17_ = n; + _tmp18_ = _tmp17_->prev; + _tmp16_->prev = _tmp18_; } else { + GeeTreeMapNode* _tmp19_; GeeTreeMapNode* _tmp20_; - GeeTreeMapNode* _tmp21_; - _tmp20_ = n; - _tmp21_ = _tmp20_->next; - self->priv->last = _tmp21_; + _tmp19_ = n; + _tmp20_ = _tmp19_->next; + self->priv->last = _tmp20_; } - _tmp22_ = n; - ((_tmp22_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp22_->value = (self->priv->v_destroy_func (_tmp22_->value), NULL)); - _tmp22_->value = NULL; + _tmp21_ = n; + ((_tmp21_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp21_->value = (self->priv->v_destroy_func (_tmp21_->value), NULL)); + _tmp21_->value = NULL; _gee_tree_map_node_free0 (*node); *node = NULL; - _tmp23_ = self->priv->_size; - self->priv->_size = _tmp23_ - 1; + _tmp22_ = self->priv->_size; + self->priv->_size = _tmp22_ - 1; _gee_tree_map_node_free0 (n); if (key) { *key = _vala_key; @@ -1594,6 +2788,10 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = *node; if (_tmp0_ == NULL) { + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = NULL; + _vala_next = NULL; + _vala_prev = NULL; result = FALSE; if (value) { *value = _vala_value; @@ -1608,18 +2806,21 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* } return result; } else { - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; gconstpointer _tmp3_; GeeTreeMapNode* _tmp4_; gconstpointer _tmp5_; gint _tmp6_ = 0; - _tmp1_ = gee_tree_map_get_key_compare_func (self); + _tmp1_ = gee_tree_map_get_key_compare_func (self, &_tmp1__target); _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; _tmp3_ = key; _tmp4_ = *node; _tmp5_ = _tmp4_->key; - _tmp6_ = _tmp2_ (_tmp3_, _tmp5_); + _tmp6_ = _tmp2_ (_tmp3_, _tmp5_, _tmp2__target); if (_tmp6_ < 0) { GeeTreeMapNode* _tmp7_; GeeTreeMapNode* _tmp8_; @@ -1643,6 +2844,10 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* left = _tmp8_; _tmp9_ = left; if (_tmp9_ == NULL) { + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = NULL; + _vala_next = NULL; + _vala_prev = NULL; result = FALSE; if (value) { *value = _vala_value; @@ -1714,8 +2919,10 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* GeeTreeMapNode* _tmp31_; GeeTreeMapNode* r; gboolean _tmp32_ = FALSE; - GCompareFunc _tmp33_; - GCompareFunc _tmp34_; + GCompareDataFunc _tmp33_; + void* _tmp33__target; + GCompareDataFunc _tmp34_; + void* _tmp34__target; gconstpointer _tmp35_; GeeTreeMapNode* _tmp36_; gconstpointer _tmp37_; @@ -1727,8 +2934,10 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* gboolean _tmp49_ = FALSE; gboolean _tmp51_; gboolean _tmp55_; - GCompareFunc _tmp56_; - GCompareFunc _tmp57_; + GCompareDataFunc _tmp56_; + void* _tmp56__target; + GCompareDataFunc _tmp57_; + void* _tmp57__target; gconstpointer _tmp58_; GeeTreeMapNode* _tmp59_; gconstpointer _tmp60_; @@ -1742,12 +2951,13 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* _tmp30_ = *node; _tmp31_ = _tmp30_->right; r = _tmp31_; - _tmp33_ = gee_tree_map_get_key_compare_func (self); + _tmp33_ = gee_tree_map_get_key_compare_func (self, &_tmp33__target); _tmp34_ = _tmp33_; + _tmp34__target = _tmp33__target; _tmp35_ = key; _tmp36_ = *node; _tmp37_ = _tmp36_->key; - _tmp38_ = _tmp34_ (_tmp35_, _tmp37_); + _tmp38_ = _tmp34_ (_tmp35_, _tmp37_, _tmp34__target); if (_tmp38_ == 0) { GeeTreeMapNode* _tmp39_; _tmp39_ = r; @@ -1757,21 +2967,17 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* } _tmp40_ = _tmp32_; if (_tmp40_) { + GeeTreeMapNode* _tmp41_; + GeeTreeMapNode* _tmp42_; + GeeTreeMapNode* _tmp43_; + GeeTreeMapNode* _tmp44_; gpointer _tmp45_ = NULL; - if ((&_vala_prev) != NULL) { - GeeTreeMapNode* _tmp41_; - GeeTreeMapNode* _tmp42_; - _tmp41_ = *node; - _tmp42_ = _tmp41_->prev; - _vala_prev = _tmp42_; - } - if ((&_vala_next) != NULL) { - GeeTreeMapNode* _tmp43_; - GeeTreeMapNode* _tmp44_; - _tmp43_ = *node; - _tmp44_ = _tmp43_->next; - _vala_next = _tmp44_; - } + _tmp41_ = *node; + _tmp42_ = _tmp41_->prev; + _vala_prev = _tmp42_; + _tmp43_ = *node; + _tmp44_ = _tmp43_->next; + _vala_next = _tmp44_; gee_tree_map_fix_removal (self, node, NULL, &_tmp45_); ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); _vala_value = _tmp45_; @@ -1814,15 +3020,19 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* if (_tmp55_) { gee_tree_map_move_red_right (self, node); } - _tmp56_ = gee_tree_map_get_key_compare_func (self); + _tmp56_ = gee_tree_map_get_key_compare_func (self, &_tmp56__target); _tmp57_ = _tmp56_; + _tmp57__target = _tmp56__target; _tmp58_ = key; _tmp59_ = *node; _tmp60_ = _tmp59_->key; - _tmp61_ = _tmp57_ (_tmp58_, _tmp60_); + _tmp61_ = _tmp57_ (_tmp58_, _tmp60_, _tmp57__target); if (_tmp61_ == 0) { GeeTreeMapNode* _tmp62_; gpointer _tmp63_; + GeeTreeMapNode* _tmp64_; + GeeTreeMapNode* _tmp65_; + GeeTreeMapNode* _tmp66_; GeeTreeMapNode* _tmp67_; GeeTreeMapNode* _tmp68_; GeeTreeMapNode* _tmp69_; @@ -1833,18 +3043,11 @@ static gboolean gee_tree_map_remove_from_node (GeeTreeMap* self, GeeTreeMapNode* _tmp62_->value = NULL; ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); _vala_value = _tmp63_; - if ((&_vala_prev) != NULL) { - GeeTreeMapNode* _tmp64_; - GeeTreeMapNode* _tmp65_; - _tmp64_ = *node; - _tmp65_ = _tmp64_->prev; - _vala_prev = _tmp65_; - } - if ((&_vala_next) != NULL) { - GeeTreeMapNode* _tmp66_; - _tmp66_ = *node; - _vala_next = _tmp66_; - } + _tmp64_ = *node; + _tmp65_ = _tmp64_->prev; + _vala_prev = _tmp65_; + _tmp66_ = *node; + _vala_next = _tmp66_; _tmp67_ = *node; _tmp68_ = *node; _tmp69_ = *node; @@ -2000,36 +3203,27 @@ static gboolean gee_tree_map_real_unset (GeeAbstractMap* base, gconstpointer key GeeTreeMap * self; gpointer _vala_value = NULL; gboolean result = FALSE; - gpointer node_value = NULL; gconstpointer _tmp0_; gpointer _tmp1_ = NULL; gboolean _tmp2_ = FALSE; gboolean b; - GeeTreeMapNode* _tmp4_; - gint _tmp6_; + GeeTreeMapNode* _tmp3_; + gint _tmp5_; self = (GeeTreeMap*) base; _tmp0_ = key; _tmp2_ = gee_tree_map_remove_from_node (self, &self->priv->root, _tmp0_, &_tmp1_, NULL, NULL); - ((node_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (node_value = (self->priv->v_destroy_func (node_value), NULL)); - node_value = _tmp1_; + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = _tmp1_; b = _tmp2_; - if ((&_vala_value) != NULL) { - gpointer _tmp3_; - _tmp3_ = node_value; - node_value = NULL; - ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); - _vala_value = _tmp3_; - } - _tmp4_ = self->priv->root; - if (_tmp4_ != NULL) { - GeeTreeMapNode* _tmp5_; - _tmp5_ = self->priv->root; - _tmp5_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; + _tmp3_ = self->priv->root; + if (_tmp3_ != NULL) { + GeeTreeMapNode* _tmp4_; + _tmp4_ = self->priv->root; + _tmp4_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; } - _tmp6_ = self->priv->stamp; - self->priv->stamp = _tmp6_ + 1; + _tmp5_ = self->priv->stamp; + self->priv->stamp = _tmp5_ + 1; result = b; - ((node_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (node_value = (self->priv->v_destroy_func (node_value), NULL)); if (value) { *value = _vala_value; } else { @@ -2106,639 +3300,1042 @@ static void gee_tree_map_real_clear (GeeAbstractMap* base) { /** * {@inheritDoc} */ -static GeeMapIterator* gee_tree_map_real_map_iterator (GeeAbstractMap* base) { +static GeeSortedMap* gee_tree_map_real_head_map (GeeAbstractSortedMap* base, gconstpointer before) { GeeTreeMap * self; - GeeMapIterator* result = NULL; - GeeTreeMapMapIterator* _tmp0_; + GeeSortedMap* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapSubMap* _tmp3_; + GeeSortedMap* _tmp4_; self = (GeeTreeMap*) base; - _tmp0_ = gee_tree_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); - result = (GeeMapIterator*) _tmp0_; + _tmp0_ = before; + _tmp1_ = gee_tree_map_range_new_head (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp2_); + _tmp4_ = (GeeSortedMap*) _tmp3_; + _gee_tree_map_range_unref0 (_tmp2_); + result = _tmp4_; return result; } -static gint gee_tree_map_real_get_size (GeeAbstractMap* base) { - gint result; - GeeTreeMap* self; - gint _tmp0_; +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_tree_map_real_tail_map (GeeAbstractSortedMap* base, gconstpointer after) { + GeeTreeMap * self; + GeeSortedMap* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapSubMap* _tmp3_; + GeeSortedMap* _tmp4_; self = (GeeTreeMap*) base; - _tmp0_ = self->priv->_size; - result = _tmp0_; + _tmp0_ = after; + _tmp1_ = gee_tree_map_range_new_tail (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp2_); + _tmp4_ = (GeeSortedMap*) _tmp3_; + _gee_tree_map_range_unref0 (_tmp2_); + result = _tmp4_; return result; } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -static GeeSet* gee_tree_map_real_get_keys (GeeAbstractMap* base) { - GeeSet* result; - GeeTreeMap* self; - GeeSet* _tmp0_; - GeeSet* _tmp1_; - GeeSet* keys; - GeeSet* _tmp2_; +/** + * {@inheritDoc} + */ +static GeeSortedMap* gee_tree_map_real_sub_map (GeeAbstractSortedMap* base, gconstpointer after, gconstpointer before) { + GeeTreeMap * self; + GeeSortedMap* result = NULL; + gconstpointer _tmp0_; + gconstpointer _tmp1_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapRange* _tmp3_; + GeeTreeMapSubMap* _tmp4_; + GeeSortedMap* _tmp5_; self = (GeeTreeMap*) base; - _tmp0_ = self->priv->_keys; - _tmp1_ = _g_object_ref0 (_tmp0_); - keys = _tmp1_; - _tmp2_ = self->priv->_keys; - if (_tmp2_ == NULL) { - GeeTreeMapKeySet* _tmp3_; - GeeSet* _tmp4_; - GeeSet* _tmp5_; - _tmp3_ = gee_tree_map_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); - _g_object_unref0 (keys); - keys = (GeeSet*) _tmp3_; - _tmp4_ = keys; - self->priv->_keys = _tmp4_; - _tmp5_ = keys; - g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_keys)); - } - result = keys; + _tmp0_ = after; + _tmp1_ = before; + _tmp2_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp0_, _tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self, _tmp3_); + _tmp5_ = (GeeSortedMap*) _tmp4_; + _gee_tree_map_range_unref0 (_tmp3_); + result = _tmp5_; return result; } -static GeeCollection* gee_tree_map_real_get_values (GeeAbstractMap* base) { - GeeCollection* result; - GeeTreeMap* self; - GeeCollection* _tmp0_; - GeeCollection* _tmp1_; - GeeCollection* values; - GeeCollection* _tmp2_; +/** + * {@inheritDoc} + */ +static GeeMapIterator* gee_tree_map_real_map_iterator (GeeAbstractMap* base) { + GeeTreeMap * self; + GeeMapIterator* result = NULL; + GeeTreeMapMapIterator* _tmp0_; self = (GeeTreeMap*) base; - _tmp0_ = self->priv->_values; - _tmp1_ = _g_object_ref0 (_tmp0_); - values = _tmp1_; - _tmp2_ = self->priv->_values; - if (_tmp2_ == NULL) { - GeeTreeMapValueCollection* _tmp3_; - GeeCollection* _tmp4_; - GeeCollection* _tmp5_; - _tmp3_ = gee_tree_map_value_collection_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); - _g_object_unref0 (values); - values = (GeeCollection*) _tmp3_; - _tmp4_ = values; - self->priv->_values = _tmp4_; - _tmp5_ = values; - g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_values)); - } - result = values; + _tmp0_ = gee_tree_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + result = (GeeMapIterator*) _tmp0_; return result; } -static GeeSet* gee_tree_map_real_get_entries (GeeAbstractMap* base) { - GeeSet* result; - GeeTreeMap* self; - GeeSet* _tmp0_; - GeeSet* _tmp1_; - GeeSet* entries; - GeeSet* _tmp2_; +/** + * {@inheritDoc} + */ +static GeeBidirMapIterator* gee_tree_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* base) { + GeeTreeMap * self; + GeeBidirMapIterator* result = NULL; + GeeTreeMapMapIterator* _tmp0_; self = (GeeTreeMap*) base; - _tmp0_ = self->priv->_entries; - _tmp1_ = _g_object_ref0 (_tmp0_); - entries = _tmp1_; - _tmp2_ = self->priv->_entries; - if (_tmp2_ == NULL) { - GeeTreeMapEntrySet* _tmp3_; - GeeSet* _tmp4_; - GeeSet* _tmp5_; - _tmp3_ = gee_tree_map_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); - _g_object_unref0 (entries); - entries = (GeeSet*) _tmp3_; - _tmp4_ = entries; - self->priv->_entries = _tmp4_; - _tmp5_ = entries; - g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_entries)); - } - result = entries; + _tmp0_ = gee_tree_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + result = (GeeBidirMapIterator*) _tmp0_; return result; } -GCompareFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self) { - GCompareFunc result; - GCompareFunc _tmp0_; +static inline gpointer gee_tree_map_min (GeeTreeMap* self, gconstpointer a, gconstpointer b) { + gpointer result = NULL; + gconstpointer _tmp0_ = NULL; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + gint _tmp5_ = 0; + gconstpointer _tmp8_; + gpointer _tmp9_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_key_compare_func; - result = _tmp0_; + _tmp1_ = gee_tree_map_get_key_compare_func (self, &_tmp1__target); + _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; + _tmp3_ = a; + _tmp4_ = b; + _tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target); + if (_tmp5_ <= 0) { + gconstpointer _tmp6_; + _tmp6_ = a; + _tmp0_ = _tmp6_; + } else { + gconstpointer _tmp7_; + _tmp7_ = b; + _tmp0_ = _tmp7_; + } + _tmp8_ = _tmp0_; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + result = _tmp9_; return result; } -static void gee_tree_map_set_key_compare_func (GeeTreeMap* self, GCompareFunc value) { - GCompareFunc _tmp0_; - g_return_if_fail (self != NULL); - _tmp0_ = value; - self->priv->_key_compare_func = _tmp0_; - g_object_notify ((GObject *) self, "key-compare-func"); -} +static inline gpointer gee_tree_map_max (GeeTreeMap* self, gconstpointer a, gconstpointer b) { + gpointer result = NULL; + gconstpointer _tmp0_ = NULL; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + gint _tmp5_ = 0; + gconstpointer _tmp8_; + gpointer _tmp9_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = gee_tree_map_get_key_compare_func (self, &_tmp1__target); + _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; + _tmp3_ = a; + _tmp4_ = b; + _tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target); + if (_tmp5_ > 0) { + gconstpointer _tmp6_; + _tmp6_ = a; + _tmp0_ = _tmp6_; + } else { + gconstpointer _tmp7_; + _tmp7_ = b; + _tmp0_ = _tmp7_; + } + _tmp8_ = _tmp0_; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + result = _tmp9_; + return result; +} -GEqualFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self) { - GEqualFunc result; - GEqualFunc _tmp0_; +static inline GeeTreeMapNode* gee_tree_map_find_node (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + GeeTreeMapNode* _tmp0_; + GeeTreeMapNode* cur; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = self->priv->_value_equal_func; - result = _tmp0_; + _tmp0_ = self->priv->root; + cur = _tmp0_; + while (TRUE) { + GeeTreeMapNode* _tmp1_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gint _tmp7_ = 0; + gint res; + gint _tmp8_; + _tmp1_ = cur; + if (!(_tmp1_ != NULL)) { + break; + } + _tmp2_ = gee_tree_map_get_key_compare_func (self, &_tmp2__target); + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + _tmp4_ = key; + _tmp5_ = cur; + _tmp6_ = _tmp5_->key; + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); + res = _tmp7_; + _tmp8_ = res; + if (_tmp8_ == 0) { + GeeTreeMapNode* _tmp9_; + _tmp9_ = cur; + result = _tmp9_; + return result; + } else { + gint _tmp10_; + _tmp10_ = res; + if (_tmp10_ < 0) { + GeeTreeMapNode* _tmp11_; + GeeTreeMapNode* _tmp12_; + _tmp11_ = cur; + _tmp12_ = _tmp11_->left; + cur = _tmp12_; + } else { + GeeTreeMapNode* _tmp13_; + GeeTreeMapNode* _tmp14_; + _tmp13_ = cur; + _tmp14_ = _tmp13_->right; + cur = _tmp14_; + } + } + } + result = NULL; return result; } -static void gee_tree_map_set_value_equal_func (GeeTreeMap* self, GEqualFunc value) { - GEqualFunc _tmp0_; - g_return_if_fail (self != NULL); - _tmp0_ = value; - self->priv->_value_equal_func = _tmp0_; - g_object_notify ((GObject *) self, "value-equal-func"); +static inline GeeTreeMapNode* gee_tree_map_find_nearest (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + GeeTreeMapNode* _tmp0_; + GeeTreeMapNode* cur; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->root; + cur = _tmp0_; + while (TRUE) { + GeeTreeMapNode* _tmp1_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + gconstpointer _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gint _tmp7_ = 0; + gint res; + gint _tmp8_; + _tmp1_ = cur; + if (!(_tmp1_ != NULL)) { + break; + } + _tmp2_ = gee_tree_map_get_key_compare_func (self, &_tmp2__target); + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + _tmp4_ = key; + _tmp5_ = cur; + _tmp6_ = _tmp5_->key; + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); + res = _tmp7_; + _tmp8_ = res; + if (_tmp8_ == 0) { + GeeTreeMapNode* _tmp9_; + _tmp9_ = cur; + result = _tmp9_; + return result; + } else { + gint _tmp10_; + _tmp10_ = res; + if (_tmp10_ < 0) { + GeeTreeMapNode* _tmp11_; + GeeTreeMapNode* _tmp12_; + GeeTreeMapNode* _tmp14_; + GeeTreeMapNode* _tmp15_; + _tmp11_ = cur; + _tmp12_ = _tmp11_->left; + if (_tmp12_ == NULL) { + GeeTreeMapNode* _tmp13_; + _tmp13_ = cur; + result = _tmp13_; + return result; + } + _tmp14_ = cur; + _tmp15_ = _tmp14_->left; + cur = _tmp15_; + } else { + GeeTreeMapNode* _tmp16_; + GeeTreeMapNode* _tmp17_; + GeeTreeMapNode* _tmp19_; + GeeTreeMapNode* _tmp20_; + _tmp16_ = cur; + _tmp17_ = _tmp16_->right; + if (_tmp17_ == NULL) { + GeeTreeMapNode* _tmp18_; + _tmp18_ = cur; + result = _tmp18_; + return result; + } + _tmp19_ = cur; + _tmp20_ = _tmp19_->right; + cur = _tmp20_; + } + } + } + result = NULL; + return result; } -static GeeTreeMapNodeColor gee_tree_map_node_color_flip (GeeTreeMapNodeColor self) { - GeeTreeMapNodeColor result = 0; - if (self == GEE_TREE_MAP_NODE_COLOR_RED) { - result = GEE_TREE_MAP_NODE_COLOR_BLACK; +static inline GeeTreeMapNode* gee_tree_map_find_lower (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeTreeMapNode* _tmp7_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + GeeTreeMapNode* _tmp13_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = key; + _tmp1_ = gee_tree_map_find_nearest (self, _tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = NULL; return result; + } + _tmp4_ = gee_tree_map_get_key_compare_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = node; + _tmp8_ = _tmp7_->key; + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); + if (_tmp9_ <= 0) { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = node; + _tmp11_ = _tmp10_->prev; + _tmp3_ = _tmp11_; } else { - result = GEE_TREE_MAP_NODE_COLOR_RED; - return result; + GeeTreeMapNode* _tmp12_; + _tmp12_ = node; + _tmp3_ = _tmp12_; } + _tmp13_ = _tmp3_; + result = _tmp13_; + return result; } -GType gee_tree_map_node_color_get_type (void) { - static volatile gsize gee_tree_map_node_color_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_node_color_type_id__volatile)) { - static const GEnumValue values[] = {{GEE_TREE_MAP_NODE_COLOR_RED, "GEE_TREE_MAP_NODE_COLOR_RED", "red"}, {GEE_TREE_MAP_NODE_COLOR_BLACK, "GEE_TREE_MAP_NODE_COLOR_BLACK", "black"}, {0, NULL, NULL}}; - GType gee_tree_map_node_color_type_id; - gee_tree_map_node_color_type_id = g_enum_register_static ("GeeTreeMapNodeColor", values); - g_once_init_leave (&gee_tree_map_node_color_type_id__volatile, gee_tree_map_node_color_type_id); +static inline GeeTreeMapNode* gee_tree_map_find_higher (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeTreeMapNode* _tmp7_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + GeeTreeMapNode* _tmp13_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = key; + _tmp1_ = gee_tree_map_find_nearest (self, _tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = NULL; + return result; } - return gee_tree_map_node_color_type_id__volatile; + _tmp4_ = gee_tree_map_get_key_compare_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = node; + _tmp8_ = _tmp7_->key; + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); + if (_tmp9_ >= 0) { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = node; + _tmp11_ = _tmp10_->next; + _tmp3_ = _tmp11_; + } else { + GeeTreeMapNode* _tmp12_; + _tmp12_ = node; + _tmp3_ = _tmp12_; + } + _tmp13_ = _tmp3_; + result = _tmp13_; + return result; } -static GeeTreeMapNode* gee_tree_map_node_new (gpointer key, gpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next) { - GeeTreeMapNode* self; - gpointer _tmp0_; - gpointer _tmp1_; +static inline GeeTreeMapNode* gee_tree_map_find_floor (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; GeeTreeMapNode* _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - GeeTreeMapNode* _tmp6_; - self = g_slice_new0 (GeeTreeMapNode); - gee_tree_map_node_instance_init (self); + GeeTreeMapNode* _tmp3_ = NULL; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeTreeMapNode* _tmp7_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + GeeTreeMapNode* _tmp13_; + g_return_val_if_fail (self != NULL, NULL); _tmp0_ = key; - key = NULL; - self->key = _tmp0_; - _tmp1_ = value; - value = NULL; - self->value = _tmp1_; - self->color = GEE_TREE_MAP_NODE_COLOR_RED; - _tmp2_ = prev; - self->prev = _tmp2_; - _tmp3_ = next; - self->next = _tmp3_; - _tmp4_ = prev; - if (_tmp4_ != NULL) { - GeeTreeMapNode* _tmp5_; - _tmp5_ = prev; - _tmp5_->next = self; + _tmp1_ = gee_tree_map_find_nearest (self, _tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = NULL; + return result; } - _tmp6_ = next; - if (_tmp6_ != NULL) { - GeeTreeMapNode* _tmp7_; - _tmp7_ = next; - _tmp7_->prev = self; + _tmp4_ = gee_tree_map_get_key_compare_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = node; + _tmp8_ = _tmp7_->key; + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); + if (_tmp9_ < 0) { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = node; + _tmp11_ = _tmp10_->prev; + _tmp3_ = _tmp11_; + } else { + GeeTreeMapNode* _tmp12_; + _tmp12_ = node; + _tmp3_ = _tmp12_; } - return self; + _tmp13_ = _tmp3_; + result = _tmp13_; + return result; } -static void gee_tree_map_node_flip (GeeTreeMapNode* self) { - GeeTreeMapNodeColor _tmp0_; - GeeTreeMapNodeColor _tmp1_ = 0; +static inline GeeTreeMapNode* gee_tree_map_find_ceil (GeeTreeMap* self, gconstpointer key) { + GeeTreeMapNode* result = NULL; + gconstpointer _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; GeeTreeMapNode* _tmp7_; - g_return_if_fail (self != NULL); - _tmp0_ = self->color; - _tmp1_ = gee_tree_map_node_color_flip (_tmp0_); - self->color = _tmp1_; - _tmp2_ = self->left; - if (_tmp2_ != NULL) { - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - GeeTreeMapNodeColor _tmp5_; - GeeTreeMapNodeColor _tmp6_ = 0; - _tmp3_ = self->left; - _tmp4_ = self->left; - _tmp5_ = _tmp4_->color; - _tmp6_ = gee_tree_map_node_color_flip (_tmp5_); - _tmp3_->color = _tmp6_; + gconstpointer _tmp8_; + gint _tmp9_ = 0; + GeeTreeMapNode* _tmp13_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = key; + _tmp1_ = gee_tree_map_find_nearest (self, _tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = NULL; + return result; } - _tmp7_ = self->right; - if (_tmp7_ != NULL) { - GeeTreeMapNode* _tmp8_; - GeeTreeMapNode* _tmp9_; - GeeTreeMapNodeColor _tmp10_; - GeeTreeMapNodeColor _tmp11_ = 0; - _tmp8_ = self->right; - _tmp9_ = self->right; - _tmp10_ = _tmp9_->color; - _tmp11_ = gee_tree_map_node_color_flip (_tmp10_); - _tmp8_->color = _tmp11_; + _tmp4_ = gee_tree_map_get_key_compare_func (self, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = node; + _tmp8_ = _tmp7_->key; + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); + if (_tmp9_ > 0) { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = node; + _tmp11_ = _tmp10_->next; + _tmp3_ = _tmp11_; + } else { + GeeTreeMapNode* _tmp12_; + _tmp12_ = node; + _tmp3_ = _tmp12_; } + _tmp13_ = _tmp3_; + result = _tmp13_; + return result; } -static void gee_tree_map_node_instance_init (GeeTreeMapNode * self) { -} - - -static void gee_tree_map_node_free (GeeTreeMapNode* self) { - _gee_tree_map_node_free0 (self->left); - _gee_tree_map_node_free0 (self->right); - g_slice_free (GeeTreeMapNode, self); -} - - -static GeeMapEntry* gee_tree_map_entry_entry_for (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { - GeeMapEntry* result = NULL; - GeeTreeMapNode* _tmp0_; - GeeMapEntry* _tmp1_; - GeeMapEntry* _tmp2_; - GeeMapEntry* _result_; - GeeTreeMapNode* _tmp3_; - GeeMapEntry* _tmp4_; - g_return_val_if_fail (node != NULL, NULL); - _tmp0_ = node; - _tmp1_ = _tmp0_->entry; - _tmp2_ = _g_object_ref0 (_tmp1_); - _result_ = _tmp2_; - _tmp3_ = node; - _tmp4_ = _tmp3_->entry; - if (_tmp4_ == NULL) { - GeeTreeMapNode* _tmp5_; - GeeTreeMapEntry* _tmp6_; - GeeTreeMapNode* _tmp7_; - GeeMapEntry* _tmp8_; - GeeMapEntry* _tmp9_; - GeeTreeMapNode* _tmp10_; - _tmp5_ = node; - _tmp6_ = gee_tree_map_entry_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp5_); - _g_object_unref0 (_result_); - _result_ = (GeeMapEntry*) _tmp6_; - _tmp7_ = node; - _tmp8_ = _result_; - _tmp7_->entry = _tmp8_; - _tmp9_ = _result_; - _tmp10_ = node; - g_object_add_weak_pointer ((GObject*) _tmp9_, (void**) (&_tmp10_->entry)); +static inline gpointer gee_tree_map_lift_null_key (GeeTreeMap* self, GeeTreeMapNode* node) { + gpointer result = NULL; + gconstpointer _tmp0_ = NULL; + GeeTreeMapNode* _tmp1_; + gconstpointer _tmp4_; + gpointer _tmp5_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = node; + if (_tmp1_ != NULL) { + GeeTreeMapNode* _tmp2_; + gconstpointer _tmp3_; + _tmp2_ = node; + _tmp3_ = _tmp2_->key; + _tmp0_ = _tmp3_; + } else { + _tmp0_ = NULL; } - result = _result_; + _tmp4_ = _tmp0_; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; return result; } -static GeeTreeMapEntry* gee_tree_map_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { - GeeTreeMapEntry * self = NULL; - GeeTreeMapNode* _tmp0_; - g_return_val_if_fail (node != NULL, NULL); - self = (GeeTreeMapEntry*) gee_map_entry_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); - self->priv->k_type = k_type; - self->priv->k_dup_func = k_dup_func; - self->priv->k_destroy_func = k_destroy_func; - self->priv->v_type = v_type; - self->priv->v_dup_func = v_dup_func; - self->priv->v_destroy_func = v_destroy_func; - _tmp0_ = node; - self->priv->_node = _tmp0_; - return self; +static gint gee_tree_map_real_get_size (GeeAbstractMap* base) { + gint result; + GeeTreeMap* self; + gint _tmp0_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_size; + result = _tmp0_; + return result; } -static GeeTreeMapEntry* gee_tree_map_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { - return gee_tree_map_entry_construct (GEE_TREE_MAP_TYPE_ENTRY, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, node); +static gboolean gee_tree_map_real_get_read_only (GeeAbstractMap* base) { + gboolean result; + GeeTreeMap* self; + self = (GeeTreeMap*) base; + result = FALSE; + return result; } -static gconstpointer gee_tree_map_entry_real_get_key (GeeMapEntry* base) { - gconstpointer result; - GeeTreeMapEntry* self; - GeeTreeMapNode* _tmp0_; - gconstpointer _tmp1_; - self = (GeeTreeMapEntry*) base; - _tmp0_ = self->priv->_node; - _tmp1_ = _tmp0_->key; - result = _tmp1_; +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static GeeSet* gee_tree_map_real_get_keys (GeeAbstractMap* base) { + GeeSet* result; + GeeTreeMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* keys; + GeeSortedSet* _tmp2_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_keys; + _tmp1_ = _g_object_ref0 (_tmp0_); + keys = _tmp1_; + _tmp2_ = self->priv->_keys; + if (_tmp2_ == NULL) { + GeeTreeMapKeySet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + _tmp3_ = gee_tree_map_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + _g_object_unref0 (keys); + keys = (GeeSortedSet*) _tmp3_; + _tmp4_ = keys; + self->priv->_keys = _tmp4_; + _tmp5_ = keys; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_keys)); + } + result = (GeeSet*) keys; return result; } -static gconstpointer gee_tree_map_entry_real_get_value (GeeMapEntry* base) { - gconstpointer result; - GeeTreeMapEntry* self; - GeeTreeMapNode* _tmp0_; - gconstpointer _tmp1_; - self = (GeeTreeMapEntry*) base; - _tmp0_ = self->priv->_node; - _tmp1_ = _tmp0_->value; +static GeeCollection* gee_tree_map_real_get_values (GeeAbstractMap* base) { + GeeCollection* result; + GeeTreeMap* self; + GeeCollection* _tmp0_; + GeeCollection* _tmp1_; + GeeCollection* values; + GeeCollection* _tmp2_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_values; + _tmp1_ = _g_object_ref0 (_tmp0_); + values = _tmp1_; + _tmp2_ = self->priv->_values; + if (_tmp2_ == NULL) { + GeeTreeMapValueCollection* _tmp3_; + GeeCollection* _tmp4_; + GeeCollection* _tmp5_; + _tmp3_ = gee_tree_map_value_collection_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + _g_object_unref0 (values); + values = (GeeCollection*) _tmp3_; + _tmp4_ = values; + self->priv->_values = _tmp4_; + _tmp5_ = values; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_values)); + } + result = values; + return result; +} + + +static GeeSet* gee_tree_map_real_get_entries (GeeAbstractMap* base) { + GeeSet* result; + GeeTreeMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* entries; + GeeSortedSet* _tmp2_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_entries; + _tmp1_ = _g_object_ref0 (_tmp0_); + entries = _tmp1_; + _tmp2_ = self->priv->_entries; + if (_tmp2_ == NULL) { + GeeTreeMapEntrySet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + _tmp3_ = gee_tree_map_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + _g_object_unref0 (entries); + entries = (GeeSortedSet*) _tmp3_; + _tmp4_ = entries; + self->priv->_entries = _tmp4_; + _tmp5_ = entries; + g_object_add_weak_pointer ((GObject*) _tmp5_, (void**) (&self->priv->_entries)); + } + result = (GeeSet*) entries; + return result; +} + + +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target) { + GCompareDataFunc result; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_key_compare_func; + _tmp0__target = self->priv->_key_compare_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; result = _tmp1_; return result; } -static void gee_tree_map_entry_real_set_value (GeeMapEntry* base, gconstpointer value) { - GeeTreeMapEntry* self; - GeeTreeMapNode* _tmp0_; - gconstpointer _tmp1_; - gpointer _tmp2_; - self = (GeeTreeMapEntry*) base; - _tmp0_ = self->priv->_node; - _tmp1_ = value; - _tmp2_ = ((_tmp1_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); - ((_tmp0_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp0_->value = (self->priv->v_destroy_func (_tmp0_->value), NULL)); - _tmp0_->value = _tmp2_; - g_object_notify ((GObject *) self, "value"); +static void gee_tree_map_set_key_compare_func (GeeTreeMap* self, GCompareDataFunc value, gpointer value_target) { + GCompareDataFunc _tmp0_; + void* _tmp0__target; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_key_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_compare_func_target_destroy_notify (self->priv->_key_compare_func_target), NULL); + self->priv->_key_compare_func = NULL; + self->priv->_key_compare_func_target = NULL; + self->priv->_key_compare_func_target_destroy_notify = NULL; + self->priv->_key_compare_func = _tmp0_; + self->priv->_key_compare_func_target = _tmp0__target; + self->priv->_key_compare_func_target_destroy_notify = NULL; } -static void gee_tree_map_entry_class_init (GeeTreeMapEntryClass * klass) { - gee_tree_map_entry_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapEntryPrivate)); - GEE_MAP_ENTRY_CLASS (klass)->get_key = gee_tree_map_entry_real_get_key; - GEE_MAP_ENTRY_CLASS (klass)->get_value = gee_tree_map_entry_real_get_value; - GEE_MAP_ENTRY_CLASS (klass)->set_value = gee_tree_map_entry_real_set_value; - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_tree_map_entry_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_KEY, g_param_spec_pointer ("key", "key", "key", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_VALUE, g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); +GeeEqualDataFunc gee_tree_map_get_value_equal_func (GeeTreeMap* self, gpointer* result_target) { + GeeEqualDataFunc result; + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + GeeEqualDataFunc _tmp1_; + void* _tmp1__target; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_value_equal_func; + _tmp0__target = self->priv->_value_equal_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; + return result; } -static void gee_tree_map_entry_instance_init (GeeTreeMapEntry * self) { - self->priv = GEE_TREE_MAP_ENTRY_GET_PRIVATE (self); +static void gee_tree_map_set_value_equal_func (GeeTreeMap* self, GeeEqualDataFunc value, gpointer value_target) { + GeeEqualDataFunc _tmp0_; + void* _tmp0__target; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; + self->priv->_value_equal_func = _tmp0_; + self->priv->_value_equal_func_target = _tmp0__target; + self->priv->_value_equal_func_target_destroy_notify = NULL; } -static void gee_tree_map_entry_finalize (GObject* obj) { - GeeTreeMapEntry * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); - G_OBJECT_CLASS (gee_tree_map_entry_parent_class)->finalize (obj); +static GeeSortedSet* gee_tree_map_real_get_ascending_keys (GeeAbstractSortedMap* base) { + GeeSortedSet* result; + GeeTreeMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* keys; + GeeSortedSet* _tmp2_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_keys; + _tmp1_ = _g_object_ref0 (_tmp0_); + keys = _tmp1_; + _tmp2_ = self->priv->_keys; + if (_tmp2_ == NULL) { + GeeTreeMapKeySet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + _tmp3_ = gee_tree_map_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + _g_object_unref0 (keys); + keys = (GeeSortedSet*) _tmp3_; + _tmp4_ = keys; + self->priv->_keys = _tmp4_; + _tmp5_ = keys; + g_object_add_weak_pointer ((GObject*) _tmp5_, &self->priv->_keys); + } + result = keys; + return result; } -static GType gee_tree_map_entry_get_type (void) { - static volatile gsize gee_tree_map_entry_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_entry_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntry), 0, (GInstanceInitFunc) gee_tree_map_entry_instance_init, NULL }; - GType gee_tree_map_entry_type_id; - gee_tree_map_entry_type_id = g_type_register_static (GEE_MAP_TYPE_ENTRY, "GeeTreeMapEntry", &g_define_type_info, 0); - g_once_init_leave (&gee_tree_map_entry_type_id__volatile, gee_tree_map_entry_type_id); +static GeeSortedSet* gee_tree_map_real_get_ascending_entries (GeeAbstractSortedMap* base) { + GeeSortedSet* result; + GeeTreeMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* entries; + GeeSortedSet* _tmp2_; + self = (GeeTreeMap*) base; + _tmp0_ = self->priv->_entries; + _tmp1_ = _g_object_ref0 (_tmp0_); + entries = _tmp1_; + _tmp2_ = self->priv->_entries; + if (_tmp2_ == NULL) { + GeeTreeMapEntrySet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + _tmp3_ = gee_tree_map_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, self); + _g_object_unref0 (entries); + entries = (GeeSortedSet*) _tmp3_; + _tmp4_ = entries; + self->priv->_entries = _tmp4_; + _tmp5_ = entries; + g_object_add_weak_pointer ((GObject*) _tmp5_, &self->priv->_entries); } - return gee_tree_map_entry_type_id__volatile; + result = entries; + return result; } -static void _vala_gee_tree_map_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapEntry * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); - switch (property_id) { - case GEE_TREE_MAP_ENTRY_KEY: - g_value_set_pointer (value, gee_map_entry_get_key ((GeeMapEntry*) self)); - break; - case GEE_TREE_MAP_ENTRY_VALUE: - g_value_set_pointer (value, gee_map_entry_get_value ((GeeMapEntry*) self)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; +static GeeTreeMapNodeColor gee_tree_map_node_color_flip (GeeTreeMapNodeColor self) { + GeeTreeMapNodeColor result = 0; + if (self == GEE_TREE_MAP_NODE_COLOR_RED) { + result = GEE_TREE_MAP_NODE_COLOR_BLACK; + return result; + } else { + result = GEE_TREE_MAP_NODE_COLOR_RED; + return result; } } -static void _vala_gee_tree_map_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapEntry * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); - switch (property_id) { - case GEE_TREE_MAP_ENTRY_VALUE: - gee_map_entry_set_value ((GeeMapEntry*) self, g_value_get_pointer (value)); - break; - case GEE_TREE_MAP_ENTRY_K_TYPE: - self->priv->k_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_ENTRY_K_DUP_FUNC: - self->priv->k_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_K_DESTROY_FUNC: - self->priv->k_destroy_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_V_TYPE: - self->priv->v_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_ENTRY_V_DUP_FUNC: - self->priv->v_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_V_DESTROY_FUNC: - self->priv->v_destroy_func = g_value_get_pointer (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; +GType gee_tree_map_node_color_get_type (void) { + static volatile gsize gee_tree_map_node_color_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_node_color_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_TREE_MAP_NODE_COLOR_RED, "GEE_TREE_MAP_NODE_COLOR_RED", "red"}, {GEE_TREE_MAP_NODE_COLOR_BLACK, "GEE_TREE_MAP_NODE_COLOR_BLACK", "black"}, {0, NULL, NULL}}; + GType gee_tree_map_node_color_type_id; + gee_tree_map_node_color_type_id = g_enum_register_static ("GeeTreeMapNodeColor", values); + g_once_init_leave (&gee_tree_map_node_color_type_id__volatile, gee_tree_map_node_color_type_id); } + return gee_tree_map_node_color_type_id__volatile; } -static GeeTreeMapKeySet* gee_tree_map_key_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapKeySet * self = NULL; - GeeTreeMap* _tmp0_; - GeeTreeMap* _tmp1_; - g_return_val_if_fail (map != NULL, NULL); - self = (GeeTreeMapKeySet*) gee_abstract_set_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func); - self->priv->k_type = k_type; - self->priv->k_dup_func = k_dup_func; - self->priv->k_destroy_func = k_destroy_func; - self->priv->v_type = v_type; - self->priv->v_dup_func = v_dup_func; - self->priv->v_destroy_func = v_destroy_func; - _tmp0_ = map; - _tmp1_ = _g_object_ref0 (_tmp0_); - _g_object_unref0 (self->priv->_map); - self->priv->_map = _tmp1_; +static GeeTreeMapNode* gee_tree_map_node_new (gpointer key, gpointer value, GeeTreeMapNode* prev, GeeTreeMapNode* next) { + GeeTreeMapNode* self; + gpointer _tmp0_; + gpointer _tmp1_; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeTreeMapNode* _tmp4_; + GeeTreeMapNode* _tmp6_; + self = g_slice_new0 (GeeTreeMapNode); + gee_tree_map_node_instance_init (self); + _tmp0_ = key; + key = NULL; + self->key = _tmp0_; + _tmp1_ = value; + value = NULL; + self->value = _tmp1_; + self->color = GEE_TREE_MAP_NODE_COLOR_RED; + _tmp2_ = prev; + self->prev = _tmp2_; + _tmp3_ = next; + self->next = _tmp3_; + _tmp4_ = prev; + if (_tmp4_ != NULL) { + GeeTreeMapNode* _tmp5_; + _tmp5_ = prev; + _tmp5_->next = self; + } + _tmp6_ = next; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; + _tmp7_ = next; + _tmp7_->prev = self; + } return self; } -static GeeTreeMapKeySet* gee_tree_map_key_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_key_set_construct (GEE_TREE_MAP_TYPE_KEY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static void gee_tree_map_node_flip (GeeTreeMapNode* self) { + GeeTreeMapNodeColor _tmp0_; + GeeTreeMapNodeColor _tmp1_ = 0; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp7_; + g_return_if_fail (self != NULL); + _tmp0_ = self->color; + _tmp1_ = gee_tree_map_node_color_flip (_tmp0_); + self->color = _tmp1_; + _tmp2_ = self->left; + if (_tmp2_ != NULL) { + GeeTreeMapNode* _tmp3_; + GeeTreeMapNode* _tmp4_; + GeeTreeMapNodeColor _tmp5_; + GeeTreeMapNodeColor _tmp6_ = 0; + _tmp3_ = self->left; + _tmp4_ = self->left; + _tmp5_ = _tmp4_->color; + _tmp6_ = gee_tree_map_node_color_flip (_tmp5_); + _tmp3_->color = _tmp6_; + } + _tmp7_ = self->right; + if (_tmp7_ != NULL) { + GeeTreeMapNode* _tmp8_; + GeeTreeMapNode* _tmp9_; + GeeTreeMapNodeColor _tmp10_; + GeeTreeMapNodeColor _tmp11_ = 0; + _tmp8_ = self->right; + _tmp9_ = self->right; + _tmp10_ = _tmp9_->color; + _tmp11_ = gee_tree_map_node_color_flip (_tmp10_); + _tmp8_->color = _tmp11_; + } } -static GeeIterator* gee_tree_map_key_set_real_iterator (GeeAbstractCollection* base) { - GeeTreeMapKeySet * self; - GeeIterator* result = NULL; - GeeTreeMap* _tmp0_; - GeeTreeMapKeyIterator* _tmp1_; - self = (GeeTreeMapKeySet*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_tree_map_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); - result = (GeeIterator*) _tmp1_; - return result; +static void gee_tree_map_node_instance_init (GeeTreeMapNode * self) { } -static gboolean gee_tree_map_key_set_real_add (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - self = (GeeTreeMapKeySet*) base; - g_assert_not_reached (); - return result; +static void gee_tree_map_node_free (GeeTreeMapNode* self) { + _gee_tree_map_node_free0 (self->left); + _gee_tree_map_node_free0 (self->right); + g_slice_free (GeeTreeMapNode, self); } -static void gee_tree_map_key_set_real_clear (GeeAbstractCollection* base) { - GeeTreeMapKeySet * self; - self = (GeeTreeMapKeySet*) base; - g_assert_not_reached (); +static GeeMapEntry* gee_tree_map_entry_entry_for (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { + GeeMapEntry* result = NULL; + GeeTreeMapNode* _tmp0_; + GeeMapEntry* _tmp1_; + GeeMapEntry* _tmp2_; + GeeMapEntry* _result_; + GeeMapEntry* _tmp3_; + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = node; + _tmp1_ = _tmp0_->entry; + _tmp2_ = _g_object_ref0 (_tmp1_); + _result_ = _tmp2_; + _tmp3_ = _result_; + if (_tmp3_ == NULL) { + GeeTreeMapNode* _tmp4_; + GeeTreeMapEntry* _tmp5_; + GeeTreeMapNode* _tmp6_; + GeeMapEntry* _tmp7_; + GeeMapEntry* _tmp8_; + GeeTreeMapNode* _tmp9_; + _tmp4_ = node; + _tmp5_ = gee_tree_map_entry_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp4_); + _g_object_unref0 (_result_); + _result_ = (GeeMapEntry*) _tmp5_; + _tmp6_ = node; + _tmp7_ = _result_; + _tmp6_->entry = _tmp7_; + _tmp8_ = _result_; + _tmp9_ = node; + g_object_add_weak_pointer ((GObject*) _tmp8_, (void**) (&_tmp9_->entry)); + } + result = _result_; + return result; } -static gboolean gee_tree_map_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - self = (GeeTreeMapKeySet*) base; - g_assert_not_reached (); - return result; +static GeeTreeMapEntry* gee_tree_map_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { + GeeTreeMapEntry * self = NULL; + GeeTreeMapNode* _tmp0_; + g_return_val_if_fail (node != NULL, NULL); + self = (GeeTreeMapEntry*) gee_map_entry_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = node; + self->priv->_node = _tmp0_; + return self; } -static gboolean gee_tree_map_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - GeeTreeMap* _tmp0_; - gconstpointer _tmp1_; - gboolean _tmp2_ = FALSE; - self = (GeeTreeMapKeySet*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = key; - _tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp1_); - result = _tmp2_; - return result; +static GeeTreeMapEntry* gee_tree_map_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMapNode* node) { + return gee_tree_map_entry_construct (GEE_TREE_MAP_TYPE_ENTRY, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, node); } -static gboolean gee_tree_map_key_set_real_add_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - self = (GeeTreeMapKeySet*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); +static gconstpointer gee_tree_map_entry_real_get_key (GeeMapEntry* base) { + gconstpointer result; + GeeTreeMapEntry* self; + GeeTreeMapNode* _tmp0_; + gconstpointer _tmp1_; + self = (GeeTreeMapEntry*) base; + _tmp0_ = self->priv->_node; + _tmp1_ = _tmp0_->key; + result = _tmp1_; return result; } -static gboolean gee_tree_map_key_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - self = (GeeTreeMapKeySet*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); +static gconstpointer gee_tree_map_entry_real_get_value (GeeMapEntry* base) { + gconstpointer result; + GeeTreeMapEntry* self; + GeeTreeMapNode* _tmp0_; + gconstpointer _tmp1_; + self = (GeeTreeMapEntry*) base; + _tmp0_ = self->priv->_node; + _tmp1_ = _tmp0_->value; + result = _tmp1_; return result; } -static gboolean gee_tree_map_key_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapKeySet * self; - gboolean result = FALSE; - self = (GeeTreeMapKeySet*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); - return result; +static void gee_tree_map_entry_real_set_value (GeeMapEntry* base, gconstpointer value) { + GeeTreeMapEntry* self; + GeeTreeMapNode* _tmp0_; + gconstpointer _tmp1_; + gpointer _tmp2_; + self = (GeeTreeMapEntry*) base; + _tmp0_ = self->priv->_node; + _tmp1_ = value; + _tmp2_ = ((_tmp1_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_); + ((_tmp0_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp0_->value = (self->priv->v_destroy_func (_tmp0_->value), NULL)); + _tmp0_->value = _tmp2_; + g_object_notify ((GObject *) self, "value"); } -static gint gee_tree_map_key_set_real_get_size (GeeAbstractCollection* base) { - gint result; - GeeTreeMapKeySet* self; - GeeTreeMap* _tmp0_; - gint _tmp1_; - gint _tmp2_; - self = (GeeTreeMapKeySet*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; - result = _tmp2_; +static gboolean gee_tree_map_entry_real_get_read_only (GeeMapEntry* base) { + gboolean result; + GeeTreeMapEntry* self; + self = (GeeTreeMapEntry*) base; + result = FALSE; return result; } -static void gee_tree_map_key_set_class_init (GeeTreeMapKeySetClass * klass) { - gee_tree_map_key_set_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapKeySetPrivate)); - GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_key_set_real_iterator; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_key_set_real_add; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_key_set_real_clear; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_key_set_real_remove; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_key_set_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_tree_map_key_set_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_tree_map_key_set_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_tree_map_key_set_real_retain_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_key_set_real_get_size; - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_key_set_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_key_set_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_tree_map_key_set_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +static void gee_tree_map_entry_class_init (GeeTreeMapEntryClass * klass) { + gee_tree_map_entry_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapEntryPrivate)); + GEE_MAP_ENTRY_CLASS (klass)->get_key = gee_tree_map_entry_real_get_key; + GEE_MAP_ENTRY_CLASS (klass)->get_value = gee_tree_map_entry_real_get_value; + GEE_MAP_ENTRY_CLASS (klass)->set_value = gee_tree_map_entry_real_set_value; + GEE_MAP_ENTRY_CLASS (klass)->get_read_only = gee_tree_map_entry_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_entry_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_KEY, g_param_spec_pointer ("key", "key", "key", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_VALUE, g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } -static void gee_tree_map_key_set_instance_init (GeeTreeMapKeySet * self) { - self->priv = GEE_TREE_MAP_KEY_SET_GET_PRIVATE (self); +static void gee_tree_map_entry_instance_init (GeeTreeMapEntry * self) { + self->priv = GEE_TREE_MAP_ENTRY_GET_PRIVATE (self); } -static void gee_tree_map_key_set_finalize (GObject* obj) { - GeeTreeMapKeySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); - _g_object_unref0 (self->priv->_map); - G_OBJECT_CLASS (gee_tree_map_key_set_parent_class)->finalize (obj); +static void gee_tree_map_entry_finalize (GObject* obj) { + GeeTreeMapEntry * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); + G_OBJECT_CLASS (gee_tree_map_entry_parent_class)->finalize (obj); } -static GType gee_tree_map_key_set_get_type (void) { - static volatile gsize gee_tree_map_key_set_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_key_set_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapKeySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_key_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapKeySet), 0, (GInstanceInitFunc) gee_tree_map_key_set_instance_init, NULL }; - GType gee_tree_map_key_set_type_id; - gee_tree_map_key_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeTreeMapKeySet", &g_define_type_info, 0); - g_once_init_leave (&gee_tree_map_key_set_type_id__volatile, gee_tree_map_key_set_type_id); +static GType gee_tree_map_entry_get_type (void) { + static volatile gsize gee_tree_map_entry_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_entry_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntry), 0, (GInstanceInitFunc) gee_tree_map_entry_instance_init, NULL }; + GType gee_tree_map_entry_type_id; + gee_tree_map_entry_type_id = g_type_register_static (GEE_MAP_TYPE_ENTRY, "GeeTreeMapEntry", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_entry_type_id__volatile, gee_tree_map_entry_type_id); } - return gee_tree_map_key_set_type_id__volatile; + return gee_tree_map_entry_type_id__volatile; } -static void _vala_gee_tree_map_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapKeySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); +static void _vala_gee_tree_map_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapEntry * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); switch (property_id) { - case GEE_TREE_MAP_KEY_SET_SIZE: - g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + case GEE_TREE_MAP_ENTRY_KEY: + g_value_set_pointer (value, gee_map_entry_get_key ((GeeMapEntry*) self)); + break; + case GEE_TREE_MAP_ENTRY_VALUE: + g_value_set_pointer (value, gee_map_entry_get_value ((GeeMapEntry*) self)); + break; + case GEE_TREE_MAP_ENTRY_READ_ONLY: + g_value_set_boolean (value, gee_map_entry_get_read_only ((GeeMapEntry*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -2747,26 +4344,29 @@ static void _vala_gee_tree_map_key_set_get_property (GObject * object, guint pro } -static void _vala_gee_tree_map_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapKeySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); +static void _vala_gee_tree_map_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapEntry * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY, GeeTreeMapEntry); switch (property_id) { - case GEE_TREE_MAP_KEY_SET_K_TYPE: + case GEE_TREE_MAP_ENTRY_VALUE: + gee_map_entry_set_value ((GeeMapEntry*) self, g_value_get_pointer (value)); + break; + case GEE_TREE_MAP_ENTRY_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_KEY_SET_K_DUP_FUNC: + case GEE_TREE_MAP_ENTRY_K_DUP_FUNC: self->priv->k_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC: + case GEE_TREE_MAP_ENTRY_K_DESTROY_FUNC: self->priv->k_destroy_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_SET_V_TYPE: + case GEE_TREE_MAP_ENTRY_V_TYPE: self->priv->v_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_KEY_SET_V_DUP_FUNC: + case GEE_TREE_MAP_ENTRY_V_DUP_FUNC: self->priv->v_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_SET_V_DESTROY_FUNC: + case GEE_TREE_MAP_ENTRY_V_DESTROY_FUNC: self->priv->v_destroy_func = g_value_get_pointer (value); break; default: @@ -2776,12 +4376,20 @@ static void _vala_gee_tree_map_key_set_set_property (GObject * object, guint pro } -static GeeTreeMapValueCollection* gee_tree_map_value_collection_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapValueCollection * self = NULL; +static GeeTreeMapRange* gee_tree_map_range_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after, gconstpointer before) { + GeeTreeMapRange* self = NULL; GeeTreeMap* _tmp0_; GeeTreeMap* _tmp1_; + GeeTreeMap* _tmp2_; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + gconstpointer _tmp5_; + gconstpointer _tmp6_; + gint _tmp7_ = 0; g_return_val_if_fail (map != NULL, NULL); - self = (GeeTreeMapValueCollection*) gee_abstract_collection_construct (object_type, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self = (GeeTreeMapRange*) g_type_create_instance (object_type); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; @@ -2790,477 +4398,867 @@ static GeeTreeMapValueCollection* gee_tree_map_value_collection_construct (GType self->priv->v_destroy_func = v_destroy_func; _tmp0_ = map; _tmp1_ = _g_object_ref0 (_tmp0_); - _g_object_unref0 (self->priv->_map); - self->priv->_map = _tmp1_; + _g_object_unref0 (self->priv->map); + self->priv->map = _tmp1_; + _tmp2_ = map; + _tmp3_ = gee_tree_map_get_key_compare_func (_tmp2_, &_tmp3__target); + _tmp4_ = _tmp3_; + _tmp4__target = _tmp3__target; + _tmp5_ = after; + _tmp6_ = before; + _tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target); + if (_tmp7_ < 0) { + gconstpointer _tmp8_; + gpointer _tmp9_; + gconstpointer _tmp10_; + gpointer _tmp11_; + _tmp8_ = after; + _tmp9_ = ((_tmp8_ != NULL) && (k_dup_func != NULL)) ? k_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + _k_destroy_func0 (self->priv->after); + self->priv->after = _tmp9_; + _tmp10_ = before; + _tmp11_ = ((_tmp10_ != NULL) && (k_dup_func != NULL)) ? k_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_); + _k_destroy_func0 (self->priv->before); + self->priv->before = _tmp11_; + self->priv->type = GEE_TREE_MAP_RANGE_TYPE_BOUNDED; + } else { + self->priv->type = GEE_TREE_MAP_RANGE_TYPE_EMPTY; + } return self; } -static GeeTreeMapValueCollection* gee_tree_map_value_collection_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_value_collection_construct (GEE_TREE_MAP_TYPE_VALUE_COLLECTION, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static GeeTreeMapRange* gee_tree_map_range_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after, gconstpointer before) { + return gee_tree_map_range_construct (GEE_TREE_MAP_TYPE_RANGE, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, after, before); } -static GeeIterator* gee_tree_map_value_collection_real_iterator (GeeAbstractCollection* base) { - GeeTreeMapValueCollection * self; - GeeIterator* result = NULL; +static GeeTreeMapRange* gee_tree_map_range_construct_head (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer before) { + GeeTreeMapRange* self = NULL; GeeTreeMap* _tmp0_; - GeeTreeMapValueIterator* _tmp1_; - self = (GeeTreeMapValueCollection*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_tree_map_value_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); - result = (GeeIterator*) _tmp1_; - return result; -} - - -static gboolean gee_tree_map_value_collection_real_add (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - self = (GeeTreeMapValueCollection*) base; - g_assert_not_reached (); - return result; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapRange*) g_type_create_instance (object_type); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->map); + self->priv->map = _tmp1_; + _tmp2_ = before; + _tmp3_ = ((_tmp2_ != NULL) && (k_dup_func != NULL)) ? k_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + _k_destroy_func0 (self->priv->before); + self->priv->before = _tmp3_; + self->priv->type = GEE_TREE_MAP_RANGE_TYPE_HEAD; + return self; } -static void gee_tree_map_value_collection_real_clear (GeeAbstractCollection* base) { - GeeTreeMapValueCollection * self; - self = (GeeTreeMapValueCollection*) base; - g_assert_not_reached (); +static GeeTreeMapRange* gee_tree_map_range_new_head (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer before) { + return gee_tree_map_range_construct_head (GEE_TREE_MAP_TYPE_RANGE, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, before); } -static gboolean gee_tree_map_value_collection_real_remove (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - self = (GeeTreeMapValueCollection*) base; - g_assert_not_reached (); - return result; +static GeeTreeMapRange* gee_tree_map_range_construct_tail (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after) { + GeeTreeMapRange* self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + gpointer _tmp3_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapRange*) g_type_create_instance (object_type); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->map); + self->priv->map = _tmp1_; + _tmp2_ = after; + _tmp3_ = ((_tmp2_ != NULL) && (k_dup_func != NULL)) ? k_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + _k_destroy_func0 (self->priv->after); + self->priv->after = _tmp3_; + self->priv->type = GEE_TREE_MAP_RANGE_TYPE_TAIL; + return self; } -static gboolean gee_tree_map_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - GeeIterator* _tmp0_ = NULL; - GeeIterator* it; - self = (GeeTreeMapValueCollection*) base; - _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); - it = _tmp0_; - while (TRUE) { - GeeIterator* _tmp1_; - gboolean _tmp2_ = FALSE; - GeeTreeMap* _tmp3_; - GEqualFunc _tmp4_; - GEqualFunc _tmp5_; - gconstpointer _tmp6_; - GeeIterator* _tmp7_; - gpointer _tmp8_ = NULL; - gpointer _tmp9_; - gboolean _tmp10_ = FALSE; - gboolean _tmp11_; - _tmp1_ = it; - _tmp2_ = gee_iterator_next (_tmp1_); - if (!_tmp2_) { - break; - } - _tmp3_ = self->priv->_map; - _tmp4_ = gee_tree_map_get_value_equal_func (_tmp3_); - _tmp5_ = _tmp4_; - _tmp6_ = key; - _tmp7_ = it; - _tmp8_ = gee_iterator_get (_tmp7_); - _tmp9_ = _tmp8_; - _tmp10_ = _tmp5_ (_tmp6_, _tmp9_); - _tmp11_ = _tmp10_; - ((_tmp9_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->v_destroy_func (_tmp9_), NULL)); - if (_tmp11_) { - result = TRUE; - _g_object_unref0 (it); - return result; - } - } - result = FALSE; - _g_object_unref0 (it); - return result; +static GeeTreeMapRange* gee_tree_map_range_new_tail (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, gconstpointer after) { + return gee_tree_map_range_construct_tail (GEE_TREE_MAP_TYPE_RANGE, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, after); } -static gboolean gee_tree_map_value_collection_real_add_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - self = (GeeTreeMapValueCollection*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); - return result; +static GeeTreeMapRange* gee_tree_map_range_construct_empty (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapRange* self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapRange*) g_type_create_instance (object_type); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->map); + self->priv->map = _tmp1_; + self->priv->type = GEE_TREE_MAP_RANGE_TYPE_EMPTY; + return self; } -static gboolean gee_tree_map_value_collection_real_remove_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - self = (GeeTreeMapValueCollection*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); - return result; +static GeeTreeMapRange* gee_tree_map_range_new_empty (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_range_construct_empty (GEE_TREE_MAP_TYPE_RANGE, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); } -static gboolean gee_tree_map_value_collection_real_retain_all (GeeAbstractCollection* base, GeeCollection* collection) { - GeeTreeMapValueCollection * self; - gboolean result = FALSE; - self = (GeeTreeMapValueCollection*) base; - g_return_val_if_fail (collection != NULL, FALSE); - g_assert_not_reached (); - return result; +static gpointer _gee_tree_map_range_ref0 (gpointer self) { + return self ? gee_tree_map_range_ref (self) : NULL; } -static gint gee_tree_map_value_collection_real_get_size (GeeAbstractCollection* base) { - gint result; - GeeTreeMapValueCollection* self; - GeeTreeMap* _tmp0_; - gint _tmp1_; - gint _tmp2_; - self = (GeeTreeMapValueCollection*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; - result = _tmp2_; - return result; +static GeeTreeMapRange* gee_tree_map_range_cut_head (GeeTreeMapRange* self, gconstpointer after) { + GeeTreeMapRange* result = NULL; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_HEAD: + { + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapRange* _tmp4_; + _tmp1_ = self->priv->map; + _tmp2_ = after; + _tmp3_ = self->priv->before; + _tmp4_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp2_, _tmp3_); + result = _tmp4_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_TAIL: + { + GeeTreeMap* _tmp5_; + GeeTreeMap* _tmp6_; + gconstpointer _tmp7_; + gconstpointer _tmp8_; + gpointer _tmp9_ = NULL; + gpointer _tmp10_; + GeeTreeMapRange* _tmp11_; + GeeTreeMapRange* _tmp12_; + _tmp5_ = self->priv->map; + _tmp6_ = self->priv->map; + _tmp7_ = after; + _tmp8_ = self->priv->after; + _tmp9_ = gee_tree_map_max (_tmp6_, _tmp7_, _tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_tree_map_range_new_tail (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp5_, _tmp10_); + _tmp12_ = _tmp11_; + ((_tmp10_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp10_ = (self->priv->k_destroy_func (_tmp10_), NULL)); + result = _tmp12_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + GeeTreeMapRange* _tmp13_; + _tmp13_ = _gee_tree_map_range_ref0 (self); + result = _tmp13_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_BOUNDED: + { + GeeTreeMap* _tmp14_; + gconstpointer _tmp15_; + gconstpointer _tmp16_; + gpointer _tmp17_ = NULL; + gpointer _after; + GeeTreeMap* _tmp18_; + gconstpointer _tmp19_; + gconstpointer _tmp20_; + GeeTreeMapRange* _tmp21_; + _tmp14_ = self->priv->map; + _tmp15_ = after; + _tmp16_ = self->priv->after; + _tmp17_ = gee_tree_map_max (_tmp14_, _tmp15_, _tmp16_); + _after = _tmp17_; + _tmp18_ = self->priv->map; + _tmp19_ = _after; + _tmp20_ = self->priv->before; + _tmp21_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp18_, _tmp19_, _tmp20_); + result = _tmp21_; + ((_after == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_after = (self->priv->k_destroy_func (_after), NULL)); + return result; + } + default: + { + g_assert_not_reached (); + } + } } -static void gee_tree_map_value_collection_class_init (GeeTreeMapValueCollectionClass * klass) { - gee_tree_map_value_collection_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapValueCollectionPrivate)); - GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_value_collection_real_iterator; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_value_collection_real_add; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_value_collection_real_clear; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_value_collection_real_remove; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_value_collection_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_tree_map_value_collection_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_tree_map_value_collection_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_tree_map_value_collection_real_retain_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_value_collection_real_get_size; - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_value_collection_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_value_collection_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_tree_map_value_collection_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +static GeeTreeMapRange* gee_tree_map_range_cut_tail (GeeTreeMapRange* self, gconstpointer before) { + GeeTreeMapRange* result = NULL; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_HEAD: + { + GeeTreeMap* _tmp1_; + GeeTreeMap* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_ = NULL; + gpointer _tmp6_; + GeeTreeMapRange* _tmp7_; + GeeTreeMapRange* _tmp8_; + _tmp1_ = self->priv->map; + _tmp2_ = self->priv->map; + _tmp3_ = before; + _tmp4_ = self->priv->before; + _tmp5_ = gee_tree_map_min (_tmp2_, _tmp3_, _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_tree_map_range_new_head (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp6_); + _tmp8_ = _tmp7_; + ((_tmp6_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp6_ = (self->priv->k_destroy_func (_tmp6_), NULL)); + result = _tmp8_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_TAIL: + { + GeeTreeMap* _tmp9_; + gconstpointer _tmp10_; + gconstpointer _tmp11_; + GeeTreeMapRange* _tmp12_; + _tmp9_ = self->priv->map; + _tmp10_ = self->priv->after; + _tmp11_ = before; + _tmp12_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp9_, _tmp10_, _tmp11_); + result = _tmp12_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + GeeTreeMapRange* _tmp13_; + _tmp13_ = _gee_tree_map_range_ref0 (self); + result = _tmp13_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_BOUNDED: + { + GeeTreeMap* _tmp14_; + gconstpointer _tmp15_; + gconstpointer _tmp16_; + gpointer _tmp17_ = NULL; + gpointer _before; + GeeTreeMap* _tmp18_; + gconstpointer _tmp19_; + gconstpointer _tmp20_; + GeeTreeMapRange* _tmp21_; + _tmp14_ = self->priv->map; + _tmp15_ = before; + _tmp16_ = self->priv->before; + _tmp17_ = gee_tree_map_min (_tmp14_, _tmp15_, _tmp16_); + _before = _tmp17_; + _tmp18_ = self->priv->map; + _tmp19_ = self->priv->after; + _tmp20_ = _before; + _tmp21_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp18_, _tmp19_, _tmp20_); + result = _tmp21_; + ((_before == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_before = (self->priv->k_destroy_func (_before), NULL)); + return result; + } + default: + { + g_assert_not_reached (); + } + } } -static void gee_tree_map_value_collection_instance_init (GeeTreeMapValueCollection * self) { - self->priv = GEE_TREE_MAP_VALUE_COLLECTION_GET_PRIVATE (self); +static GeeTreeMapRange* gee_tree_map_range_cut (GeeTreeMapRange* self, gconstpointer after, gconstpointer before) { + GeeTreeMapRange* result = NULL; + GeeTreeMapRangeType _tmp0_; + gpointer _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; + GeeTreeMapRangeType _tmp4_; + gboolean _tmp6_; + gconstpointer _tmp13_; + gpointer _tmp14_; + gpointer _before; + gpointer _tmp15_ = NULL; + gboolean _tmp16_ = FALSE; + GeeTreeMapRangeType _tmp17_; + gboolean _tmp19_; + gconstpointer _tmp26_; + gpointer _tmp27_; + gpointer _after; + GeeTreeMap* _tmp28_; + gconstpointer _tmp29_; + gconstpointer _tmp30_; + GeeTreeMapRange* _tmp31_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->type; + if (_tmp0_ == GEE_TREE_MAP_RANGE_TYPE_EMPTY) { + GeeTreeMapRange* _tmp1_; + _tmp1_ = _gee_tree_map_range_ref0 (self); + result = _tmp1_; + return result; + } + _tmp4_ = self->priv->type; + if (_tmp4_ == GEE_TREE_MAP_RANGE_TYPE_HEAD) { + _tmp3_ = TRUE; + } else { + GeeTreeMapRangeType _tmp5_; + _tmp5_ = self->priv->type; + _tmp3_ = _tmp5_ == GEE_TREE_MAP_RANGE_TYPE_BOUNDED; + } + _tmp6_ = _tmp3_; + if (_tmp6_) { + GeeTreeMap* _tmp7_; + gconstpointer _tmp8_; + gconstpointer _tmp9_; + gpointer _tmp10_ = NULL; + _tmp7_ = self->priv->map; + _tmp8_ = before; + _tmp9_ = self->priv->before; + _tmp10_ = gee_tree_map_min (_tmp7_, _tmp8_, _tmp9_); + ((_tmp2_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->k_destroy_func (_tmp2_), NULL)); + _tmp2_ = _tmp10_; + } else { + gconstpointer _tmp11_; + gpointer _tmp12_; + _tmp11_ = before; + _tmp12_ = ((_tmp11_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_); + ((_tmp2_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->k_destroy_func (_tmp2_), NULL)); + _tmp2_ = _tmp12_; + } + _tmp13_ = _tmp2_; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _before = _tmp14_; + _tmp17_ = self->priv->type; + if (_tmp17_ == GEE_TREE_MAP_RANGE_TYPE_TAIL) { + _tmp16_ = TRUE; + } else { + GeeTreeMapRangeType _tmp18_; + _tmp18_ = self->priv->type; + _tmp16_ = _tmp18_ == GEE_TREE_MAP_RANGE_TYPE_BOUNDED; + } + _tmp19_ = _tmp16_; + if (_tmp19_) { + GeeTreeMap* _tmp20_; + gconstpointer _tmp21_; + gconstpointer _tmp22_; + gpointer _tmp23_ = NULL; + _tmp20_ = self->priv->map; + _tmp21_ = after; + _tmp22_ = self->priv->after; + _tmp23_ = gee_tree_map_max (_tmp20_, _tmp21_, _tmp22_); + ((_tmp15_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp15_ = (self->priv->k_destroy_func (_tmp15_), NULL)); + _tmp15_ = _tmp23_; + } else { + gconstpointer _tmp24_; + gpointer _tmp25_; + _tmp24_ = after; + _tmp25_ = ((_tmp24_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp24_) : ((gpointer) _tmp24_); + ((_tmp15_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp15_ = (self->priv->k_destroy_func (_tmp15_), NULL)); + _tmp15_ = _tmp25_; + } + _tmp26_ = _tmp15_; + _tmp27_ = ((_tmp26_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp26_) : ((gpointer) _tmp26_); + _after = _tmp27_; + _tmp28_ = self->priv->map; + _tmp29_ = _after; + _tmp30_ = _before; + _tmp31_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp28_, _tmp29_, _tmp30_); + result = _tmp31_; + ((_after == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_after = (self->priv->k_destroy_func (_after), NULL)); + ((_tmp15_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp15_ = (self->priv->k_destroy_func (_tmp15_), NULL)); + ((_before == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_before = (self->priv->k_destroy_func (_before), NULL)); + ((_tmp2_ == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (_tmp2_ = (self->priv->k_destroy_func (_tmp2_), NULL)); + return result; } -static void gee_tree_map_value_collection_finalize (GObject* obj) { - GeeTreeMapValueCollection * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); - _g_object_unref0 (self->priv->_map); - G_OBJECT_CLASS (gee_tree_map_value_collection_parent_class)->finalize (obj); +static gboolean gee_tree_map_range_in_range (GeeTreeMapRange* self, gconstpointer key) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeTreeMapRangeType _tmp1_; + gboolean _tmp4_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp1_ = self->priv->type; + if (_tmp1_ == GEE_TREE_MAP_RANGE_TYPE_EMPTY) { + _tmp0_ = FALSE; + } else { + gconstpointer _tmp2_; + gint _tmp3_ = 0; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_compare_range (self, _tmp2_); + _tmp0_ = _tmp3_ == 0; + } + _tmp4_ = _tmp0_; + result = _tmp4_; + return result; } -static GType gee_tree_map_value_collection_get_type (void) { - static volatile gsize gee_tree_map_value_collection_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_value_collection_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapValueCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_value_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapValueCollection), 0, (GInstanceInitFunc) gee_tree_map_value_collection_instance_init, NULL }; - GType gee_tree_map_value_collection_type_id; - gee_tree_map_value_collection_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeTreeMapValueCollection", &g_define_type_info, 0); - g_once_init_leave (&gee_tree_map_value_collection_type_id__volatile, gee_tree_map_value_collection_type_id); +static gint gee_tree_map_range_compare_range (GeeTreeMapRange* self, gconstpointer key) { + gint result = 0; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, 0); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_HEAD: + { + gint _tmp1_ = 0; + GeeTreeMap* _tmp2_; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + gconstpointer _tmp5_; + gconstpointer _tmp6_; + gint _tmp7_ = 0; + gint _tmp8_; + _tmp2_ = self->priv->map; + _tmp3_ = gee_tree_map_get_key_compare_func (_tmp2_, &_tmp3__target); + _tmp4_ = _tmp3_; + _tmp4__target = _tmp3__target; + _tmp5_ = key; + _tmp6_ = self->priv->before; + _tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target); + if (_tmp7_ < 0) { + _tmp1_ = 0; + } else { + _tmp1_ = 1; + } + _tmp8_ = _tmp1_; + result = _tmp8_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_TAIL: + { + gint _tmp9_ = 0; + GeeTreeMap* _tmp10_; + GCompareDataFunc _tmp11_; + void* _tmp11__target; + GCompareDataFunc _tmp12_; + void* _tmp12__target; + gconstpointer _tmp13_; + gconstpointer _tmp14_; + gint _tmp15_ = 0; + gint _tmp16_; + _tmp10_ = self->priv->map; + _tmp11_ = gee_tree_map_get_key_compare_func (_tmp10_, &_tmp11__target); + _tmp12_ = _tmp11_; + _tmp12__target = _tmp11__target; + _tmp13_ = key; + _tmp14_ = self->priv->after; + _tmp15_ = _tmp12_ (_tmp13_, _tmp14_, _tmp12__target); + if (_tmp15_ >= 0) { + _tmp9_ = 0; + } else { + _tmp9_ = -1; + } + _tmp16_ = _tmp9_; + result = _tmp16_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + result = 0; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_BOUNDED: + { + gint _tmp17_ = 0; + GeeTreeMap* _tmp18_; + GCompareDataFunc _tmp19_; + void* _tmp19__target; + GCompareDataFunc _tmp20_; + void* _tmp20__target; + gconstpointer _tmp21_; + gconstpointer _tmp22_; + gint _tmp23_ = 0; + gint _tmp32_; + _tmp18_ = self->priv->map; + _tmp19_ = gee_tree_map_get_key_compare_func (_tmp18_, &_tmp19__target); + _tmp20_ = _tmp19_; + _tmp20__target = _tmp19__target; + _tmp21_ = key; + _tmp22_ = self->priv->after; + _tmp23_ = _tmp20_ (_tmp21_, _tmp22_, _tmp20__target); + if (_tmp23_ >= 0) { + gint _tmp24_ = 0; + GeeTreeMap* _tmp25_; + GCompareDataFunc _tmp26_; + void* _tmp26__target; + GCompareDataFunc _tmp27_; + void* _tmp27__target; + gconstpointer _tmp28_; + gconstpointer _tmp29_; + gint _tmp30_ = 0; + gint _tmp31_; + _tmp25_ = self->priv->map; + _tmp26_ = gee_tree_map_get_key_compare_func (_tmp25_, &_tmp26__target); + _tmp27_ = _tmp26_; + _tmp27__target = _tmp26__target; + _tmp28_ = key; + _tmp29_ = self->priv->before; + _tmp30_ = _tmp27_ (_tmp28_, _tmp29_, _tmp27__target); + if (_tmp30_ < 0) { + _tmp24_ = 0; + } else { + _tmp24_ = 1; + } + _tmp31_ = _tmp24_; + _tmp17_ = _tmp31_; + } else { + _tmp17_ = -1; + } + _tmp32_ = _tmp17_; + result = _tmp32_; + return result; + } + default: + { + g_assert_not_reached (); + } } - return gee_tree_map_value_collection_type_id__volatile; } -static void _vala_gee_tree_map_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapValueCollection * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); - switch (property_id) { - case GEE_TREE_MAP_VALUE_COLLECTION_SIZE: - g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); - break; +static gboolean gee_tree_map_range_empty_submap (GeeTreeMapRange* self) { + gboolean result = FALSE; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_HEAD: + { + gboolean _tmp1_ = FALSE; + GeeTreeMap* _tmp2_; + GeeTreeMapNode* _tmp3_; + gboolean _tmp8_; + _tmp2_ = self->priv->map; + _tmp3_ = _tmp2_->priv->first; + if (_tmp3_ == NULL) { + _tmp1_ = TRUE; + } else { + GeeTreeMap* _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp4_ = self->priv->map; + _tmp5_ = _tmp4_->priv->first; + _tmp6_ = _tmp5_->key; + _tmp7_ = gee_tree_map_range_in_range (self, _tmp6_); + _tmp1_ = !_tmp7_; + } + _tmp8_ = _tmp1_; + result = _tmp8_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_TAIL: + { + gboolean _tmp9_ = FALSE; + GeeTreeMap* _tmp10_; + GeeTreeMapNode* _tmp11_; + gboolean _tmp16_; + _tmp10_ = self->priv->map; + _tmp11_ = _tmp10_->priv->last; + if (_tmp11_ == NULL) { + _tmp9_ = TRUE; + } else { + GeeTreeMap* _tmp12_; + GeeTreeMapNode* _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp12_ = self->priv->map; + _tmp13_ = _tmp12_->priv->last; + _tmp14_ = _tmp13_->key; + _tmp15_ = gee_tree_map_range_in_range (self, _tmp14_); + _tmp9_ = !_tmp15_; + } + _tmp16_ = _tmp9_; + result = _tmp16_; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + result = TRUE; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_BOUNDED: + { + GeeTreeMapNode* _tmp17_ = NULL; + _tmp17_ = gee_tree_map_range_first (self); + result = _tmp17_ == NULL; + return result; + } default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; + { + g_assert_not_reached (); + } } } -static void _vala_gee_tree_map_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapValueCollection * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); - switch (property_id) { - case GEE_TREE_MAP_VALUE_COLLECTION_K_TYPE: - self->priv->k_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_VALUE_COLLECTION_K_DUP_FUNC: - self->priv->k_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_COLLECTION_K_DESTROY_FUNC: - self->priv->k_destroy_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_COLLECTION_V_TYPE: - self->priv->v_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_VALUE_COLLECTION_V_DUP_FUNC: - self->priv->v_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_COLLECTION_V_DESTROY_FUNC: - self->priv->v_destroy_func = g_value_get_pointer (value); - break; +static GeeTreeMapNode* gee_tree_map_range_first (GeeTreeMapRange* self) { + GeeTreeMapNode* result = NULL; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + result = NULL; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_HEAD: + { + GeeTreeMap* _tmp1_; + GeeTreeMapNode* _tmp2_; + _tmp1_ = self->priv->map; + _tmp2_ = _tmp1_->priv->first; + result = _tmp2_; + return result; + } default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; + { + GeeTreeMap* _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapNode* _tmp5_ = NULL; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->after; + _tmp5_ = gee_tree_map_find_floor (_tmp3_, _tmp4_); + result = _tmp5_; + return result; + } } } -static GeeTreeMapEntrySet* gee_tree_map_entry_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapEntrySet * self = NULL; - GeeTreeMap* _tmp0_; - GeeTreeMap* _tmp1_; - g_return_val_if_fail (map != NULL, NULL); - self = (GeeTreeMapEntrySet*) gee_abstract_set_construct (object_type, GEE_MAP_TYPE_ENTRY, (GBoxedCopyFunc) g_object_ref, g_object_unref); - self->priv->k_type = k_type; - self->priv->k_dup_func = k_dup_func; - self->priv->k_destroy_func = k_destroy_func; - self->priv->v_type = v_type; - self->priv->v_dup_func = v_dup_func; - self->priv->v_destroy_func = v_destroy_func; - _tmp0_ = map; - _tmp1_ = _g_object_ref0 (_tmp0_); - _g_object_unref0 (self->priv->_map); - self->priv->_map = _tmp1_; - return self; +static GeeTreeMapNode* gee_tree_map_range_last (GeeTreeMapRange* self) { + GeeTreeMapNode* result = NULL; + GeeTreeMapRangeType _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->type; + switch (_tmp0_) { + case GEE_TREE_MAP_RANGE_TYPE_EMPTY: + { + result = NULL; + return result; + } + case GEE_TREE_MAP_RANGE_TYPE_TAIL: + { + GeeTreeMap* _tmp1_; + GeeTreeMapNode* _tmp2_; + _tmp1_ = self->priv->map; + _tmp2_ = _tmp1_->priv->last; + result = _tmp2_; + return result; + } + default: + { + GeeTreeMap* _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapNode* _tmp5_ = NULL; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->before; + _tmp5_ = gee_tree_map_find_lower (_tmp3_, _tmp4_); + result = _tmp5_; + return result; + } + } } -static GeeTreeMapEntrySet* gee_tree_map_entry_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_entry_set_construct (GEE_TREE_MAP_TYPE_ENTRY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static void gee_tree_map_value_range_init (GValue* value) { + value->data[0].v_pointer = NULL; } -static GeeIterator* gee_tree_map_entry_set_real_iterator (GeeAbstractCollection* base) { - GeeTreeMapEntrySet * self; - GeeIterator* result = NULL; - GeeTreeMap* _tmp0_; - GeeTreeMapEntryIterator* _tmp1_; - self = (GeeTreeMapEntrySet*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_tree_map_entry_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); - result = (GeeIterator*) _tmp1_; - return result; +static void gee_tree_map_value_range_free_value (GValue* value) { + if (value->data[0].v_pointer) { + gee_tree_map_range_unref (value->data[0].v_pointer); + } } -static gboolean gee_tree_map_entry_set_real_add (GeeAbstractCollection* base, GeeMapEntry* entry) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entry != NULL, FALSE); - g_assert_not_reached (); - return result; +static void gee_tree_map_value_range_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = gee_tree_map_range_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } } -static void gee_tree_map_entry_set_real_clear (GeeAbstractCollection* base) { - GeeTreeMapEntrySet * self; - self = (GeeTreeMapEntrySet*) base; - g_assert_not_reached (); +static gpointer gee_tree_map_value_range_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; } -static gboolean gee_tree_map_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entry != NULL, FALSE); - g_assert_not_reached (); - return result; +static gchar* gee_tree_map_value_range_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + GeeTreeMapRange* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = gee_tree_map_range_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; } -static gboolean gee_tree_map_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - GeeTreeMap* _tmp0_; - GeeMapEntry* _tmp1_; - gconstpointer _tmp2_; - gconstpointer _tmp3_; - GeeMapEntry* _tmp4_; - gconstpointer _tmp5_; - gconstpointer _tmp6_; - gboolean _tmp7_ = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entry != NULL, FALSE); - _tmp0_ = self->priv->_map; - _tmp1_ = entry; - _tmp2_ = gee_map_entry_get_key (_tmp1_); - _tmp3_ = _tmp2_; - _tmp4_ = entry; - _tmp5_ = gee_map_entry_get_value (_tmp4_); - _tmp6_ = _tmp5_; - _tmp7_ = gee_abstract_map_has ((GeeAbstractMap*) _tmp0_, _tmp3_, _tmp6_); - result = _tmp7_; - return result; +static gchar* gee_tree_map_value_range_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + GeeTreeMapRange** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = gee_tree_map_range_ref (value->data[0].v_pointer); + } + return NULL; } -static gboolean gee_tree_map_entry_set_real_add_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entries != NULL, FALSE); - g_assert_not_reached (); - return result; +static GParamSpec* gee_tree_map_param_spec_range (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + GeeTreeMapParamSpecRange* spec; + g_return_val_if_fail (g_type_is_a (object_type, GEE_TREE_MAP_TYPE_RANGE), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); } -static gboolean gee_tree_map_entry_set_real_remove_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entries != NULL, FALSE); - g_assert_not_reached (); - return result; +static gpointer gee_tree_map_value_get_range (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TREE_MAP_TYPE_RANGE), NULL); + return value->data[0].v_pointer; } -static gboolean gee_tree_map_entry_set_real_retain_all (GeeAbstractCollection* base, GeeCollection* entries) { - GeeTreeMapEntrySet * self; - gboolean result = FALSE; - self = (GeeTreeMapEntrySet*) base; - g_return_val_if_fail (entries != NULL, FALSE); - g_assert_not_reached (); - return result; -} - +static void gee_tree_map_value_set_range (GValue* value, gpointer v_object) { + GeeTreeMapRange* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TREE_MAP_TYPE_RANGE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TREE_MAP_TYPE_RANGE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + gee_tree_map_range_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_tree_map_range_unref (old); + } +} -static gint gee_tree_map_entry_set_real_get_size (GeeAbstractCollection* base) { - gint result; - GeeTreeMapEntrySet* self; - GeeTreeMap* _tmp0_; - gint _tmp1_; - gint _tmp2_; - self = (GeeTreeMapEntrySet*) base; - _tmp0_ = self->priv->_map; - _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); - _tmp2_ = _tmp1_; - result = _tmp2_; - return result; + +static void gee_tree_map_value_take_range (GValue* value, gpointer v_object) { + GeeTreeMapRange* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TREE_MAP_TYPE_RANGE)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TREE_MAP_TYPE_RANGE)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + gee_tree_map_range_unref (old); + } } -static void gee_tree_map_entry_set_class_init (GeeTreeMapEntrySetClass * klass) { - gee_tree_map_entry_set_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapEntrySetPrivate)); - GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_entry_set_real_iterator; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_entry_set_real_add; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_entry_set_real_clear; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_entry_set_real_remove; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_entry_set_real_contains; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_tree_map_entry_set_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_tree_map_entry_set_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_tree_map_entry_set_real_retain_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_entry_set_real_get_size; - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_set_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_set_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_tree_map_entry_set_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +static void gee_tree_map_range_class_init (GeeTreeMapRangeClass * klass) { + gee_tree_map_range_parent_class = g_type_class_peek_parent (klass); + GEE_TREE_MAP_RANGE_CLASS (klass)->finalize = gee_tree_map_range_finalize; + g_type_class_add_private (klass, sizeof (GeeTreeMapRangePrivate)); } -static void gee_tree_map_entry_set_instance_init (GeeTreeMapEntrySet * self) { - self->priv = GEE_TREE_MAP_ENTRY_SET_GET_PRIVATE (self); +static void gee_tree_map_range_instance_init (GeeTreeMapRange * self) { + self->priv = GEE_TREE_MAP_RANGE_GET_PRIVATE (self); + self->ref_count = 1; } -static void gee_tree_map_entry_set_finalize (GObject* obj) { - GeeTreeMapEntrySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); - _g_object_unref0 (self->priv->_map); - G_OBJECT_CLASS (gee_tree_map_entry_set_parent_class)->finalize (obj); +static void gee_tree_map_range_finalize (GeeTreeMapRange* obj) { + GeeTreeMapRange * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_RANGE, GeeTreeMapRange); + _g_object_unref0 (self->priv->map); + ((self->priv->after == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (self->priv->after = (self->priv->k_destroy_func (self->priv->after), NULL)); + ((self->priv->before == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (self->priv->before = (self->priv->k_destroy_func (self->priv->before), NULL)); } -static GType gee_tree_map_entry_set_get_type (void) { - static volatile gsize gee_tree_map_entry_set_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_entry_set_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntrySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntrySet), 0, (GInstanceInitFunc) gee_tree_map_entry_set_instance_init, NULL }; - GType gee_tree_map_entry_set_type_id; - gee_tree_map_entry_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeTreeMapEntrySet", &g_define_type_info, 0); - g_once_init_leave (&gee_tree_map_entry_set_type_id__volatile, gee_tree_map_entry_set_type_id); +static GType gee_tree_map_range_get_type (void) { + static volatile gsize gee_tree_map_range_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_range_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { gee_tree_map_value_range_init, gee_tree_map_value_range_free_value, gee_tree_map_value_range_copy_value, gee_tree_map_value_range_peek_pointer, "p", gee_tree_map_value_range_collect_value, "p", gee_tree_map_value_range_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapRangeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_range_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapRange), 0, (GInstanceInitFunc) gee_tree_map_range_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType gee_tree_map_range_type_id; + gee_tree_map_range_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeTreeMapRange", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&gee_tree_map_range_type_id__volatile, gee_tree_map_range_type_id); } - return gee_tree_map_entry_set_type_id__volatile; + return gee_tree_map_range_type_id__volatile; } -static void _vala_gee_tree_map_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapEntrySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); - switch (property_id) { - case GEE_TREE_MAP_ENTRY_SET_SIZE: - g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } +static gpointer gee_tree_map_range_ref (gpointer instance) { + GeeTreeMapRange* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; } -static void _vala_gee_tree_map_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapEntrySet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); - switch (property_id) { - case GEE_TREE_MAP_ENTRY_SET_K_TYPE: - self->priv->k_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_ENTRY_SET_K_DUP_FUNC: - self->priv->k_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_SET_K_DESTROY_FUNC: - self->priv->k_destroy_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_SET_V_TYPE: - self->priv->v_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_ENTRY_SET_V_DUP_FUNC: - self->priv->v_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_ENTRY_SET_V_DESTROY_FUNC: - self->priv->v_destroy_func = g_value_get_pointer (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; +static void gee_tree_map_range_unref (gpointer instance) { + GeeTreeMapRange* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + GEE_TREE_MAP_RANGE_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); } } -static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapNodeIterator * self = NULL; +static GeeTreeMapSubMap* gee_tree_map_sub_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubMap * self = NULL; GeeTreeMap* _tmp0_; GeeTreeMap* _tmp1_; - GeeTreeMap* _tmp2_; - gint _tmp3_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapRange* _tmp3_; g_return_val_if_fail (map != NULL, NULL); - self = (GeeTreeMapNodeIterator*) g_object_new (object_type, NULL); + g_return_val_if_fail (range != NULL, NULL); + self = (GeeTreeMapSubMap*) gee_abstract_bidir_sorted_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; @@ -3269,442 +5267,6038 @@ static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct (GType objec self->priv->v_destroy_func = v_destroy_func; _tmp0_ = map; _tmp1_ = _g_object_ref0 (_tmp0_); - _g_object_unref0 (self->_map); - self->_map = _tmp1_; - _tmp2_ = self->_map; - _tmp3_ = _tmp2_->priv->stamp; - self->stamp = _tmp3_; + _g_object_unref0 (self->priv->map); + self->priv->map = _tmp1_; + _tmp2_ = range; + _tmp3_ = _gee_tree_map_range_ref0 (_tmp2_); + _gee_tree_map_range_unref0 (self->priv->range); + self->priv->range = _tmp3_; return self; } -static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_node_iterator_construct (GEE_TREE_MAP_TYPE_NODE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static GeeTreeMapSubMap* gee_tree_map_sub_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_map_construct (GEE_TREE_MAP_TYPE_SUB_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); } -static gboolean gee_tree_map_node_iterator_next (GeeTreeMapNodeIterator* self) { +static gboolean gee_tree_map_sub_map_real_has_key (GeeAbstractMap* base, gconstpointer key) { + GeeTreeMapSubMap * self; gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMapNode* _tmp3_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = self->current; - if (_tmp3_ != NULL) { - GeeTreeMapNode* _tmp4_; - GeeTreeMapNode* _tmp5_; - _tmp4_ = self->current; - _tmp5_ = _tmp4_->next; - if (_tmp5_ != NULL) { - GeeTreeMapNode* _tmp6_; - GeeTreeMapNode* _tmp7_; - _tmp6_ = self->current; - _tmp7_ = _tmp6_->next; - self->current = _tmp7_; - result = TRUE; - return result; - } else { - result = FALSE; - return result; - } + gboolean _tmp0_ = FALSE; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp7_; + self = (GeeTreeMapSubMap*) base; + _tmp1_ = self->priv->range; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_in_range (_tmp1_, _tmp2_); + if (_tmp3_) { + GeeTreeMap* _tmp4_; + gconstpointer _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp4_ = self->priv->map; + _tmp5_ = key; + _tmp6_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _tmp5_); + _tmp0_ = _tmp6_; } else { - gboolean _tmp8_ = FALSE; - GeeTreeMapNode* _tmp9_; - gboolean _tmp11_; - _tmp9_ = self->_next; - if (_tmp9_ == NULL) { - GeeTreeMapNode* _tmp10_; - _tmp10_ = self->_prev; - _tmp8_ = _tmp10_ == NULL; - } else { - _tmp8_ = FALSE; - } - _tmp11_ = _tmp8_; - if (_tmp11_) { - GeeTreeMap* _tmp12_; - GeeTreeMapNode* _tmp13_; - GeeTreeMapNode* _tmp14_; - _tmp12_ = self->_map; - _tmp13_ = _tmp12_->priv->first; - self->current = _tmp13_; - _tmp14_ = self->current; - result = _tmp14_ != NULL; - return result; - } else { - GeeTreeMapNode* _tmp15_; - GeeTreeMapNode* _tmp16_; - GeeTreeMapNode* _tmp17_; - _tmp15_ = self->_next; - self->current = _tmp15_; - _tmp16_ = self->current; - if (_tmp16_ != NULL) { - self->_next = NULL; - self->_prev = NULL; - } - _tmp17_ = self->current; - result = _tmp17_ != NULL; - return result; - } + _tmp0_ = FALSE; } + _tmp7_ = _tmp0_; + result = _tmp7_; + return result; } -static gboolean gee_tree_map_node_iterator_has_next (GeeTreeMapNodeIterator* self) { +static gboolean gee_tree_map_sub_map_real_has (GeeAbstractMap* base, gconstpointer key, gconstpointer value) { + GeeTreeMapSubMap * self; gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; + gboolean _tmp0_ = FALSE; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; gboolean _tmp3_ = FALSE; - gboolean _tmp4_ = FALSE; - gboolean _tmp5_ = FALSE; - gboolean _tmp6_ = FALSE; - gboolean _tmp7_ = FALSE; - GeeTreeMapNode* _tmp8_; - gboolean _tmp10_; - gboolean _tmp12_; - gboolean _tmp15_; - gboolean _tmp20_; - gboolean _tmp26_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp8_ = self->current; - if (_tmp8_ == NULL) { - GeeTreeMapNode* _tmp9_; - _tmp9_ = self->_next; - _tmp7_ = _tmp9_ == NULL; + gboolean _tmp8_; + self = (GeeTreeMapSubMap*) base; + _tmp1_ = self->priv->range; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_in_range (_tmp1_, _tmp2_); + if (_tmp3_) { + GeeTreeMap* _tmp4_; + gconstpointer _tmp5_; + gconstpointer _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp4_ = self->priv->map; + _tmp5_ = key; + _tmp6_ = value; + _tmp7_ = gee_abstract_map_has ((GeeAbstractMap*) _tmp4_, _tmp5_, _tmp6_); + _tmp0_ = _tmp7_; } else { - _tmp7_ = FALSE; + _tmp0_ = FALSE; } - _tmp10_ = _tmp7_; - if (_tmp10_) { - GeeTreeMapNode* _tmp11_; - _tmp11_ = self->_prev; - _tmp6_ = _tmp11_ == NULL; + _tmp8_ = _tmp0_; + result = _tmp8_; + return result; +} + + +static gpointer gee_tree_map_sub_map_real_get (GeeAbstractMap* base, gconstpointer key) { + GeeTreeMapSubMap * self; + gpointer result = NULL; + gpointer _tmp0_ = NULL; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + self = (GeeTreeMapSubMap*) base; + _tmp1_ = self->priv->range; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_in_range (_tmp1_, _tmp2_); + if (_tmp3_) { + GeeTreeMap* _tmp4_; + gconstpointer _tmp5_; + gpointer _tmp6_ = NULL; + _tmp4_ = self->priv->map; + _tmp5_ = key; + _tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp4_, _tmp5_); + ((_tmp0_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp0_ = (self->priv->v_destroy_func (_tmp0_), NULL)); + _tmp0_ = _tmp6_; } else { - _tmp6_ = FALSE; + ((_tmp0_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp0_ = (self->priv->v_destroy_func (_tmp0_), NULL)); + _tmp0_ = NULL; } - _tmp12_ = _tmp6_; - if (_tmp12_) { - GeeTreeMap* _tmp13_; - GeeTreeMapNode* _tmp14_; - _tmp13_ = self->_map; - _tmp14_ = _tmp13_->priv->first; - _tmp5_ = _tmp14_ != NULL; - } else { - _tmp5_ = FALSE; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_map_real_set (GeeAbstractMap* base, gconstpointer key, gconstpointer value) { + GeeTreeMapSubMap * self; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_in_range (_tmp0_, _tmp1_); + if (_tmp2_) { + GeeTreeMap* _tmp3_; + gconstpointer _tmp4_; + gconstpointer _tmp5_; + _tmp3_ = self->priv->map; + _tmp4_ = key; + _tmp5_ = value; + gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp4_, _tmp5_); } - _tmp15_ = _tmp5_; - if (_tmp15_) { - _tmp4_ = TRUE; - } else { - gboolean _tmp16_ = FALSE; - GeeTreeMapNode* _tmp17_; - gboolean _tmp19_; - _tmp17_ = self->current; - if (_tmp17_ == NULL) { - GeeTreeMapNode* _tmp18_; +} + + +static gboolean gee_tree_map_sub_map_real_unset (GeeAbstractMap* base, gconstpointer key, gpointer* value) { + GeeTreeMapSubMap * self; + gpointer _vala_value = NULL; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp8_; + self = (GeeTreeMapSubMap*) base; + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = NULL; + _tmp1_ = self->priv->range; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_in_range (_tmp1_, _tmp2_); + if (_tmp3_) { + GeeTreeMap* _tmp4_; + gconstpointer _tmp5_; + gpointer _tmp6_ = NULL; + gboolean _tmp7_ = FALSE; + _tmp4_ = self->priv->map; + _tmp5_ = key; + _tmp7_ = gee_abstract_map_unset ((GeeAbstractMap*) _tmp4_, _tmp5_, &_tmp6_); + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + _vala_value = _tmp6_; + _tmp0_ = _tmp7_; + } else { + _tmp0_ = FALSE; + } + _tmp8_ = _tmp0_; + result = _tmp8_; + if (value) { + *value = _vala_value; + } else { + ((_vala_value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_vala_value = (self->priv->v_destroy_func (_vala_value), NULL)); + } + return result; +} + + +static void gee_tree_map_sub_map_real_clear (GeeAbstractMap* base) { + GeeTreeMapSubMap * self; + self = (GeeTreeMapSubMap*) base; + { + GeeMapIterator* _tmp0_ = NULL; + GeeMapIterator* iterator; + _tmp0_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) self); + iterator = _tmp0_; + { + gboolean _tmp1_; + _tmp1_ = TRUE; + while (TRUE) { + gboolean _tmp2_; + GeeMapIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + GeeMapIterator* _tmp5_; + _tmp2_ = _tmp1_; + if (!_tmp2_) { + } + _tmp1_ = FALSE; + _tmp3_ = iterator; + _tmp4_ = gee_map_iterator_next (_tmp3_); + if (!_tmp4_) { + break; + } + _tmp5_ = iterator; + gee_map_iterator_unset (_tmp5_); + } + } + _g_object_unref0 (iterator); + } +} + + +static GeeMapIterator* gee_tree_map_sub_map_real_map_iterator (GeeAbstractMap* base) { + GeeTreeMapSubMap * self; + GeeMapIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubMapIterator* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->map; + _tmp1_ = self->priv->range; + _tmp2_ = gee_tree_map_sub_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeMapIterator*) _tmp2_; + return result; +} + + +static GeeBidirMapIterator* gee_tree_map_sub_map_real_bidir_map_iterator (GeeAbstractBidirSortedMap* base) { + GeeTreeMapSubMap * self; + GeeBidirMapIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubMapIterator* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->map; + _tmp1_ = self->priv->range; + _tmp2_ = gee_tree_map_sub_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeBidirMapIterator*) _tmp2_; + return result; +} + + +static GeeSortedMap* gee_tree_map_sub_map_real_head_map (GeeAbstractSortedMap* base, gconstpointer before) { + GeeTreeMapSubMap * self; + GeeSortedMap* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_ = NULL; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubMap* _tmp5_; + GeeSortedMap* _tmp6_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->map; + _tmp1_ = self->priv->range; + _tmp2_ = before; + _tmp3_ = gee_tree_map_range_cut_tail (_tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedMap*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedMap* gee_tree_map_sub_map_real_tail_map (GeeAbstractSortedMap* base, gconstpointer after) { + GeeTreeMapSubMap * self; + GeeSortedMap* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_ = NULL; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubMap* _tmp5_; + GeeSortedMap* _tmp6_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->map; + _tmp1_ = self->priv->range; + _tmp2_ = after; + _tmp3_ = gee_tree_map_range_cut_head (_tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedMap*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedMap* gee_tree_map_sub_map_real_sub_map (GeeAbstractSortedMap* base, gconstpointer after, gconstpointer before) { + GeeTreeMapSubMap * self; + GeeSortedMap* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapRange* _tmp4_ = NULL; + GeeTreeMapRange* _tmp5_; + GeeTreeMapSubMap* _tmp6_; + GeeSortedMap* _tmp7_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->map; + _tmp1_ = self->priv->range; + _tmp2_ = after; + _tmp3_ = before; + _tmp4_ = gee_tree_map_range_cut (_tmp1_, _tmp2_, _tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_tree_map_sub_map_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp5_); + _tmp7_ = (GeeSortedMap*) _tmp6_; + _gee_tree_map_range_unref0 (_tmp5_); + result = _tmp7_; + return result; +} + + +static gint gee_tree_map_sub_map_real_get_size (GeeAbstractMap* base) { + gint result; + GeeTreeMapSubMap* self; + GeeSet* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + gint _tmp3_; + gint _tmp4_; + gint _tmp5_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = gee_abstract_map_get_keys ((GeeMap*) self); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_; + _tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp2_); + result = _tmp5_; + return result; +} + + +static gboolean gee_tree_map_sub_map_get_is_empty (GeeTreeMapSubMap* self) { + gboolean result; + GeeSet* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + gboolean _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = gee_abstract_map_get_keys ((GeeMap*) self); + _tmp1_ = _tmp0_; + _tmp2_ = _tmp1_; + _tmp3_ = gee_collection_get_is_empty ((GeeCollection*) _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp2_); + result = _tmp5_; + return result; +} + + +static GeeSet* gee_tree_map_sub_map_real_get_keys (GeeAbstractMap* base) { + GeeSet* result; + GeeTreeMapSubMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* keys; + GeeSortedSet* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->_keys; + _tmp1_ = _g_object_ref0 (_tmp0_); + keys = _tmp1_; + _tmp2_ = self->priv->_keys; + if (_tmp2_ == NULL) { + GeeTreeMap* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->range; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_, _tmp4_); + _g_object_unref0 (keys); + keys = (GeeSortedSet*) _tmp5_; + _tmp6_ = keys; + self->priv->_keys = _tmp6_; + _tmp7_ = keys; + g_object_add_weak_pointer ((GObject*) _tmp7_, &self->priv->_keys); + } + result = (GeeSet*) keys; + return result; +} + + +static GeeCollection* gee_tree_map_sub_map_real_get_values (GeeAbstractMap* base) { + GeeCollection* result; + GeeTreeMapSubMap* self; + GeeCollection* _tmp0_; + GeeCollection* _tmp1_; + GeeCollection* values; + GeeCollection* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->_values; + _tmp1_ = _g_object_ref0 (_tmp0_); + values = _tmp1_; + _tmp2_ = self->priv->_values; + if (_tmp2_ == NULL) { + GeeTreeMap* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubValueCollection* _tmp5_; + GeeCollection* _tmp6_; + GeeCollection* _tmp7_; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->range; + _tmp5_ = gee_tree_map_sub_value_collection_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_, _tmp4_); + _g_object_unref0 (values); + values = (GeeCollection*) _tmp5_; + _tmp6_ = values; + self->priv->_values = _tmp6_; + _tmp7_ = values; + g_object_add_weak_pointer ((GObject*) _tmp7_, &self->priv->_values); + } + result = values; + return result; +} + + +static GeeSet* gee_tree_map_sub_map_real_get_entries (GeeAbstractMap* base) { + GeeSet* result; + GeeTreeMapSubMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* entries; + GeeSortedSet* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->_entries; + _tmp1_ = _g_object_ref0 (_tmp0_); + entries = _tmp1_; + _tmp2_ = self->priv->_entries; + if (_tmp2_ == NULL) { + GeeTreeMap* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubEntrySet* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->range; + _tmp5_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_, _tmp4_); + _g_object_unref0 (entries); + entries = (GeeSortedSet*) _tmp5_; + _tmp6_ = entries; + self->priv->_entries = _tmp6_; + _tmp7_ = entries; + g_object_add_weak_pointer ((GObject*) _tmp7_, &self->priv->_entries); + } + result = (GeeSet*) entries; + return result; +} + + +static gboolean gee_tree_map_sub_map_real_get_read_only (GeeAbstractMap* base) { + gboolean result; + GeeTreeMapSubMap* self; + self = (GeeTreeMapSubMap*) base; + result = TRUE; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_map_real_get_ascending_keys (GeeAbstractSortedMap* base) { + GeeSortedSet* result; + GeeTreeMapSubMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* keys; + GeeSortedSet* _tmp2_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->_keys; + _tmp1_ = _g_object_ref0 (_tmp0_); + keys = _tmp1_; + _tmp2_ = self->priv->_keys; + if (_tmp2_ == NULL) { + GeeTreeMap* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->range; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_, _tmp4_); + _g_object_unref0 (keys); + keys = (GeeSortedSet*) _tmp5_; + _tmp6_ = keys; + self->priv->_keys = _tmp6_; + _tmp7_ = keys; + g_object_add_weak_pointer ((GObject*) _tmp7_, &self->priv->_keys); + } + result = keys; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_map_real_get_ascending_entries (GeeAbstractSortedMap* base) { + GeeSortedSet* result; + GeeTreeMapSubMap* self; + GeeSortedSet* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* entries; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp8_; + GeeSortedSet* _tmp9_; + self = (GeeTreeMapSubMap*) base; + _tmp0_ = self->priv->_entries; + _tmp1_ = _g_object_ref0 (_tmp0_); + entries = _tmp1_; + _tmp2_ = self->priv->_entries; + if (_tmp2_ == NULL) { + GeeTreeMap* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubEntrySet* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + _tmp3_ = self->priv->map; + _tmp4_ = self->priv->range; + _tmp5_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_, _tmp4_); + _g_object_unref0 (entries); + entries = (GeeSortedSet*) _tmp5_; + _tmp6_ = entries; + self->priv->_entries = _tmp6_; + _tmp7_ = entries; + g_object_add_weak_pointer ((GObject*) _tmp7_, &self->priv->_entries); + } + _tmp8_ = self->priv->_entries; + _tmp9_ = _g_object_ref0 (_tmp8_); + result = _tmp9_; + _g_object_unref0 (entries); + return result; +} + + +static void gee_tree_map_sub_map_class_init (GeeTreeMapSubMapClass * klass) { + gee_tree_map_sub_map_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubMapPrivate)); + GEE_ABSTRACT_MAP_CLASS (klass)->has_key = gee_tree_map_sub_map_real_has_key; + GEE_ABSTRACT_MAP_CLASS (klass)->has = gee_tree_map_sub_map_real_has; + GEE_ABSTRACT_MAP_CLASS (klass)->get = gee_tree_map_sub_map_real_get; + GEE_ABSTRACT_MAP_CLASS (klass)->set = gee_tree_map_sub_map_real_set; + GEE_ABSTRACT_MAP_CLASS (klass)->unset = gee_tree_map_sub_map_real_unset; + GEE_ABSTRACT_MAP_CLASS (klass)->clear = gee_tree_map_sub_map_real_clear; + GEE_ABSTRACT_MAP_CLASS (klass)->map_iterator = gee_tree_map_sub_map_real_map_iterator; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->bidir_map_iterator = gee_tree_map_sub_map_real_bidir_map_iterator; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->head_map = gee_tree_map_sub_map_real_head_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->tail_map = gee_tree_map_sub_map_real_tail_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->sub_map = gee_tree_map_sub_map_real_sub_map; + GEE_ABSTRACT_MAP_CLASS (klass)->get_size = gee_tree_map_sub_map_real_get_size; + GEE_ABSTRACT_MAP_CLASS (klass)->get_keys = gee_tree_map_sub_map_real_get_keys; + GEE_ABSTRACT_MAP_CLASS (klass)->get_values = gee_tree_map_sub_map_real_get_values; + GEE_ABSTRACT_MAP_CLASS (klass)->get_entries = gee_tree_map_sub_map_real_get_entries; + GEE_ABSTRACT_MAP_CLASS (klass)->get_read_only = gee_tree_map_sub_map_real_get_read_only; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->get_ascending_keys = gee_tree_map_sub_map_real_get_ascending_keys; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->get_ascending_entries = gee_tree_map_sub_map_real_get_ascending_entries; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_map_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_map_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_sub_map_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_KEYS, g_param_spec_object ("keys", "keys", "keys", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_VALUES, g_param_spec_object ("values", "values", "values", GEE_TYPE_COLLECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ENTRIES, g_param_spec_object ("entries", "entries", "entries", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ASCENDING_KEYS, g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ASCENDING_ENTRIES, g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_sub_map_instance_init (GeeTreeMapSubMap * self) { + self->priv = GEE_TREE_MAP_SUB_MAP_GET_PRIVATE (self); +} + + +static void gee_tree_map_sub_map_finalize (GObject* obj) { + GeeTreeMapSubMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMap); + _g_object_unref0 (self->priv->map); + _gee_tree_map_range_unref0 (self->priv->range); + G_OBJECT_CLASS (gee_tree_map_sub_map_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_sub_map_get_type (void) { + static volatile gsize gee_tree_map_sub_map_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_map_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubMap), 0, (GInstanceInitFunc) gee_tree_map_sub_map_instance_init, NULL }; + GType gee_tree_map_sub_map_type_id; + gee_tree_map_sub_map_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, "GeeTreeMapSubMap", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_sub_map_type_id__volatile, gee_tree_map_sub_map_type_id); + } + return gee_tree_map_sub_map_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMap); + switch (property_id) { + case GEE_TREE_MAP_SUB_MAP_SIZE: + g_value_set_int (value, gee_abstract_map_get_size ((GeeAbstractMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_IS_EMPTY: + g_value_set_boolean (value, gee_tree_map_sub_map_get_is_empty (self)); + break; + case GEE_TREE_MAP_SUB_MAP_KEYS: + g_value_take_object (value, gee_abstract_map_get_keys ((GeeAbstractMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_VALUES: + g_value_take_object (value, gee_abstract_map_get_values ((GeeAbstractMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_ENTRIES: + g_value_take_object (value, gee_abstract_map_get_entries ((GeeAbstractMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_READ_ONLY: + g_value_set_boolean (value, gee_abstract_map_get_read_only ((GeeAbstractMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_ASCENDING_KEYS: + g_value_take_object (value, gee_abstract_sorted_map_get_ascending_keys ((GeeAbstractSortedMap*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_ASCENDING_ENTRIES: + g_value_take_object (value, gee_abstract_sorted_map_get_ascending_entries ((GeeAbstractSortedMap*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubMap * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMap); + switch (property_id) { + case GEE_TREE_MAP_SUB_MAP_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_MAP_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_MAP_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapKeySet* gee_tree_map_key_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapKeySet * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapKeySet*) gee_abstract_bidir_sorted_set_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; + return self; +} + + +static GeeTreeMapKeySet* gee_tree_map_key_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_key_set_construct (GEE_TREE_MAP_TYPE_KEY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeIterator* gee_tree_map_key_set_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapKeySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapKeyIterator* _tmp1_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_tree_map_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + result = (GeeIterator*) _tmp1_; + return result; +} + + +static gboolean gee_tree_map_key_set_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapKeySet * self; + gboolean result = FALSE; + self = (GeeTreeMapKeySet*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_key_set_real_clear (GeeAbstractCollection* base) { + GeeTreeMapKeySet * self; + self = (GeeTreeMapKeySet*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapKeySet * self; + gboolean result = FALSE; + self = (GeeTreeMapKeySet*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapKeySet * self; + gboolean result = FALSE; + GeeTreeMap* _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = key; + _tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_first (GeeAbstractSortedSet* base) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + GeeTreeMap* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = _tmp0_->priv->first; + _vala_assert (_tmp1_ != NULL, "_map.first != null"); + _tmp2_ = self->priv->_map; + _tmp3_ = _tmp2_->priv->first; + _tmp4_ = _tmp3_->key; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_last (GeeAbstractSortedSet* base) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + GeeTreeMap* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = _tmp0_->priv->last; + _vala_assert (_tmp1_ != NULL, "_map.last != null"); + _tmp2_ = self->priv->_map; + _tmp3_ = _tmp2_->priv->last; + _tmp4_ = _tmp3_->key; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; + return result; +} + + +static GeeBidirIterator* gee_tree_map_key_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { + GeeTreeMapKeySet * self; + GeeBidirIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapKeyIterator* _tmp1_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_tree_map_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + result = (GeeBidirIterator*) _tmp1_; + return result; +} + + +static GeeSortedSet* gee_tree_map_key_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { + GeeTreeMapKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = before; + _tmp3_ = gee_tree_map_range_new_head (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedSet* gee_tree_map_key_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { + GeeTreeMapKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = after; + _tmp3_ = gee_tree_map_range_new_tail (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedSet* gee_tree_map_key_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) { + GeeTreeMapKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapRange* _tmp4_; + GeeTreeMapRange* _tmp5_; + GeeTreeMapSubKeySet* _tmp6_; + GeeSortedSet* _tmp7_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = after; + _tmp3_ = before; + _tmp4_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp2_, _tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp5_); + _tmp7_ = (GeeSortedSet*) _tmp6_; + _gee_tree_map_range_unref0 (_tmp5_); + result = _tmp7_; + return result; +} + + +static GeeIterator* gee_tree_map_key_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item) { + GeeTreeMapKeySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + gconstpointer _tmp1_; + GeeTreeMapNode* _tmp2_ = NULL; + GeeTreeMapNode* node; + GeeTreeMapNode* _tmp3_; + GeeTreeMap* _tmp4_; + GeeTreeMapNode* _tmp5_; + GeeTreeMapKeyIterator* _tmp6_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_tree_map_find_node (_tmp0_, _tmp1_); + node = _tmp2_; + _tmp3_ = node; + if (_tmp3_ == NULL) { + result = NULL; + return result; + } + _tmp4_ = self->priv->_map; + _tmp5_ = node; + _tmp6_ = gee_tree_map_key_iterator_new_pointing (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp4_, _tmp5_); + result = (GeeIterator*) _tmp6_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + gpointer _tmp4_ = NULL; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = item; + _tmp3_ = gee_tree_map_find_lower (_tmp1_, _tmp2_); + _tmp4_ = gee_tree_map_lift_null_key (_tmp0_, _tmp3_); + result = _tmp4_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + gpointer _tmp4_ = NULL; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = item; + _tmp3_ = gee_tree_map_find_higher (_tmp1_, _tmp2_); + _tmp4_ = gee_tree_map_lift_null_key (_tmp0_, _tmp3_); + result = _tmp4_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + gpointer _tmp4_ = NULL; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = item; + _tmp3_ = gee_tree_map_find_floor (_tmp1_, _tmp2_); + _tmp4_ = gee_tree_map_lift_null_key (_tmp0_, _tmp3_); + result = _tmp4_; + return result; +} + + +static gpointer gee_tree_map_key_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item) { + GeeTreeMapKeySet * self; + gpointer result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + gpointer _tmp4_ = NULL; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = item; + _tmp3_ = gee_tree_map_find_ceil (_tmp1_, _tmp2_); + _tmp4_ = gee_tree_map_lift_null_key (_tmp0_, _tmp3_); + result = _tmp4_; + return result; +} + + +static gint gee_tree_map_key_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapKeySet* self; + GeeTreeMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeTreeMapKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_tree_map_key_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapKeySet* self; + self = (GeeTreeMapKeySet*) base; + result = TRUE; + return result; +} + + +static void gee_tree_map_key_set_class_init (GeeTreeMapKeySetClass * klass) { + gee_tree_map_key_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapKeySetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_key_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_key_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_key_set_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_key_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_key_set_real_contains; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_map_key_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_map_key_set_real_last; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_map_key_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_map_key_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_map_key_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_map_key_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_map_key_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_map_key_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_map_key_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_map_key_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_map_key_set_real_ceil; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_key_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_key_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_key_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_key_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_key_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_key_set_instance_init (GeeTreeMapKeySet * self) { + self->priv = GEE_TREE_MAP_KEY_SET_GET_PRIVATE (self); +} + + +static void gee_tree_map_key_set_finalize (GObject* obj) { + GeeTreeMapKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); + _g_object_unref0 (self->priv->_map); + G_OBJECT_CLASS (gee_tree_map_key_set_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_key_set_get_type (void) { + static volatile gsize gee_tree_map_key_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_key_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapKeySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_key_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapKeySet), 0, (GInstanceInitFunc) gee_tree_map_key_set_instance_init, NULL }; + GType gee_tree_map_key_set_type_id; + gee_tree_map_key_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeMapKeySet", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_key_set_type_id__volatile, gee_tree_map_key_set_type_id); + } + return gee_tree_map_key_set_type_id__volatile; +} + + +static void _vala_gee_tree_map_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); + switch (property_id) { + case GEE_TREE_MAP_KEY_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_KEY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_SET, GeeTreeMapKeySet); + switch (property_id) { + case GEE_TREE_MAP_KEY_SET_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_KEY_SET_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_SET_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_SET_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_KEY_SET_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_SET_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubKeySet* gee_tree_map_sub_key_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubKeySet * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + self = (GeeTreeMapSubKeySet*) gee_abstract_bidir_sorted_set_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + gee_tree_map_sub_key_set_set_map (self, _tmp0_); + _tmp1_ = range; + gee_tree_map_sub_key_set_set_range (self, _tmp1_); + return self; +} + + +static GeeTreeMapSubKeySet* gee_tree_map_sub_key_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_key_set_construct (GEE_TREE_MAP_TYPE_SUB_KEY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeIterator* gee_tree_map_sub_key_set_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapSubKeySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubKeyIterator* _tmp2_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_tree_map_sub_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeIterator*) _tmp2_; + return result; +} + + +static gboolean gee_tree_map_sub_key_set_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gboolean result = FALSE; + self = (GeeTreeMapSubKeySet*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_sub_key_set_real_clear (GeeAbstractCollection* base) { + GeeTreeMapSubKeySet * self; + self = (GeeTreeMapSubKeySet*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_sub_key_set_real_remove (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gboolean result = FALSE; + self = (GeeTreeMapSubKeySet*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_sub_key_set_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp7_; + self = (GeeTreeMapSubKeySet*) base; + _tmp1_ = self->priv->_range; + _tmp2_ = key; + _tmp3_ = gee_tree_map_range_in_range (_tmp1_, _tmp2_); + if (_tmp3_) { + GeeTreeMap* _tmp4_; + gconstpointer _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp4_ = self->priv->_map; + _tmp5_ = key; + _tmp6_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _tmp5_); + _tmp0_ = _tmp6_; + } else { + _tmp0_ = FALSE; + } + _tmp7_ = _tmp0_; + result = _tmp7_; + return result; +} + + +static GeeBidirIterator* gee_tree_map_sub_key_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { + GeeTreeMapSubKeySet * self; + GeeBidirIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubKeyIterator* _tmp2_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_tree_map_sub_key_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeBidirIterator*) _tmp2_; + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_first (GeeAbstractSortedSet* base) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* _first; + gconstpointer _tmp2_; + gpointer _tmp3_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_first (_tmp0_); + _first = _tmp1_; + _vala_assert (_first != NULL, "_first != null"); + _tmp2_ = _first->key; + _tmp3_ = ((_tmp2_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + result = _tmp3_; + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_last (GeeAbstractSortedSet* base) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* _last; + gconstpointer _tmp2_; + gpointer _tmp3_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_last (_tmp0_); + _last = _tmp1_; + _vala_assert (_last != NULL, "_last != null"); + _tmp2_ = _last->key; + _tmp3_ = ((_tmp2_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + result = _tmp3_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_key_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { + GeeTreeMapSubKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_ = NULL; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = before; + _tmp3_ = gee_tree_map_range_cut_tail (_tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_key_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { + GeeTreeMapSubKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + GeeTreeMapRange* _tmp3_ = NULL; + GeeTreeMapRange* _tmp4_; + GeeTreeMapSubKeySet* _tmp5_; + GeeSortedSet* _tmp6_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = after; + _tmp3_ = gee_tree_map_range_cut_head (_tmp1_, _tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp4_); + _tmp6_ = (GeeSortedSet*) _tmp5_; + _gee_tree_map_range_unref0 (_tmp4_); + result = _tmp6_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_key_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) { + GeeTreeMapSubKeySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapRange* _tmp4_ = NULL; + GeeTreeMapRange* _tmp5_; + GeeTreeMapSubKeySet* _tmp6_; + GeeSortedSet* _tmp7_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = after; + _tmp3_ = before; + _tmp4_ = gee_tree_map_range_cut (_tmp1_, _tmp2_, _tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_tree_map_sub_key_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp5_); + _tmp7_ = (GeeSortedSet*) _tmp6_; + _gee_tree_map_range_unref0 (_tmp5_); + result = _tmp7_; + return result; +} + + +static GeeIterator* gee_tree_map_sub_key_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + GeeIterator* result = NULL; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gboolean _tmp2_ = FALSE; + GeeTreeMap* _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapNode* _tmp5_ = NULL; + GeeTreeMapNode* n; + GeeTreeMapNode* _tmp6_; + GeeTreeMap* _tmp7_; + GeeTreeMapRange* _tmp8_; + GeeTreeMapNode* _tmp9_; + GeeTreeMapSubKeyIterator* _tmp10_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_in_range (_tmp0_, _tmp1_); + if (!_tmp2_) { + result = NULL; + return result; + } + _tmp3_ = self->priv->_map; + _tmp4_ = key; + _tmp5_ = gee_tree_map_find_node (_tmp3_, _tmp4_); + n = _tmp5_; + _tmp6_ = n; + if (_tmp6_ == NULL) { + result = NULL; + return result; + } + _tmp7_ = self->priv->_map; + _tmp8_ = self->priv->_range; + _tmp9_ = n; + _tmp10_ = gee_tree_map_sub_key_iterator_new_pointing (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp7_, _tmp8_, _tmp9_); + result = (GeeIterator*) _tmp10_; + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_lower (GeeAbstractSortedSet* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + gint res; + gint _tmp3_; + GeeTreeMap* _tmp5_; + GeeTreeMap* _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapNode* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + gpointer l; + gconstpointer _tmp10_ = NULL; + gboolean _tmp11_ = FALSE; + gconstpointer _tmp12_; + gboolean _tmp16_; + gconstpointer _tmp18_; + gpointer _tmp19_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_compare_range (_tmp0_, _tmp1_); + res = _tmp2_; + _tmp3_ = res; + if (_tmp3_ > 0) { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = _tmp4_; + return result; + } + _tmp5_ = self->priv->_map; + _tmp6_ = self->priv->_map; + _tmp7_ = key; + _tmp8_ = gee_tree_map_find_lower (_tmp6_, _tmp7_); + _tmp9_ = gee_tree_map_lift_null_key (_tmp5_, _tmp8_); + l = _tmp9_; + _tmp12_ = l; + if (_tmp12_ != NULL) { + GeeTreeMapRange* _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp13_ = self->priv->_range; + _tmp14_ = l; + _tmp15_ = gee_tree_map_range_in_range (_tmp13_, _tmp14_); + _tmp11_ = _tmp15_; + } else { + _tmp11_ = FALSE; + } + _tmp16_ = _tmp11_; + if (_tmp16_) { + gconstpointer _tmp17_; + _tmp17_ = l; + _tmp10_ = _tmp17_; + } else { + _tmp10_ = NULL; + } + _tmp18_ = _tmp10_; + _tmp19_ = ((_tmp18_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp18_) : ((gpointer) _tmp18_); + result = _tmp19_; + ((l == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (l = (self->priv->k_destroy_func (l), NULL)); + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_higher (GeeAbstractSortedSet* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + gint res; + gint _tmp3_; + GeeTreeMap* _tmp5_; + GeeTreeMap* _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapNode* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + gpointer h; + gconstpointer _tmp10_ = NULL; + gboolean _tmp11_ = FALSE; + gconstpointer _tmp12_; + gboolean _tmp16_; + gconstpointer _tmp18_; + gpointer _tmp19_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_compare_range (_tmp0_, _tmp1_); + res = _tmp2_; + _tmp3_ = res; + if (_tmp3_ < 0) { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = _tmp4_; + return result; + } + _tmp5_ = self->priv->_map; + _tmp6_ = self->priv->_map; + _tmp7_ = key; + _tmp8_ = gee_tree_map_find_higher (_tmp6_, _tmp7_); + _tmp9_ = gee_tree_map_lift_null_key (_tmp5_, _tmp8_); + h = _tmp9_; + _tmp12_ = h; + if (_tmp12_ != NULL) { + GeeTreeMapRange* _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp13_ = self->priv->_range; + _tmp14_ = h; + _tmp15_ = gee_tree_map_range_in_range (_tmp13_, _tmp14_); + _tmp11_ = _tmp15_; + } else { + _tmp11_ = FALSE; + } + _tmp16_ = _tmp11_; + if (_tmp16_) { + gconstpointer _tmp17_; + _tmp17_ = h; + _tmp10_ = _tmp17_; + } else { + _tmp10_ = NULL; + } + _tmp18_ = _tmp10_; + _tmp19_ = ((_tmp18_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp18_) : ((gpointer) _tmp18_); + result = _tmp19_; + ((h == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (h = (self->priv->k_destroy_func (h), NULL)); + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_floor (GeeAbstractSortedSet* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + gint res; + gint _tmp3_; + GeeTreeMap* _tmp5_; + GeeTreeMap* _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapNode* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + gpointer l; + gconstpointer _tmp10_ = NULL; + gboolean _tmp11_ = FALSE; + gconstpointer _tmp12_; + gboolean _tmp16_; + gconstpointer _tmp18_; + gpointer _tmp19_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_compare_range (_tmp0_, _tmp1_); + res = _tmp2_; + _tmp3_ = res; + if (_tmp3_ > 0) { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = _tmp4_; + return result; + } + _tmp5_ = self->priv->_map; + _tmp6_ = self->priv->_map; + _tmp7_ = key; + _tmp8_ = gee_tree_map_find_floor (_tmp6_, _tmp7_); + _tmp9_ = gee_tree_map_lift_null_key (_tmp5_, _tmp8_); + l = _tmp9_; + _tmp12_ = l; + if (_tmp12_ != NULL) { + GeeTreeMapRange* _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp13_ = self->priv->_range; + _tmp14_ = l; + _tmp15_ = gee_tree_map_range_in_range (_tmp13_, _tmp14_); + _tmp11_ = _tmp15_; + } else { + _tmp11_ = FALSE; + } + _tmp16_ = _tmp11_; + if (_tmp16_) { + gconstpointer _tmp17_; + _tmp17_ = l; + _tmp10_ = _tmp17_; + } else { + _tmp10_ = NULL; + } + _tmp18_ = _tmp10_; + _tmp19_ = ((_tmp18_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp18_) : ((gpointer) _tmp18_); + result = _tmp19_; + ((l == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (l = (self->priv->k_destroy_func (l), NULL)); + return result; +} + + +static gpointer gee_tree_map_sub_key_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer key) { + GeeTreeMapSubKeySet * self; + gpointer result = NULL; + GeeTreeMapRange* _tmp0_; + gconstpointer _tmp1_; + gint _tmp2_ = 0; + gint res; + gint _tmp3_; + GeeTreeMap* _tmp5_; + GeeTreeMap* _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapNode* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + gpointer h; + gconstpointer _tmp10_ = NULL; + gboolean _tmp11_ = FALSE; + gconstpointer _tmp12_; + gboolean _tmp16_; + gconstpointer _tmp18_; + gpointer _tmp19_; + self = (GeeTreeMapSubKeySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = key; + _tmp2_ = gee_tree_map_range_compare_range (_tmp0_, _tmp1_); + res = _tmp2_; + _tmp3_ = res; + if (_tmp3_ < 0) { + gpointer _tmp4_ = NULL; + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = _tmp4_; + return result; + } + _tmp5_ = self->priv->_map; + _tmp6_ = self->priv->_map; + _tmp7_ = key; + _tmp8_ = gee_tree_map_find_ceil (_tmp6_, _tmp7_); + _tmp9_ = gee_tree_map_lift_null_key (_tmp5_, _tmp8_); + h = _tmp9_; + _tmp12_ = h; + if (_tmp12_ != NULL) { + GeeTreeMapRange* _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp13_ = self->priv->_range; + _tmp14_ = h; + _tmp15_ = gee_tree_map_range_in_range (_tmp13_, _tmp14_); + _tmp11_ = _tmp15_; + } else { + _tmp11_ = FALSE; + } + _tmp16_ = _tmp11_; + if (_tmp16_) { + gconstpointer _tmp17_; + _tmp17_ = h; + _tmp10_ = _tmp17_; + } else { + _tmp10_ = NULL; + } + _tmp18_ = _tmp10_; + _tmp19_ = ((_tmp18_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp18_) : ((gpointer) _tmp18_); + result = _tmp19_; + ((h == NULL) || (self->priv->k_destroy_func == NULL)) ? NULL : (h = (self->priv->k_destroy_func (h), NULL)); + return result; +} + + +static GeeTreeMap* gee_tree_map_sub_key_set_get_map (GeeTreeMapSubKeySet* self) { + GeeTreeMap* result; + GeeTreeMap* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_map; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_key_set_set_map (GeeTreeMapSubKeySet* self, GeeTreeMap* value) { + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; +} + + +static GeeTreeMapRange* gee_tree_map_sub_key_set_get_range (GeeTreeMapSubKeySet* self) { + GeeTreeMapRange* result; + GeeTreeMapRange* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_range; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_key_set_set_range (GeeTreeMapSubKeySet* self, GeeTreeMapRange* value) { + GeeTreeMapRange* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _gee_tree_map_range_ref0 (_tmp0_); + _gee_tree_map_range_unref0 (self->priv->_range); + self->priv->_range = _tmp1_; +} + + +static gint gee_tree_map_sub_key_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapSubKeySet* self; + gint i; + GeeIterator* _tmp0_ = NULL; + GeeIterator* iterator; + gint _tmp4_; + self = (GeeTreeMapSubKeySet*) base; + i = 0; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iterator = _tmp0_; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + gint _tmp3_; + _tmp1_ = iterator; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp4_ = i; + result = _tmp4_; + _g_object_unref0 (iterator); + return result; +} + + +static gboolean gee_tree_map_sub_key_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapSubKeySet* self; + self = (GeeTreeMapSubKeySet*) base; + result = TRUE; + return result; +} + + +static gboolean gee_tree_map_sub_key_set_get_is_empty (GeeTreeMapSubKeySet* self) { + gboolean result; + GeeTreeMapRange* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_empty_submap (_tmp0_); + result = _tmp1_; + return result; +} + + +static void gee_tree_map_sub_key_set_class_init (GeeTreeMapSubKeySetClass * klass) { + gee_tree_map_sub_key_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubKeySetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_sub_key_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_sub_key_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_sub_key_set_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_sub_key_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_sub_key_set_real_contains; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_map_sub_key_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_map_sub_key_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_map_sub_key_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_map_sub_key_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_map_sub_key_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_map_sub_key_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_map_sub_key_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_map_sub_key_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_map_sub_key_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_map_sub_key_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_map_sub_key_set_real_ceil; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_sub_key_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_sub_key_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_key_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_key_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_sub_key_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_MAP, g_param_spec_object ("map", "map", "map", GEE_TYPE_TREE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_RANGE, gee_tree_map_param_spec_range ("range", "range", "range", GEE_TREE_MAP_TYPE_RANGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_SET_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_sub_key_set_instance_init (GeeTreeMapSubKeySet * self) { + self->priv = GEE_TREE_MAP_SUB_KEY_SET_GET_PRIVATE (self); +} + + +static void gee_tree_map_sub_key_set_finalize (GObject* obj) { + GeeTreeMapSubKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySet); + _g_object_unref0 (self->priv->_map); + _gee_tree_map_range_unref0 (self->priv->_range); + G_OBJECT_CLASS (gee_tree_map_sub_key_set_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_sub_key_set_get_type (void) { + static volatile gsize gee_tree_map_sub_key_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_key_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubKeySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_key_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubKeySet), 0, (GInstanceInitFunc) gee_tree_map_sub_key_set_instance_init, NULL }; + GType gee_tree_map_sub_key_set_type_id; + gee_tree_map_sub_key_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeMapSubKeySet", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_sub_key_set_type_id__volatile, gee_tree_map_sub_key_set_type_id); + } + return gee_tree_map_sub_key_set_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_key_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySet); + switch (property_id) { + case GEE_TREE_MAP_SUB_KEY_SET_MAP: + g_value_set_object (value, gee_tree_map_sub_key_set_get_map (self)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_RANGE: + gee_tree_map_value_set_range (value, gee_tree_map_sub_key_set_get_range (self)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_IS_EMPTY: + g_value_set_boolean (value, gee_tree_map_sub_key_set_get_is_empty (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_key_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubKeySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_KEY_SET, GeeTreeMapSubKeySet); + switch (property_id) { + case GEE_TREE_MAP_SUB_KEY_SET_MAP: + gee_tree_map_sub_key_set_set_map (self, g_value_get_object (value)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_RANGE: + gee_tree_map_sub_key_set_set_range (self, gee_tree_map_value_get_range (value)); + break; + case GEE_TREE_MAP_SUB_KEY_SET_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_KEY_SET_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_SET_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_SET_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_KEY_SET_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_SET_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapValueCollection* gee_tree_map_value_collection_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapValueCollection * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapValueCollection*) gee_abstract_collection_construct (object_type, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; + return self; +} + + +static GeeTreeMapValueCollection* gee_tree_map_value_collection_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_value_collection_construct (GEE_TREE_MAP_TYPE_VALUE_COLLECTION, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeIterator* gee_tree_map_value_collection_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapValueCollection * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapValueIterator* _tmp1_; + self = (GeeTreeMapValueCollection*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_tree_map_value_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + result = (GeeIterator*) _tmp1_; + return result; +} + + +static gboolean gee_tree_map_value_collection_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapValueCollection * self; + gboolean result = FALSE; + self = (GeeTreeMapValueCollection*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_value_collection_real_clear (GeeAbstractCollection* base) { + GeeTreeMapValueCollection * self; + self = (GeeTreeMapValueCollection*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_value_collection_real_remove (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapValueCollection * self; + gboolean result = FALSE; + self = (GeeTreeMapValueCollection*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapValueCollection * self; + gboolean result = FALSE; + GeeIterator* _tmp0_ = NULL; + GeeIterator* it; + self = (GeeTreeMapValueCollection*) base; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + it = _tmp0_; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + GeeTreeMap* _tmp3_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeIterator* _tmp7_; + gpointer _tmp8_ = NULL; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean _tmp11_; + _tmp1_ = it; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = self->priv->_map; + _tmp4_ = gee_tree_map_get_value_equal_func (_tmp3_, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = it; + _tmp8_ = gee_iterator_get (_tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = _tmp5_ (_tmp6_, _tmp9_, _tmp5__target); + _tmp11_ = _tmp10_; + ((_tmp9_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->v_destroy_func (_tmp9_), NULL)); + if (_tmp11_) { + result = TRUE; + _g_object_unref0 (it); + return result; + } + } + result = FALSE; + _g_object_unref0 (it); + return result; +} + + +static gint gee_tree_map_value_collection_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapValueCollection* self; + GeeTreeMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeTreeMapValueCollection*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_tree_map_value_collection_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapValueCollection* self; + self = (GeeTreeMapValueCollection*) base; + result = TRUE; + return result; +} + + +static void gee_tree_map_value_collection_class_init (GeeTreeMapValueCollectionClass * klass) { + gee_tree_map_value_collection_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapValueCollectionPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_value_collection_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_value_collection_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_value_collection_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_value_collection_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_value_collection_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_value_collection_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_value_collection_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_value_collection_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_value_collection_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_value_collection_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_COLLECTION_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_value_collection_instance_init (GeeTreeMapValueCollection * self) { + self->priv = GEE_TREE_MAP_VALUE_COLLECTION_GET_PRIVATE (self); +} + + +static void gee_tree_map_value_collection_finalize (GObject* obj) { + GeeTreeMapValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); + _g_object_unref0 (self->priv->_map); + G_OBJECT_CLASS (gee_tree_map_value_collection_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_value_collection_get_type (void) { + static volatile gsize gee_tree_map_value_collection_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_value_collection_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapValueCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_value_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapValueCollection), 0, (GInstanceInitFunc) gee_tree_map_value_collection_instance_init, NULL }; + GType gee_tree_map_value_collection_type_id; + gee_tree_map_value_collection_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeTreeMapValueCollection", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_value_collection_type_id__volatile, gee_tree_map_value_collection_type_id); + } + return gee_tree_map_value_collection_type_id__volatile; +} + + +static void _vala_gee_tree_map_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); + switch (property_id) { + case GEE_TREE_MAP_VALUE_COLLECTION_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_COLLECTION, GeeTreeMapValueCollection); + switch (property_id) { + case GEE_TREE_MAP_VALUE_COLLECTION_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_COLLECTION_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubValueCollection* gee_tree_map_sub_value_collection_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubValueCollection * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + self = (GeeTreeMapSubValueCollection*) gee_abstract_collection_construct (object_type, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + gee_tree_map_sub_value_collection_set_map (self, _tmp0_); + _tmp1_ = range; + gee_tree_map_sub_value_collection_set_range (self, _tmp1_); + return self; +} + + +static GeeTreeMapSubValueCollection* gee_tree_map_sub_value_collection_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_value_collection_construct (GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeIterator* gee_tree_map_sub_value_collection_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapSubValueCollection * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubValueIterator* _tmp2_; + self = (GeeTreeMapSubValueCollection*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_tree_map_sub_value_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeIterator*) _tmp2_; + return result; +} + + +static gboolean gee_tree_map_sub_value_collection_real_add (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubValueCollection * self; + gboolean result = FALSE; + self = (GeeTreeMapSubValueCollection*) base; + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_sub_value_collection_real_clear (GeeAbstractCollection* base) { + GeeTreeMapSubValueCollection * self; + self = (GeeTreeMapSubValueCollection*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_sub_value_collection_real_remove (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubValueCollection * self; + gboolean result = FALSE; + self = (GeeTreeMapSubValueCollection*) base; + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_sub_value_collection_real_contains (GeeAbstractCollection* base, gconstpointer key) { + GeeTreeMapSubValueCollection * self; + gboolean result = FALSE; + GeeIterator* _tmp0_ = NULL; + GeeIterator* it; + self = (GeeTreeMapSubValueCollection*) base; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + it = _tmp0_; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + GeeTreeMap* _tmp3_; + GeeEqualDataFunc _tmp4_; + void* _tmp4__target; + GeeEqualDataFunc _tmp5_; + void* _tmp5__target; + gconstpointer _tmp6_; + GeeIterator* _tmp7_; + gpointer _tmp8_ = NULL; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean _tmp11_; + _tmp1_ = it; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = self->priv->_map; + _tmp4_ = gee_tree_map_get_value_equal_func (_tmp3_, &_tmp4__target); + _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; + _tmp6_ = key; + _tmp7_ = it; + _tmp8_ = gee_iterator_get (_tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = _tmp5_ (_tmp6_, _tmp9_, _tmp5__target); + _tmp11_ = _tmp10_; + ((_tmp9_ == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->v_destroy_func (_tmp9_), NULL)); + if (_tmp11_) { + result = TRUE; + _g_object_unref0 (it); + return result; + } + } + result = FALSE; + _g_object_unref0 (it); + return result; +} + + +static GeeTreeMap* gee_tree_map_sub_value_collection_get_map (GeeTreeMapSubValueCollection* self) { + GeeTreeMap* result; + GeeTreeMap* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_map; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_value_collection_set_map (GeeTreeMapSubValueCollection* self, GeeTreeMap* value) { + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; +} + + +static GeeTreeMapRange* gee_tree_map_sub_value_collection_get_range (GeeTreeMapSubValueCollection* self) { + GeeTreeMapRange* result; + GeeTreeMapRange* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_range; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_value_collection_set_range (GeeTreeMapSubValueCollection* self, GeeTreeMapRange* value) { + GeeTreeMapRange* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _gee_tree_map_range_ref0 (_tmp0_); + _gee_tree_map_range_unref0 (self->priv->_range); + self->priv->_range = _tmp1_; +} + + +static gboolean gee_tree_map_sub_value_collection_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapSubValueCollection* self; + self = (GeeTreeMapSubValueCollection*) base; + result = TRUE; + return result; +} + + +static gint gee_tree_map_sub_value_collection_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapSubValueCollection* self; + gint i; + GeeIterator* _tmp0_ = NULL; + GeeIterator* iterator; + gint _tmp4_; + self = (GeeTreeMapSubValueCollection*) base; + i = 0; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iterator = _tmp0_; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + gint _tmp3_; + _tmp1_ = iterator; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp4_ = i; + result = _tmp4_; + _g_object_unref0 (iterator); + return result; +} + + +static gboolean gee_tree_map_sub_value_collection_get_is_empty (GeeTreeMapSubValueCollection* self) { + gboolean result; + GeeTreeMapRange* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_empty_submap (_tmp0_); + result = _tmp1_; + return result; +} + + +static void gee_tree_map_sub_value_collection_class_init (GeeTreeMapSubValueCollectionClass * klass) { + gee_tree_map_sub_value_collection_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubValueCollectionPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_sub_value_collection_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_sub_value_collection_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_sub_value_collection_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_sub_value_collection_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_sub_value_collection_real_contains; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_sub_value_collection_real_get_read_only; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_sub_value_collection_real_get_size; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_value_collection_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_value_collection_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_sub_value_collection_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_MAP, g_param_spec_object ("map", "map", "map", GEE_TYPE_TREE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_RANGE, gee_tree_map_param_spec_range ("range", "range", "range", GEE_TREE_MAP_TYPE_RANGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_COLLECTION_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_sub_value_collection_instance_init (GeeTreeMapSubValueCollection * self) { + self->priv = GEE_TREE_MAP_SUB_VALUE_COLLECTION_GET_PRIVATE (self); +} + + +static void gee_tree_map_sub_value_collection_finalize (GObject* obj) { + GeeTreeMapSubValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollection); + _g_object_unref0 (self->priv->_map); + _gee_tree_map_range_unref0 (self->priv->_range); + G_OBJECT_CLASS (gee_tree_map_sub_value_collection_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_sub_value_collection_get_type (void) { + static volatile gsize gee_tree_map_sub_value_collection_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_value_collection_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubValueCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_value_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubValueCollection), 0, (GInstanceInitFunc) gee_tree_map_sub_value_collection_instance_init, NULL }; + GType gee_tree_map_sub_value_collection_type_id; + gee_tree_map_sub_value_collection_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_COLLECTION, "GeeTreeMapSubValueCollection", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_sub_value_collection_type_id__volatile, gee_tree_map_sub_value_collection_type_id); + } + return gee_tree_map_sub_value_collection_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_value_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollection); + switch (property_id) { + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_MAP: + g_value_set_object (value, gee_tree_map_sub_value_collection_get_map (self)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_RANGE: + gee_tree_map_value_set_range (value, gee_tree_map_sub_value_collection_get_range (self)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_IS_EMPTY: + g_value_set_boolean (value, gee_tree_map_sub_value_collection_get_is_empty (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_value_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubValueCollection * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_VALUE_COLLECTION, GeeTreeMapSubValueCollection); + switch (property_id) { + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_MAP: + gee_tree_map_sub_value_collection_set_map (self, g_value_get_object (value)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_RANGE: + gee_tree_map_sub_value_collection_set_range (self, gee_tree_map_value_get_range (value)); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_VALUE_COLLECTION_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapEntrySet* gee_tree_map_entry_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapEntrySet * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapEntrySet*) gee_abstract_bidir_sorted_set_construct (object_type, GEE_MAP_TYPE_ENTRY, (GBoxedCopyFunc) g_object_ref, g_object_unref); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; + return self; +} + + +static GeeTreeMapEntrySet* gee_tree_map_entry_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_entry_set_construct (GEE_TREE_MAP_TYPE_ENTRY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeIterator* gee_tree_map_entry_set_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapEntrySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapEntryIterator* _tmp1_; + self = (GeeTreeMapEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_tree_map_entry_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + result = (GeeIterator*) _tmp1_; + return result; +} + + +static gboolean gee_tree_map_entry_set_real_add (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapEntrySet * self; + gboolean result = FALSE; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_entry_set_real_clear (GeeAbstractCollection* base) { + GeeTreeMapEntrySet * self; + self = (GeeTreeMapEntrySet*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapEntrySet * self; + gboolean result = FALSE; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapEntrySet * self; + gboolean result = FALSE; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeMapEntry* _tmp4_; + gconstpointer _tmp5_; + gconstpointer _tmp6_; + gboolean _tmp7_ = FALSE; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + _tmp0_ = self->priv->_map; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = entry; + _tmp5_ = gee_map_entry_get_value (_tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_abstract_map_has ((GeeAbstractMap*) _tmp0_, _tmp3_, _tmp6_); + result = _tmp7_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_first (GeeAbstractSortedSet* base) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + GeeTreeMap* _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeMapEntry* _tmp4_ = NULL; + self = (GeeTreeMapEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = _tmp0_->priv->first; + _vala_assert (_tmp1_ != NULL, "_map.first != null"); + _tmp2_ = self->priv->_map; + _tmp3_ = _tmp2_->priv->first; + _tmp4_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_); + result = _tmp4_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_last (GeeAbstractSortedSet* base) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + GeeTreeMap* _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeMapEntry* _tmp4_ = NULL; + self = (GeeTreeMapEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = _tmp0_->priv->last; + _vala_assert (_tmp1_ != NULL, "_map.last != null"); + _tmp2_ = self->priv->_map; + _tmp3_ = _tmp2_->priv->last; + _tmp4_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp3_); + result = _tmp4_; + return result; +} + + +static GeeBidirIterator* gee_tree_map_entry_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { + GeeTreeMapEntrySet * self; + GeeBidirIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapEntryIterator* _tmp1_; + self = (GeeTreeMapEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_tree_map_entry_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + result = (GeeBidirIterator*) _tmp1_; + return result; +} + + +static GeeSortedSet* gee_tree_map_entry_set_real_head_set (GeeAbstractSortedSet* base, GeeMapEntry* before) { + GeeTreeMapEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapRange* _tmp5_; + GeeTreeMapRange* _tmp6_; + GeeTreeMapSubEntrySet* _tmp7_; + GeeSortedSet* _tmp8_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (before != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = before; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_range_new_head (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp6_); + _tmp8_ = (GeeSortedSet*) _tmp7_; + _gee_tree_map_range_unref0 (_tmp6_); + result = _tmp8_; + return result; +} + + +static GeeSortedSet* gee_tree_map_entry_set_real_tail_set (GeeAbstractSortedSet* base, GeeMapEntry* after) { + GeeTreeMapEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapRange* _tmp5_; + GeeTreeMapRange* _tmp6_; + GeeTreeMapSubEntrySet* _tmp7_; + GeeSortedSet* _tmp8_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (after != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = after; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_range_new_tail (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp6_); + _tmp8_ = (GeeSortedSet*) _tmp7_; + _gee_tree_map_range_unref0 (_tmp6_); + result = _tmp8_; + return result; +} + + +static GeeSortedSet* gee_tree_map_entry_set_real_sub_set (GeeAbstractSortedSet* base, GeeMapEntry* after, GeeMapEntry* before) { + GeeTreeMapEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeMapEntry* _tmp5_; + gconstpointer _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapRange* _tmp8_; + GeeTreeMapRange* _tmp9_; + GeeTreeMapSubEntrySet* _tmp10_; + GeeSortedSet* _tmp11_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (after != NULL, NULL); + g_return_val_if_fail (before != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_map; + _tmp2_ = after; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = before; + _tmp6_ = gee_map_entry_get_key (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = gee_tree_map_range_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp1_, _tmp4_, _tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp9_); + _tmp11_ = (GeeSortedSet*) _tmp10_; + _gee_tree_map_range_unref0 (_tmp9_); + result = _tmp11_; + return result; +} + + +static GeeIterator* gee_tree_map_entry_set_real_iterator_at (GeeAbstractSortedSet* base, GeeMapEntry* item) { + GeeTreeMapEntrySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapNode* _tmp4_ = NULL; + GeeTreeMapNode* node; + gboolean _tmp5_ = FALSE; + GeeTreeMapNode* _tmp6_; + gboolean _tmp16_; + GeeTreeMap* _tmp17_; + GeeTreeMapNode* _tmp18_; + GeeTreeMapEntryIterator* _tmp19_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (item != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_find_node (_tmp0_, _tmp3_); + node = _tmp4_; + _tmp6_ = node; + if (_tmp6_ == NULL) { + _tmp5_ = TRUE; + } else { + GeeTreeMap* _tmp7_; + GeeEqualDataFunc _tmp8_; + void* _tmp8__target; + GeeEqualDataFunc _tmp9_; + void* _tmp9__target; + GeeTreeMapNode* _tmp10_; + gconstpointer _tmp11_; + GeeMapEntry* _tmp12_; + gconstpointer _tmp13_; + gconstpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp7_ = self->priv->_map; + _tmp8_ = gee_tree_map_get_value_equal_func (_tmp7_, &_tmp8__target); + _tmp9_ = _tmp8_; + _tmp9__target = _tmp8__target; + _tmp10_ = node; + _tmp11_ = _tmp10_->value; + _tmp12_ = item; + _tmp13_ = gee_map_entry_get_value (_tmp12_); + _tmp14_ = _tmp13_; + _tmp15_ = _tmp9_ (_tmp11_, _tmp14_, _tmp9__target); + _tmp5_ = !_tmp15_; + } + _tmp16_ = _tmp5_; + if (_tmp16_) { + result = NULL; + return result; + } + _tmp17_ = self->priv->_map; + _tmp18_ = node; + _tmp19_ = gee_tree_map_entry_iterator_new_pointing (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp17_, _tmp18_); + result = (GeeIterator*) _tmp19_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_lower (GeeAbstractSortedSet* base, GeeMapEntry* item) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapNode* _tmp4_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp5_ = NULL; + GeeTreeMapNode* _tmp6_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (item != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_find_lower (_tmp0_, _tmp3_); + l = _tmp4_; + _tmp6_ = l; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; + GeeMapEntry* _tmp8_ = NULL; + _tmp7_ = l; + _tmp8_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp7_); + _g_object_unref0 (_tmp5_); + _tmp5_ = _tmp8_; + } else { + _g_object_unref0 (_tmp5_); + _tmp5_ = NULL; + } + result = _tmp5_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_higher (GeeAbstractSortedSet* base, GeeMapEntry* item) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapNode* _tmp4_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp5_ = NULL; + GeeTreeMapNode* _tmp6_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (item != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_find_higher (_tmp0_, _tmp3_); + l = _tmp4_; + _tmp6_ = l; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; + GeeMapEntry* _tmp8_ = NULL; + _tmp7_ = l; + _tmp8_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp7_); + _g_object_unref0 (_tmp5_); + _tmp5_ = _tmp8_; + } else { + _g_object_unref0 (_tmp5_); + _tmp5_ = NULL; + } + result = _tmp5_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_floor (GeeAbstractSortedSet* base, GeeMapEntry* item) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapNode* _tmp4_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp5_ = NULL; + GeeTreeMapNode* _tmp6_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (item != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_find_floor (_tmp0_, _tmp3_); + l = _tmp4_; + _tmp6_ = l; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; + GeeMapEntry* _tmp8_ = NULL; + _tmp7_ = l; + _tmp8_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp7_); + _g_object_unref0 (_tmp5_); + _tmp5_ = _tmp8_; + } else { + _g_object_unref0 (_tmp5_); + _tmp5_ = NULL; + } + result = _tmp5_; + return result; +} + + +static GeeMapEntry* gee_tree_map_entry_set_real_ceil (GeeAbstractSortedSet* base, GeeMapEntry* item) { + GeeTreeMapEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMap* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + GeeTreeMapNode* _tmp4_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp5_ = NULL; + GeeTreeMapNode* _tmp6_; + self = (GeeTreeMapEntrySet*) base; + g_return_val_if_fail (item != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = item; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_find_ceil (_tmp0_, _tmp3_); + l = _tmp4_; + _tmp6_ = l; + if (_tmp6_ != NULL) { + GeeTreeMapNode* _tmp7_; + GeeMapEntry* _tmp8_ = NULL; + _tmp7_ = l; + _tmp8_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp7_); + _g_object_unref0 (_tmp5_); + _tmp5_ = _tmp8_; + } else { + _g_object_unref0 (_tmp5_); + _tmp5_ = NULL; + } + result = _tmp5_; + return result; +} + + +static gint gee_tree_map_entry_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapEntrySet* self; + GeeTreeMap* _tmp0_; + gint _tmp1_; + gint _tmp2_; + self = (GeeTreeMapEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = gee_abstract_map_get_size ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + +static gboolean gee_tree_map_entry_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapEntrySet* self; + self = (GeeTreeMapEntrySet*) base; + result = TRUE; + return result; +} + + +static void gee_tree_map_entry_set_class_init (GeeTreeMapEntrySetClass * klass) { + gee_tree_map_entry_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapEntrySetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_entry_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_entry_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_entry_set_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_entry_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_entry_set_real_contains; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_map_entry_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_map_entry_set_real_last; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_map_entry_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_map_entry_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_map_entry_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_map_entry_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_map_entry_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_map_entry_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_map_entry_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_map_entry_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_map_entry_set_real_ceil; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_entry_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_entry_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_entry_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_entry_set_instance_init (GeeTreeMapEntrySet * self) { + self->priv = GEE_TREE_MAP_ENTRY_SET_GET_PRIVATE (self); +} + + +static void gee_tree_map_entry_set_finalize (GObject* obj) { + GeeTreeMapEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); + _g_object_unref0 (self->priv->_map); + G_OBJECT_CLASS (gee_tree_map_entry_set_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_entry_set_get_type (void) { + static volatile gsize gee_tree_map_entry_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_entry_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntrySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntrySet), 0, (GInstanceInitFunc) gee_tree_map_entry_set_instance_init, NULL }; + GType gee_tree_map_entry_set_type_id; + gee_tree_map_entry_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeMapEntrySet", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_entry_set_type_id__volatile, gee_tree_map_entry_set_type_id); + } + return gee_tree_map_entry_set_type_id__volatile; +} + + +static void _vala_gee_tree_map_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); + switch (property_id) { + case GEE_TREE_MAP_ENTRY_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_ENTRY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_SET, GeeTreeMapEntrySet); + switch (property_id) { + case GEE_TREE_MAP_ENTRY_SET_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_ENTRY_SET_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_ENTRY_SET_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_ENTRY_SET_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_ENTRY_SET_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_ENTRY_SET_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubEntrySet* gee_tree_map_sub_entry_set_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubEntrySet * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + self = (GeeTreeMapSubEntrySet*) gee_abstract_bidir_sorted_set_construct (object_type, GEE_MAP_TYPE_ENTRY, (GBoxedCopyFunc) g_object_ref, g_object_unref); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + gee_tree_map_sub_entry_set_set_map (self, _tmp0_); + _tmp1_ = range; + gee_tree_map_sub_entry_set_set_range (self, _tmp1_); + return self; +} + + +static GeeTreeMapSubEntrySet* gee_tree_map_sub_entry_set_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_entry_set_construct (GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeIterator* gee_tree_map_sub_entry_set_real_iterator (GeeAbstractCollection* base) { + GeeTreeMapSubEntrySet * self; + GeeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubEntryIterator* _tmp2_; + self = (GeeTreeMapSubEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_tree_map_sub_entry_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeIterator*) _tmp2_; + return result; +} + + +static gboolean gee_tree_map_sub_entry_set_real_add (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + gboolean result = FALSE; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + g_assert_not_reached (); + return result; +} + + +static void gee_tree_map_sub_entry_set_real_clear (GeeAbstractCollection* base) { + GeeTreeMapSubEntrySet * self; + self = (GeeTreeMapSubEntrySet*) base; + g_assert_not_reached (); +} + + +static gboolean gee_tree_map_sub_entry_set_real_remove (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + gboolean result = FALSE; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + g_assert_not_reached (); + return result; +} + + +static gboolean gee_tree_map_sub_entry_set_real_contains (GeeAbstractCollection* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeTreeMapRange* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + gboolean _tmp5_ = FALSE; + gboolean _tmp14_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, FALSE); + _tmp1_ = self->priv->_range; + _tmp2_ = entry; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_range_in_range (_tmp1_, _tmp4_); + if (_tmp5_) { + GeeTreeMap* _tmp6_; + GeeMapEntry* _tmp7_; + gconstpointer _tmp8_; + gconstpointer _tmp9_; + GeeMapEntry* _tmp10_; + gconstpointer _tmp11_; + gconstpointer _tmp12_; + gboolean _tmp13_ = FALSE; + _tmp6_ = self->priv->_map; + _tmp7_ = entry; + _tmp8_ = gee_map_entry_get_key (_tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = entry; + _tmp11_ = gee_map_entry_get_value (_tmp10_); + _tmp12_ = _tmp11_; + _tmp13_ = gee_abstract_map_has ((GeeAbstractMap*) _tmp6_, _tmp9_, _tmp12_); + _tmp0_ = _tmp13_; + } else { + _tmp0_ = FALSE; + } + _tmp14_ = _tmp0_; + result = _tmp14_; + return result; +} + + +static GeeBidirIterator* gee_tree_map_sub_entry_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { + GeeTreeMapSubEntrySet * self; + GeeBidirIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapSubEntryIterator* _tmp2_; + self = (GeeTreeMapSubEntrySet*) base; + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = gee_tree_map_sub_entry_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = (GeeBidirIterator*) _tmp2_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_first (GeeAbstractSortedSet* base) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* _first; + GeeMapEntry* _tmp2_ = NULL; + self = (GeeTreeMapSubEntrySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_first (_tmp0_); + _first = _tmp1_; + _vala_assert (_first != NULL, "_first != null"); + _tmp2_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _first); + result = _tmp2_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_last (GeeAbstractSortedSet* base) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* _last; + GeeMapEntry* _tmp2_ = NULL; + self = (GeeTreeMapSubEntrySet*) base; + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_last (_tmp0_); + _last = _tmp1_; + _vala_assert (_last != NULL, "_last != null"); + _tmp2_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _last); + result = _tmp2_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_entry_set_real_head_set (GeeAbstractSortedSet* base, GeeMapEntry* before) { + GeeTreeMapSubEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapRange* _tmp5_ = NULL; + GeeTreeMapRange* _tmp6_; + GeeTreeMapSubEntrySet* _tmp7_; + GeeSortedSet* _tmp8_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (before != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = before; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_range_cut_tail (_tmp1_, _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp6_); + _tmp8_ = (GeeSortedSet*) _tmp7_; + _gee_tree_map_range_unref0 (_tmp6_); + result = _tmp8_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_entry_set_real_tail_set (GeeAbstractSortedSet* base, GeeMapEntry* after) { + GeeTreeMapSubEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeTreeMapRange* _tmp5_ = NULL; + GeeTreeMapRange* _tmp6_; + GeeTreeMapSubEntrySet* _tmp7_; + GeeSortedSet* _tmp8_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (after != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = after; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = gee_tree_map_range_cut_head (_tmp1_, _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp6_); + _tmp8_ = (GeeSortedSet*) _tmp7_; + _gee_tree_map_range_unref0 (_tmp6_); + result = _tmp8_; + return result; +} + + +static GeeSortedSet* gee_tree_map_sub_entry_set_real_sub_set (GeeAbstractSortedSet* base, GeeMapEntry* after, GeeMapEntry* before) { + GeeTreeMapSubEntrySet * self; + GeeSortedSet* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeMapEntry* _tmp2_; + gconstpointer _tmp3_; + gconstpointer _tmp4_; + GeeMapEntry* _tmp5_; + gconstpointer _tmp6_; + gconstpointer _tmp7_; + GeeTreeMapRange* _tmp8_ = NULL; + GeeTreeMapRange* _tmp9_; + GeeTreeMapSubEntrySet* _tmp10_; + GeeSortedSet* _tmp11_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (after != NULL, NULL); + g_return_val_if_fail (before != NULL, NULL); + _tmp0_ = self->priv->_map; + _tmp1_ = self->priv->_range; + _tmp2_ = after; + _tmp3_ = gee_map_entry_get_key (_tmp2_); + _tmp4_ = _tmp3_; + _tmp5_ = before; + _tmp6_ = gee_map_entry_get_key (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = gee_tree_map_range_cut (_tmp1_, _tmp4_, _tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = gee_tree_map_sub_entry_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp9_); + _tmp11_ = (GeeSortedSet*) _tmp10_; + _gee_tree_map_range_unref0 (_tmp9_); + result = _tmp11_; + return result; +} + + +static GeeIterator* gee_tree_map_sub_entry_set_real_iterator_at (GeeAbstractSortedSet* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + GeeIterator* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gboolean _tmp4_ = FALSE; + GeeTreeMap* _tmp5_; + GeeMapEntry* _tmp6_; + gconstpointer _tmp7_; + gconstpointer _tmp8_; + GeeTreeMapNode* _tmp9_ = NULL; + GeeTreeMapNode* n; + gboolean _tmp10_ = FALSE; + GeeTreeMapNode* _tmp11_; + gboolean _tmp21_; + GeeTreeMap* _tmp22_; + GeeTreeMapRange* _tmp23_; + GeeTreeMapNode* _tmp24_; + GeeTreeMapSubEntryIterator* _tmp25_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, NULL); + _tmp0_ = self->priv->_range; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_range_in_range (_tmp0_, _tmp3_); + if (!_tmp4_) { + result = NULL; + return result; + } + _tmp5_ = self->priv->_map; + _tmp6_ = entry; + _tmp7_ = gee_map_entry_get_key (_tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = gee_tree_map_find_node (_tmp5_, _tmp8_); + n = _tmp9_; + _tmp11_ = n; + if (_tmp11_ == NULL) { + _tmp10_ = TRUE; + } else { + GeeTreeMap* _tmp12_; + GeeEqualDataFunc _tmp13_; + void* _tmp13__target; + GeeEqualDataFunc _tmp14_; + void* _tmp14__target; + GeeTreeMapNode* _tmp15_; + gconstpointer _tmp16_; + GeeMapEntry* _tmp17_; + gconstpointer _tmp18_; + gconstpointer _tmp19_; + gboolean _tmp20_ = FALSE; + _tmp12_ = self->priv->_map; + _tmp13_ = gee_tree_map_get_value_equal_func (_tmp12_, &_tmp13__target); + _tmp14_ = _tmp13_; + _tmp14__target = _tmp13__target; + _tmp15_ = n; + _tmp16_ = _tmp15_->value; + _tmp17_ = entry; + _tmp18_ = gee_map_entry_get_value (_tmp17_); + _tmp19_ = _tmp18_; + _tmp20_ = _tmp14_ (_tmp16_, _tmp19_, _tmp14__target); + _tmp10_ = !_tmp20_; + } + _tmp21_ = _tmp10_; + if (_tmp21_) { + result = NULL; + return result; + } + _tmp22_ = self->priv->_map; + _tmp23_ = self->priv->_range; + _tmp24_ = n; + _tmp25_ = gee_tree_map_sub_entry_iterator_new_pointing (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp22_, _tmp23_, _tmp24_); + result = (GeeIterator*) _tmp25_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_lower (GeeAbstractSortedSet* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gint _tmp4_ = 0; + gint res; + gint _tmp5_; + GeeTreeMap* _tmp7_; + GeeMapEntry* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + GeeTreeMapNode* _tmp11_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeTreeMapNode* _tmp14_; + gboolean _tmp19_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, NULL); + _tmp0_ = self->priv->_range; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_range_compare_range (_tmp0_, _tmp3_); + res = _tmp4_; + _tmp5_ = res; + if (_tmp5_ > 0) { + gpointer _tmp6_ = NULL; + _tmp6_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = (GeeMapEntry*) _tmp6_; + return result; + } + _tmp7_ = self->priv->_map; + _tmp8_ = entry; + _tmp9_ = gee_map_entry_get_key (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_tree_map_find_lower (_tmp7_, _tmp10_); + l = _tmp11_; + _tmp14_ = l; + if (_tmp14_ != NULL) { + GeeTreeMapRange* _tmp15_; + GeeTreeMapNode* _tmp16_; + gconstpointer _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = l; + _tmp17_ = _tmp16_->key; + _tmp18_ = gee_tree_map_range_in_range (_tmp15_, _tmp17_); + _tmp13_ = _tmp18_; + } else { + _tmp13_ = FALSE; + } + _tmp19_ = _tmp13_; + if (_tmp19_) { + GeeTreeMapNode* _tmp20_; + GeeMapEntry* _tmp21_ = NULL; + _tmp20_ = l; + _tmp21_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp20_); + _g_object_unref0 (_tmp12_); + _tmp12_ = _tmp21_; + } else { + _g_object_unref0 (_tmp12_); + _tmp12_ = NULL; + } + result = _tmp12_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_higher (GeeAbstractSortedSet* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gint _tmp4_ = 0; + gint res; + gint _tmp5_; + GeeTreeMap* _tmp7_; + GeeMapEntry* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + GeeTreeMapNode* _tmp11_ = NULL; + GeeTreeMapNode* h; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeTreeMapNode* _tmp14_; + gboolean _tmp19_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, NULL); + _tmp0_ = self->priv->_range; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_range_compare_range (_tmp0_, _tmp3_); + res = _tmp4_; + _tmp5_ = res; + if (_tmp5_ < 0) { + gpointer _tmp6_ = NULL; + _tmp6_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = (GeeMapEntry*) _tmp6_; + return result; + } + _tmp7_ = self->priv->_map; + _tmp8_ = entry; + _tmp9_ = gee_map_entry_get_key (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_tree_map_find_higher (_tmp7_, _tmp10_); + h = _tmp11_; + _tmp14_ = h; + if (_tmp14_ != NULL) { + GeeTreeMapRange* _tmp15_; + GeeTreeMapNode* _tmp16_; + gconstpointer _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = h; + _tmp17_ = _tmp16_->key; + _tmp18_ = gee_tree_map_range_in_range (_tmp15_, _tmp17_); + _tmp13_ = _tmp18_; + } else { + _tmp13_ = FALSE; + } + _tmp19_ = _tmp13_; + if (_tmp19_) { + GeeTreeMapNode* _tmp20_; + GeeMapEntry* _tmp21_ = NULL; + _tmp20_ = h; + _tmp21_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp20_); + _g_object_unref0 (_tmp12_); + _tmp12_ = _tmp21_; + } else { + _g_object_unref0 (_tmp12_); + _tmp12_ = NULL; + } + result = _tmp12_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_floor (GeeAbstractSortedSet* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gint _tmp4_ = 0; + gint res; + gint _tmp5_; + GeeTreeMap* _tmp7_; + GeeMapEntry* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + GeeTreeMapNode* _tmp11_ = NULL; + GeeTreeMapNode* l; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeTreeMapNode* _tmp14_; + gboolean _tmp19_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, NULL); + _tmp0_ = self->priv->_range; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_range_compare_range (_tmp0_, _tmp3_); + res = _tmp4_; + _tmp5_ = res; + if (_tmp5_ > 0) { + gpointer _tmp6_ = NULL; + _tmp6_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); + result = (GeeMapEntry*) _tmp6_; + return result; + } + _tmp7_ = self->priv->_map; + _tmp8_ = entry; + _tmp9_ = gee_map_entry_get_key (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_tree_map_find_floor (_tmp7_, _tmp10_); + l = _tmp11_; + _tmp14_ = l; + if (_tmp14_ != NULL) { + GeeTreeMapRange* _tmp15_; + GeeTreeMapNode* _tmp16_; + gconstpointer _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = l; + _tmp17_ = _tmp16_->key; + _tmp18_ = gee_tree_map_range_in_range (_tmp15_, _tmp17_); + _tmp13_ = _tmp18_; + } else { + _tmp13_ = FALSE; + } + _tmp19_ = _tmp13_; + if (_tmp19_) { + GeeTreeMapNode* _tmp20_; + GeeMapEntry* _tmp21_ = NULL; + _tmp20_ = l; + _tmp21_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp20_); + _g_object_unref0 (_tmp12_); + _tmp12_ = _tmp21_; + } else { + _g_object_unref0 (_tmp12_); + _tmp12_ = NULL; + } + result = _tmp12_; + return result; +} + + +static GeeMapEntry* gee_tree_map_sub_entry_set_real_ceil (GeeAbstractSortedSet* base, GeeMapEntry* entry) { + GeeTreeMapSubEntrySet * self; + GeeMapEntry* result = NULL; + GeeTreeMapRange* _tmp0_; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gint _tmp4_ = 0; + gint res; + gint _tmp5_; + GeeTreeMap* _tmp7_; + GeeMapEntry* _tmp8_; + gconstpointer _tmp9_; + gconstpointer _tmp10_; + GeeTreeMapNode* _tmp11_ = NULL; + GeeTreeMapNode* h; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + GeeTreeMapNode* _tmp14_; + gboolean _tmp19_; + self = (GeeTreeMapSubEntrySet*) base; + g_return_val_if_fail (entry != NULL, NULL); + _tmp0_ = self->priv->_range; + _tmp1_ = entry; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = gee_tree_map_range_compare_range (_tmp0_, _tmp3_); + res = _tmp4_; + _tmp5_ = res; + if (_tmp5_ < 0) { + gpointer _tmp6_ = NULL; + _tmp6_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); + result = (GeeMapEntry*) _tmp6_; + return result; + } + _tmp7_ = self->priv->_map; + _tmp8_ = entry; + _tmp9_ = gee_map_entry_get_key (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_tree_map_find_ceil (_tmp7_, _tmp10_); + h = _tmp11_; + _tmp14_ = h; + if (_tmp14_ != NULL) { + GeeTreeMapRange* _tmp15_; + GeeTreeMapNode* _tmp16_; + gconstpointer _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp15_ = self->priv->_range; + _tmp16_ = h; + _tmp17_ = _tmp16_->key; + _tmp18_ = gee_tree_map_range_in_range (_tmp15_, _tmp17_); + _tmp13_ = _tmp18_; + } else { + _tmp13_ = FALSE; + } + _tmp19_ = _tmp13_; + if (_tmp19_) { + GeeTreeMapNode* _tmp20_; + GeeMapEntry* _tmp21_ = NULL; + _tmp20_ = h; + _tmp21_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp20_); + _g_object_unref0 (_tmp12_); + _tmp12_ = _tmp21_; + } else { + _g_object_unref0 (_tmp12_); + _tmp12_ = NULL; + } + result = _tmp12_; + return result; +} + + +static GeeTreeMap* gee_tree_map_sub_entry_set_get_map (GeeTreeMapSubEntrySet* self) { + GeeTreeMap* result; + GeeTreeMap* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_map; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_entry_set_set_map (GeeTreeMapSubEntrySet* self, GeeTreeMap* value) { + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->priv->_map); + self->priv->_map = _tmp1_; +} + + +static GeeTreeMapRange* gee_tree_map_sub_entry_set_get_range (GeeTreeMapSubEntrySet* self) { + GeeTreeMapRange* result; + GeeTreeMapRange* _tmp0_; + g_return_val_if_fail (self != NULL, NULL); + _tmp0_ = self->priv->_range; + result = _tmp0_; + return result; +} + + +static void gee_tree_map_sub_entry_set_set_range (GeeTreeMapSubEntrySet* self, GeeTreeMapRange* value) { + GeeTreeMapRange* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = value; + _tmp1_ = _gee_tree_map_range_ref0 (_tmp0_); + _gee_tree_map_range_unref0 (self->priv->_range); + self->priv->_range = _tmp1_; +} + + +static gint gee_tree_map_sub_entry_set_real_get_size (GeeAbstractCollection* base) { + gint result; + GeeTreeMapSubEntrySet* self; + gint i; + GeeIterator* _tmp0_ = NULL; + GeeIterator* iterator; + gint _tmp4_; + self = (GeeTreeMapSubEntrySet*) base; + i = 0; + _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self); + iterator = _tmp0_; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + gint _tmp3_; + _tmp1_ = iterator; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = i; + i = _tmp3_ + 1; + } + _tmp4_ = i; + result = _tmp4_; + _g_object_unref0 (iterator); + return result; +} + + +static gboolean gee_tree_map_sub_entry_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeMapSubEntrySet* self; + self = (GeeTreeMapSubEntrySet*) base; + result = TRUE; + return result; +} + + +static gboolean gee_tree_map_sub_entry_set_get_is_empty (GeeTreeMapSubEntrySet* self) { + gboolean result; + GeeTreeMapRange* _tmp0_; + gboolean _tmp1_ = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->priv->_range; + _tmp1_ = gee_tree_map_range_empty_submap (_tmp0_); + result = _tmp1_; + return result; +} + + +static void gee_tree_map_sub_entry_set_class_init (GeeTreeMapSubEntrySetClass * klass) { + gee_tree_map_sub_entry_set_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubEntrySetPrivate)); + GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_map_sub_entry_set_real_iterator; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_tree_map_sub_entry_set_real_add; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_map_sub_entry_set_real_clear; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_map_sub_entry_set_real_remove; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_tree_map_sub_entry_set_real_contains; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_map_sub_entry_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_map_sub_entry_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_map_sub_entry_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_map_sub_entry_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_map_sub_entry_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_map_sub_entry_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_map_sub_entry_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_map_sub_entry_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_map_sub_entry_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_map_sub_entry_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_map_sub_entry_set_real_ceil; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_map_sub_entry_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_map_sub_entry_set_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_entry_set_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_entry_set_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_sub_entry_set_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_MAP, g_param_spec_object ("map", "map", "map", GEE_TYPE_TREE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_RANGE, gee_tree_map_param_spec_range ("range", "range", "range", GEE_TREE_MAP_TYPE_RANGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_SET_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_sub_entry_set_instance_init (GeeTreeMapSubEntrySet * self) { + self->priv = GEE_TREE_MAP_SUB_ENTRY_SET_GET_PRIVATE (self); +} + + +static void gee_tree_map_sub_entry_set_finalize (GObject* obj) { + GeeTreeMapSubEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySet); + _g_object_unref0 (self->priv->_map); + _gee_tree_map_range_unref0 (self->priv->_range); + G_OBJECT_CLASS (gee_tree_map_sub_entry_set_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_sub_entry_set_get_type (void) { + static volatile gsize gee_tree_map_sub_entry_set_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_entry_set_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubEntrySetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_entry_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubEntrySet), 0, (GInstanceInitFunc) gee_tree_map_sub_entry_set_instance_init, NULL }; + GType gee_tree_map_sub_entry_set_type_id; + gee_tree_map_sub_entry_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeMapSubEntrySet", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_sub_entry_set_type_id__volatile, gee_tree_map_sub_entry_set_type_id); + } + return gee_tree_map_sub_entry_set_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_entry_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySet); + switch (property_id) { + case GEE_TREE_MAP_SUB_ENTRY_SET_MAP: + g_value_set_object (value, gee_tree_map_sub_entry_set_get_map (self)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_RANGE: + gee_tree_map_value_set_range (value, gee_tree_map_sub_entry_set_get_range (self)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_SIZE: + g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_IS_EMPTY: + g_value_set_boolean (value, gee_tree_map_sub_entry_set_get_is_empty (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_entry_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubEntrySet * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_ENTRY_SET, GeeTreeMapSubEntrySet); + switch (property_id) { + case GEE_TREE_MAP_SUB_ENTRY_SET_MAP: + gee_tree_map_sub_entry_set_set_map (self, g_value_get_object (value)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_RANGE: + gee_tree_map_sub_entry_set_set_range (self, gee_tree_map_value_get_range (value)); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_ENTRY_SET_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapNodeIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeTreeMap* _tmp2_; + gint _tmp3_; + g_return_val_if_fail (map != NULL, NULL); + self = (GeeTreeMapNodeIterator*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_map); + self->_map = _tmp1_; + _tmp2_ = self->_map; + _tmp3_ = _tmp2_->priv->stamp; + self->stamp = _tmp3_; + return self; +} + + +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_node_iterator_construct (GEE_TREE_MAP_TYPE_NODE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + GeeTreeMapNodeIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeTreeMap* _tmp2_; + gint _tmp3_; + GeeTreeMapNode* _tmp4_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (current != NULL, NULL); + self = (GeeTreeMapNodeIterator*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_map); + self->_map = _tmp1_; + _tmp2_ = self->_map; + _tmp3_ = _tmp2_->priv->stamp; + self->stamp = _tmp3_; + _tmp4_ = current; + self->current = _tmp4_; + return self; +} + + +static GeeTreeMapNodeIterator* gee_tree_map_node_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + return gee_tree_map_node_iterator_construct_pointing (GEE_TREE_MAP_TYPE_NODE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, current); +} + + +static gboolean gee_tree_map_node_iterator_next (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMapNode* _tmp3_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = self->current; + if (_tmp3_ != NULL) { + GeeTreeMapNode* _tmp4_; + GeeTreeMapNode* _tmp5_; + _tmp4_ = self->current; + _tmp5_ = _tmp4_->next; + if (_tmp5_ != NULL) { + GeeTreeMapNode* _tmp6_; + GeeTreeMapNode* _tmp7_; + _tmp6_ = self->current; + _tmp7_ = _tmp6_->next; + self->current = _tmp7_; + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } + } else { + gboolean _tmp8_ = FALSE; + GeeTreeMapNode* _tmp9_; + gboolean _tmp11_; + _tmp9_ = self->_next; + if (_tmp9_ == NULL) { + GeeTreeMapNode* _tmp10_; + _tmp10_ = self->_prev; + _tmp8_ = _tmp10_ == NULL; + } else { + _tmp8_ = FALSE; + } + _tmp11_ = _tmp8_; + if (_tmp11_) { + GeeTreeMap* _tmp12_; + GeeTreeMapNode* _tmp13_; + GeeTreeMapNode* _tmp14_; + _tmp12_ = self->_map; + _tmp13_ = _tmp12_->priv->first; + self->current = _tmp13_; + self->started = TRUE; + _tmp14_ = self->current; + result = _tmp14_ != NULL; + return result; + } else { + GeeTreeMapNode* _tmp15_; + GeeTreeMapNode* _tmp16_; + GeeTreeMapNode* _tmp17_; + _tmp15_ = self->_next; + self->current = _tmp15_; + _tmp16_ = self->current; + if (_tmp16_ != NULL) { + self->_next = NULL; + self->_prev = NULL; + } + _tmp17_ = self->current; + result = _tmp17_ != NULL; + return result; + } + } +} + + +static gboolean gee_tree_map_node_iterator_has_next (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + GeeTreeMapNode* _tmp8_; + gboolean _tmp10_; + gboolean _tmp12_; + gboolean _tmp15_; + gboolean _tmp20_; + gboolean _tmp26_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp8_ = self->current; + if (_tmp8_ == NULL) { + GeeTreeMapNode* _tmp9_; + _tmp9_ = self->_next; + _tmp7_ = _tmp9_ == NULL; + } else { + _tmp7_ = FALSE; + } + _tmp10_ = _tmp7_; + if (_tmp10_) { + GeeTreeMapNode* _tmp11_; + _tmp11_ = self->_prev; + _tmp6_ = _tmp11_ == NULL; + } else { + _tmp6_ = FALSE; + } + _tmp12_ = _tmp6_; + if (_tmp12_) { + GeeTreeMap* _tmp13_; + GeeTreeMapNode* _tmp14_; + _tmp13_ = self->_map; + _tmp14_ = _tmp13_->priv->first; + _tmp5_ = _tmp14_ != NULL; + } else { + _tmp5_ = FALSE; + } + _tmp15_ = _tmp5_; + if (_tmp15_) { + _tmp4_ = TRUE; + } else { + gboolean _tmp16_ = FALSE; + GeeTreeMapNode* _tmp17_; + gboolean _tmp19_; + _tmp17_ = self->current; + if (_tmp17_ == NULL) { + GeeTreeMapNode* _tmp18_; _tmp18_ = self->_next; _tmp16_ = _tmp18_ != NULL; } else { - _tmp16_ = FALSE; + _tmp16_ = FALSE; + } + _tmp19_ = _tmp16_; + _tmp4_ = _tmp19_; + } + _tmp20_ = _tmp4_; + if (_tmp20_) { + _tmp3_ = TRUE; + } else { + gboolean _tmp21_ = FALSE; + GeeTreeMapNode* _tmp22_; + gboolean _tmp25_; + _tmp22_ = self->current; + if (_tmp22_ != NULL) { + GeeTreeMapNode* _tmp23_; + GeeTreeMapNode* _tmp24_; + _tmp23_ = self->current; + _tmp24_ = _tmp23_->next; + _tmp21_ = _tmp24_ != NULL; + } else { + _tmp21_ = FALSE; + } + _tmp25_ = _tmp21_; + _tmp3_ = _tmp25_; + } + _tmp26_ = _tmp3_; + result = _tmp26_; + return result; +} + + +static gboolean gee_tree_map_node_iterator_first (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMap* _tmp3_; + GeeTreeMapNode* _tmp4_; + GeeTreeMapNode* _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = self->_map; + _tmp4_ = _tmp3_->priv->first; + self->current = _tmp4_; + self->_next = NULL; + self->_prev = NULL; + _tmp5_ = self->current; + result = _tmp5_ != NULL; + return result; +} + + +static gboolean gee_tree_map_node_iterator_previous (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMapNode* _tmp3_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = self->current; + if (_tmp3_ != NULL) { + GeeTreeMapNode* _tmp4_; + GeeTreeMapNode* _tmp5_; + _tmp4_ = self->current; + _tmp5_ = _tmp4_->prev; + if (_tmp5_ != NULL) { + GeeTreeMapNode* _tmp6_; + GeeTreeMapNode* _tmp7_; + _tmp6_ = self->current; + _tmp7_ = _tmp6_->prev; + self->current = _tmp7_; + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } + } else { + GeeTreeMapNode* _tmp8_; + _tmp8_ = self->_prev; + if (_tmp8_ != NULL) { + GeeTreeMapNode* _tmp9_; + _tmp9_ = self->_prev; + self->current = _tmp9_; + self->_next = NULL; + self->_prev = NULL; + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } + } +} + + +static gboolean gee_tree_map_node_iterator_has_previous (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + GeeTreeMapNode* _tmp5_; + gboolean _tmp7_; + gboolean _tmp13_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp5_ = self->current; + if (_tmp5_ == NULL) { + GeeTreeMapNode* _tmp6_; + _tmp6_ = self->_prev; + _tmp4_ = _tmp6_ != NULL; + } else { + _tmp4_ = FALSE; + } + _tmp7_ = _tmp4_; + if (_tmp7_) { + _tmp3_ = TRUE; + } else { + gboolean _tmp8_ = FALSE; + GeeTreeMapNode* _tmp9_; + gboolean _tmp12_; + _tmp9_ = self->current; + if (_tmp9_ != NULL) { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = self->current; + _tmp11_ = _tmp10_->prev; + _tmp8_ = _tmp11_ != NULL; + } else { + _tmp8_ = FALSE; + } + _tmp12_ = _tmp8_; + _tmp3_ = _tmp12_; + } + _tmp13_ = _tmp3_; + result = _tmp13_; + return result; +} + + +static gboolean gee_tree_map_node_iterator_last (GeeTreeMapNodeIterator* self) { + gboolean result = FALSE; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMap* _tmp3_; + GeeTreeMapNode* _tmp4_; + GeeTreeMapNode* _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = self->_map; + _tmp4_ = _tmp3_->priv->last; + self->current = _tmp4_; + self->_next = NULL; + self->_prev = NULL; + _tmp5_ = self->current; + result = _tmp5_ != NULL; + return result; +} + + +static void gee_tree_map_node_iterator_remove (GeeTreeMapNodeIterator* self) { + g_return_if_fail (self != NULL); + g_assert_not_reached (); +} + + +static void gee_tree_map_node_iterator_unset (GeeTreeMapNodeIterator* self) { + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMapNode* _tmp3_; + gpointer value = NULL; + GeeTreeMap* _tmp4_; + GeeTreeMap* _tmp5_; + GeeTreeMapNode* _tmp6_; + gconstpointer _tmp7_; + gpointer _tmp8_ = NULL; + GeeTreeMapNode* _tmp9_ = NULL; + GeeTreeMapNode* _tmp10_ = NULL; + gboolean _tmp11_ = FALSE; + gboolean success; + gboolean _tmp12_; + GeeTreeMap* _tmp13_; + GeeTreeMapNode* _tmp14_; + gint _tmp17_; + GeeTreeMap* _tmp18_; + gint _tmp19_; + gint _tmp20_; + GeeTreeMap* _tmp21_; + gint _tmp22_; + g_return_if_fail (self != NULL); + _tmp0_ = self->stamp; + _tmp1_ = self->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = self->current; + _vala_assert (_tmp3_ != NULL, "current != null"); + _tmp4_ = self->_map; + _tmp5_ = self->_map; + _tmp6_ = self->current; + _tmp7_ = _tmp6_->key; + _tmp11_ = gee_tree_map_remove_from_node (_tmp4_, &_tmp5_->priv->root, _tmp7_, &_tmp8_, &_tmp9_, &_tmp10_); + ((value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (value = (self->priv->v_destroy_func (value), NULL)); + value = _tmp8_; + self->_prev = _tmp9_; + self->_next = _tmp10_; + success = _tmp11_; + _tmp12_ = success; + _vala_assert (_tmp12_, "success"); + _tmp13_ = self->_map; + _tmp14_ = _tmp13_->priv->root; + if (_tmp14_ != NULL) { + GeeTreeMap* _tmp15_; + GeeTreeMapNode* _tmp16_; + _tmp15_ = self->_map; + _tmp16_ = _tmp15_->priv->root; + _tmp16_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; + } + self->current = NULL; + _tmp17_ = self->stamp; + self->stamp = _tmp17_ + 1; + _tmp18_ = self->_map; + _tmp19_ = _tmp18_->priv->stamp; + _tmp18_->priv->stamp = _tmp19_ + 1; + _tmp20_ = self->stamp; + _tmp21_ = self->_map; + _tmp22_ = _tmp21_->priv->stamp; + _vala_assert (_tmp20_ == _tmp22_, "stamp == _map.stamp"); + ((value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (value = (self->priv->v_destroy_func (value), NULL)); +} + + +static GeeTreeMapNode* gee_tree_map_node_iterator_safe_next_get (GeeTreeMapNodeIterator* self) { + GeeTreeMapNode* result = NULL; + GeeTreeMapNode* _tmp0_ = NULL; + GeeTreeMapNode* _tmp1_; + GeeTreeMapNode* _tmp5_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = self->current; + if (_tmp1_ != NULL) { + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_; + _tmp2_ = self->current; + _tmp3_ = _tmp2_->next; + _tmp0_ = _tmp3_; + } else { + GeeTreeMapNode* _tmp4_; + _tmp4_ = self->_next; + _tmp0_ = _tmp4_; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static GeeTreeMapNode* gee_tree_map_node_iterator_safe_previous_get (GeeTreeMapNodeIterator* self) { + GeeTreeMapNode* result = NULL; + GeeTreeMapNode* _tmp0_ = NULL; + GeeTreeMapNode* _tmp1_; + GeeTreeMapNode* _tmp5_; + g_return_val_if_fail (self != NULL, NULL); + _tmp1_ = self->current; + if (_tmp1_ != NULL) { + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_; + _tmp2_ = self->current; + _tmp3_ = _tmp2_->prev; + _tmp0_ = _tmp3_; + } else { + GeeTreeMapNode* _tmp4_; + _tmp4_ = self->_prev; + _tmp0_ = _tmp4_; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static gboolean gee_tree_map_node_iterator_get_read_only (GeeTreeMapNodeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_TREE_MAP_NODE_ITERATOR_GET_CLASS (self)->get_read_only (self); +} + + +static gboolean gee_tree_map_node_iterator_real_get_read_only (GeeTreeMapNodeIterator* base) { + gboolean result; + GeeTreeMapNodeIterator* self; + self = base; + result = TRUE; + return result; +} + + +static gboolean gee_tree_map_node_iterator_get_valid (GeeTreeMapNodeIterator* self) { + gboolean result; + GeeTreeMapNode* _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->current; + result = _tmp0_ != NULL; + return result; +} + + +static void gee_tree_map_node_iterator_class_init (GeeTreeMapNodeIteratorClass * klass) { + gee_tree_map_node_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapNodeIteratorPrivate)); + GEE_TREE_MAP_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_tree_map_node_iterator_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_node_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_node_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_node_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_node_iterator_instance_init (GeeTreeMapNodeIterator * self) { + self->priv = GEE_TREE_MAP_NODE_ITERATOR_GET_PRIVATE (self); + self->started = FALSE; +} + + +static void gee_tree_map_node_iterator_finalize (GObject* obj) { + GeeTreeMapNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); + _g_object_unref0 (self->_map); + G_OBJECT_CLASS (gee_tree_map_node_iterator_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_node_iterator_get_type (void) { + static volatile gsize gee_tree_map_node_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_node_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapNodeIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_node_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapNodeIterator), 0, (GInstanceInitFunc) gee_tree_map_node_iterator_instance_init, NULL }; + GType gee_tree_map_node_iterator_type_id; + gee_tree_map_node_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeMapNodeIterator", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_node_iterator_type_id__volatile, gee_tree_map_node_iterator_type_id); + } + return gee_tree_map_node_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); + switch (property_id) { + case GEE_TREE_MAP_NODE_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_tree_map_node_iterator_get_read_only (self)); + break; + case GEE_TREE_MAP_NODE_ITERATOR_VALID: + g_value_set_boolean (value, gee_tree_map_node_iterator_get_valid (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); + switch (property_id) { + case GEE_TREE_MAP_NODE_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_NODE_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_NODE_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_NODE_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_NODE_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubNodeIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapRange* _tmp3_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + self = (GeeTreeMapSubNodeIterator*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_map); + self->_map = _tmp1_; + _tmp2_ = range; + _tmp3_ = _gee_tree_map_range_ref0 (_tmp2_); + _gee_tree_map_range_unref0 (self->range); + self->range = _tmp3_; + return self; +} + + +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_node_iterator_construct (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + GeeTreeMapSubNodeIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMap* _tmp1_; + GeeTreeMapRange* _tmp2_; + GeeTreeMapRange* _tmp3_; + GeeTreeMap* _tmp4_; + GeeTreeMapNode* _tmp5_; + GeeTreeMapNodeIterator* _tmp6_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + self = (GeeTreeMapSubNodeIterator*) g_object_new (object_type, NULL); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + _tmp0_ = map; + _tmp1_ = _g_object_ref0 (_tmp0_); + _g_object_unref0 (self->_map); + self->_map = _tmp1_; + _tmp2_ = range; + _tmp3_ = _gee_tree_map_range_ref0 (_tmp2_); + _gee_tree_map_range_unref0 (self->range); + self->range = _tmp3_; + _tmp4_ = self->_map; + _tmp5_ = node; + _tmp6_ = gee_tree_map_node_iterator_new_pointing (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp4_, _tmp5_); + _g_object_unref0 (self->iterator); + self->iterator = _tmp6_; + return self; +} + + +static GeeTreeMapSubNodeIterator* gee_tree_map_sub_node_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + return gee_tree_map_sub_node_iterator_construct_pointing (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range, node); +} + + +static gboolean gee_tree_map_sub_node_iterator_next (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapNodeIterator* _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->iterator; + if (_tmp0_ != NULL) { + GeeTreeMapNodeIterator* _tmp1_; + GeeTreeMapNode* _tmp2_ = NULL; + GeeTreeMapNode* node; + gboolean _tmp3_ = FALSE; + GeeTreeMapNode* _tmp4_; + gboolean _tmp9_; + _tmp1_ = self->iterator; + _tmp2_ = gee_tree_map_node_iterator_safe_next_get (_tmp1_); + node = _tmp2_; + _tmp4_ = node; + if (_tmp4_ != NULL) { + GeeTreeMapRange* _tmp5_; + GeeTreeMapNode* _tmp6_; + gconstpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp5_ = self->range; + _tmp6_ = node; + _tmp7_ = _tmp6_->key; + _tmp8_ = gee_tree_map_range_in_range (_tmp5_, _tmp7_); + _tmp3_ = _tmp8_; + } else { + _tmp3_ = FALSE; + } + _tmp9_ = _tmp3_; + if (_tmp9_) { + GeeTreeMapNodeIterator* _tmp10_; + gboolean _tmp11_ = FALSE; + _tmp10_ = self->iterator; + _tmp11_ = gee_tree_map_node_iterator_next (_tmp10_); + _vala_assert (_tmp11_, "iterator.next ()"); + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } + } else { + gboolean _tmp12_ = FALSE; + _tmp12_ = gee_tree_map_sub_node_iterator_first (self); + result = _tmp12_; + return result; + } +} + + +static gboolean gee_tree_map_sub_node_iterator_has_next (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapNodeIterator* _tmp0_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->iterator; + if (_tmp0_ != NULL) { + GeeTreeMapNodeIterator* _tmp1_; + GeeTreeMapNode* _tmp2_ = NULL; + GeeTreeMapNode* node; + gboolean _tmp3_ = FALSE; + GeeTreeMapNode* _tmp4_; + gboolean _tmp9_; + _tmp1_ = self->iterator; + _tmp2_ = gee_tree_map_node_iterator_safe_next_get (_tmp1_); + node = _tmp2_; + _tmp4_ = node; + if (_tmp4_ != NULL) { + GeeTreeMapRange* _tmp5_; + GeeTreeMapNode* _tmp6_; + gconstpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp5_ = self->range; + _tmp6_ = node; + _tmp7_ = _tmp6_->key; + _tmp8_ = gee_tree_map_range_in_range (_tmp5_, _tmp7_); + _tmp3_ = _tmp8_; + } else { + _tmp3_ = FALSE; + } + _tmp9_ = _tmp3_; + result = _tmp9_; + return result; + } else { + GeeTreeMapRange* _tmp10_; + GeeTreeMapNode* _tmp11_ = NULL; + _tmp10_ = self->range; + _tmp11_ = gee_tree_map_range_first (_tmp10_); + result = _tmp11_ != NULL; + return result; + } +} + + +static gboolean gee_tree_map_sub_node_iterator_real_first (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeTreeMapNodeIterator* _tmp4_ = NULL; + _tmp0_ = self->range; + _tmp1_ = gee_tree_map_range_first (_tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = FALSE; + return result; + } + _tmp3_ = node; + _tmp4_ = gee_tree_map_sub_node_iterator_iterator_pointing_at (self, _tmp3_); + _g_object_unref0 (self->iterator); + self->iterator = _tmp4_; + result = TRUE; + return result; +} + + +gboolean gee_tree_map_sub_node_iterator_first (GeeTreeMapSubNodeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_CLASS (self)->first (self); +} + + +static gboolean gee_tree_map_sub_node_iterator_previous (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapNodeIterator* _tmp0_; + GeeTreeMapNode* node = NULL; + gboolean _tmp1_ = FALSE; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + GeeTreeMapNode* _tmp4_; + gboolean _tmp9_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->iterator; + if (_tmp0_ == NULL) { + result = FALSE; + return result; + } + _tmp2_ = self->iterator; + _tmp3_ = gee_tree_map_node_iterator_safe_previous_get (_tmp2_); + node = _tmp3_; + _tmp4_ = node; + if (_tmp4_ != NULL) { + GeeTreeMapRange* _tmp5_; + GeeTreeMapNode* _tmp6_; + gconstpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp5_ = self->range; + _tmp6_ = node; + _tmp7_ = _tmp6_->key; + _tmp8_ = gee_tree_map_range_in_range (_tmp5_, _tmp7_); + _tmp1_ = _tmp8_; + } else { + _tmp1_ = FALSE; + } + _tmp9_ = _tmp1_; + if (_tmp9_) { + GeeTreeMapNodeIterator* _tmp10_; + gboolean _tmp11_ = FALSE; + _tmp10_ = self->iterator; + _tmp11_ = gee_tree_map_node_iterator_previous (_tmp10_); + _vala_assert (_tmp11_, "iterator.previous ()"); + result = TRUE; + return result; + } else { + result = FALSE; + return result; + } +} + + +static gboolean gee_tree_map_sub_node_iterator_has_previous (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapNodeIterator* _tmp0_; + GeeTreeMapNode* node = NULL; + gboolean _tmp1_ = FALSE; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_ = NULL; + GeeTreeMapNode* _tmp4_; + gboolean _tmp9_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp0_ = self->iterator; + if (_tmp0_ == NULL) { + result = FALSE; + return result; + } + _tmp2_ = self->iterator; + _tmp3_ = gee_tree_map_node_iterator_safe_previous_get (_tmp2_); + node = _tmp3_; + _tmp4_ = node; + if (_tmp4_ != NULL) { + GeeTreeMapRange* _tmp5_; + GeeTreeMapNode* _tmp6_; + gconstpointer _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp5_ = self->range; + _tmp6_ = node; + _tmp7_ = _tmp6_->key; + _tmp8_ = gee_tree_map_range_in_range (_tmp5_, _tmp7_); + _tmp1_ = _tmp8_; + } else { + _tmp1_ = FALSE; + } + _tmp9_ = _tmp1_; + result = _tmp9_; + return result; +} + + +static gboolean gee_tree_map_sub_node_iterator_real_last (GeeTreeMapSubNodeIterator* self) { + gboolean result = FALSE; + GeeTreeMapRange* _tmp0_; + GeeTreeMapNode* _tmp1_ = NULL; + GeeTreeMapNode* node; + GeeTreeMapNode* _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeTreeMapNodeIterator* _tmp4_ = NULL; + _tmp0_ = self->range; + _tmp1_ = gee_tree_map_range_last (_tmp0_); + node = _tmp1_; + _tmp2_ = node; + if (_tmp2_ == NULL) { + result = FALSE; + return result; + } + _tmp3_ = node; + _tmp4_ = gee_tree_map_sub_node_iterator_iterator_pointing_at (self, _tmp3_); + _g_object_unref0 (self->iterator); + self->iterator = _tmp4_; + result = TRUE; + return result; +} + + +gboolean gee_tree_map_sub_node_iterator_last (GeeTreeMapSubNodeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_CLASS (self)->last (self); +} + + +static void gee_tree_map_sub_node_iterator_remove (GeeTreeMapSubNodeIterator* self) { + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + g_return_if_fail (self != NULL); + _tmp0_ = gee_tree_map_sub_node_iterator_get_valid (self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = self->iterator; + gee_tree_map_node_iterator_remove (_tmp2_); +} + + +static void gee_tree_map_sub_node_iterator_unset (GeeTreeMapSubNodeIterator* self) { + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + g_return_if_fail (self != NULL); + _tmp0_ = gee_tree_map_sub_node_iterator_get_valid (self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = self->iterator; + gee_tree_map_node_iterator_unset (_tmp2_); +} + + +static GeeTreeMapNodeIterator* gee_tree_map_sub_node_iterator_real_iterator_pointing_at (GeeTreeMapSubNodeIterator* self, GeeTreeMapNode* node) { + GeeTreeMapNodeIterator* result = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = self->_map; + _tmp1_ = node; + _tmp2_ = gee_tree_map_node_iterator_new_pointing (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp1_); + result = _tmp2_; + return result; +} + + +GeeTreeMapNodeIterator* gee_tree_map_sub_node_iterator_iterator_pointing_at (GeeTreeMapSubNodeIterator* self, GeeTreeMapNode* node) { + g_return_val_if_fail (self != NULL, NULL); + return GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_CLASS (self)->iterator_pointing_at (self, node); +} + + +static gboolean gee_tree_map_sub_node_iterator_get_read_only (GeeTreeMapSubNodeIterator* self) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_CLASS (self)->get_read_only (self); +} + + +static gboolean gee_tree_map_sub_node_iterator_real_get_read_only (GeeTreeMapSubNodeIterator* base) { + gboolean result; + GeeTreeMapSubNodeIterator* self; + self = base; + result = TRUE; + return result; +} + + +static gboolean gee_tree_map_sub_node_iterator_get_valid (GeeTreeMapSubNodeIterator* self) { + gboolean result; + gboolean _tmp0_ = FALSE; + GeeTreeMapNodeIterator* _tmp1_; + gboolean _tmp5_; + g_return_val_if_fail (self != NULL, FALSE); + _tmp1_ = self->iterator; + if (_tmp1_ != NULL) { + GeeTreeMapNodeIterator* _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + _tmp2_ = self->iterator; + _tmp3_ = gee_tree_map_node_iterator_get_valid (_tmp2_); + _tmp4_ = _tmp3_; + _tmp0_ = _tmp4_; + } else { + _tmp0_ = FALSE; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static void gee_tree_map_sub_node_iterator_class_init (GeeTreeMapSubNodeIteratorClass * klass) { + gee_tree_map_sub_node_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubNodeIteratorPrivate)); + GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS (klass)->first = gee_tree_map_sub_node_iterator_real_first; + GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS (klass)->last = gee_tree_map_sub_node_iterator_real_last; + GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS (klass)->iterator_pointing_at = gee_tree_map_sub_node_iterator_real_iterator_pointing_at; + GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_tree_map_sub_node_iterator_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_node_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_node_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_tree_map_sub_node_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_NODE_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void gee_tree_map_sub_node_iterator_instance_init (GeeTreeMapSubNodeIterator * self) { + self->priv = GEE_TREE_MAP_SUB_NODE_ITERATOR_GET_PRIVATE (self); + self->iterator = NULL; +} + + +static void gee_tree_map_sub_node_iterator_finalize (GObject* obj) { + GeeTreeMapSubNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIterator); + _g_object_unref0 (self->_map); + _gee_tree_map_range_unref0 (self->range); + _g_object_unref0 (self->iterator); + G_OBJECT_CLASS (gee_tree_map_sub_node_iterator_parent_class)->finalize (obj); +} + + +static GType gee_tree_map_sub_node_iterator_get_type (void) { + static volatile gsize gee_tree_map_sub_node_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_node_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubNodeIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_node_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubNodeIterator), 0, (GInstanceInitFunc) gee_tree_map_sub_node_iterator_instance_init, NULL }; + GType gee_tree_map_sub_node_iterator_type_id; + gee_tree_map_sub_node_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeMapSubNodeIterator", &g_define_type_info, 0); + g_once_init_leave (&gee_tree_map_sub_node_iterator_type_id__volatile, gee_tree_map_sub_node_iterator_type_id); + } + return gee_tree_map_sub_node_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIterator); + switch (property_id) { + case GEE_TREE_MAP_SUB_NODE_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_tree_map_sub_node_iterator_get_read_only (self)); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_VALID: + g_value_set_boolean (value, gee_tree_map_sub_node_iterator_get_valid (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubNodeIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, GeeTreeMapSubNodeIterator); + switch (property_id) { + case GEE_TREE_MAP_SUB_NODE_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_NODE_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapKeyIterator * self = NULL; + GeeTreeMap* _tmp0_; + g_return_val_if_fail (map != NULL, NULL); + _tmp0_ = map; + self = (GeeTreeMapKeyIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_key_iterator_construct (GEE_TREE_MAP_TYPE_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + GeeTreeMapKeyIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (current != NULL, NULL); + _tmp0_ = map; + _tmp1_ = current; + self = (GeeTreeMapKeyIterator*) gee_tree_map_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + return gee_tree_map_key_iterator_construct_pointing (GEE_TREE_MAP_TYPE_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, current); +} + + +static gpointer gee_tree_map_key_iterator_real_get (GeeIterator* base) { + GeeTreeMapKeyIterator * self; + gpointer result = NULL; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + GeeTreeMapNode* _tmp3_; + GeeTreeMapNode* _tmp4_; + gconstpointer _tmp5_; + gpointer _tmp6_; + self = (GeeTreeMapKeyIterator*) base; + _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; + _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; + _vala_assert (_tmp3_ != NULL, "current != null"); + _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp5_ = _tmp4_->key; + _tmp6_ = ((_tmp5_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + result = _tmp6_; + return result; +} + + +static gboolean gee_tree_map_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapKeyIterator * self; + gboolean result = FALSE; + GeeTreeMapNode* _tmp0_; + self = (GeeTreeMapKeyIterator*) base; + _tmp0_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeTreeMapNode* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + gboolean _tmp5_ = FALSE; + GeeTreeMapNode* _tmp6_; + GeeTreeMapNode* _tmp7_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp3_ = _tmp2_->key; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + _tmp5_ = _tmp1_ (_tmp4_, _tmp1__target); + if (!_tmp5_) { + result = FALSE; + return result; + } + _tmp6_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp7_ = _tmp6_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp7_; + } else { + GeeTreeMapNode* _tmp8_; + _tmp8_ = ((GeeTreeMapNodeIterator*) self)->_next; + if (_tmp8_ == NULL) { + GeeTreeMap* _tmp9_; + GeeTreeMapNode* _tmp10_; + _tmp9_ = ((GeeTreeMapNodeIterator*) self)->_map; + _tmp10_ = _tmp9_->priv->first; + ((GeeTreeMapNodeIterator*) self)->current = _tmp10_; + ((GeeTreeMapNodeIterator*) self)->started = TRUE; + } else { + GeeTreeMapNode* _tmp11_; + GeeTreeMapNode* _tmp12_; + _tmp11_ = ((GeeTreeMapNodeIterator*) self)->_next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp11_; + _tmp12_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp12_ != NULL) { + ((GeeTreeMapNodeIterator*) self)->_next = NULL; + ((GeeTreeMapNodeIterator*) self)->_prev = NULL; + } + } + } + { + gboolean _tmp13_; + _tmp13_ = TRUE; + while (TRUE) { + gboolean _tmp14_; + GeeTreeMapNode* _tmp17_; + GeeForallFunc _tmp18_; + void* _tmp18__target; + GeeTreeMapNode* _tmp19_; + gconstpointer _tmp20_; + gpointer _tmp21_; + gboolean _tmp22_ = FALSE; + _tmp14_ = _tmp13_; + if (!_tmp14_) { + GeeTreeMapNode* _tmp15_; + GeeTreeMapNode* _tmp16_; + _tmp15_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp16_ = _tmp15_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp16_; + } + _tmp13_ = FALSE; + _tmp17_ = ((GeeTreeMapNodeIterator*) self)->current; + if (!(_tmp17_ != NULL)) { + break; + } + _tmp18_ = f; + _tmp18__target = f_target; + _tmp19_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp20_ = _tmp19_->key; + _tmp21_ = ((_tmp20_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp20_) : ((gpointer) _tmp20_); + _tmp22_ = _tmp18_ (_tmp21_, _tmp18__target); + if (!_tmp22_) { + result = FALSE; + return result; + } + } + } + result = TRUE; + return result; +} + + +static void gee_tree_map_key_iterator_class_init (GeeTreeMapKeyIteratorClass * klass) { + gee_tree_map_key_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapKeyIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_key_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_key_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_tree_map_key_iterator_gee_traversable_get_g_type (GeeTreeMapKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_key_iterator_gee_traversable_get_g_dup_func (GeeTreeMapKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_key_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_tree_map_key_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_key_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_key_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_key_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_key_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_key_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_tree_map_key_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_key_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_key_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_node_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_read_only; +} + + +static GType gee_tree_map_key_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_key_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_key_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_tree_map_key_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_key_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_key_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_key_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_key_iterator_gee_bidir_iterator_get_g_destroy_func; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_last; +} + + +static void gee_tree_map_key_iterator_instance_init (GeeTreeMapKeyIterator * self) { + self->priv = GEE_TREE_MAP_KEY_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_key_iterator_get_type (void) { + static volatile gsize gee_tree_map_key_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_key_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapKeyIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_key_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapKeyIterator), 0, (GInstanceInitFunc) gee_tree_map_key_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_key_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_key_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_key_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_key_iterator_type_id; + gee_tree_map_key_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapKeyIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_key_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_key_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_key_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_key_iterator_type_id__volatile, gee_tree_map_key_iterator_type_id); + } + return gee_tree_map_key_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_ITERATOR, GeeTreeMapKeyIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_ITERATOR, GeeTreeMapKeyIterator); + switch (property_id) { + case GEE_TREE_MAP_KEY_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_KEY_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_KEY_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_KEY_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubKeyIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + self = (GeeTreeMapSubKeyIterator*) gee_tree_map_sub_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_key_iterator_construct (GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + GeeTreeMapSubKeyIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapNode* _tmp2_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + _tmp2_ = node; + self = (GeeTreeMapSubKeyIterator*) gee_tree_map_sub_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_, _tmp2_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapSubKeyIterator* gee_tree_map_sub_key_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + return gee_tree_map_sub_key_iterator_construct_pointing (GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range, node); +} + + +static gpointer gee_tree_map_sub_key_iterator_real_get (GeeIterator* base) { + GeeTreeMapSubKeyIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapSubKeyIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp3_ = _tmp2_->current; + _tmp4_ = _tmp3_->key; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; + return result; +} + + +static gboolean gee_tree_map_sub_key_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapSubKeyIterator * self; + gboolean result = FALSE; + gboolean _tmp0_; + gboolean _tmp1_; + self = (GeeTreeMapSubKeyIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeForallFunc _tmp2_; + void* _tmp2__target; + GeeTreeMapNodeIterator* _tmp3_; + GeeTreeMapNode* _tmp4_; + gconstpointer _tmp5_; + gpointer _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp4_ = _tmp3_->current; + _tmp5_ = _tmp4_->key; + _tmp6_ = ((_tmp5_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + _tmp7_ = _tmp2_ (_tmp6_, _tmp2__target); + if (!_tmp7_) { + result = FALSE; + return result; + } + } + while (TRUE) { + GeeTreeMapNodeIterator* _tmp8_; + gboolean _tmp9_ = FALSE; + GeeForallFunc _tmp10_; + void* _tmp10__target; + GeeTreeMapNodeIterator* _tmp11_; + GeeTreeMapNode* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp8_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp9_ = gee_tree_map_node_iterator_next (_tmp8_); + if (!_tmp9_) { + break; + } + _tmp10_ = f; + _tmp10__target = f_target; + _tmp11_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp12_ = _tmp11_->current; + _tmp13_ = _tmp12_->key; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _tmp15_ = _tmp10_ (_tmp14_, _tmp10__target); + if (!_tmp15_) { + result = FALSE; + return result; + } + } + result = TRUE; + return result; +} + + +static void gee_tree_map_sub_key_iterator_class_init (GeeTreeMapSubKeyIteratorClass * klass) { + gee_tree_map_sub_key_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubKeyIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_key_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_key_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_tree_map_sub_key_iterator_gee_traversable_get_g_type (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_key_iterator_gee_traversable_get_g_dup_func (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_key_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_tree_map_sub_key_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_sub_key_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_sub_key_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_sub_key_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_sub_key_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_sub_key_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_tree_map_sub_key_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_sub_key_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_sub_key_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_read_only; +} + + +static GType gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapSubKeyIterator* self) { + return self->priv->k_destroy_func; +} + + +static void gee_tree_map_sub_key_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_sub_key_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_sub_key_iterator_gee_bidir_iterator_get_g_destroy_func; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_last; +} + + +static void gee_tree_map_sub_key_iterator_instance_init (GeeTreeMapSubKeyIterator * self) { + self->priv = GEE_TREE_MAP_SUB_KEY_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_sub_key_iterator_get_type (void) { + static volatile gsize gee_tree_map_sub_key_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_key_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubKeyIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_key_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubKeyIterator), 0, (GInstanceInitFunc) gee_tree_map_sub_key_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_sub_key_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_key_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_key_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_sub_key_iterator_type_id; + gee_tree_map_sub_key_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, "GeeTreeMapSubKeyIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_sub_key_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_sub_key_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_sub_key_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_sub_key_iterator_type_id__volatile, gee_tree_map_sub_key_iterator_type_id); + } + return gee_tree_map_sub_key_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubKeyIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_KEY_ITERATOR, GeeTreeMapSubKeyIterator); + switch (property_id) { + case GEE_TREE_MAP_SUB_KEY_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_KEY_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapValueIterator * self = NULL; + GeeTreeMap* _tmp0_; + g_return_val_if_fail (map != NULL, NULL); + _tmp0_ = map; + self = (GeeTreeMapValueIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_value_iterator_construct (GEE_TREE_MAP_TYPE_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +} + + +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + GeeTreeMapValueIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (current != NULL, NULL); + _tmp0_ = map; + _tmp1_ = current; + self = (GeeTreeMapValueIterator*) gee_tree_map_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapValueIterator* gee_tree_map_value_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* current) { + return gee_tree_map_value_iterator_construct_pointing (GEE_TREE_MAP_TYPE_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, current); +} + + +static gpointer gee_tree_map_value_iterator_real_get (GeeIterator* base) { + GeeTreeMapValueIterator * self; + gpointer result = NULL; + gint _tmp0_; + GeeTreeMap* _tmp1_; + gint _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; + self = (GeeTreeMapValueIterator*) base; + _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; + _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); + _tmp3_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp4_ = _tmp3_; + _vala_assert (_tmp4_, "valid"); + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = _tmp5_->value; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + result = _tmp7_; + return result; +} + + +static gboolean gee_tree_map_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapValueIterator * self; + gboolean result = FALSE; + GeeTreeMapNode* _tmp0_; + self = (GeeTreeMapValueIterator*) base; + _tmp0_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeTreeMapNode* _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + gboolean _tmp5_ = FALSE; + GeeTreeMapNode* _tmp6_; + GeeTreeMapNode* _tmp7_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp3_ = _tmp2_->key; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + _tmp5_ = _tmp1_ (_tmp4_, _tmp1__target); + if (!_tmp5_) { + result = FALSE; + return result; + } + _tmp6_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp7_ = _tmp6_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp7_; + } else { + GeeTreeMapNode* _tmp8_; + _tmp8_ = ((GeeTreeMapNodeIterator*) self)->_next; + if (_tmp8_ == NULL) { + GeeTreeMap* _tmp9_; + GeeTreeMapNode* _tmp10_; + _tmp9_ = ((GeeTreeMapNodeIterator*) self)->_map; + _tmp10_ = _tmp9_->priv->first; + ((GeeTreeMapNodeIterator*) self)->current = _tmp10_; + ((GeeTreeMapNodeIterator*) self)->started = TRUE; + } else { + GeeTreeMapNode* _tmp11_; + GeeTreeMapNode* _tmp12_; + _tmp11_ = ((GeeTreeMapNodeIterator*) self)->_next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp11_; + _tmp12_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp12_ != NULL) { + ((GeeTreeMapNodeIterator*) self)->_next = NULL; + ((GeeTreeMapNodeIterator*) self)->_prev = NULL; + } } - _tmp19_ = _tmp16_; - _tmp4_ = _tmp19_; } - _tmp20_ = _tmp4_; - if (_tmp20_) { - _tmp3_ = TRUE; - } else { - gboolean _tmp21_ = FALSE; - GeeTreeMapNode* _tmp22_; - gboolean _tmp25_; - _tmp22_ = self->current; - if (_tmp22_ != NULL) { - GeeTreeMapNode* _tmp23_; - GeeTreeMapNode* _tmp24_; - _tmp23_ = self->current; - _tmp24_ = _tmp23_->next; - _tmp21_ = _tmp24_ != NULL; - } else { - _tmp21_ = FALSE; - } - _tmp25_ = _tmp21_; - _tmp3_ = _tmp25_; + { + gboolean _tmp13_; + _tmp13_ = TRUE; + while (TRUE) { + gboolean _tmp14_; + GeeTreeMapNode* _tmp17_; + GeeForallFunc _tmp18_; + void* _tmp18__target; + GeeTreeMapNode* _tmp19_; + gconstpointer _tmp20_; + gpointer _tmp21_; + gboolean _tmp22_ = FALSE; + _tmp14_ = _tmp13_; + if (!_tmp14_) { + GeeTreeMapNode* _tmp15_; + GeeTreeMapNode* _tmp16_; + _tmp15_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp16_ = _tmp15_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp16_; + } + _tmp13_ = FALSE; + _tmp17_ = ((GeeTreeMapNodeIterator*) self)->current; + if (!(_tmp17_ != NULL)) { + break; + } + _tmp18_ = f; + _tmp18__target = f_target; + _tmp19_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp20_ = _tmp19_->key; + _tmp21_ = ((_tmp20_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp20_) : ((gpointer) _tmp20_); + _tmp22_ = _tmp18_ (_tmp21_, _tmp18__target); + if (!_tmp22_) { + result = FALSE; + return result; + } + } + } + result = TRUE; + return result; +} + + +static void gee_tree_map_value_iterator_class_init (GeeTreeMapValueIteratorClass * klass) { + gee_tree_map_value_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapValueIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_value_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_value_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_tree_map_value_iterator_gee_traversable_get_g_type (GeeTreeMapValueIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_value_iterator_gee_traversable_get_g_dup_func (GeeTreeMapValueIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_value_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapValueIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_value_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_value_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_value_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_value_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_value_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_value_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_tree_map_value_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_value_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_value_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_node_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_read_only; +} + + +static GType gee_tree_map_value_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapValueIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_value_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapValueIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_value_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapValueIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_value_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_value_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_value_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_value_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_value_iterator_gee_bidir_iterator_get_g_destroy_func; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_last; +} + + +static void gee_tree_map_value_iterator_instance_init (GeeTreeMapValueIterator * self) { + self->priv = GEE_TREE_MAP_VALUE_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_value_iterator_get_type (void) { + static volatile gsize gee_tree_map_value_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_value_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapValueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_value_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapValueIterator), 0, (GInstanceInitFunc) gee_tree_map_value_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_value_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_value_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_value_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_value_iterator_type_id; + gee_tree_map_value_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapValueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_value_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_value_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_value_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_value_iterator_type_id__volatile, gee_tree_map_value_iterator_type_id); + } + return gee_tree_map_value_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_ITERATOR, GeeTreeMapValueIterator); + switch (property_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; } - _tmp26_ = _tmp3_; - result = _tmp26_; - return result; } -static gboolean gee_tree_map_node_iterator_first (GeeTreeMapNodeIterator* self) { - gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMap* _tmp3_; - GeeTreeMapNode* _tmp4_; - GeeTreeMapNode* _tmp5_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = self->_map; - _tmp4_ = _tmp3_->priv->first; - self->current = _tmp4_; - self->_next = NULL; - self->_prev = NULL; - _tmp5_ = self->current; - result = _tmp5_ != NULL; +static void _vala_gee_tree_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_ITERATOR, GeeTreeMapValueIterator); + switch (property_id) { + case GEE_TREE_MAP_VALUE_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_VALUE_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_VALUE_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_VALUE_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubValueIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + self = (GeeTreeMapSubValueIterator*) gee_tree_map_sub_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_value_iterator_construct (GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + GeeTreeMapSubValueIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapNode* _tmp2_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + _tmp2_ = node; + self = (GeeTreeMapSubValueIterator*) gee_tree_map_sub_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_, _tmp2_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapSubValueIterator* gee_tree_map_sub_value_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + return gee_tree_map_sub_value_iterator_construct_pointing (GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range, node); +} + + +static gpointer gee_tree_map_sub_value_iterator_real_get (GeeIterator* base) { + GeeTreeMapSubValueIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapSubValueIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp3_ = _tmp2_->current; + _tmp4_ = _tmp3_->value; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; return result; } -static gboolean gee_tree_map_node_iterator_previous (GeeTreeMapNodeIterator* self) { +static gboolean gee_tree_map_sub_value_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapSubValueIterator * self; gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMapNode* _tmp3_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = self->current; - if (_tmp3_ != NULL) { + gboolean _tmp0_; + gboolean _tmp1_; + self = (GeeTreeMapSubValueIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeForallFunc _tmp2_; + void* _tmp2__target; + GeeTreeMapNodeIterator* _tmp3_; GeeTreeMapNode* _tmp4_; - GeeTreeMapNode* _tmp5_; - _tmp4_ = self->current; - _tmp5_ = _tmp4_->prev; - if (_tmp5_ != NULL) { - GeeTreeMapNode* _tmp6_; - GeeTreeMapNode* _tmp7_; - _tmp6_ = self->current; - _tmp7_ = _tmp6_->prev; - self->current = _tmp7_; - result = TRUE; - return result; - } else { + gconstpointer _tmp5_; + gpointer _tmp6_; + gboolean _tmp7_ = FALSE; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp4_ = _tmp3_->current; + _tmp5_ = _tmp4_->key; + _tmp6_ = ((_tmp5_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + _tmp7_ = _tmp2_ (_tmp6_, _tmp2__target); + if (!_tmp7_) { result = FALSE; return result; } - } else { - GeeTreeMapNode* _tmp8_; - _tmp8_ = self->_prev; - if (_tmp8_ != NULL) { - GeeTreeMapNode* _tmp9_; - _tmp9_ = self->_prev; - self->current = _tmp9_; - self->_next = NULL; - self->_prev = NULL; - result = TRUE; - return result; - } else { + } + while (TRUE) { + GeeTreeMapNodeIterator* _tmp8_; + gboolean _tmp9_ = FALSE; + GeeForallFunc _tmp10_; + void* _tmp10__target; + GeeTreeMapNodeIterator* _tmp11_; + GeeTreeMapNode* _tmp12_; + gconstpointer _tmp13_; + gpointer _tmp14_; + gboolean _tmp15_ = FALSE; + _tmp8_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp9_ = gee_tree_map_node_iterator_next (_tmp8_); + if (!_tmp9_) { + break; + } + _tmp10_ = f; + _tmp10__target = f_target; + _tmp11_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp12_ = _tmp11_->current; + _tmp13_ = _tmp12_->key; + _tmp14_ = ((_tmp13_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp13_) : ((gpointer) _tmp13_); + _tmp15_ = _tmp10_ (_tmp14_, _tmp10__target); + if (!_tmp15_) { result = FALSE; return result; } } + result = TRUE; + return result; } -static gboolean gee_tree_map_node_iterator_has_previous (GeeTreeMapNodeIterator* self) { - gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - gboolean _tmp3_ = FALSE; - gboolean _tmp4_ = FALSE; - GeeTreeMapNode* _tmp5_; - gboolean _tmp7_; - gboolean _tmp13_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp5_ = self->current; - if (_tmp5_ == NULL) { - GeeTreeMapNode* _tmp6_; - _tmp6_ = self->_prev; - _tmp4_ = _tmp6_ != NULL; - } else { - _tmp4_ = FALSE; - } - _tmp7_ = _tmp4_; - if (_tmp7_) { - _tmp3_ = TRUE; - } else { - gboolean _tmp8_ = FALSE; - GeeTreeMapNode* _tmp9_; - gboolean _tmp12_; - _tmp9_ = self->current; - if (_tmp9_ != NULL) { - GeeTreeMapNode* _tmp10_; - GeeTreeMapNode* _tmp11_; - _tmp10_ = self->current; - _tmp11_ = _tmp10_->prev; - _tmp8_ = _tmp11_ != NULL; - } else { - _tmp8_ = FALSE; - } - _tmp12_ = _tmp8_; - _tmp3_ = _tmp12_; - } - _tmp13_ = _tmp3_; - result = _tmp13_; - return result; +static void gee_tree_map_sub_value_iterator_class_init (GeeTreeMapSubValueIteratorClass * klass) { + gee_tree_map_sub_value_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubValueIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_value_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_value_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_tree_map_sub_value_iterator_gee_traversable_get_g_type (GeeTreeMapSubValueIterator* self) { + return self->priv->v_type; } -static gboolean gee_tree_map_node_iterator_last (GeeTreeMapNodeIterator* self) { - gboolean result = FALSE; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMap* _tmp3_; - GeeTreeMapNode* _tmp4_; - GeeTreeMapNode* _tmp5_; - g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = self->_map; - _tmp4_ = _tmp3_->priv->last; - self->current = _tmp4_; - self->_next = NULL; - self->_prev = NULL; - _tmp5_ = self->current; - result = _tmp5_ != NULL; - return result; +static GBoxedCopyFunc gee_tree_map_sub_value_iterator_gee_traversable_get_g_dup_func (GeeTreeMapSubValueIterator* self) { + return self->priv->v_dup_func; } -static void gee_tree_map_node_iterator_remove (GeeTreeMapNodeIterator* self) { - g_return_if_fail (self != NULL); - g_assert_not_reached (); +static GDestroyNotify gee_tree_map_sub_value_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapSubValueIterator* self) { + return self->priv->v_destroy_func; } -static void gee_tree_map_node_iterator_unset (GeeTreeMapNodeIterator* self) { - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMapNode* _tmp3_; - gpointer value = NULL; - GeeTreeMap* _tmp4_; - GeeTreeMap* _tmp5_; - GeeTreeMapNode* _tmp6_; - gconstpointer _tmp7_; - gpointer _tmp8_ = NULL; - GeeTreeMapNode* _tmp9_ = NULL; - GeeTreeMapNode* _tmp10_ = NULL; - gboolean _tmp11_ = FALSE; - gboolean success; - gboolean _tmp12_; - GeeTreeMap* _tmp13_; - GeeTreeMapNode* _tmp14_; - gint _tmp17_; - GeeTreeMap* _tmp18_; - gint _tmp19_; - gint _tmp20_; - GeeTreeMap* _tmp21_; - gint _tmp22_; - g_return_if_fail (self != NULL); - _tmp0_ = self->stamp; - _tmp1_ = self->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = self->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = self->_map; - _tmp5_ = self->_map; - _tmp6_ = self->current; - _tmp7_ = _tmp6_->key; - _tmp11_ = gee_tree_map_remove_from_node (_tmp4_, &_tmp5_->priv->root, _tmp7_, &_tmp8_, &_tmp9_, &_tmp10_); - ((value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (value = (self->priv->v_destroy_func (value), NULL)); - value = _tmp8_; - self->_prev = _tmp9_; - self->_next = _tmp10_; - success = _tmp11_; - _tmp12_ = success; - _vala_assert (_tmp12_, "success"); - _tmp13_ = self->_map; - _tmp14_ = _tmp13_->priv->root; - if (_tmp14_ != NULL) { - GeeTreeMap* _tmp15_; - GeeTreeMapNode* _tmp16_; - _tmp15_ = self->_map; - _tmp16_ = _tmp15_->priv->root; - _tmp16_->color = GEE_TREE_MAP_NODE_COLOR_BLACK; - } - self->current = NULL; - _tmp17_ = self->stamp; - self->stamp = _tmp17_ + 1; - _tmp18_ = self->_map; - _tmp19_ = _tmp18_->priv->stamp; - _tmp18_->priv->stamp = _tmp19_ + 1; - _tmp20_ = self->stamp; - _tmp21_ = self->_map; - _tmp22_ = _tmp21_->priv->stamp; - _vala_assert (_tmp20_ == _tmp22_, "stamp == _map.stamp"); - ((value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (value = (self->priv->v_destroy_func (value), NULL)); +static void gee_tree_map_sub_value_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_sub_value_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_sub_value_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_sub_value_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_sub_value_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_sub_value_iterator_gee_traversable_get_g_destroy_func; } -static void gee_tree_map_node_iterator_class_init (GeeTreeMapNodeIteratorClass * klass) { - gee_tree_map_node_iterator_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapNodeIteratorPrivate)); - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_node_iterator_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_node_iterator_set_property; - G_OBJECT_CLASS (klass)->finalize = gee_tree_map_node_iterator_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +static void gee_tree_map_sub_value_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_sub_value_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_sub_value_iterator_real_get; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_has_next; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_remove; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_read_only; } -static void gee_tree_map_node_iterator_instance_init (GeeTreeMapNodeIterator * self) { - self->priv = GEE_TREE_MAP_NODE_ITERATOR_GET_PRIVATE (self); +static GType gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapSubValueIterator* self) { + return self->priv->v_type; } -static void gee_tree_map_node_iterator_finalize (GObject* obj) { - GeeTreeMapNodeIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); - _g_object_unref0 (self->_map); - G_OBJECT_CLASS (gee_tree_map_node_iterator_parent_class)->finalize (obj); +static GBoxedCopyFunc gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapSubValueIterator* self) { + return self->priv->v_dup_func; } -static GType gee_tree_map_node_iterator_get_type (void) { - static volatile gsize gee_tree_map_node_iterator_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_node_iterator_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapNodeIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_node_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapNodeIterator), 0, (GInstanceInitFunc) gee_tree_map_node_iterator_instance_init, NULL }; - GType gee_tree_map_node_iterator_type_id; - gee_tree_map_node_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeMapNodeIterator", &g_define_type_info, 0); - g_once_init_leave (&gee_tree_map_node_iterator_type_id__volatile, gee_tree_map_node_iterator_type_id); +static GDestroyNotify gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapSubValueIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_sub_value_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_sub_value_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_sub_value_iterator_gee_bidir_iterator_get_g_destroy_func; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_last; +} + + +static void gee_tree_map_sub_value_iterator_instance_init (GeeTreeMapSubValueIterator * self) { + self->priv = GEE_TREE_MAP_SUB_VALUE_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_sub_value_iterator_get_type (void) { + static volatile gsize gee_tree_map_sub_value_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_value_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubValueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_value_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubValueIterator), 0, (GInstanceInitFunc) gee_tree_map_sub_value_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_sub_value_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_value_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_value_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_sub_value_iterator_type_id; + gee_tree_map_sub_value_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, "GeeTreeMapSubValueIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_sub_value_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_sub_value_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_sub_value_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_sub_value_iterator_type_id__volatile, gee_tree_map_sub_value_iterator_type_id); } - return gee_tree_map_node_iterator_type_id__volatile; + return gee_tree_map_sub_value_iterator_type_id__volatile; } -static void _vala_gee_tree_map_node_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapNodeIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); +static void _vala_gee_tree_map_sub_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIterator); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -3713,26 +11307,26 @@ static void _vala_gee_tree_map_node_iterator_get_property (GObject * object, gui } -static void _vala_gee_tree_map_node_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapNodeIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_NODE_ITERATOR, GeeTreeMapNodeIterator); +static void _vala_gee_tree_map_sub_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubValueIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_VALUE_ITERATOR, GeeTreeMapSubValueIterator); switch (property_id) { - case GEE_TREE_MAP_NODE_ITERATOR_K_TYPE: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_NODE_ITERATOR_K_DUP_FUNC: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DUP_FUNC: self->priv->k_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_NODE_ITERATOR_K_DESTROY_FUNC: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_K_DESTROY_FUNC: self->priv->k_destroy_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_NODE_ITERATOR_V_TYPE: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_TYPE: self->priv->v_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_NODE_ITERATOR_V_DUP_FUNC: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DUP_FUNC: self->priv->v_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_NODE_ITERATOR_V_DESTROY_FUNC: + case GEE_TREE_MAP_SUB_VALUE_ITERATOR_V_DESTROY_FUNC: self->priv->v_destroy_func = g_value_get_pointer (value); break; default: @@ -3742,12 +11336,12 @@ static void _vala_gee_tree_map_node_iterator_set_property (GObject * object, gui } -static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapKeyIterator * self = NULL; +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + GeeTreeMapEntryIterator * self = NULL; GeeTreeMap* _tmp0_; g_return_val_if_fail (map != NULL, NULL); _tmp0_ = map; - self = (GeeTreeMapKeyIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + self = (GeeTreeMapEntryIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; @@ -3758,92 +11352,257 @@ static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_construct (GType object_ } -static GeeTreeMapKeyIterator* gee_tree_map_key_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_key_iterator_construct (GEE_TREE_MAP_TYPE_KEY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { + return gee_tree_map_entry_iterator_construct (GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); } -static gpointer gee_tree_map_key_iterator_real_get (GeeIterator* base) { - GeeTreeMapKeyIterator * self; - gpointer result = NULL; +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* node) { + GeeTreeMapEntryIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapNode* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = map; + _tmp1_ = node; + self = (GeeTreeMapEntryIterator*) gee_tree_map_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapNode* node) { + return gee_tree_map_entry_iterator_construct_pointing (GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, node); +} + + +static GeeMapEntry* gee_tree_map_entry_iterator_real_get (GeeIterator* base) { + GeeTreeMapEntryIterator * self; + GeeMapEntry* result = NULL; gint _tmp0_; GeeTreeMap* _tmp1_; gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - gconstpointer _tmp5_; - gpointer _tmp6_; - self = (GeeTreeMapKeyIterator*) base; + gboolean _tmp3_; + gboolean _tmp4_; + GeeTreeMapNode* _tmp5_; + GeeMapEntry* _tmp6_ = NULL; + self = (GeeTreeMapEntryIterator*) base; _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; _tmp2_ = _tmp1_->priv->stamp; _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = _tmp4_->key; - _tmp6_ = ((_tmp5_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); + _tmp3_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp4_ = _tmp3_; + _vala_assert (_tmp4_, "valid"); + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp5_); result = _tmp6_; return result; } -static void gee_tree_map_key_iterator_class_init (GeeTreeMapKeyIteratorClass * klass) { - gee_tree_map_key_iterator_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapKeyIteratorPrivate)); - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_key_iterator_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_key_iterator_set_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +static void gee_tree_map_entry_iterator_real_remove (GeeIterator* base) { + GeeTreeMapEntryIterator * self; + self = (GeeTreeMapEntryIterator*) base; + gee_tree_map_node_iterator_unset ((GeeTreeMapNodeIterator*) self); +} + + +static gboolean gee_tree_map_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapEntryIterator * self; + gboolean result = FALSE; + GeeTreeMapNode* _tmp0_; + self = (GeeTreeMapEntryIterator*) base; + _tmp0_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeTreeMapNode* _tmp2_; + GeeMapEntry* _tmp3_ = NULL; + gboolean _tmp4_ = FALSE; + GeeTreeMapNode* _tmp5_; + GeeTreeMapNode* _tmp6_; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp3_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + _tmp4_ = _tmp1_ (_tmp3_, _tmp1__target); + if (!_tmp4_) { + result = FALSE; + return result; + } + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = _tmp5_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp6_; + } else { + GeeTreeMapNode* _tmp7_; + _tmp7_ = ((GeeTreeMapNodeIterator*) self)->_next; + if (_tmp7_ == NULL) { + GeeTreeMap* _tmp8_; + GeeTreeMapNode* _tmp9_; + _tmp8_ = ((GeeTreeMapNodeIterator*) self)->_map; + _tmp9_ = _tmp8_->priv->first; + ((GeeTreeMapNodeIterator*) self)->current = _tmp9_; + ((GeeTreeMapNodeIterator*) self)->started = TRUE; + } else { + GeeTreeMapNode* _tmp10_; + GeeTreeMapNode* _tmp11_; + _tmp10_ = ((GeeTreeMapNodeIterator*) self)->_next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp10_; + _tmp11_ = ((GeeTreeMapNodeIterator*) self)->current; + if (_tmp11_ != NULL) { + ((GeeTreeMapNodeIterator*) self)->_next = NULL; + ((GeeTreeMapNodeIterator*) self)->_prev = NULL; + } + } + } + { + gboolean _tmp12_; + _tmp12_ = TRUE; + while (TRUE) { + gboolean _tmp13_; + GeeTreeMapNode* _tmp16_; + GeeForallFunc _tmp17_; + void* _tmp17__target; + GeeTreeMapNode* _tmp18_; + GeeMapEntry* _tmp19_ = NULL; + gboolean _tmp20_ = FALSE; + _tmp13_ = _tmp12_; + if (!_tmp13_) { + GeeTreeMapNode* _tmp14_; + GeeTreeMapNode* _tmp15_; + _tmp14_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp15_ = _tmp14_->next; + ((GeeTreeMapNodeIterator*) self)->current = _tmp15_; + } + _tmp12_ = FALSE; + _tmp16_ = ((GeeTreeMapNodeIterator*) self)->current; + if (!(_tmp16_ != NULL)) { + break; + } + _tmp17_ = f; + _tmp17__target = f_target; + _tmp18_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp19_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp18_); + _tmp20_ = _tmp17_ (_tmp19_, _tmp17__target); + if (!_tmp20_) { + result = FALSE; + return result; + } + } + } + result = TRUE; + return result; +} + + +static void gee_tree_map_entry_iterator_class_init (GeeTreeMapEntryIteratorClass * klass) { + gee_tree_map_entry_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapEntryIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + + +static GType gee_tree_map_entry_iterator_gee_traversable_get_g_type (GeeTreeMapEntryIterator* self) { + return GEE_MAP_TYPE_ENTRY; +} + + +static GBoxedCopyFunc gee_tree_map_entry_iterator_gee_traversable_get_g_dup_func (GeeTreeMapEntryIterator* self) { + return g_object_ref; +} + + +static GDestroyNotify gee_tree_map_entry_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapEntryIterator* self) { + return g_object_unref; +} + + +static void gee_tree_map_entry_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_entry_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_entry_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_entry_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_entry_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_entry_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_tree_map_entry_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_entry_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_entry_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_entry_iterator_real_remove; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_node_iterator_get_read_only; +} + + +static GType gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapEntryIterator* self) { + return GEE_MAP_TYPE_ENTRY; } -static void gee_tree_map_key_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { - gee_tree_map_key_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_key_iterator_real_get; - iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; - iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_first; - iface->remove = (void (*)(GeeIterator*)) gee_tree_map_node_iterator_remove; +static GBoxedCopyFunc gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapEntryIterator* self) { + return g_object_ref; } -static void gee_tree_map_key_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { - gee_tree_map_key_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); +static GDestroyNotify gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapEntryIterator* self) { + return g_object_unref; +} + + +static void gee_tree_map_entry_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_entry_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_entry_iterator_gee_bidir_iterator_get_g_destroy_func; iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_previous; iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_first; iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_last; } -static void gee_tree_map_key_iterator_instance_init (GeeTreeMapKeyIterator * self) { - self->priv = GEE_TREE_MAP_KEY_ITERATOR_GET_PRIVATE (self); +static void gee_tree_map_entry_iterator_instance_init (GeeTreeMapEntryIterator * self) { + self->priv = GEE_TREE_MAP_ENTRY_ITERATOR_GET_PRIVATE (self); } -static GType gee_tree_map_key_iterator_get_type (void) { - static volatile gsize gee_tree_map_key_iterator_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_key_iterator_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapKeyIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_key_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapKeyIterator), 0, (GInstanceInitFunc) gee_tree_map_key_iterator_instance_init, NULL }; - static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_key_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_key_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - GType gee_tree_map_key_iterator_type_id; - gee_tree_map_key_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapKeyIterator", &g_define_type_info, 0); - g_type_add_interface_static (gee_tree_map_key_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); - g_type_add_interface_static (gee_tree_map_key_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); - g_once_init_leave (&gee_tree_map_key_iterator_type_id__volatile, gee_tree_map_key_iterator_type_id); +static GType gee_tree_map_entry_iterator_get_type (void) { + static volatile gsize gee_tree_map_entry_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_entry_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntryIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntryIterator), 0, (GInstanceInitFunc) gee_tree_map_entry_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_entry_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_entry_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_entry_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_entry_iterator_type_id; + gee_tree_map_entry_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapEntryIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_entry_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_entry_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_entry_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_entry_iterator_type_id__volatile, gee_tree_map_entry_iterator_type_id); } - return gee_tree_map_key_iterator_type_id__volatile; + return gee_tree_map_entry_iterator_type_id__volatile; } -static void _vala_gee_tree_map_key_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapKeyIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_ITERATOR, GeeTreeMapKeyIterator); +static void _vala_gee_tree_map_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapEntryIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, GeeTreeMapEntryIterator); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -3852,26 +11611,26 @@ static void _vala_gee_tree_map_key_iterator_get_property (GObject * object, guin } -static void _vala_gee_tree_map_key_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapKeyIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_KEY_ITERATOR, GeeTreeMapKeyIterator); +static void _vala_gee_tree_map_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapEntryIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, GeeTreeMapEntryIterator); switch (property_id) { - case GEE_TREE_MAP_KEY_ITERATOR_K_TYPE: + case GEE_TREE_MAP_ENTRY_ITERATOR_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_KEY_ITERATOR_K_DUP_FUNC: + case GEE_TREE_MAP_ENTRY_ITERATOR_K_DUP_FUNC: self->priv->k_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_ITERATOR_K_DESTROY_FUNC: + case GEE_TREE_MAP_ENTRY_ITERATOR_K_DESTROY_FUNC: self->priv->k_destroy_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_ITERATOR_V_TYPE: + case GEE_TREE_MAP_ENTRY_ITERATOR_V_TYPE: self->priv->v_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_KEY_ITERATOR_V_DUP_FUNC: + case GEE_TREE_MAP_ENTRY_ITERATOR_V_DUP_FUNC: self->priv->v_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_KEY_ITERATOR_V_DESTROY_FUNC: + case GEE_TREE_MAP_ENTRY_ITERATOR_V_DESTROY_FUNC: self->priv->v_destroy_func = g_value_get_pointer (value); break; default: @@ -3881,12 +11640,15 @@ static void _vala_gee_tree_map_key_iterator_set_property (GObject * object, guin } -static GeeTreeMapValueIterator* gee_tree_map_value_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapValueIterator * self = NULL; +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubEntryIterator * self = NULL; GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); _tmp0_ = map; - self = (GeeTreeMapValueIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); + _tmp1_ = range; + self = (GeeTreeMapSubEntryIterator*) gee_tree_map_sub_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; @@ -3897,229 +11659,221 @@ static GeeTreeMapValueIterator* gee_tree_map_value_iterator_construct (GType obj } -static GeeTreeMapValueIterator* gee_tree_map_value_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_value_iterator_construct (GEE_TREE_MAP_TYPE_VALUE_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_entry_iterator_construct (GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); } -static gpointer gee_tree_map_value_iterator_real_get (GeeIterator* base) { - GeeTreeMapValueIterator * self; - gpointer result = NULL; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - gconstpointer _tmp5_; - gpointer _tmp6_; - self = (GeeTreeMapValueIterator*) base; - _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; - _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = _tmp4_->value; - _tmp6_ = ((_tmp5_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); - result = _tmp6_; - return result; +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_construct_pointing (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + GeeTreeMapSubEntryIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + GeeTreeMapNode* _tmp2_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + g_return_val_if_fail (node != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + _tmp2_ = node; + self = (GeeTreeMapSubEntryIterator*) gee_tree_map_sub_node_iterator_construct_pointing (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_, _tmp2_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; } -static void gee_tree_map_value_iterator_class_init (GeeTreeMapValueIteratorClass * klass) { - gee_tree_map_value_iterator_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapValueIteratorPrivate)); - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_value_iterator_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_value_iterator_set_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +static GeeTreeMapSubEntryIterator* gee_tree_map_sub_entry_iterator_new_pointing (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range, GeeTreeMapNode* node) { + return gee_tree_map_sub_entry_iterator_construct_pointing (GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range, node); } -static void gee_tree_map_value_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { - gee_tree_map_value_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_value_iterator_real_get; - iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; - iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_first; - iface->remove = (void (*)(GeeIterator*)) gee_tree_map_node_iterator_remove; +static GeeMapEntry* gee_tree_map_sub_entry_iterator_real_get (GeeIterator* base) { + GeeTreeMapSubEntryIterator * self; + GeeMapEntry* result = NULL; + GeeTreeMapNodeIterator* _tmp0_; + GeeTreeMapNodeIterator* _tmp1_; + GeeTreeMapNode* _tmp2_; + GeeMapEntry* _tmp3_ = NULL; + self = (GeeTreeMapSubEntryIterator*) base; + _tmp0_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _vala_assert (_tmp0_ != NULL, "iterator != null"); + _tmp1_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp2_ = _tmp1_->current; + _tmp3_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_); + result = _tmp3_; + return result; } -static void gee_tree_map_value_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { - gee_tree_map_value_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_previous; - iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_has_previous; - iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_last; +static void gee_tree_map_sub_entry_iterator_real_remove (GeeIterator* base) { + GeeTreeMapSubEntryIterator * self; + self = (GeeTreeMapSubEntryIterator*) base; + gee_tree_map_sub_node_iterator_unset ((GeeTreeMapSubNodeIterator*) self); } -static void gee_tree_map_value_iterator_instance_init (GeeTreeMapValueIterator * self) { - self->priv = GEE_TREE_MAP_VALUE_ITERATOR_GET_PRIVATE (self); +static gboolean gee_tree_map_sub_entry_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeMapSubEntryIterator * self; + gboolean result = FALSE; + gboolean _tmp0_; + gboolean _tmp1_; + self = (GeeTreeMapSubEntryIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeForallFunc _tmp2_; + void* _tmp2__target; + GeeTreeMapNodeIterator* _tmp3_; + GeeTreeMapNode* _tmp4_; + GeeMapEntry* _tmp5_ = NULL; + gboolean _tmp6_ = FALSE; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp4_ = _tmp3_->current; + _tmp5_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp4_); + _tmp6_ = _tmp2_ (_tmp5_, _tmp2__target); + if (!_tmp6_) { + result = FALSE; + return result; + } + } + while (TRUE) { + GeeTreeMapNodeIterator* _tmp7_; + gboolean _tmp8_ = FALSE; + GeeForallFunc _tmp9_; + void* _tmp9__target; + GeeTreeMapNodeIterator* _tmp10_; + GeeTreeMapNode* _tmp11_; + GeeMapEntry* _tmp12_ = NULL; + gboolean _tmp13_ = FALSE; + _tmp7_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp8_ = gee_tree_map_node_iterator_next (_tmp7_); + if (!_tmp8_) { + break; + } + _tmp9_ = f; + _tmp9__target = f_target; + _tmp10_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp11_ = _tmp10_->current; + _tmp12_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp11_); + _tmp13_ = _tmp9_ (_tmp12_, _tmp9__target); + if (!_tmp13_) { + result = FALSE; + return result; + } + } + result = TRUE; + return result; } -static GType gee_tree_map_value_iterator_get_type (void) { - static volatile gsize gee_tree_map_value_iterator_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_value_iterator_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapValueIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_value_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapValueIterator), 0, (GInstanceInitFunc) gee_tree_map_value_iterator_instance_init, NULL }; - static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_value_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_value_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - GType gee_tree_map_value_iterator_type_id; - gee_tree_map_value_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapValueIterator", &g_define_type_info, 0); - g_type_add_interface_static (gee_tree_map_value_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); - g_type_add_interface_static (gee_tree_map_value_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); - g_once_init_leave (&gee_tree_map_value_iterator_type_id__volatile, gee_tree_map_value_iterator_type_id); - } - return gee_tree_map_value_iterator_type_id__volatile; +static void gee_tree_map_sub_entry_iterator_class_init (GeeTreeMapSubEntryIteratorClass * klass) { + gee_tree_map_sub_entry_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubEntryIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_entry_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_entry_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); } -static void _vala_gee_tree_map_value_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapValueIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_ITERATOR, GeeTreeMapValueIterator); - switch (property_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } +static GType gee_tree_map_sub_entry_iterator_gee_traversable_get_g_type (GeeTreeMapSubEntryIterator* self) { + return GEE_MAP_TYPE_ENTRY; } -static void _vala_gee_tree_map_value_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapValueIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_VALUE_ITERATOR, GeeTreeMapValueIterator); - switch (property_id) { - case GEE_TREE_MAP_VALUE_ITERATOR_K_TYPE: - self->priv->k_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_VALUE_ITERATOR_K_DUP_FUNC: - self->priv->k_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_ITERATOR_K_DESTROY_FUNC: - self->priv->k_destroy_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_ITERATOR_V_TYPE: - self->priv->v_type = g_value_get_gtype (value); - break; - case GEE_TREE_MAP_VALUE_ITERATOR_V_DUP_FUNC: - self->priv->v_dup_func = g_value_get_pointer (value); - break; - case GEE_TREE_MAP_VALUE_ITERATOR_V_DESTROY_FUNC: - self->priv->v_destroy_func = g_value_get_pointer (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } +static GBoxedCopyFunc gee_tree_map_sub_entry_iterator_gee_traversable_get_g_dup_func (GeeTreeMapSubEntryIterator* self) { + return g_object_ref; } -static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - GeeTreeMapEntryIterator * self = NULL; - GeeTreeMap* _tmp0_; - g_return_val_if_fail (map != NULL, NULL); - _tmp0_ = map; - self = (GeeTreeMapEntryIterator*) gee_tree_map_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_); - self->priv->k_type = k_type; - self->priv->k_dup_func = k_dup_func; - self->priv->k_destroy_func = k_destroy_func; - self->priv->v_type = v_type; - self->priv->v_dup_func = v_dup_func; - self->priv->v_destroy_func = v_destroy_func; - return self; +static GDestroyNotify gee_tree_map_sub_entry_iterator_gee_traversable_get_g_destroy_func (GeeTreeMapSubEntryIterator* self) { + return g_object_unref; } -static GeeTreeMapEntryIterator* gee_tree_map_entry_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map) { - return gee_tree_map_entry_iterator_construct (GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map); +static void gee_tree_map_sub_entry_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_map_sub_entry_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_map_sub_entry_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_map_sub_entry_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_map_sub_entry_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_map_sub_entry_iterator_gee_traversable_get_g_destroy_func; } -static GeeMapEntry* gee_tree_map_entry_iterator_real_get (GeeIterator* base) { - GeeTreeMapEntryIterator * self; - GeeMapEntry* result = NULL; - gint _tmp0_; - GeeTreeMap* _tmp1_; - gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - GeeMapEntry* _tmp5_ = NULL; - self = (GeeTreeMapEntryIterator*) base; - _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; - _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; - _tmp2_ = _tmp1_->priv->stamp; - _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = gee_tree_map_entry_entry_for (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp4_); - result = _tmp5_; - return result; +static void gee_tree_map_sub_entry_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_tree_map_sub_entry_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_sub_entry_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_tree_map_sub_entry_iterator_real_remove; + iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_sub_node_iterator_has_next; + iface->get_valid = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_valid; + iface->get_read_only = (gboolean (*) (GeeIterator *)) gee_tree_map_sub_node_iterator_get_read_only; } - -static void gee_tree_map_entry_iterator_class_init (GeeTreeMapEntryIteratorClass * klass) { - gee_tree_map_entry_iterator_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GeeTreeMapEntryIteratorPrivate)); - G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_entry_iterator_get_property; - G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_entry_iterator_set_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRY_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + +static GType gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_type (GeeTreeMapSubEntryIterator* self) { + return GEE_MAP_TYPE_ENTRY; } -static void gee_tree_map_entry_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { - gee_tree_map_entry_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->get = (gpointer (*)(GeeIterator*)) gee_tree_map_entry_iterator_real_get; - iface->next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_next; - iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_tree_map_node_iterator_first; - iface->remove = (void (*)(GeeIterator*)) gee_tree_map_node_iterator_remove; +static GBoxedCopyFunc gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeMapSubEntryIterator* self) { + return g_object_ref; } -static void gee_tree_map_entry_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { - gee_tree_map_entry_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); - iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_previous; - iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_has_previous; - iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_node_iterator_last; +static GDestroyNotify gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeMapSubEntryIterator* self) { + return g_object_unref; } -static void gee_tree_map_entry_iterator_instance_init (GeeTreeMapEntryIterator * self) { - self->priv = GEE_TREE_MAP_ENTRY_ITERATOR_GET_PRIVATE (self); +static void gee_tree_map_sub_entry_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { + gee_tree_map_sub_entry_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_map_sub_entry_iterator_gee_bidir_iterator_get_g_destroy_func; + iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_map_sub_node_iterator_last; } -static GType gee_tree_map_entry_iterator_get_type (void) { - static volatile gsize gee_tree_map_entry_iterator_type_id__volatile = 0; - if (g_once_init_enter (&gee_tree_map_entry_iterator_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapEntryIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_entry_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapEntryIterator), 0, (GInstanceInitFunc) gee_tree_map_entry_iterator_instance_init, NULL }; - static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_entry_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_entry_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - GType gee_tree_map_entry_iterator_type_id; - gee_tree_map_entry_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapEntryIterator", &g_define_type_info, 0); - g_type_add_interface_static (gee_tree_map_entry_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); - g_type_add_interface_static (gee_tree_map_entry_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); - g_once_init_leave (&gee_tree_map_entry_iterator_type_id__volatile, gee_tree_map_entry_iterator_type_id); +static void gee_tree_map_sub_entry_iterator_instance_init (GeeTreeMapSubEntryIterator * self) { + self->priv = GEE_TREE_MAP_SUB_ENTRY_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_sub_entry_iterator_get_type (void) { + static volatile gsize gee_tree_map_sub_entry_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_entry_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubEntryIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_entry_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubEntryIterator), 0, (GInstanceInitFunc) gee_tree_map_sub_entry_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_map_sub_entry_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_entry_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_entry_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_sub_entry_iterator_type_id; + gee_tree_map_sub_entry_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, "GeeTreeMapSubEntryIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_sub_entry_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_tree_map_sub_entry_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_type_add_interface_static (gee_tree_map_sub_entry_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); + g_once_init_leave (&gee_tree_map_sub_entry_iterator_type_id__volatile, gee_tree_map_sub_entry_iterator_type_id); } - return gee_tree_map_entry_iterator_type_id__volatile; + return gee_tree_map_sub_entry_iterator_type_id__volatile; } -static void _vala_gee_tree_map_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GeeTreeMapEntryIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, GeeTreeMapEntryIterator); +static void _vala_gee_tree_map_sub_entry_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubEntryIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIterator); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -4128,26 +11882,26 @@ static void _vala_gee_tree_map_entry_iterator_get_property (GObject * object, gu } -static void _vala_gee_tree_map_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GeeTreeMapEntryIterator * self; - self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_ENTRY_ITERATOR, GeeTreeMapEntryIterator); +static void _vala_gee_tree_map_sub_entry_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubEntryIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_ENTRY_ITERATOR, GeeTreeMapSubEntryIterator); switch (property_id) { - case GEE_TREE_MAP_ENTRY_ITERATOR_K_TYPE: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_ENTRY_ITERATOR_K_DUP_FUNC: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DUP_FUNC: self->priv->k_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_ENTRY_ITERATOR_K_DESTROY_FUNC: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_K_DESTROY_FUNC: self->priv->k_destroy_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_ENTRY_ITERATOR_V_TYPE: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_TYPE: self->priv->v_type = g_value_get_gtype (value); break; - case GEE_TREE_MAP_ENTRY_ITERATOR_V_DUP_FUNC: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DUP_FUNC: self->priv->v_dup_func = g_value_get_pointer (value); break; - case GEE_TREE_MAP_ENTRY_ITERATOR_V_DESTROY_FUNC: + case GEE_TREE_MAP_SUB_ENTRY_ITERATOR_V_DESTROY_FUNC: self->priv->v_destroy_func = g_value_get_pointer (value); break; default: @@ -4184,21 +11938,23 @@ static gpointer gee_tree_map_map_iterator_real_get_key (GeeMapIterator* base) { gint _tmp0_; GeeTreeMap* _tmp1_; gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - gconstpointer _tmp5_; - gpointer _tmp6_; + gboolean _tmp3_; + gboolean _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; self = (GeeTreeMapMapIterator*) base; _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; _tmp2_ = _tmp1_->priv->stamp; _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = _tmp4_->key; - _tmp6_ = ((_tmp5_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); - result = _tmp6_; + _tmp3_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp4_ = _tmp3_; + _vala_assert (_tmp4_, "valid"); + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = _tmp5_->key; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + result = _tmp7_; return result; } @@ -4209,21 +11965,23 @@ static gpointer gee_tree_map_map_iterator_real_get_value (GeeMapIterator* base) gint _tmp0_; GeeTreeMap* _tmp1_; gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - gconstpointer _tmp5_; - gpointer _tmp6_; + gboolean _tmp3_; + gboolean _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; self = (GeeTreeMapMapIterator*) base; _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; _tmp2_ = _tmp1_->priv->stamp; _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = _tmp4_->value; - _tmp6_ = ((_tmp5_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); - result = _tmp6_; + _tmp3_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp4_ = _tmp3_; + _vala_assert (_tmp4_, "valid"); + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = _tmp5_->value; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + result = _tmp7_; return result; } @@ -4233,28 +11991,49 @@ static void gee_tree_map_map_iterator_real_set_value (GeeMapIterator* base, gcon gint _tmp0_; GeeTreeMap* _tmp1_; gint _tmp2_; - GeeTreeMapNode* _tmp3_; - GeeTreeMapNode* _tmp4_; - gconstpointer _tmp5_; - gpointer _tmp6_; + gboolean _tmp3_; + gboolean _tmp4_; + GeeTreeMapNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; self = (GeeTreeMapMapIterator*) base; _tmp0_ = ((GeeTreeMapNodeIterator*) self)->stamp; _tmp1_ = ((GeeTreeMapNodeIterator*) self)->_map; _tmp2_ = _tmp1_->priv->stamp; _vala_assert (_tmp0_ == _tmp2_, "stamp == _map.stamp"); - _tmp3_ = ((GeeTreeMapNodeIterator*) self)->current; - _vala_assert (_tmp3_ != NULL, "current != null"); - _tmp4_ = ((GeeTreeMapNodeIterator*) self)->current; - _tmp5_ = value; - _tmp6_ = ((_tmp5_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_); - ((_tmp4_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp4_->value = (self->priv->v_destroy_func (_tmp4_->value), NULL)); - _tmp4_->value = _tmp6_; + _tmp3_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp4_ = _tmp3_; + _vala_assert (_tmp4_, "valid"); + _tmp5_ = ((GeeTreeMapNodeIterator*) self)->current; + _tmp6_ = value; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + ((_tmp5_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp5_->value = (self->priv->v_destroy_func (_tmp5_->value), NULL)); + _tmp5_->value = _tmp7_; +} + + +static gboolean gee_tree_map_map_iterator_real_get_read_only (GeeTreeMapNodeIterator* base) { + gboolean result; + GeeTreeMapMapIterator* self; + self = (GeeTreeMapMapIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_tree_map_map_iterator_real_get_mutable (GeeMapIterator* base) { + gboolean result; + GeeTreeMapMapIterator* self; + self = (GeeTreeMapMapIterator*) base; + result = TRUE; + return result; } static void gee_tree_map_map_iterator_class_init (GeeTreeMapMapIteratorClass * klass) { gee_tree_map_map_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeTreeMapMapIteratorPrivate)); + GEE_TREE_MAP_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_tree_map_map_iterator_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_map_iterator_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_map_iterator_set_property; g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); @@ -4263,6 +12042,38 @@ static void gee_tree_map_map_iterator_class_init (GeeTreeMapMapIteratorClass * k g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_MAP_ITERATOR_MUTABLE, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_tree_map_map_iterator_gee_map_iterator_get_k_type (GeeTreeMapMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_map_iterator_gee_map_iterator_get_k_dup_func (GeeTreeMapMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_map_iterator_gee_map_iterator_get_k_destroy_func (GeeTreeMapMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_tree_map_map_iterator_gee_map_iterator_get_v_type (GeeTreeMapMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_map_iterator_gee_map_iterator_get_v_dup_func (GeeTreeMapMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_map_iterator_gee_map_iterator_get_v_destroy_func (GeeTreeMapMapIterator* self) { + return self->priv->v_destroy_func; } @@ -4271,10 +12082,63 @@ static void gee_tree_map_map_iterator_gee_map_iterator_interface_init (GeeMapIte iface->get_key = (gpointer (*)(GeeMapIterator*)) gee_tree_map_map_iterator_real_get_key; iface->get_value = (gpointer (*)(GeeMapIterator*)) gee_tree_map_map_iterator_real_get_value; iface->set_value = (void (*)(GeeMapIterator*, gconstpointer)) gee_tree_map_map_iterator_real_set_value; + iface->get_k_type = (GType(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_tree_map_map_iterator_gee_map_iterator_get_v_destroy_func; iface->next = (gboolean (*)(GeeMapIterator*)) gee_tree_map_node_iterator_next; iface->has_next = (gboolean (*)(GeeMapIterator*)) gee_tree_map_node_iterator_has_next; - iface->first = (gboolean (*)(GeeMapIterator*)) gee_tree_map_node_iterator_first; iface->unset = (void (*)(GeeMapIterator*)) gee_tree_map_node_iterator_unset; + iface->get_read_only = gee_tree_map_map_iterator_real_get_read_only; + iface->get_mutable = gee_tree_map_map_iterator_real_get_mutable; + iface->get_valid = (gboolean (*) (GeeMapIterator *)) gee_tree_map_node_iterator_get_valid; +} + + +static GType gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_type (GeeTreeMapMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_dup_func (GeeTreeMapMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_destroy_func (GeeTreeMapMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_type (GeeTreeMapMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_dup_func (GeeTreeMapMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_destroy_func (GeeTreeMapMapIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_map_iterator_gee_bidir_map_iterator_interface_init (GeeBidirMapIteratorIface * iface) { + gee_tree_map_map_iterator_gee_bidir_map_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_k_type = (GType(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_tree_map_map_iterator_gee_bidir_map_iterator_get_v_destroy_func; + iface->previous = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_node_iterator_last; } @@ -4288,9 +12152,11 @@ static GType gee_tree_map_map_iterator_get_type (void) { if (g_once_init_enter (&gee_tree_map_map_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapMapIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_map_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapMapIterator), 0, (GInstanceInitFunc) gee_tree_map_map_iterator_instance_init, NULL }; static const GInterfaceInfo gee_map_iterator_info = { (GInterfaceInitFunc) gee_tree_map_map_iterator_gee_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_map_iterator_info = { (GInterfaceInitFunc) gee_tree_map_map_iterator_gee_bidir_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_tree_map_map_iterator_type_id; gee_tree_map_map_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_NODE_ITERATOR, "GeeTreeMapMapIterator", &g_define_type_info, 0); g_type_add_interface_static (gee_tree_map_map_iterator_type_id, GEE_TYPE_MAP_ITERATOR, &gee_map_iterator_info); + g_type_add_interface_static (gee_tree_map_map_iterator_type_id, GEE_TYPE_BIDIR_MAP_ITERATOR, &gee_bidir_map_iterator_info); g_once_init_leave (&gee_tree_map_map_iterator_type_id__volatile, gee_tree_map_map_iterator_type_id); } return gee_tree_map_map_iterator_type_id__volatile; @@ -4301,6 +12167,12 @@ static void _vala_gee_tree_map_map_iterator_get_property (GObject * object, guin GeeTreeMapMapIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_MAP_ITERATOR, GeeTreeMapMapIterator); switch (property_id) { + case GEE_TREE_MAP_MAP_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_tree_map_node_iterator_get_read_only ((GeeTreeMapNodeIterator*) self)); + break; + case GEE_TREE_MAP_MAP_ITERATOR_MUTABLE: + g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -4337,6 +12209,292 @@ static void _vala_gee_tree_map_map_iterator_set_property (GObject * object, guin } +static GeeTreeMapSubMapIterator* gee_tree_map_sub_map_iterator_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + GeeTreeMapSubMapIterator * self = NULL; + GeeTreeMap* _tmp0_; + GeeTreeMapRange* _tmp1_; + g_return_val_if_fail (map != NULL, NULL); + g_return_val_if_fail (range != NULL, NULL); + _tmp0_ = map; + _tmp1_ = range; + self = (GeeTreeMapSubMapIterator*) gee_tree_map_sub_node_iterator_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, _tmp0_, _tmp1_); + self->priv->k_type = k_type; + self->priv->k_dup_func = k_dup_func; + self->priv->k_destroy_func = k_destroy_func; + self->priv->v_type = v_type; + self->priv->v_dup_func = v_dup_func; + self->priv->v_destroy_func = v_destroy_func; + return self; +} + + +static GeeTreeMapSubMapIterator* gee_tree_map_sub_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeTreeMap* map, GeeTreeMapRange* range) { + return gee_tree_map_sub_map_iterator_construct (GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map, range); +} + + +static gpointer gee_tree_map_sub_map_iterator_real_get_key (GeeMapIterator* base) { + GeeTreeMapSubMapIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapSubMapIterator*) base; + _tmp0_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp3_ = _tmp2_->current; + _tmp4_ = _tmp3_->key; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->k_dup_func != NULL)) ? self->priv->k_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; + return result; +} + + +static gpointer gee_tree_map_sub_map_iterator_real_get_value (GeeMapIterator* base) { + GeeTreeMapSubMapIterator * self; + gpointer result = NULL; + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapSubMapIterator*) base; + _tmp0_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp3_ = _tmp2_->current; + _tmp4_ = _tmp3_->value; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + result = _tmp5_; + return result; +} + + +static void gee_tree_map_sub_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value) { + GeeTreeMapSubMapIterator * self; + gboolean _tmp0_; + gboolean _tmp1_; + GeeTreeMapNodeIterator* _tmp2_; + GeeTreeMapNode* _tmp3_; + gconstpointer _tmp4_; + gpointer _tmp5_; + self = (GeeTreeMapSubMapIterator*) base; + _tmp0_ = gee_map_iterator_get_valid ((GeeMapIterator*) self); + _tmp1_ = _tmp0_; + _vala_assert (_tmp1_, "valid"); + _tmp2_ = ((GeeTreeMapSubNodeIterator*) self)->iterator; + _tmp3_ = _tmp2_->current; + _tmp4_ = value; + _tmp5_ = ((_tmp4_ != NULL) && (self->priv->v_dup_func != NULL)) ? self->priv->v_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_); + ((_tmp3_->value == NULL) || (self->priv->v_destroy_func == NULL)) ? NULL : (_tmp3_->value = (self->priv->v_destroy_func (_tmp3_->value), NULL)); + _tmp3_->value = _tmp5_; +} + + +static gboolean gee_tree_map_sub_map_iterator_real_get_read_only (GeeTreeMapSubNodeIterator* base) { + gboolean result; + GeeTreeMapSubMapIterator* self; + self = (GeeTreeMapSubMapIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_tree_map_sub_map_iterator_real_get_mutable (GeeMapIterator* base) { + gboolean result; + GeeTreeMapSubMapIterator* self; + self = (GeeTreeMapSubMapIterator*) base; + result = TRUE; + return result; +} + + +static void gee_tree_map_sub_map_iterator_class_init (GeeTreeMapSubMapIteratorClass * klass) { + gee_tree_map_sub_map_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeTreeMapSubMapIteratorPrivate)); + GEE_TREE_MAP_SUB_NODE_ITERATOR_CLASS (klass)->get_read_only = gee_tree_map_sub_map_iterator_real_get_read_only; + G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_sub_map_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_sub_map_iterator_set_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SUB_MAP_ITERATOR_MUTABLE, g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_type (GeeTreeMapSubMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_dup_func (GeeTreeMapSubMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_destroy_func (GeeTreeMapSubMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_type (GeeTreeMapSubMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_dup_func (GeeTreeMapSubMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_destroy_func (GeeTreeMapSubMapIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_sub_map_iterator_gee_map_iterator_interface_init (GeeMapIteratorIface * iface) { + gee_tree_map_sub_map_iterator_gee_map_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_key = (gpointer (*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_real_get_key; + iface->get_value = (gpointer (*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_real_get_value; + iface->set_value = (void (*)(GeeMapIterator*, gconstpointer)) gee_tree_map_sub_map_iterator_real_set_value; + iface->get_k_type = (GType(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMapIterator*)) gee_tree_map_sub_map_iterator_gee_map_iterator_get_v_destroy_func; + iface->next = (gboolean (*)(GeeMapIterator*)) gee_tree_map_sub_node_iterator_next; + iface->has_next = (gboolean (*)(GeeMapIterator*)) gee_tree_map_sub_node_iterator_has_next; + iface->unset = (void (*)(GeeMapIterator*)) gee_tree_map_sub_node_iterator_unset; + iface->get_read_only = gee_tree_map_sub_map_iterator_real_get_read_only; + iface->get_mutable = gee_tree_map_sub_map_iterator_real_get_mutable; + iface->get_valid = (gboolean (*) (GeeMapIterator *)) gee_tree_map_sub_node_iterator_get_valid; +} + + +static GType gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_type (GeeTreeMapSubMapIterator* self) { + return self->priv->k_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_dup_func (GeeTreeMapSubMapIterator* self) { + return self->priv->k_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_destroy_func (GeeTreeMapSubMapIterator* self) { + return self->priv->k_destroy_func; +} + + +static GType gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_type (GeeTreeMapSubMapIterator* self) { + return self->priv->v_type; +} + + +static GBoxedCopyFunc gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_dup_func (GeeTreeMapSubMapIterator* self) { + return self->priv->v_dup_func; +} + + +static GDestroyNotify gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_destroy_func (GeeTreeMapSubMapIterator* self) { + return self->priv->v_destroy_func; +} + + +static void gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_interface_init (GeeBidirMapIteratorIface * iface) { + gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->get_k_type = (GType(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_type; + iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_dup_func; + iface->get_k_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_k_destroy_func; + iface->get_v_type = (GType(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_type; + iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_dup_func; + iface->get_v_destroy_func = (GDestroyNotify(*)(GeeBidirMapIterator*)) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_get_v_destroy_func; + iface->previous = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_sub_node_iterator_previous; + iface->has_previous = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_sub_node_iterator_has_previous; + iface->first = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_sub_node_iterator_first; + iface->last = (gboolean (*)(GeeBidirMapIterator*)) gee_tree_map_sub_node_iterator_last; +} + + +static void gee_tree_map_sub_map_iterator_instance_init (GeeTreeMapSubMapIterator * self) { + self->priv = GEE_TREE_MAP_SUB_MAP_ITERATOR_GET_PRIVATE (self); +} + + +static GType gee_tree_map_sub_map_iterator_get_type (void) { + static volatile gsize gee_tree_map_sub_map_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_tree_map_sub_map_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapSubMapIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_sub_map_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMapSubMapIterator), 0, (GInstanceInitFunc) gee_tree_map_sub_map_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_map_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_map_iterator_gee_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_bidir_map_iterator_info = { (GInterfaceInitFunc) gee_tree_map_sub_map_iterator_gee_bidir_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_tree_map_sub_map_iterator_type_id; + gee_tree_map_sub_map_iterator_type_id = g_type_register_static (GEE_TREE_MAP_TYPE_SUB_NODE_ITERATOR, "GeeTreeMapSubMapIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_map_sub_map_iterator_type_id, GEE_TYPE_MAP_ITERATOR, &gee_map_iterator_info); + g_type_add_interface_static (gee_tree_map_sub_map_iterator_type_id, GEE_TYPE_BIDIR_MAP_ITERATOR, &gee_bidir_map_iterator_info); + g_once_init_leave (&gee_tree_map_sub_map_iterator_type_id__volatile, gee_tree_map_sub_map_iterator_type_id); + } + return gee_tree_map_sub_map_iterator_type_id__volatile; +} + + +static void _vala_gee_tree_map_sub_map_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeTreeMapSubMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIterator); + switch (property_id) { + case GEE_TREE_MAP_SUB_MAP_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_tree_map_sub_node_iterator_get_read_only ((GeeTreeMapSubNodeIterator*) self)); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_MUTABLE: + g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_tree_map_sub_map_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeTreeMapSubMapIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_MAP_ITERATOR, GeeTreeMapSubMapIterator); + switch (property_id) { + case GEE_TREE_MAP_SUB_MAP_ITERATOR_K_TYPE: + self->priv->k_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DUP_FUNC: + self->priv->k_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_K_DESTROY_FUNC: + self->priv->k_destroy_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_V_TYPE: + self->priv->v_type = g_value_get_gtype (value); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DUP_FUNC: + self->priv->v_dup_func = g_value_get_pointer (value); + break; + case GEE_TREE_MAP_SUB_MAP_ITERATOR_V_DESTROY_FUNC: + self->priv->v_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + static void gee_tree_map_class_init (GeeTreeMapClass * klass) { gee_tree_map_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeTreeMapPrivate)); @@ -4346,11 +12504,18 @@ static void gee_tree_map_class_init (GeeTreeMapClass * klass) { GEE_ABSTRACT_MAP_CLASS (klass)->set = gee_tree_map_real_set; GEE_ABSTRACT_MAP_CLASS (klass)->unset = gee_tree_map_real_unset; GEE_ABSTRACT_MAP_CLASS (klass)->clear = gee_tree_map_real_clear; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->head_map = gee_tree_map_real_head_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->tail_map = gee_tree_map_real_tail_map; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->sub_map = gee_tree_map_real_sub_map; GEE_ABSTRACT_MAP_CLASS (klass)->map_iterator = gee_tree_map_real_map_iterator; + GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS (klass)->bidir_map_iterator = gee_tree_map_real_bidir_map_iterator; GEE_ABSTRACT_MAP_CLASS (klass)->get_size = gee_tree_map_real_get_size; + GEE_ABSTRACT_MAP_CLASS (klass)->get_read_only = gee_tree_map_real_get_read_only; GEE_ABSTRACT_MAP_CLASS (klass)->get_keys = gee_tree_map_real_get_keys; GEE_ABSTRACT_MAP_CLASS (klass)->get_values = gee_tree_map_real_get_values; GEE_ABSTRACT_MAP_CLASS (klass)->get_entries = gee_tree_map_real_get_entries; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->get_ascending_keys = gee_tree_map_real_get_ascending_keys; + GEE_ABSTRACT_SORTED_MAP_CLASS (klass)->get_ascending_entries = gee_tree_map_real_get_ascending_entries; G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_map_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_map_set_property; G_OBJECT_CLASS (klass)->finalize = gee_tree_map_finalize; @@ -4364,6 +12529,7 @@ static void gee_tree_map_class_init (GeeTreeMapClass * klass) { * {@inheritDoc} */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** * {@inheritDoc} */ @@ -4377,13 +12543,13 @@ static void gee_tree_map_class_init (GeeTreeMapClass * klass) { */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ENTRIES, g_param_spec_object ("entries", "entries", "entries", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * The keys' comparator function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_KEY_COMPARE_FUNC, g_param_spec_pointer ("key-compare-func", "key-compare-func", "key-compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ASCENDING_KEYS, g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * The values' equality testing function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_VALUE_EQUAL_FUNC, g_param_spec_pointer ("value-equal-func", "value-equal-func", "value-equal-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MAP_ASCENDING_ENTRIES, g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -4400,6 +12566,15 @@ static void gee_tree_map_instance_init (GeeTreeMap * self) { static void gee_tree_map_finalize (GObject* obj) { GeeTreeMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TREE_MAP, GeeTreeMap); + gee_abstract_map_clear ((GeeAbstractMap*) self); + (self->priv->_key_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_key_compare_func_target_destroy_notify (self->priv->_key_compare_func_target), NULL); + self->priv->_key_compare_func = NULL; + self->priv->_key_compare_func_target = NULL; + self->priv->_key_compare_func_target_destroy_notify = NULL; + (self->priv->_value_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_equal_func_target_destroy_notify (self->priv->_value_equal_func_target), NULL); + self->priv->_value_equal_func = NULL; + self->priv->_value_equal_func_target = NULL; + self->priv->_value_equal_func_target_destroy_notify = NULL; _gee_tree_map_node_free0 (self->priv->root); G_OBJECT_CLASS (gee_tree_map_parent_class)->finalize (obj); } @@ -4419,7 +12594,7 @@ GType gee_tree_map_get_type (void) { if (g_once_init_enter (&gee_tree_map_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeMap), 0, (GInstanceInitFunc) gee_tree_map_instance_init, NULL }; GType gee_tree_map_type_id; - gee_tree_map_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_MAP, "GeeTreeMap", &g_define_type_info, 0); + gee_tree_map_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, "GeeTreeMap", &g_define_type_info, 0); g_once_init_leave (&gee_tree_map_type_id__volatile, gee_tree_map_type_id); } return gee_tree_map_type_id__volatile; @@ -4433,6 +12608,9 @@ static void _vala_gee_tree_map_get_property (GObject * object, guint property_id case GEE_TREE_MAP_SIZE: g_value_set_int (value, gee_abstract_map_get_size ((GeeAbstractMap*) self)); break; + case GEE_TREE_MAP_READ_ONLY: + g_value_set_boolean (value, gee_abstract_map_get_read_only ((GeeAbstractMap*) self)); + break; case GEE_TREE_MAP_KEYS: g_value_take_object (value, gee_abstract_map_get_keys ((GeeAbstractMap*) self)); break; @@ -4442,11 +12620,11 @@ static void _vala_gee_tree_map_get_property (GObject * object, guint property_id case GEE_TREE_MAP_ENTRIES: g_value_take_object (value, gee_abstract_map_get_entries ((GeeAbstractMap*) self)); break; - case GEE_TREE_MAP_KEY_COMPARE_FUNC: - g_value_set_pointer (value, gee_tree_map_get_key_compare_func (self)); + case GEE_TREE_MAP_ASCENDING_KEYS: + g_value_take_object (value, gee_abstract_sorted_map_get_ascending_keys ((GeeAbstractSortedMap*) self)); break; - case GEE_TREE_MAP_VALUE_EQUAL_FUNC: - g_value_set_pointer (value, gee_tree_map_get_value_equal_func (self)); + case GEE_TREE_MAP_ASCENDING_ENTRIES: + g_value_take_object (value, gee_abstract_sorted_map_get_ascending_entries ((GeeAbstractSortedMap*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -4459,12 +12637,6 @@ static void _vala_gee_tree_map_set_property (GObject * object, guint property_id GeeTreeMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_MAP, GeeTreeMap); switch (property_id) { - case GEE_TREE_MAP_KEY_COMPARE_FUNC: - gee_tree_map_set_key_compare_func (self, g_value_get_pointer (value)); - break; - case GEE_TREE_MAP_VALUE_EQUAL_FUNC: - gee_tree_map_set_value_equal_func (self, g_value_get_pointer (value)); - break; case GEE_TREE_MAP_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; diff --git a/gee/treemap.vala b/gee/treemap.vala index 8b3917e..2d2708a 100644 --- a/gee/treemap.vala +++ b/gee/treemap.vala @@ -1,6 +1,6 @@ /* treemap.vala * - * Copyright (C) 2009 Maciej Piechotka + * Copyright (C) 2009-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,20 +31,24 @@ using GLib; * * @see HashMap */ -public class Gee.TreeMap : Gee.AbstractMap { +public class Gee.TreeMap : Gee.AbstractBidirSortedMap { /** * {@inheritDoc} */ public override int size { get { return _size; } } + + public override bool read_only { + get { return false; } + } /** * {@inheritDoc} */ public override Set keys { owned get { - Set keys = _keys; + var keys = _keys; if (_keys == null) { keys = new KeySet (this); _keys = keys; @@ -59,7 +63,7 @@ public class Gee.TreeMap : Gee.AbstractMap { */ public override Collection values { owned get { - Collection values = _values; + var values = _values; if (_values == null) { values = new ValueCollection (this); _values = values; @@ -74,7 +78,7 @@ public class Gee.TreeMap : Gee.AbstractMap { */ public override Set> entries { owned get { - Set> entries = _entries; + var entries = _entries; if (_entries == null) { entries = new EntrySet (this); _entries = entries; @@ -87,18 +91,20 @@ public class Gee.TreeMap : Gee.AbstractMap { /** * The keys' comparator function. */ - public CompareFunc key_compare_func { private set; get; } + [CCode (notify = false)] + public CompareDataFunc key_compare_func { private set; get; } /** * The values' equality testing function. */ - public EqualFunc value_equal_func { private set; get; } + [CCode (notify = false)] + public EqualDataFunc value_equal_func { private set; get; } private int _size = 0; - private weak Set _keys; + private weak SortedSet _keys; private weak Collection _values; - private weak Set> _entries; + private weak SortedSet> _entries; /** * Constructs a new, empty tree map sorted according to the specified @@ -110,7 +116,7 @@ public class Gee.TreeMap : Gee.AbstractMap { * @param key_compare_func an optional key comparator function * @param value_equal_func an optional values equality testing function */ - public TreeMap (CompareFunc? key_compare_func = null, EqualFunc? value_equal_func = null) { + public TreeMap (owned CompareDataFunc? key_compare_func = null, owned EqualDataFunc? value_equal_func = null) { if (key_compare_func == null) { key_compare_func = Functions.get_compare_func_for (typeof (K)); } @@ -121,6 +127,10 @@ public class Gee.TreeMap : Gee.AbstractMap { this.value_equal_func = value_equal_func; } + ~TreeMap () { + clear (); + } + private void rotate_right (ref Node root) { Node pivot = (owned) root.left; pivot.color = root.color; @@ -191,8 +201,9 @@ public class Gee.TreeMap : Gee.AbstractMap { return null; } - private void set_to_node (ref Node? node, K key, V value, Node? prev, Node? next) { + private bool set_to_node (ref Node? node, K key, V value, out V? old_value, Node? prev, Node? next) { if (node == null) { + old_value = null; node = new Node (key, value, prev, next); if (prev == null) { first = node; @@ -201,25 +212,36 @@ public class Gee.TreeMap : Gee.AbstractMap { last = node; } _size++; + return true; } int cmp = key_compare_func (key, node.key); + bool changed; if (cmp == 0) { - node.value = value; + if (value_equal_func (value, node.value)) { + old_value = null; + changed = false; + } else { + old_value = (owned) node.value; + node.value = value; + changed = true; + } } else if (cmp < 0) { - set_to_node (ref node.left, key, value, node.prev, node); + changed = set_to_node (ref node.left, key, value, out old_value, node.prev, node); } else { - set_to_node (ref node.right, key, value, node, node.next); + changed = set_to_node (ref node.right, key, value, out old_value, node, node.next); } fix_up (ref node); + return changed; } /** * {@inheritDoc} */ public override void set (K key, V value) { - set_to_node (ref root, key, value, null, null); + V old_value; + set_to_node (ref root, key, value, out old_value, null, null); root.color = Node.Color.BLACK; stamp++; } @@ -243,12 +265,8 @@ public class Gee.TreeMap : Gee.AbstractMap { private void fix_removal (ref Node node, out K? key = null, out V? value) { Node n = (owned) node; - if (&key != null) - key = (owned) n.key; - else - n.key = null; - if (&value != null) - value = (owned) n.value; + key = (owned) n.key; + value = (owned) n.value; if (n.prev != null) { n.prev.next = n.next; } else { @@ -279,12 +297,18 @@ public class Gee.TreeMap : Gee.AbstractMap { fix_up (ref node); } - private bool remove_from_node (ref Node? node, K key, out V value, out unowned Node? prev = null, out unowned Node? next = null) { + private bool remove_from_node (ref Node? node, K key, out V? value, out unowned Node? prev = null, out unowned Node? next = null) { if (node == null) { + value = null; + next = null; + prev = null; return false; } else if (key_compare_func (key, node.key) < 0) { weak Node left = node.left; if (left == null) { + value = null; + next = null; + prev = null; return false; } if (node.left != null && is_black (left) && is_black (left.left)) { @@ -300,10 +324,8 @@ public class Gee.TreeMap : Gee.AbstractMap { weak Node? r = node.right; if (key_compare_func (key, node.key) == 0 && r == null) { - if (&prev != null) - prev = node.prev; - if (&next != null) - next = node.next; + prev = node.prev; + next = node.next; fix_removal (ref node, null, out value); return true; } @@ -312,10 +334,8 @@ public class Gee.TreeMap : Gee.AbstractMap { } if (key_compare_func (key, node.key) == 0) { value = (owned) node.value; - if (&prev != null) - prev = node.prev; - if (&next != null) - next = node; + prev = node.prev; + next = node; remove_minimal (ref node.right, out node.key, out node.value); fix_up (ref node); return true; @@ -343,12 +363,7 @@ public class Gee.TreeMap : Gee.AbstractMap { * {@inheritDoc} */ public override bool unset (K key, out V? value = null) { - V node_value; - bool b = remove_from_node (ref root, key, out node_value); - - if (&value != null) { - value = (owned) node_value; - } + bool b = remove_from_node (ref root, key, out value); if (root != null) { root.color = Node.Color.BLACK; @@ -378,12 +393,69 @@ public class Gee.TreeMap : Gee.AbstractMap { stamp++; } + /** + * {@inheritDoc} + */ + public override SortedMap head_map (K before) { + return new SubMap (this, new Range.head (this, before)); + } + + /** + * {@inheritDoc} + */ + public override SortedMap tail_map (K after) { + return new SubMap (this, new Range.tail (this, after)); + } + + /** + * {@inheritDoc} + */ + public override SortedMap sub_map (K after, K before) { + return new SubMap (this, new Range (this, after, before)); + } + + /** + * {@inheritDoc} + */ + public override SortedSet ascending_keys { + owned get { + var keys = _keys; + if (_keys == null) { + keys = new KeySet (this); + _keys = keys; + keys.add_weak_pointer (&_keys); + } + return keys; + } + } + /** + * {@inheritDoc} + */ + public override SortedSet> ascending_entries { + owned get { + var entries = _entries; + if (_entries == null) { + entries = new EntrySet (this); + _entries = entries; + entries.add_weak_pointer (&_entries); + } + return entries; + } + } + /** * {@inheritDoc} */ public override Gee.MapIterator map_iterator () { return new MapIterator (this); } + + /** + * {@inheritDoc} + */ + public override Gee.BidirMapIterator bidir_map_iterator () { + return new MapIterator (this); + } [Compact] private class Node { @@ -439,12 +511,54 @@ public class Gee.TreeMap : Gee.AbstractMap { private weak Node? last = null; private int stamp = 0; + private inline K min (K a, K b) { + return key_compare_func (a, b) <= 0 ? a : b; + } + + private inline K max (K a, K b) { + return key_compare_func (a, b) > 0 ? a : b; + } + + private inline unowned Node? find_node (K key) { + unowned Node? cur = root; + while (cur != null) { + int res = key_compare_func (key, cur.key); + if (res == 0) { + return cur; + } else if (res < 0) { + cur = cur.left; + } else { + cur = cur.right; + } + } + return null; + } + + private inline unowned Node? find_nearest (K key) { + unowned Node? cur = root; + while (cur != null) { + int res = key_compare_func (key, cur.key); + if (res == 0) { + return cur; + } else if (res < 0) { + if (cur.left == null) + return cur; + cur = cur.left; + } else { + if (cur.right == null) + return cur; + cur = cur.right; + } + } + return null; + } + private class Entry : Map.Entry { private unowned Node _node; public static Map.Entry entry_for (Node node) { Map.Entry result = node.entry; - if (node.entry == null) { + if (result == null) { result = new Entry (node); node.entry = result; result.add_weak_pointer ((void**) (&node.entry)); @@ -462,118 +576,332 @@ public class Gee.TreeMap : Gee.AbstractMap { get { return _node.value; } set { _node.value = value; } } + + public override bool read_only { get { return false; } } } - private class KeySet : AbstractSet { - private TreeMap _map; + private inline unowned Node? find_lower (K key) { + unowned Node? node = find_nearest (key); + if (node == null) + return null; + return key_compare_func (key, node.key) <= 0 ? node.prev : node; + } - public KeySet (TreeMap map) { - _map = map; + private inline unowned Node? find_higher (K key) { + unowned Node? node = find_nearest (key); + if (node == null) + return null; + return key_compare_func (key, node.key) >= 0 ? node.next : node; + } + + private inline unowned Node? find_floor (K key) { + unowned Node? node = find_nearest (key); + if (node == null) + return null; + return key_compare_func (key, node.key) < 0 ? node.prev : node; + } + + private inline unowned Node? find_ceil (K key) { + unowned Node? node = find_nearest (key); + if (node == null) + return null; + return key_compare_func (key, node.key) > 0 ? node.next : node; + } + + private inline K? lift_null_key (Node? node) { + return node != null ? node.key : null; + } + + private class Range { + public Range (TreeMap map, K after, K before) { + this.map = map; + if (map.key_compare_func (after, before) < 0) { + this.after = after; + this.before = before; + type = RangeType.BOUNDED; + } else { + type = RangeType.EMPTY; + } } - public override Iterator iterator () { - return new KeyIterator (_map); + public Range.head (TreeMap map, K before) { + this.map = map; + this.before = before; + type = RangeType.HEAD; } - public override int size { - get { return _map.size; } + public Range.tail (TreeMap map, K after) { + this.map = map; + this.after = after; + type = RangeType.TAIL; } - public override bool add (K key) { - assert_not_reached (); + public Range.empty (TreeMap map) { + this.map = map; + type = RangeType.EMPTY; } - public override void clear () { - assert_not_reached (); + public Range cut_head (K after) { + switch (type) { + case RangeType.HEAD: + return new Range (map, after, before); + case RangeType.TAIL: + return new Range.tail (map, map.max (after, this.after)); + case RangeType.EMPTY: + return this; + case RangeType.BOUNDED: + var _after = map.max (after, this.after); + return new Range (map, _after, before); + default: + assert_not_reached (); + } } - public override bool remove (K key) { - assert_not_reached (); + public Range cut_tail (K before) { + switch (type) { + case RangeType.HEAD: + return new Range.head (map, map.min (before, this.before)); + case RangeType.TAIL: + return new Range (map, after, before); + case RangeType.EMPTY: + return this; + case RangeType.BOUNDED: + var _before = map.min (before, this.before); + return new Range (map, after, _before); + default: + assert_not_reached (); + } } - public override bool contains (K key) { - return _map.has_key (key); + public Range cut (K after, K before) { + if (type == RangeType.EMPTY) + return this; + var _before = (type == RangeType.HEAD || type == RangeType.BOUNDED) ? + map.min (before, this.before) : before; + var _after = (type == RangeType.TAIL || type == RangeType.BOUNDED) ? + map.max (after, this.after) : after; + return new Range (map, _after, _before); + } + + public bool in_range (K key) { + return type == RangeType.EMPTY ? false : compare_range(key) == 0; + } + + public int compare_range (K key) { + switch (type) { + case RangeType.HEAD: + return map.key_compare_func (key, before) < 0 ? 0 : 1; + case RangeType.TAIL: + return map.key_compare_func (key, after) >= 0 ? 0 : -1; + case RangeType.EMPTY: + return 0; // For simplicity - please make sure it does not break anything + case RangeType.BOUNDED: + return map.key_compare_func (key, after) >= 0 ? + (map.key_compare_func (key, before) < 0 ? 0 : 1) : -1; + default: + assert_not_reached (); + } } - public override bool add_all (Collection collection) { - assert_not_reached (); + public bool empty_submap () { + switch (type) { + case RangeType.HEAD: + return map.first == null || !in_range (map.first.key); + case RangeType.TAIL: + return map.last == null || !in_range (map.last.key); + case RangeType.EMPTY: + return true; + case RangeType.BOUNDED: + return first () == null; + default: + assert_not_reached (); + } } - public override bool remove_all (Collection collection) { - assert_not_reached (); + public unowned Node? first () { + switch (type) { + case RangeType.EMPTY: + return null; + case RangeType.HEAD: + return map.first; + default: + return map.find_floor (after); + } } - public override bool retain_all (Collection collection) { - assert_not_reached (); + public unowned Node? last () { + switch (type) { + case RangeType.EMPTY: + return null; + case RangeType.TAIL: + return map.last; + default: + return map.find_lower (before); + } } + + private new TreeMap map; + private K after; + private K before; + private RangeType type; } - private class ValueCollection : AbstractCollection { - private TreeMap _map; + private enum RangeType { + HEAD, + TAIL, + EMPTY, + BOUNDED + } - public ValueCollection (TreeMap map) { - _map = map; + private class SubMap : AbstractBidirSortedMap { + public override int size { get { return keys.size; } } + public bool is_empty { get { return keys.is_empty; } } + + public SubMap (TreeMap map, Range range) { + this.map = map; + this.range = range; } - public override Iterator iterator () { - return new ValueIterator (_map); + private weak SortedSet? _keys; + public override Set keys { + owned get { + var keys = _keys; + if (_keys == null) { + keys = new SubKeySet (map, range); + _keys = keys; + keys.add_weak_pointer(&_keys); + } + return keys; + } } - public override int size { - get { return _map.size; } + private weak Collection? _values; + public override Collection values { + owned get { + var values = _values; + if (_values == null) { + values = new SubValueCollection (map, range); + _values = values; + values.add_weak_pointer(&_values); + } + return values; + } } - public override bool add (V key) { - assert_not_reached (); + private weak SortedSet>? _entries; + public override Set> entries { + owned get { + var entries = _entries; + if (_entries == null) { + entries = new SubEntrySet (map, range); + _entries = entries; + entries.add_weak_pointer(&_entries); + } + return entries; + } + } + + public override bool read_only { + get { + return true; + } + } + + public override bool has_key (K key) { + return range.in_range (key) && map.has_key (key); + } + + public override bool has (K key, V value) { + return range.in_range (key) && map.has (key, value); + } + + public override new V? get (K key) { + return range.in_range (key) ? map.get (key) : null; + } + + public override void set (K key, V value) { + if (range.in_range (key)) + map.set (key, value); + } + + public override bool unset (K key, out V? value = null) { + value = null; + return range.in_range (key) && map.unset (key, out value); } public override void clear () { - assert_not_reached (); + for (var iterator = map_iterator (); iterator.next ();) + iterator.unset (); + } + + public override Gee.MapIterator map_iterator () { + return new SubMapIterator (map, range); + } + + public override BidirMapIterator bidir_map_iterator () { + return new SubMapIterator (map, range); } - public override bool remove (V key) { - assert_not_reached (); + public override SortedMap head_map (K before) { + return new SubMap (map, range.cut_tail (before)); } - public override bool contains (V key) { - Iterator it = iterator (); - while (it.next ()) { - if (_map.value_equal_func (key, it.get ())) { - return true; - } - } - return false; + public override SortedMap tail_map (K after) { + return new SubMap (map, range.cut_head (after)); } - public override bool add_all (Collection collection) { - assert_not_reached (); + public override SortedMap sub_map (K after, K before) { + return new SubMap (map, range.cut (after, before)); } - public override bool remove_all (Collection collection) { - assert_not_reached (); + public override SortedSet ascending_keys { + owned get { + var keys = _keys; + if (_keys == null) { + keys = new SubKeySet (map, range); + _keys = keys; + keys.add_weak_pointer(&_keys); + } + return keys; + } } - public override bool retain_all (Collection collection) { - assert_not_reached (); + public override SortedSet ascending_entries { + owned get { + var entries = _entries; + if (_entries == null) { + entries = new SubEntrySet (map, range); + _entries = entries; + entries.add_weak_pointer(&_entries); + } + return _entries; + } } + + private TreeMap map; + private Range range; } - private class EntrySet : AbstractSet> { + private class KeySet : AbstractBidirSortedSet { private TreeMap _map; - public EntrySet (TreeMap map) { + public KeySet (TreeMap map) { _map = map; } - public override Iterator> iterator () { - return new EntryIterator (_map); + public override Iterator iterator () { + return new KeyIterator (_map); } public override int size { get { return _map.size; } } - public override bool add (Map.Entry entry) { + public override bool read_only { + get { return true; } + } + + public override bool add (K key) { assert_not_reached (); } @@ -581,104 +909,575 @@ public class Gee.TreeMap : Gee.AbstractMap { assert_not_reached (); } - public override bool remove (Map.Entry entry) { + public override bool remove (K key) { assert_not_reached (); } - public override bool contains (Map.Entry entry) { - return _map.has (entry.key, entry.value); + public override bool contains (K key) { + return _map.has_key (key); } - public override bool add_all (Collection> entries) { - assert_not_reached (); + public override K first () { + assert (_map.first != null); + return _map.first.key; } - public override bool remove_all (Collection> entries) { - assert_not_reached (); + public override K last () { + assert (_map.last != null); + return _map.last.key; } - public override bool retain_all (Collection> entries) { - assert_not_reached (); + public override BidirIterator bidir_iterator () { + return new KeyIterator (_map); } - } - - private class NodeIterator : Object { - protected TreeMap _map; - - // concurrent modification protection - protected int stamp; - protected weak Node? current; - protected weak Node? _next; - protected weak Node? _prev; + public override SortedSet head_set (K before) { + return new SubKeySet (_map, new Range.head (_map, before)); + } - public NodeIterator (TreeMap map) { - _map = map; - stamp = _map.stamp; + public override SortedSet tail_set (K after) { + return new SubKeySet (_map, new Range.tail (_map, after)); } - public bool next () { - assert (stamp == _map.stamp); - if (current != null) { - if (current.next != null) { - current = current.next; - return true; - } else { - return false; - } - } else if (_next == null && _prev == null) { - current = _map.first; - return current != null; - } else { - current = _next; - if (current != null) { - _next = null; - _prev = null; - } - return current != null; - } + public override SortedSet sub_set (K after, K before) { + return new SubKeySet (_map, new Range (_map, after, before)); } - public bool has_next () { - assert (stamp == _map.stamp); - return (current == null && _next == null && _prev == null && _map.first != null) || - (current == null && _next != null) || - (current != null && current.next != null); + public override Iterator? iterator_at (K item) { + weak Node? node = _map.find_node (item); + if (node == null) + return null; + return new KeyIterator.pointing (_map, node); } - public bool first () { - assert (stamp == _map.stamp); - current = _map.first; - _next = null; - _prev = null; - return current != null; // on false it is null anyway + public override K? lower (K item) { + return _map.lift_null_key (_map.find_lower (item)); } - public bool previous () { - assert (stamp == _map.stamp); - if (current != null) { - if (current.prev != null) { - current = current.prev; - return true; - } else { - return false; - } - } else { - if (_prev != null) { - current = _prev; - _next = null; - _prev = null; - return true; - } else { - return false; - } - } + public override K? higher (K item) { + return _map.lift_null_key (_map.find_higher (item)); } - public bool has_previous () { - assert (stamp == _map.stamp); - return (current == null && _prev != null) || - (current != null && current.prev != null); + public override K? floor (K item) { + return _map.lift_null_key (_map.find_floor (item)); + } + + public override K? ceil (K item) { + return _map.lift_null_key (_map.find_ceil (item)); + } + } + + private class SubKeySet : AbstractBidirSortedSet { + [CCode (notify = false)] + public TreeMap map { private set; get; } + [CCode (notify = false)] + public Range range { private set; get; } + + public SubKeySet (TreeMap map, Range range) { + this.map = map; + this.range = range; + } + + public override Iterator iterator () { + return new SubKeyIterator (map, range); + } + + public override int size { + get { + var i = 0; + Gee.Iterator iterator = iterator (); + while (iterator.next ()) + i++; + return i; + } + } + + public override bool read_only { + get { + return true; + } + } + + public bool is_empty { get { return range.empty_submap (); } } + + public override bool add (K key) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public override bool remove (K key) { + assert_not_reached (); + } + + public override bool contains (K key) { + return range.in_range(key) && map.has_key (key); + } + + public override BidirIterator bidir_iterator () { + return new SubKeyIterator (map, range); + } + + public override K first () { + weak Node? _first = range.first (); + assert (_first != null); + return _first.key; + } + + public override K last () { + weak Node? _last = range.last (); + assert (_last != null); + return _last.key; + } + + public override SortedSet head_set (K before) { + return new SubKeySet (map, range.cut_tail (before)); + } + + public override SortedSet tail_set (K after) { + return new SubKeySet (map, range.cut_head (after)); + } + + public override SortedSet sub_set (K after, K before) { + return new SubKeySet (map, range.cut (after, before)); + } + + public override Iterator? iterator_at (K key) { + if (!range.in_range (key)) + return null; + weak Node? n = map.find_node (key); + if (n == null) + return null; + return new SubKeyIterator.pointing (map, range, n); + } + + public override K? lower (K key) { + var res = range.compare_range (key); + if (res > 0) + return last (); + var l = map.lift_null_key (map.find_lower (key)); + return l != null && range.in_range (l) ? l : null; + } + + public override K? higher (K key) { + var res = range.compare_range (key); + if (res < 0) + return first (); + var h = map.lift_null_key (map.find_higher (key)); + return h != null && range.in_range (h) ? h : null; + } + + public override K? floor (K key) { + var res = range.compare_range (key); + if (res > 0) + return last (); + var l = map.lift_null_key (map.find_floor (key)); + return l != null && range.in_range (l) ? l : null; + } + + public override K? ceil (K key) { + var res = range.compare_range (key); + if (res < 0) + return first (); + var h = map.lift_null_key (map.find_ceil (key)); + return h != null && range.in_range (h) ? h : null; + } + } + + private class ValueCollection : AbstractCollection { + private TreeMap _map; + + public ValueCollection (TreeMap map) { + _map = map; + } + + public override Iterator iterator () { + return new ValueIterator (_map); + } + + public override int size { + get { return _map.size; } + } + + public override bool read_only { + get { return true; } + } + + public override bool add (V key) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public override bool remove (V key) { + assert_not_reached (); + } + + public override bool contains (V key) { + Iterator it = iterator (); + while (it.next ()) { + if (_map.value_equal_func (key, it.get ())) { + return true; + } + } + return false; + } + } + + private class SubValueCollection : AbstractCollection { + [CCode (notify = false)] + public TreeMap map { private set; get; } + [CCode (notify = false)] + public Range range { private set; get; } + + public SubValueCollection (TreeMap map, Range range) { + this.map = map; + this.range = range; + } + + public override Iterator iterator () { + return new SubValueIterator (map, range); + } + + public override bool read_only { + get { + return true; + } + } + + public override int size { + get { + var i = 0; + Gee.Iterator iterator = iterator (); + while (iterator.next ()) + i++; + return i; + } + } + + public bool is_empty { get { return range.empty_submap (); } } + + public override bool add (V key) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public override bool remove (V key) { + assert_not_reached (); + } + + public override bool contains (V key) { + Iterator it = iterator (); + while (it.next ()) { + if (map.value_equal_func (key, it.get ())) { + return true; + } + } + return false; + } + } + + private class EntrySet : AbstractBidirSortedSet> { + private TreeMap _map; + + public EntrySet (TreeMap map) { + _map = map; + } + + public override Iterator> iterator () { + return new EntryIterator (_map); + } + + public override int size { + get { return _map.size; } + } + + public override bool read_only { + get { return true; } + } + + public override bool add (Map.Entry entry) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public override bool remove (Map.Entry entry) { + assert_not_reached (); + } + + public override bool contains (Map.Entry entry) { + return _map.has (entry.key, entry.value); + } + + public override Map.Entry/*?*/ first () { + assert (_map.first != null); + return Entry.entry_for (_map.first); + } + + public override Map.Entry/*?*/ last () { + assert (_map.last != null); + return Entry.entry_for (_map.last); + } + + public override BidirIterator> bidir_iterator () { + return new EntryIterator (_map); + } + + public override SortedSet> head_set (Map.Entry before) { + return new SubEntrySet (_map, new Range.head (_map, before.key)); + } + + public override SortedSet> tail_set (Map.Entry after) { + return new SubEntrySet (_map, new Range.tail (_map, after.key)); + } + + public override SortedSet sub_set (Map.Entry after, Map.Entry before) { + return new SubEntrySet (_map, new Range (_map, after.key, before.key)); + } + + public override Iterator>? iterator_at (Map.Entry item) { + weak Node? node = _map.find_node (item.key); + if (node == null || !_map.value_equal_func (node.value, item.value)) + return null; + return new EntryIterator.pointing (_map, node); + } + + public override Map.Entry/*?*/ lower (Map.Entry item) { + weak Node? l = _map.find_lower (item.key); + return l != null ? Entry.entry_for (l) : null; + } + + public override Map.Entry/*?*/ higher (Map.Entry item) { + weak Node? l = _map.find_higher (item.key); + return l != null ? Entry.entry_for (l) : null; + } + + public override Map.Entry/*?*/ floor (Map.Entry item) { + weak Node? l = _map.find_floor (item.key); + return l != null ? Entry.entry_for (l) : null; + } + + public override Map.Entry/*?*/ ceil (Map.Entry item) { + weak Node? l = _map.find_ceil (item.key); + return l != null ? Entry.entry_for (l) : null; + } + } + + private class SubEntrySet : AbstractBidirSortedSet> { + [CCode (notify = false)] + public TreeMap map { private set; get; } + [CCode (notify = false)] + public Range range { private set; get; } + + public SubEntrySet (TreeMap map, Range range) { + this.map = map; + this.range = range; + } + + public override Iterator> iterator () { + return new SubEntryIterator (map, range); + } + + public override int size { + get { + var i = 0; + Gee.Iterator> iterator = iterator (); + while (iterator.next ()) + i++; + return i; + } + } + + public override bool read_only { + get { + return true; + } + } + + public bool is_empty { get { return range.empty_submap (); } } + + public override bool add (Map.Entry entry) { + assert_not_reached (); + } + + public override void clear () { + assert_not_reached (); + } + + public override bool remove (Map.Entry entry) { + assert_not_reached (); + } + + public override bool contains (Map.Entry entry) { + return range.in_range(entry.key) && map.has (entry.key, entry.value); + } + + public override BidirIterator bidir_iterator () { + return new SubEntryIterator (map, range); + } + + public override Map.Entry first () { + weak Node? _first = range.first (); + assert (_first != null); + return Entry.entry_for (_first); + } + + public override Map.Entry last () { + weak Node? _last = range.last (); + assert (_last != null); + return Entry.entry_for (_last); + } + + public override SortedSet head_set (Map.Entry before) { + return new SubEntrySet (map, range.cut_tail (before.key)); + } + + public override SortedSet tail_set (Map.Entry after) { + return new SubEntrySet (map, range.cut_head (after.key)); + } + + public override SortedSet sub_set (Map.Entry after, Map.Entry before) { + return new SubEntrySet (map, range.cut (after.key, before.key)); + } + + public override Iterator>? iterator_at (Map.Entry entry) { + if (!range.in_range (entry.key)) + return null; + weak Node? n = map.find_node (entry.key); + if (n == null || !map.value_equal_func (n.value, entry.value)) + return null; + return new SubEntryIterator.pointing (map, range, n); + } + + public override Map.Entry/*?*/ lower (Map.Entry entry) { + var res = range.compare_range (entry.key); + if (res > 0) + return last (); + weak Node? l = map.find_lower (entry.key); + return l != null && range.in_range (l.key) ? Entry.entry_for (l) : null; + } + + public override Map.Entry/*?*/ higher (Map.Entry entry) { + var res = range.compare_range (entry.key); + if (res < 0) + return first (); + weak Node? h = map.find_higher (entry.key); + return h != null && range.in_range (h.key) ? Entry.entry_for (h) : null; + } + + public override Map.Entry/*?*/ floor (Map.Entry entry) { + var res = range.compare_range (entry.key); + if (res > 0) + return last (); + weak Node? l = map.find_floor (entry.key); + return l != null && range.in_range (l.key) ? Entry.entry_for (l) : null; + } + + public override Map.Entry/*?*/ ceil (Map.Entry entry) { + var res = range.compare_range (entry.key); + if (res < 0) + return first (); + weak Node? h = map.find_ceil (entry.key); + return h != null && range.in_range (h.key) ? Entry.entry_for (h) : null; + } + } + + private class NodeIterator : Object { + protected TreeMap _map; + + // concurrent modification protection + protected int stamp; + + protected bool started = false; + + internal weak Node? current; + protected weak Node? _next; + protected weak Node? _prev; + + public NodeIterator (TreeMap map) { + _map = map; + this.stamp = _map.stamp; + } + + public NodeIterator.pointing (TreeMap map, Node current) { + _map = map; + stamp = _map.stamp; + this.current = current; + } + + public bool next () { + assert (stamp == _map.stamp); + if (current != null) { + if (current.next != null) { + current = current.next; + return true; + } else { + return false; + } + } else if (_next == null && _prev == null) { + current = _map.first; + started = true; + return current != null; + } else { + current = _next; + if (current != null) { + _next = null; + _prev = null; + } + return current != null; + } + } + + public bool has_next () { + assert (stamp == _map.stamp); + return (current == null && _next == null && _prev == null && _map.first != null) || + (current == null && _next != null) || + (current != null && current.next != null); + } + + public bool first () { + assert (stamp == _map.stamp); + current = _map.first; + _next = null; + _prev = null; + return current != null; // on false it is null anyway + } + + public bool previous () { + assert (stamp == _map.stamp); + if (current != null) { + if (current.prev != null) { + current = current.prev; + return true; + } else { + return false; + } + } else { + if (_prev != null) { + current = _prev; + _next = null; + _prev = null; + return true; + } else { + return false; + } + } + } + + public bool has_previous () { + assert (stamp == _map.stamp); + return (current == null && _prev != null) || + (current != null && current.prev != null); } public bool last () { @@ -692,7 +1491,7 @@ public class Gee.TreeMap : Gee.AbstractMap { public void remove () { assert_not_reached (); } - + public void unset () { assert (stamp == _map.stamp); assert (current != null); @@ -706,65 +1505,410 @@ public class Gee.TreeMap : Gee.AbstractMap { _map.stamp++; assert (stamp == _map.stamp); } + + public virtual bool read_only { + get { + return true; + } + } + + public bool valid { + get { + return current != null; + } + } + + internal unowned Node? safe_next_get () { + return (current != null) ? current.next : _next; + } + + internal unowned Node? safe_previous_get () { + return (current != null) ? current.prev : _prev; + } + } + + private class SubNodeIterator : Object { + public SubNodeIterator (TreeMap map, Range range) { + _map = map; + this.range = range; + } + + public SubNodeIterator.pointing (TreeMap map, Range range, Node node) { + _map = map; + this.range = range; + this.iterator = new NodeIterator.pointing (_map, node); + } + + public bool next () { + if (iterator != null) { + weak Node? node= iterator.safe_next_get (); + if (node != null && range.in_range (node.key)) { + assert (iterator.next ()); + return true; + } else { + return false; + } + } else { + return first (); + } + } + + public bool has_next () { + if (iterator != null) { + weak Node? node = iterator.safe_next_get (); + return node != null && range.in_range (node.key); + } else { + return range.first () != null; + } + } + + public virtual bool first () { + weak Node? node = range.first (); + if (node == null) + return false; + iterator = iterator_pointing_at (node); + return true; + } + + public bool previous () { + if (iterator == null) + return false; + weak Node? node; + if ((node = iterator.safe_previous_get ()) != null && range.in_range (node.key)) { + assert (iterator.previous ()); + return true; + } else { + return false; + } + } + + public bool has_previous () { + if (iterator == null) + return false; + weak Node? node; + return (node = iterator.safe_previous_get ()) != null && range.in_range (node.key); + } + + public virtual bool last () { + weak Node? node = range.last (); + if (node == null) + return false; + iterator = iterator_pointing_at (node); + return true; + } + + public void remove () { + assert (valid); + iterator.remove (); + } + + public void unset () { + assert (valid); + iterator.unset (); + } + + public virtual bool read_only { + get { + return true; + } + } + + public bool valid { + get { + return iterator != null && iterator.valid; + } + } + + protected virtual NodeIterator iterator_pointing_at (Node node) { + return new NodeIterator.pointing (_map, node); + } + + protected new TreeMap _map; + protected Range range; + protected NodeIterator? iterator = null; } - private class KeyIterator : NodeIterator, Gee.Iterator, BidirIterator { + private class KeyIterator : NodeIterator, Traversable, Gee.Iterator, BidirIterator { public KeyIterator (TreeMap map) { base (map); } + public KeyIterator.pointing (TreeMap map, Node current) { + base.pointing (map, current); + } + public new K get () { assert (stamp == _map.stamp); assert (current != null); return current.key; } + + public bool foreach (ForallFunc f) { + if (current != null) { + if (!f (current.key)) { + return false; + } + current = current.next; + } else if (_next == null) { + current = _map.first; + started = true; + } else { + current = _next; + if (current != null) { + _next = null; + _prev = null; + } + } + for (; current != null; current = current.next) { + if (!f (current.key)) { + return false; + } + } + return true; + } + } + + private class SubKeyIterator : SubNodeIterator, Traversable, Gee.Iterator, BidirIterator { + public SubKeyIterator (TreeMap map, Range range) { + base (map, range); + } + + public SubKeyIterator.pointing (TreeMap map, Range range, Node node) { + base.pointing (map, range, node); + } + + public new K get () { + assert (valid); + return iterator.current.key; + } + + public bool foreach (ForallFunc f) { + if (valid) { + if (!f (iterator.current.key)) { + return false; + } + } + while (iterator.next ()) { + if (!f (iterator.current.key)) { + return false; + } + } + return true; + } } - private class ValueIterator : NodeIterator, Gee.Iterator, Gee.BidirIterator { + private class ValueIterator : NodeIterator, Traversable, Gee.Iterator, Gee.BidirIterator { public ValueIterator (TreeMap map) { base (map); } + public ValueIterator.pointing (TreeMap map, Node current) { + base.pointing (map, current); + } + public new V get () { assert (stamp == _map.stamp); - assert (current != null); + assert (valid); return current.value; } + + public bool foreach (ForallFunc f) { + if (current != null) { + if (!f (current.key)) { + return false; + } + current = current.next; + } else if (_next == null) { + current = _map.first; + started = true; + } else { + current = _next; + if (current != null) { + _next = null; + _prev = null; + } + } + for (; current != null; current = current.next) { + if (!f (current.key)) { + return false; + } + } + return true; + } + } + + private class SubValueIterator : SubNodeIterator, Traversable, Gee.Iterator, BidirIterator { + public SubValueIterator (TreeMap map, Range range) { + base (map, range); + } + + public SubValueIterator.pointing (TreeMap map, Range range, Node node) { + base.pointing (map, range, node); + } + + public new V get () { + assert (valid); + return iterator.current.value; + } + + public bool foreach (ForallFunc f) { + if (valid) { + if (!f (iterator.current.key)) { + return false; + } + } + while (iterator.next ()) { + if (!f (iterator.current.key)) { + return false; + } + } + return true; + } } - private class EntryIterator : NodeIterator, Gee.Iterator>, Gee.BidirIterator> { + private class EntryIterator : NodeIterator, Traversable>, Gee.Iterator>, Gee.BidirIterator> { public EntryIterator (TreeMap map) { base (map); } + public EntryIterator.pointing (TreeMap map, Node node) { + base.pointing (map, node); + } + public new Map.Entry get () { assert (stamp == _map.stamp); - assert (current != null); - return Entry.entry_for (current); + assert (valid); + return Entry.entry_for (current); + } + + public new void remove () { + unset (); + } + + public bool foreach (ForallFunc> f) { + if (current != null) { + if (!f (Entry.entry_for (current))) { + return false; + } + current = current.next; + } else if (_next == null) { + current = _map.first; + started = true; + } else { + current = _next; + if (current != null) { + _next = null; + _prev = null; + } + } + for (; current != null; current = current.next) { + if (!f (Entry.entry_for (current))) { + return false; + } + } + return true; + } + } + + private class SubEntryIterator : SubNodeIterator, Traversable>, Gee.Iterator>, Gee.BidirIterator> { + public SubEntryIterator (TreeMap map, Range range) { + base (map, range); + } + + public SubEntryIterator.pointing (TreeMap map, Range range, Node node) { + base.pointing (map, range, node); + } + + public new Map.Entry get () { + assert (iterator != null); + return Entry.entry_for (iterator.current); + } + + public new void remove () { + unset (); + } + + public bool foreach (ForallFunc> f) { + if (valid) { + if (!f (Entry.entry_for (iterator.current))) { + return false; + } + } + while (iterator.next ()) { + if (!f (Entry.entry_for (iterator.current))) { + return false; + } + } + return true; } } - private class MapIterator : NodeIterator, Gee.MapIterator { + private class MapIterator : NodeIterator, Gee.MapIterator, BidirMapIterator { public MapIterator (TreeMap map) { base (map); } public K get_key () { assert (stamp == _map.stamp); - assert (current != null); + assert (valid); return current.key; } public V get_value () { assert (stamp == _map.stamp); - assert (current != null); + assert (valid); return current.value; } public void set_value (V value) { assert (stamp == _map.stamp); - assert (current != null); + assert (valid); current.value = value; } + + public override bool read_only { + get { + return false; + } + } + + public bool mutable { + get { + return true; + } + } + } + + private class SubMapIterator : SubNodeIterator, Gee.MapIterator, BidirMapIterator { + public SubMapIterator (TreeMap map, Range range) { + base (map, range); + } + + public K get_key () { + assert (valid); + return iterator.current.key; + } + + public V get_value () { + assert (valid); + return iterator.current.value; + } + + public void set_value (V value) { + assert (valid); + iterator.current.value = value; + } + + public override bool read_only { + get { + return false; + } + } + + public bool mutable { + get { + return true; + } + } } } diff --git a/gee/treemultimap.c b/gee/treemultimap.c index 7fe5cd7..27eaa00 100644 --- a/gee/treemultimap.c +++ b/gee/treemultimap.c @@ -35,13 +35,25 @@ typedef struct _GeeMultiMap GeeMultiMap; typedef struct _GeeMultiMapIface GeeMultiMapIface; -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -51,6 +63,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -75,6 +95,14 @@ typedef struct _GeeSetIface GeeSetIface; typedef struct _GeeMultiSet GeeMultiSet; typedef struct _GeeMultiSetIface GeeMultiSetIface; +#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) +#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) +#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) +#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) + +typedef struct _GeeMapIterator GeeMapIterator; +typedef struct _GeeMapIteratorIface GeeMapIteratorIface; + #define GEE_TYPE_ABSTRACT_MULTI_MAP (gee_abstract_multi_map_get_type ()) #define GEE_ABSTRACT_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMap)) #define GEE_ABSTRACT_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_MULTI_MAP, GeeAbstractMultiMapClass)) @@ -94,14 +122,6 @@ typedef struct _GeeAbstractMultiMapPrivate GeeAbstractMultiMapPrivate; typedef struct _GeeMap GeeMap; typedef struct _GeeMapIface GeeMapIface; -#define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ()) -#define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator)) -#define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR)) -#define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface)) - -typedef struct _GeeMapIterator GeeMapIterator; -typedef struct _GeeMapIteratorIface GeeMapIteratorIface; - #define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ()) #define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry)) #define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass)) @@ -133,6 +153,26 @@ typedef struct _GeeTreeMultiMapPrivate GeeTreeMultiMapPrivate; typedef struct _GeeAbstractMap GeeAbstractMap; typedef struct _GeeAbstractMapClass GeeAbstractMapClass; +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; + #define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) #define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) #define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) @@ -164,6 +204,26 @@ typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractSet GeeAbstractSet; typedef struct _GeeAbstractSetClass GeeAbstractSetClass; +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; + #define GEE_TYPE_TREE_SET (gee_tree_set_get_type ()) #define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet)) #define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass)) @@ -194,23 +254,55 @@ typedef struct _GeeAbstractMultiSetClass GeeAbstractMultiSetClass; typedef struct _GeeTreeMultiSet GeeTreeMultiSet; typedef struct _GeeTreeMultiSetClass GeeTreeMultiSetClass; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -222,21 +314,58 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); +}; + +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); +struct _GeeMapIteratorIface { + GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); + gboolean (*next) (GeeMapIterator* self); + gboolean (*has_next) (GeeMapIterator* self); + gpointer (*get_key) (GeeMapIterator* self); + gpointer (*get_value) (GeeMapIterator* self); + void (*set_value) (GeeMapIterator* self, gconstpointer value); + void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeMultiMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self); + GType (*get_v_type) (GeeMultiMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self); GeeSet* (*get_keys) (GeeMultiMap* self); GeeMultiSet* (*get_all_keys) (GeeMultiMap* self); GeeCollection* (*get_values) (GeeMultiMap* self); @@ -246,44 +375,38 @@ struct _GeeMultiMapIface { gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value); gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key); void (*clear) (GeeMultiMap* self); + GeeMapIterator* (*map_iterator) (GeeMultiMap* self); gint (*get_size) (GeeMultiMap* self); + gboolean (*get_read_only) (GeeMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self); }; -struct _GeeMapIteratorIface { - GTypeInterface parent_iface; - gboolean (*next) (GeeMapIterator* self); - gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); - gpointer (*get_key) (GeeMapIterator* self); - gpointer (*get_value) (GeeMapIterator* self); - void (*set_value) (GeeMapIterator* self, gconstpointer value); - void (*unset) (GeeMapIterator* self); -}; - +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiMap { @@ -296,7 +419,17 @@ struct _GeeAbstractMultiMapClass { GObjectClass parent_class; GeeCollection* (*create_value_storage) (GeeAbstractMultiMap* self); GeeMultiSet* (*create_multi_key_set) (GeeAbstractMultiMap* self); - GEqualFunc (*get_value_equal_func) (GeeAbstractMultiMap* self); + GeeEqualDataFunc (*get_value_equal_func) (GeeAbstractMultiMap* self, void** result_target, GDestroyNotify* result_target_destroy_notify); + void (*reserved0) (GeeAbstractMultiMap* self); + void (*reserved1) (GeeAbstractMultiMap* self); + void (*reserved2) (GeeAbstractMultiMap* self); + void (*reserved3) (GeeAbstractMultiMap* self); + void (*reserved4) (GeeAbstractMultiMap* self); + void (*reserved5) (GeeAbstractMultiMap* self); + void (*reserved6) (GeeAbstractMultiMap* self); + void (*reserved7) (GeeAbstractMultiMap* self); + void (*reserved8) (GeeAbstractMultiMap* self); + GeeMultiMap* (*get_read_only_view) (GeeAbstractMultiMap* self); }; struct _GeeTreeMultiMap { @@ -315,20 +448,31 @@ struct _GeeTreeMultiMapPrivate { GType v_type; GBoxedCopyFunc v_dup_func; GDestroyNotify v_destroy_func; - GCompareFunc _value_compare_func; + GCompareDataFunc _value_compare_func; + gpointer _value_compare_func_target; + GDestroyNotify _value_compare_func_target_destroy_notify; }; static gpointer gee_tree_multi_map_parent_class = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GType gee_multi_set_get_type (void) G_GNUC_CONST; +GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_multi_map_get_type (void) G_GNUC_CONST; GType gee_abstract_multi_map_get_type (void) G_GNUC_CONST; -GType gee_map_iterator_get_type (void) G_GNUC_CONST; GType gee_map_entry_get_type (void) G_GNUC_CONST; GType gee_map_get_type (void) G_GNUC_CONST; GType gee_tree_multi_map_get_type (void) G_GNUC_CONST; @@ -340,35 +484,37 @@ enum { GEE_TREE_MULTI_MAP_K_DESTROY_FUNC, GEE_TREE_MULTI_MAP_V_TYPE, GEE_TREE_MULTI_MAP_V_DUP_FUNC, - GEE_TREE_MULTI_MAP_V_DESTROY_FUNC, - GEE_TREE_MULTI_MAP_KEY_COMPARE_FUNC, - GEE_TREE_MULTI_MAP_VALUE_COMPARE_FUNC + GEE_TREE_MULTI_MAP_V_DESTROY_FUNC }; -GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func); -GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func); -GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); +GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify); +GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; GType gee_tree_map_get_type (void) G_GNUC_CONST; GeeAbstractMultiMap* gee_abstract_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMap* storage_map); -GCompareFunc gee_functions_get_compare_func_for (GType t); -static void gee_tree_multi_map_set_value_compare_func (GeeTreeMultiMap* self, GCompareFunc value); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_tree_multi_map_set_value_compare_func (GeeTreeMultiMap* self, GCompareDataFunc value, gpointer value_target); static GeeCollection* gee_tree_multi_map_real_create_value_storage (GeeAbstractMultiMap* base); -GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; GType gee_tree_set_get_type (void) G_GNUC_CONST; static GeeMultiSet* gee_tree_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* base); -GCompareFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self); -GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); +GCompareDataFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self, gpointer* result_target); +GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); GType gee_abstract_multi_set_get_type (void) G_GNUC_CONST; GType gee_tree_multi_set_get_type (void) G_GNUC_CONST; -static GEqualFunc gee_tree_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base); -GEqualFunc gee_functions_get_equal_func_for (GType t); -GCompareFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self); -GCompareFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self); +static GeeEqualDataFunc gee_tree_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base, void** result_target, GDestroyNotify* result_target_destroy_notify); +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target); +GCompareDataFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self, gpointer* result_target); static void gee_tree_multi_map_finalize (GObject* obj); static void _vala_gee_tree_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -383,51 +529,77 @@ static void _vala_gee_tree_multi_map_set_property (GObject * object, guint prope * @param key_compare_func an optional key comparator function * @param value_compare_func an optional value comparator function */ -GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func) { +GeeTreeMultiMap* gee_tree_multi_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify) { GeeTreeMultiMap * self = NULL; - GCompareFunc _tmp0_; - GEqualFunc _tmp1_; - GeeTreeMap* _tmp2_; - GeeTreeMap* _tmp3_; - GCompareFunc _tmp4_; - GCompareFunc _tmp6_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_ = NULL; + GeeTreeMap* _tmp4_; + GeeTreeMap* _tmp5_; + GCompareDataFunc _tmp6_; + void* _tmp6__target; + GCompareDataFunc _tmp10_; + void* _tmp10__target; _tmp0_ = key_compare_func; - _tmp1_ = g_direct_equal; - _tmp2_ = gee_tree_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, GEE_TYPE_SET, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp0_, _tmp1_); - _tmp3_ = _tmp2_; - self = (GeeTreeMultiMap*) gee_abstract_multi_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMap*) _tmp3_); + _tmp0__target = key_compare_func_target; + _tmp3_ = gee_functions_get_equal_func_for (GEE_TYPE_SET, &_tmp1_, &_tmp2_); + _tmp4_ = gee_tree_map_new (k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, GEE_TYPE_SET, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp0_, _tmp0__target, NULL, _tmp3_, _tmp1_, _tmp2_); + _tmp5_ = _tmp4_; + self = (GeeTreeMultiMap*) gee_abstract_multi_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, v_destroy_func, (GeeMap*) _tmp5_); self->priv->k_type = k_type; self->priv->k_dup_func = k_dup_func; self->priv->k_destroy_func = k_destroy_func; self->priv->v_type = v_type; self->priv->v_dup_func = v_dup_func; self->priv->v_destroy_func = v_destroy_func; - _g_object_unref0 (_tmp3_); - _tmp4_ = value_compare_func; - if (_tmp4_ == NULL) { - GCompareFunc _tmp5_ = NULL; - _tmp5_ = gee_functions_get_compare_func_for (v_type); - value_compare_func = _tmp5_; - } + _g_object_unref0 (_tmp5_); _tmp6_ = value_compare_func; - gee_tree_multi_map_set_value_compare_func (self, _tmp6_); + _tmp6__target = value_compare_func_target; + if (_tmp6_ == NULL) { + void* _tmp7_ = NULL; + GDestroyNotify _tmp8_ = NULL; + GCompareDataFunc _tmp9_ = NULL; + _tmp9_ = gee_functions_get_compare_func_for (v_type, &_tmp7_, &_tmp8_); + (value_compare_func_target_destroy_notify == NULL) ? NULL : (value_compare_func_target_destroy_notify (value_compare_func_target), NULL); + value_compare_func = NULL; + value_compare_func_target = NULL; + value_compare_func_target_destroy_notify = NULL; + value_compare_func = _tmp9_; + value_compare_func_target = _tmp7_; + value_compare_func_target_destroy_notify = _tmp8_; + } + _tmp10_ = value_compare_func; + _tmp10__target = value_compare_func_target; + gee_tree_multi_map_set_value_compare_func (self, _tmp10_, _tmp10__target); + (key_compare_func_target_destroy_notify == NULL) ? NULL : (key_compare_func_target_destroy_notify (key_compare_func_target), NULL); + key_compare_func = NULL; + key_compare_func_target = NULL; + key_compare_func_target_destroy_notify = NULL; + (value_compare_func_target_destroy_notify == NULL) ? NULL : (value_compare_func_target_destroy_notify (value_compare_func_target), NULL); + value_compare_func = NULL; + value_compare_func_target = NULL; + value_compare_func_target_destroy_notify = NULL; return self; } -GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GCompareFunc value_compare_func) { - return gee_tree_multi_map_construct (GEE_TYPE_TREE_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_compare_func, value_compare_func); +GeeTreeMultiMap* gee_tree_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GCompareDataFunc value_compare_func, void* value_compare_func_target, GDestroyNotify value_compare_func_target_destroy_notify) { + return gee_tree_multi_map_construct (GEE_TYPE_TREE_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key_compare_func, key_compare_func_target, key_compare_func_target_destroy_notify, value_compare_func, value_compare_func_target, value_compare_func_target_destroy_notify); } static GeeCollection* gee_tree_multi_map_real_create_value_storage (GeeAbstractMultiMap* base) { GeeTreeMultiMap * self; GeeCollection* result = NULL; - GCompareFunc _tmp0_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; GeeTreeSet* _tmp1_; self = (GeeTreeMultiMap*) base; _tmp0_ = self->priv->_value_compare_func; - _tmp1_ = gee_tree_set_new (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_); + _tmp0__target = self->priv->_value_compare_func_target; + _tmp1_ = gee_tree_set_new (self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp0_, _tmp0__target, NULL); result = (GeeCollection*) _tmp1_; return result; } @@ -436,59 +608,94 @@ static GeeCollection* gee_tree_multi_map_real_create_value_storage (GeeAbstractM static GeeMultiSet* gee_tree_multi_map_real_create_multi_key_set (GeeAbstractMultiMap* base) { GeeTreeMultiMap * self; GeeMultiSet* result = NULL; - GCompareFunc _tmp0_; - GCompareFunc _tmp1_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp1_; + void* _tmp1__target; GeeTreeMultiSet* _tmp2_; self = (GeeTreeMultiMap*) base; - _tmp0_ = gee_tree_multi_map_get_key_compare_func (self); + _tmp0_ = gee_tree_multi_map_get_key_compare_func (self, &_tmp0__target); _tmp1_ = _tmp0_; - _tmp2_ = gee_tree_multi_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, _tmp1_); + _tmp1__target = _tmp0__target; + _tmp2_ = gee_tree_multi_set_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, _tmp1_, _tmp1__target, NULL); result = (GeeMultiSet*) _tmp2_; return result; } -static GEqualFunc gee_tree_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base) { +static GeeEqualDataFunc gee_tree_multi_map_real_get_value_equal_func (GeeAbstractMultiMap* base, void** result_target, GDestroyNotify* result_target_destroy_notify) { GeeTreeMultiMap * self; - GEqualFunc result = NULL; - GEqualFunc _tmp0_ = NULL; + GeeEqualDataFunc result = NULL; + void* _tmp0_ = NULL; + GDestroyNotify _tmp1_ = NULL; + GeeEqualDataFunc _tmp2_ = NULL; + GeeEqualDataFunc _tmp3_; + void* _tmp3__target; + GDestroyNotify _tmp3__target_destroy_notify; self = (GeeTreeMultiMap*) base; - _tmp0_ = gee_functions_get_equal_func_for (self->priv->v_type); - result = _tmp0_; + _tmp2_ = gee_functions_get_equal_func_for (self->priv->v_type, &_tmp0_, &_tmp1_); + _tmp3_ = _tmp2_; + _tmp3__target = _tmp0_; + _tmp3__target_destroy_notify = _tmp1_; + *result_target = _tmp3__target; + *result_target_destroy_notify = _tmp3__target_destroy_notify; + result = _tmp3_; return result; } -GCompareFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self) { - GCompareFunc result; +GCompareDataFunc gee_tree_multi_map_get_key_compare_func (GeeTreeMultiMap* self, gpointer* result_target) { + GCompareDataFunc result; GeeMap* _tmp0_; - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiMap*) self)->_storage_map; - _tmp1_ = gee_tree_map_get_key_compare_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_TREE_MAP, GeeTreeMap)); + _tmp1_ = gee_tree_map_get_key_compare_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_TREE_MAP, GeeTreeMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } -GCompareFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self) { - GCompareFunc result; - GCompareFunc _tmp0_; +GCompareDataFunc gee_tree_multi_map_get_value_compare_func (GeeTreeMultiMap* self, gpointer* result_target) { + GCompareDataFunc result; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_value_compare_func; - result = _tmp0_; + _tmp0__target = self->priv->_value_compare_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_tree_multi_map_set_value_compare_func (GeeTreeMultiMap* self, GCompareFunc value) { - GCompareFunc _tmp0_; +static void gee_tree_multi_map_set_value_compare_func (GeeTreeMultiMap* self, GCompareDataFunc value, gpointer value_target) { + GCompareDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_value_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_compare_func_target_destroy_notify (self->priv->_value_compare_func_target), NULL); + self->priv->_value_compare_func = NULL; + self->priv->_value_compare_func_target = NULL; + self->priv->_value_compare_func_target_destroy_notify = NULL; self->priv->_value_compare_func = _tmp0_; - g_object_notify ((GObject *) self, "value-compare-func"); + self->priv->_value_compare_func_target = _tmp0__target; + self->priv->_value_compare_func_target_destroy_notify = NULL; } @@ -507,8 +714,6 @@ static void gee_tree_multi_map_class_init (GeeTreeMultiMapClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_MAP_KEY_COMPARE_FUNC, g_param_spec_pointer ("key-compare-func", "key-compare-func", "key-compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_MAP_VALUE_COMPARE_FUNC, g_param_spec_pointer ("value-compare-func", "value-compare-func", "value-compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -520,6 +725,10 @@ static void gee_tree_multi_map_instance_init (GeeTreeMultiMap * self) { static void gee_tree_multi_map_finalize (GObject* obj) { GeeTreeMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMap); + (self->priv->_value_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_value_compare_func_target_destroy_notify (self->priv->_value_compare_func_target), NULL); + self->priv->_value_compare_func = NULL; + self->priv->_value_compare_func_target = NULL; + self->priv->_value_compare_func_target_destroy_notify = NULL; G_OBJECT_CLASS (gee_tree_multi_map_parent_class)->finalize (obj); } @@ -544,12 +753,6 @@ static void _vala_gee_tree_multi_map_get_property (GObject * object, guint prope GeeTreeMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMap); switch (property_id) { - case GEE_TREE_MULTI_MAP_KEY_COMPARE_FUNC: - g_value_set_pointer (value, gee_tree_multi_map_get_key_compare_func (self)); - break; - case GEE_TREE_MULTI_MAP_VALUE_COMPARE_FUNC: - g_value_set_pointer (value, gee_tree_multi_map_get_value_compare_func (self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -561,9 +764,6 @@ static void _vala_gee_tree_multi_map_set_property (GObject * object, guint prope GeeTreeMultiMap * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_MULTI_MAP, GeeTreeMultiMap); switch (property_id) { - case GEE_TREE_MULTI_MAP_VALUE_COMPARE_FUNC: - gee_tree_multi_map_set_value_compare_func (self, g_value_get_pointer (value)); - break; case GEE_TREE_MULTI_MAP_K_TYPE: self->priv->k_type = g_value_get_gtype (value); break; diff --git a/gee/treemultimap.vala b/gee/treemultimap.vala index c26729e..eb7c245 100644 --- a/gee/treemultimap.vala +++ b/gee/treemultimap.vala @@ -25,11 +25,12 @@ * interface. */ public class Gee.TreeMultiMap : AbstractMultiMap { - public CompareFunc key_compare_func { + public CompareDataFunc key_compare_func { get { return ((TreeMap>) _storage_map).key_compare_func; } } - public CompareFunc value_compare_func { private set; get; } + [CCode (notify = false)] + public CompareDataFunc value_compare_func { private set; get; } /** * Constructs a new, empty tree multimap. @@ -40,8 +41,8 @@ public class Gee.TreeMultiMap : AbstractMultiMap { * @param key_compare_func an optional key comparator function * @param value_compare_func an optional value comparator function */ - public TreeMultiMap (CompareFunc? key_compare_func = null, CompareFunc? value_compare_func = null) { - base (new TreeMap> (key_compare_func, direct_equal)); + public TreeMultiMap (owned CompareDataFunc? key_compare_func = null, owned CompareDataFunc? value_compare_func = null) { + base (new TreeMap> (key_compare_func, Functions.get_equal_func_for (typeof (Set)))); if (value_compare_func == null) { value_compare_func = Functions.get_compare_func_for (typeof (V)); } @@ -56,7 +57,7 @@ public class Gee.TreeMultiMap : AbstractMultiMap { return new TreeMultiSet (key_compare_func); } - protected override EqualFunc get_value_equal_func () { + protected override EqualDataFunc get_value_equal_func () { return Functions.get_equal_func_for (typeof (V)); } } diff --git a/gee/treemultiset.c b/gee/treemultiset.c index 0a65cf5..df8c81a 100644 --- a/gee/treemultiset.c +++ b/gee/treemultiset.c @@ -27,13 +27,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -43,6 +55,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -136,6 +156,26 @@ typedef struct _GeeTreeMultiSetPrivate GeeTreeMultiSetPrivate; typedef struct _GeeAbstractMap GeeAbstractMap; typedef struct _GeeAbstractMapClass GeeAbstractMapClass; +#define GEE_TYPE_ABSTRACT_SORTED_MAP (gee_abstract_sorted_map_get_type ()) +#define GEE_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMap)) +#define GEE_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) +#define GEE_IS_ABSTRACT_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_IS_ABSTRACT_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_MAP)) +#define GEE_ABSTRACT_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_MAP, GeeAbstractSortedMapClass)) + +typedef struct _GeeAbstractSortedMap GeeAbstractSortedMap; +typedef struct _GeeAbstractSortedMapClass GeeAbstractSortedMapClass; + +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP (gee_abstract_bidir_sorted_map_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMap)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP)) +#define GEE_ABSTRACT_BIDIR_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_MAP, GeeAbstractBidirSortedMapClass)) + +typedef struct _GeeAbstractBidirSortedMap GeeAbstractBidirSortedMap; +typedef struct _GeeAbstractBidirSortedMapClass GeeAbstractBidirSortedMapClass; + #define GEE_TYPE_TREE_MAP (gee_tree_map_get_type ()) #define GEE_TREE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_MAP, GeeTreeMap)) #define GEE_TREE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_MAP, GeeTreeMapClass)) @@ -147,23 +187,55 @@ typedef struct _GeeTreeMap GeeTreeMap; typedef struct _GeeTreeMapClass GeeTreeMapClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -175,6 +247,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -189,62 +262,88 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeMultiSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeMultiSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self); gint (*count) (GeeMultiSet* self, gconstpointer item); + GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self); }; +typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data); +typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data); struct _GeeMapIteratorIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self); + GType (*get_v_type) (GeeMapIterator* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self); + GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self); gboolean (*next) (GeeMapIterator* self); gboolean (*has_next) (GeeMapIterator* self); - gboolean (*first) (GeeMapIterator* self); gpointer (*get_key) (GeeMapIterator* self); gpointer (*get_value) (GeeMapIterator* self); void (*set_value) (GeeMapIterator* self, gconstpointer value); void (*unset) (GeeMapIterator* self); + gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed); + gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target); + gboolean (*get_valid) (GeeMapIterator* self); + gboolean (*get_mutable) (GeeMapIterator* self); + gboolean (*get_read_only) (GeeMapIterator* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; struct _GeeMapIface { GTypeInterface parent_iface; + GType (*get_k_type) (GeeMap* self); + GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self); + GDestroyNotify (*get_k_destroy_func) (GeeMap* self); + GType (*get_v_type) (GeeMap* self); + GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self); + GDestroyNotify (*get_v_destroy_func) (GeeMap* self); gboolean (*has_key) (GeeMap* self, gconstpointer key); - gboolean (*contains) (GeeMap* self, gconstpointer key); gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value); gpointer (*get) (GeeMap* self, gconstpointer key); void (*set) (GeeMap* self, gconstpointer key, gconstpointer value); gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value); - gboolean (*remove) (GeeMap* self, gconstpointer key, gpointer* value); void (*clear) (GeeMap* self); GeeMapIterator* (*map_iterator) (GeeMap* self); void (*set_all) (GeeMap* self, GeeMap* map); gboolean (*unset_all) (GeeMap* self, GeeMap* map); - gboolean (*remove_all) (GeeMap* self, GeeMap* map); gboolean (*has_all) (GeeMap* self, GeeMap* map); - gboolean (*contains_all) (GeeMap* self, GeeMap* map); gint (*get_size) (GeeMap* self); gboolean (*get_is_empty) (GeeMap* self); + gboolean (*get_read_only) (GeeMap* self); GeeSet* (*get_keys) (GeeMap* self); GeeCollection* (*get_values) (GeeMap* self); GeeSet* (*get_entries) (GeeMap* self); GeeMap* (*get_read_only_view) (GeeMap* self); - GType (*get_key_type) (GeeMap* self); - GType (*get_value_type) (GeeMap* self); }; struct _GeeAbstractMultiSet { @@ -255,6 +354,16 @@ struct _GeeAbstractMultiSet { struct _GeeAbstractMultiSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractMultiSet* self); + void (*reserved1) (GeeAbstractMultiSet* self); + void (*reserved2) (GeeAbstractMultiSet* self); + void (*reserved3) (GeeAbstractMultiSet* self); + void (*reserved4) (GeeAbstractMultiSet* self); + void (*reserved5) (GeeAbstractMultiSet* self); + void (*reserved6) (GeeAbstractMultiSet* self); + void (*reserved7) (GeeAbstractMultiSet* self); + void (*reserved8) (GeeAbstractMultiSet* self); + GeeMultiSet* (*get_read_only_view) (GeeAbstractMultiSet* self); }; struct _GeeTreeMultiSet { @@ -272,10 +381,20 @@ struct _GeeTreeMultiSetPrivate { GDestroyNotify g_destroy_func; }; +typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data); static gpointer gee_tree_multi_set_parent_class = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -291,18 +410,19 @@ enum { GEE_TREE_MULTI_SET_DUMMY_PROPERTY, GEE_TREE_MULTI_SET_G_TYPE, GEE_TREE_MULTI_SET_G_DUP_FUNC, - GEE_TREE_MULTI_SET_G_DESTROY_FUNC, - GEE_TREE_MULTI_SET_COMPARE_FUNC + GEE_TREE_MULTI_SET_G_DESTROY_FUNC }; -GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); -GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareFunc key_compare_func, GEqualFunc value_equal_func); +GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); +GeeTreeMap* gee_tree_map_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GCompareDataFunc key_compare_func, void* key_compare_func_target, GDestroyNotify key_compare_func_target_destroy_notify, GeeEqualDataFunc value_equal_func, void* value_equal_func_target, GDestroyNotify value_equal_func_target_destroy_notify); GType gee_abstract_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_map_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_map_get_type (void) G_GNUC_CONST; GType gee_tree_map_get_type (void) G_GNUC_CONST; GeeAbstractMultiSet* gee_abstract_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeMap* storage_map); -GCompareFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self); -GCompareFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self); +GCompareDataFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self, gpointer* result_target); +GCompareDataFunc gee_tree_map_get_key_compare_func (GeeTreeMap* self, gpointer* result_target); static void _vala_gee_tree_multi_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_multi_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -315,38 +435,52 @@ static void _vala_gee_tree_multi_set_set_property (GObject * object, guint prope * * @param compare_func an optional element comparator function */ -GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { +GeeTreeMultiSet* gee_tree_multi_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { GeeTreeMultiSet * self = NULL; - GCompareFunc _tmp0_; + GCompareDataFunc _tmp0_; + void* _tmp0__target; GeeTreeMap* _tmp1_; GeeTreeMap* _tmp2_; _tmp0_ = compare_func; - _tmp1_ = gee_tree_map_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_INT, NULL, NULL, _tmp0_, NULL); + _tmp0__target = compare_func_target; + _tmp1_ = gee_tree_map_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_INT, NULL, NULL, _tmp0_, _tmp0__target, NULL, NULL, NULL, NULL); _tmp2_ = _tmp1_; self = (GeeTreeMultiSet*) gee_abstract_multi_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeMap*) _tmp2_); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _g_object_unref0 (_tmp2_); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; return self; } -GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { - return gee_tree_multi_set_construct (GEE_TYPE_TREE_MULTI_SET, g_type, g_dup_func, g_destroy_func, compare_func); +GeeTreeMultiSet* gee_tree_multi_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + return gee_tree_multi_set_construct (GEE_TYPE_TREE_MULTI_SET, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify); } -GCompareFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self) { - GCompareFunc result; +GCompareDataFunc gee_tree_multi_set_get_compare_func (GeeTreeMultiSet* self, gpointer* result_target) { + GCompareDataFunc result; GeeMap* _tmp0_; - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((GeeAbstractMultiSet*) self)->_storage_map; - _tmp1_ = gee_tree_map_get_key_compare_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_TREE_MAP, GeeTreeMap)); + _tmp1_ = gee_tree_map_get_key_compare_func (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_TREE_MAP, GeeTreeMap), &_tmp1__target); _tmp2_ = _tmp1_; - result = _tmp2_; + _tmp2__target = _tmp1__target; + _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; + *result_target = _tmp3__target; + result = _tmp3_; return result; } @@ -359,7 +493,6 @@ static void gee_tree_multi_set_class_init (GeeTreeMultiSetClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_MULTI_SET_COMPARE_FUNC, g_param_spec_pointer ("compare-func", "compare-func", "compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -388,9 +521,6 @@ static void _vala_gee_tree_multi_set_get_property (GObject * object, guint prope GeeTreeMultiSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_MULTI_SET, GeeTreeMultiSet); switch (property_id) { - case GEE_TREE_MULTI_SET_COMPARE_FUNC: - g_value_set_pointer (value, gee_tree_multi_set_get_compare_func (self)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/gee/treemultiset.vala b/gee/treemultiset.vala index 0471608..39d0640 100644 --- a/gee/treemultiset.vala +++ b/gee/treemultiset.vala @@ -25,7 +25,7 @@ * interface. */ public class Gee.TreeMultiSet : AbstractMultiSet { - public CompareFunc compare_func { + public CompareDataFunc compare_func { get { return ((TreeMap) _storage_map).key_compare_func; } } @@ -37,7 +37,7 @@ public class Gee.TreeMultiSet : AbstractMultiSet { * * @param compare_func an optional element comparator function */ - public TreeMultiSet (CompareFunc? compare_func = null) { + public TreeMultiSet (owned CompareDataFunc? compare_func = null) { base (new TreeMap (compare_func)); } } diff --git a/gee/treeset.c b/gee/treeset.c index 4fe99e9..4a5b6d1 100644 --- a/gee/treeset.c +++ b/gee/treeset.c @@ -3,7 +3,7 @@ /* treeset.vala * - * Copyright (C) 2009 Maciej Piechotka + * Copyright (C) 2009-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,13 +28,25 @@ #include -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) -typedef struct _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; #define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) @@ -44,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -90,6 +110,25 @@ typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate; typedef struct _GeeSortedSet GeeSortedSet; typedef struct _GeeSortedSetIface GeeSortedSetIface; +#define GEE_TYPE_ABSTRACT_SORTED_SET (gee_abstract_sorted_set_get_type ()) +#define GEE_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSet)) +#define GEE_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) +#define GEE_IS_ABSTRACT_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_IS_ABSTRACT_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SORTED_SET)) +#define GEE_ABSTRACT_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SORTED_SET, GeeAbstractSortedSetClass)) + +typedef struct _GeeAbstractSortedSet GeeAbstractSortedSet; +typedef struct _GeeAbstractSortedSetClass GeeAbstractSortedSetClass; +typedef struct _GeeAbstractSortedSetPrivate GeeAbstractSortedSetPrivate; + +#define GEE_TYPE_BIDIR_SORTED_SET (gee_bidir_sorted_set_get_type ()) +#define GEE_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSet)) +#define GEE_IS_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_SORTED_SET)) +#define GEE_BIDIR_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_SORTED_SET, GeeBidirSortedSetIface)) + +typedef struct _GeeBidirSortedSet GeeBidirSortedSet; +typedef struct _GeeBidirSortedSetIface GeeBidirSortedSetIface; + #define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ()) #define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator)) #define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR)) @@ -98,6 +137,17 @@ typedef struct _GeeSortedSetIface GeeSortedSetIface; typedef struct _GeeBidirIterator GeeBidirIterator; typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface; +#define GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET (gee_abstract_bidir_sorted_set_get_type ()) +#define GEE_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSet)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_IS_ABSTRACT_BIDIR_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET)) +#define GEE_ABSTRACT_BIDIR_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, GeeAbstractBidirSortedSetClass)) + +typedef struct _GeeAbstractBidirSortedSet GeeAbstractBidirSortedSet; +typedef struct _GeeAbstractBidirSortedSetClass GeeAbstractBidirSortedSetClass; +typedef struct _GeeAbstractBidirSortedSetPrivate GeeAbstractBidirSortedSetPrivate; + #define GEE_TYPE_TREE_SET (gee_tree_set_get_type ()) #define GEE_TREE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TREE_SET, GeeTreeSet)) #define GEE_TREE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TREE_SET, GeeTreeSetClass)) @@ -164,23 +214,55 @@ typedef struct _GeeTreeSetSubIteratorClass GeeTreeSetSubIteratorClass; typedef struct _GeeTreeSetSubIteratorPrivate GeeTreeSetSubIteratorPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); struct _GeeIteratorIface { GTypeInterface parent_iface; gboolean (*next) (GeeIterator* self); gboolean (*has_next) (GeeIterator* self); - gboolean (*first) (GeeIterator* self); gpointer (*get) (GeeIterator* self); void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -192,6 +274,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -206,19 +289,28 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; struct _GeeSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSet* self); GeeSet* (*get_read_only_view) (GeeSet* self); }; @@ -229,22 +321,27 @@ struct _GeeAbstractSet { struct _GeeAbstractSetClass { GeeAbstractCollectionClass parent_class; + void (*reserved0) (GeeAbstractSet* self); + void (*reserved1) (GeeAbstractSet* self); + void (*reserved2) (GeeAbstractSet* self); + void (*reserved3) (GeeAbstractSet* self); + void (*reserved4) (GeeAbstractSet* self); + void (*reserved5) (GeeAbstractSet* self); + void (*reserved6) (GeeAbstractSet* self); + void (*reserved7) (GeeAbstractSet* self); + void (*reserved8) (GeeAbstractSet* self); + void (*reserved9) (GeeAbstractSet* self); GeeSet* (*get_read_only_view) (GeeAbstractSet* self); }; -struct _GeeBidirIteratorIface { - GTypeInterface parent_iface; - gboolean (*previous) (GeeBidirIterator* self); - gboolean (*has_previous) (GeeBidirIterator* self); - gboolean (*last) (GeeBidirIterator* self); -}; - struct _GeeSortedSetIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self); gpointer (*first) (GeeSortedSet* self); gpointer (*last) (GeeSortedSet* self); - GeeBidirIterator* (*bidir_iterator) (GeeSortedSet* self); - GeeBidirIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); + GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element); gpointer (*lower) (GeeSortedSet* self, gconstpointer element); gpointer (*higher) (GeeSortedSet* self, gconstpointer element); gpointer (*floor) (GeeSortedSet* self, gconstpointer element); @@ -252,22 +349,96 @@ struct _GeeSortedSetIface { GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before); GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after); GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to); + GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self); }; -struct _GeeTreeSet { +struct _GeeAbstractSortedSet { GeeAbstractSet parent_instance; + GeeAbstractSortedSetPrivate * priv; +}; + +struct _GeeAbstractSortedSetClass { + GeeAbstractSetClass parent_class; + gpointer (*first) (GeeAbstractSortedSet* self); + gpointer (*last) (GeeAbstractSortedSet* self); + GeeIterator* (*iterator_at) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*lower) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*higher) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*floor) (GeeAbstractSortedSet* self, gconstpointer element); + gpointer (*ceil) (GeeAbstractSortedSet* self, gconstpointer element); + GeeSortedSet* (*head_set) (GeeAbstractSortedSet* self, gconstpointer before); + GeeSortedSet* (*tail_set) (GeeAbstractSortedSet* self, gconstpointer after); + GeeSortedSet* (*sub_set) (GeeAbstractSortedSet* self, gconstpointer from, gconstpointer to); + void (*reserved0) (GeeAbstractSortedSet* self); + void (*reserved1) (GeeAbstractSortedSet* self); + void (*reserved2) (GeeAbstractSortedSet* self); + void (*reserved3) (GeeAbstractSortedSet* self); + void (*reserved4) (GeeAbstractSortedSet* self); + void (*reserved5) (GeeAbstractSortedSet* self); + void (*reserved6) (GeeAbstractSortedSet* self); + void (*reserved7) (GeeAbstractSortedSet* self); + void (*reserved8) (GeeAbstractSortedSet* self); + void (*reserved9) (GeeAbstractSortedSet* self); + GeeSortedSet* (*get_read_only_view) (GeeAbstractSortedSet* self); +}; + +struct _GeeBidirIteratorIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirIterator* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self); + gboolean (*previous) (GeeBidirIterator* self); + gboolean (*has_previous) (GeeBidirIterator* self); + gboolean (*first) (GeeBidirIterator* self); + gboolean (*last) (GeeBidirIterator* self); +}; + +struct _GeeBidirSortedSetIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeBidirSortedSet* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeBidirSortedSet* self); + GDestroyNotify (*get_g_destroy_func) (GeeBidirSortedSet* self); + GeeBidirIterator* (*bidir_iterator) (GeeBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeBidirSortedSet* self); +}; + +struct _GeeAbstractBidirSortedSet { + GeeAbstractSortedSet parent_instance; + GeeAbstractBidirSortedSetPrivate * priv; +}; + +struct _GeeAbstractBidirSortedSetClass { + GeeAbstractSortedSetClass parent_class; + GeeBidirIterator* (*bidir_iterator) (GeeAbstractBidirSortedSet* self); + void (*reserved0) (GeeAbstractBidirSortedSet* self); + void (*reserved1) (GeeAbstractBidirSortedSet* self); + void (*reserved2) (GeeAbstractBidirSortedSet* self); + void (*reserved3) (GeeAbstractBidirSortedSet* self); + void (*reserved4) (GeeAbstractBidirSortedSet* self); + void (*reserved5) (GeeAbstractBidirSortedSet* self); + void (*reserved6) (GeeAbstractBidirSortedSet* self); + void (*reserved7) (GeeAbstractBidirSortedSet* self); + void (*reserved8) (GeeAbstractBidirSortedSet* self); + void (*reserved9) (GeeAbstractBidirSortedSet* self); + GeeBidirSortedSet* (*get_read_only_view) (GeeAbstractBidirSortedSet* self); +}; + +struct _GeeTreeSet { + GeeAbstractBidirSortedSet parent_instance; GeeTreeSetPrivate * priv; }; struct _GeeTreeSetClass { - GeeAbstractSetClass parent_class; + GeeAbstractBidirSortedSetClass parent_class; }; struct _GeeTreeSetPrivate { GType g_type; GBoxedCopyFunc g_dup_func; GDestroyNotify g_destroy_func; - GCompareFunc _compare_func; + GCompareDataFunc _compare_func; + gpointer _compare_func_target; + GDestroyNotify _compare_func_target_destroy_notify; gint _size; GeeTreeSetNode* root; GeeTreeSetNode* _first; @@ -343,12 +514,12 @@ struct _GeeTreeSetParamSpecRange { }; struct _GeeTreeSetSubSet { - GeeAbstractSet parent_instance; + GeeAbstractBidirSortedSet parent_instance; GeeTreeSetSubSetPrivate * priv; }; struct _GeeTreeSetSubSetClass { - GeeAbstractSetClass parent_class; + GeeAbstractBidirSortedSetClass parent_class; }; struct _GeeTreeSetSubSetPrivate { @@ -380,24 +551,36 @@ struct _GeeTreeSetSubIteratorPrivate { static gpointer gee_tree_set_parent_class = NULL; static gpointer gee_tree_set_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_set_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_tree_set_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_tree_set_iterator_gee_bidir_iterator_parent_iface = NULL; static gpointer gee_tree_set_range_parent_class = NULL; static gpointer gee_tree_set_sub_set_parent_class = NULL; -static GeeSortedSetIface* gee_tree_set_sub_set_gee_sorted_set_parent_iface = NULL; static gpointer gee_tree_set_sub_iterator_parent_class = NULL; +static GeeTraversableIface* gee_tree_set_sub_iterator_gee_traversable_parent_iface = NULL; static GeeIteratorIface* gee_tree_set_sub_iterator_gee_iterator_parent_iface = NULL; static GeeBidirIteratorIface* gee_tree_set_sub_iterator_gee_bidir_iterator_parent_iface = NULL; -static GeeSortedSetIface* gee_tree_set_gee_sorted_set_parent_iface = NULL; +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; GType gee_set_get_type (void) G_GNUC_CONST; GType gee_abstract_set_get_type (void) G_GNUC_CONST; -GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; GType gee_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_bidir_iterator_get_type (void) G_GNUC_CONST; +GType gee_bidir_sorted_set_get_type (void) G_GNUC_CONST; +GType gee_abstract_bidir_sorted_set_get_type (void) G_GNUC_CONST; GType gee_tree_set_get_type (void) G_GNUC_CONST; static void gee_tree_set_node_free (GeeTreeSetNode* self); #define GEE_TREE_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_TREE_SET, GeeTreeSetPrivate)) @@ -407,16 +590,17 @@ enum { GEE_TREE_SET_G_DUP_FUNC, GEE_TREE_SET_G_DESTROY_FUNC, GEE_TREE_SET_SIZE, - GEE_TREE_SET_COMPARE_FUNC + GEE_TREE_SET_READ_ONLY }; +void gee_abstract_collection_clear (GeeAbstractCollection* self); static GType gee_tree_set_range_type_get_type (void) G_GNUC_UNUSED; -GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func); -GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); -GCompareFunc gee_functions_get_compare_func_for (GType t); -static void gee_tree_set_set_compare_func (GeeTreeSet* self, GCompareFunc value); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify); +GeeAbstractBidirSortedSet* gee_abstract_bidir_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); +GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify); +static void gee_tree_set_set_compare_func (GeeTreeSet* self, GCompareDataFunc value, gpointer value_target); static gboolean gee_tree_set_real_contains (GeeAbstractCollection* base, gconstpointer item); -GCompareFunc gee_tree_set_get_compare_func (GeeTreeSet* self); +GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target); GType gee_tree_set_node_color_get_type (void) G_GNUC_CONST; static inline void gee_tree_set_rotate_right (GeeTreeSet* self, GeeTreeSetNode** root); static inline void gee_tree_set_rotate_left (GeeTreeSet* self, GeeTreeSetNode** root); @@ -440,22 +624,22 @@ static GeeIterator* gee_tree_set_real_iterator (GeeAbstractCollection* base); static GeeTreeSetIterator* gee_tree_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set); static GeeTreeSetIterator* gee_tree_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set); static GType gee_tree_set_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; -static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeSortedSet* base); +static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); static inline gpointer gee_tree_set_lift_null_get (GeeTreeSet* self, GeeTreeSetNode* node); -static gpointer gee_tree_set_real_first (GeeSortedSet* base); -static gpointer gee_tree_set_real_last (GeeSortedSet* base); -static GeeSortedSet* gee_tree_set_real_head_set (GeeSortedSet* base, gconstpointer before); +static gpointer gee_tree_set_real_first (GeeAbstractSortedSet* base); +static gpointer gee_tree_set_real_last (GeeAbstractSortedSet* base); +static GeeSortedSet* gee_tree_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); static GeeTreeSetSubSet* gee_tree_set_sub_set_new_head (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before); static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_head (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer before); static GType gee_tree_set_sub_set_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; -static GeeSortedSet* gee_tree_set_real_tail_set (GeeSortedSet* base, gconstpointer after); +static GeeSortedSet* gee_tree_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); static GeeTreeSetSubSet* gee_tree_set_sub_set_new_tail (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after); static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_tail (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after); -static GeeSortedSet* gee_tree_set_real_sub_set (GeeSortedSet* base, gconstpointer after, gconstpointer before); +static GeeSortedSet* gee_tree_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before); static GeeTreeSetSubSet* gee_tree_set_sub_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before); static GeeTreeSetSubSet* gee_tree_set_sub_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, gconstpointer after, gconstpointer before); static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpointer item); -static GeeBidirIterator* gee_tree_set_real_iterator_at (GeeSortedSet* base, gconstpointer item); +static GeeIterator* gee_tree_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item); static GeeTreeSetIterator* gee_tree_set_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current); static GeeTreeSetIterator* gee_tree_set_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetNode* current); static inline GeeTreeSetNode* gee_tree_set_find_nearest (GeeTreeSet* self, gconstpointer item); @@ -463,10 +647,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_lower (GeeTreeSet* self, gconstp static inline GeeTreeSetNode* gee_tree_set_find_higher (GeeTreeSet* self, gconstpointer item); static inline GeeTreeSetNode* gee_tree_set_find_floor (GeeTreeSet* self, gconstpointer item); static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpointer item); -static gpointer gee_tree_set_real_lower (GeeSortedSet* base, gconstpointer item); -static gpointer gee_tree_set_real_higher (GeeSortedSet* base, gconstpointer item); -static gpointer gee_tree_set_real_floor (GeeSortedSet* base, gconstpointer item); -static gpointer gee_tree_set_real_ceil (GeeSortedSet* base, gconstpointer item); +static gpointer gee_tree_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item); +static gpointer gee_tree_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item); static inline gpointer gee_tree_set_min (GeeTreeSet* self, gconstpointer a, gconstpointer b); static inline gpointer gee_tree_set_max (GeeTreeSet* self, gconstpointer a, gconstpointer b); static void gee_tree_set_node_instance_init (GeeTreeSetNode * self); @@ -476,11 +660,13 @@ enum { GEE_TREE_SET_ITERATOR_DUMMY_PROPERTY, GEE_TREE_SET_ITERATOR_G_TYPE, GEE_TREE_SET_ITERATOR_G_DUP_FUNC, - GEE_TREE_SET_ITERATOR_G_DESTROY_FUNC + GEE_TREE_SET_ITERATOR_G_DESTROY_FUNC, + GEE_TREE_SET_ITERATOR_VALID, + GEE_TREE_SET_ITERATOR_READ_ONLY }; static gboolean gee_tree_set_iterator_real_next (GeeIterator* base); static gboolean gee_tree_set_iterator_real_has_next (GeeIterator* base); -static gboolean gee_tree_set_iterator_real_first (GeeIterator* base); +static gboolean gee_tree_set_iterator_real_first (GeeBidirIterator* base); static gboolean gee_tree_set_iterator_real_previous (GeeBidirIterator* base); static gboolean gee_tree_set_iterator_real_has_previous (GeeBidirIterator* base); static gboolean gee_tree_set_iterator_real_last (GeeBidirIterator* base); @@ -488,7 +674,10 @@ static gpointer gee_tree_set_iterator_real_get (GeeIterator* base); static void gee_tree_set_iterator_real_remove (GeeIterator* base); static gboolean gee_tree_set_iterator_safe_next_get (GeeTreeSetIterator* self, gpointer* val); static gboolean gee_tree_set_iterator_safe_previous_get (GeeTreeSetIterator* self, gpointer* val); +static gboolean gee_tree_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_tree_set_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_valid (GeeIterator* self); +gboolean gee_iterator_get_read_only (GeeIterator* self); static void _vala_gee_tree_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static gpointer gee_tree_set_range_ref (gpointer instance); @@ -524,6 +713,7 @@ enum { GEE_TREE_SET_SUB_SET_G_DUP_FUNC, GEE_TREE_SET_SUB_SET_G_DESTROY_FUNC, GEE_TREE_SET_SUB_SET_SIZE, + GEE_TREE_SET_SUB_SET_READ_ONLY, GEE_TREE_SET_SUB_SET_IS_EMPTY }; static GeeTreeSetSubSet* gee_tree_set_sub_set_new_from_range (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range); @@ -542,28 +732,29 @@ static GeeIterator* gee_tree_set_sub_set_real_iterator (GeeAbstractCollection* b static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range); static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range); static GType gee_tree_set_sub_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; -static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeSortedSet* base); -static gpointer gee_tree_set_sub_set_real_first (GeeSortedSet* base); -static gpointer gee_tree_set_sub_set_real_last (GeeSortedSet* base); -static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeSortedSet* base, gconstpointer before); -static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeSortedSet* base, gconstpointer after); -static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeSortedSet* base, gconstpointer after, gconstpointer before); -static GeeBidirIterator* gee_tree_set_sub_set_real_iterator_at (GeeSortedSet* base, gconstpointer item); +static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base); +static gpointer gee_tree_set_sub_set_real_first (GeeAbstractSortedSet* base); +static gpointer gee_tree_set_sub_set_real_last (GeeAbstractSortedSet* base); +static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before); +static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after); +static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before); +static GeeIterator* gee_tree_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item); static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_new_pointing (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node); static GeeTreeSetSubIterator* gee_tree_set_sub_iterator_construct_pointing (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTreeSet* set, GeeTreeSetRange* range, GeeTreeSetNode* node); -static gpointer gee_tree_set_sub_set_real_lower (GeeSortedSet* base, gconstpointer item); -gpointer gee_sorted_set_last (GeeSortedSet* self); -gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element); -static gpointer gee_tree_set_sub_set_real_higher (GeeSortedSet* base, gconstpointer item); -gpointer gee_sorted_set_first (GeeSortedSet* self); -gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element); -static gpointer gee_tree_set_sub_set_real_floor (GeeSortedSet* base, gconstpointer item); -gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element); -static gpointer gee_tree_set_sub_set_real_ceil (GeeSortedSet* base, gconstpointer item); -gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element); +static gpointer gee_tree_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item); +gpointer gee_abstract_sorted_set_last (GeeAbstractSortedSet* self); +gpointer gee_abstract_sorted_set_lower (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_tree_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item); +gpointer gee_abstract_sorted_set_first (GeeAbstractSortedSet* self); +gpointer gee_abstract_sorted_set_higher (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_tree_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item); +gpointer gee_abstract_sorted_set_floor (GeeAbstractSortedSet* self, gconstpointer element); +static gpointer gee_tree_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item); +gpointer gee_abstract_sorted_set_ceil (GeeAbstractSortedSet* self, gconstpointer element); +static gboolean gee_tree_set_sub_set_get_is_empty (GeeTreeSetSubSet* self); static void gee_tree_set_sub_set_finalize (GObject* obj); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); static void _vala_gee_tree_set_sub_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_set_sub_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); #define GEE_TREE_SET_SUB_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIteratorPrivate)) @@ -571,12 +762,14 @@ enum { GEE_TREE_SET_SUB_ITERATOR_DUMMY_PROPERTY, GEE_TREE_SET_SUB_ITERATOR_G_TYPE, GEE_TREE_SET_SUB_ITERATOR_G_DUP_FUNC, - GEE_TREE_SET_SUB_ITERATOR_G_DESTROY_FUNC + GEE_TREE_SET_SUB_ITERATOR_G_DESTROY_FUNC, + GEE_TREE_SET_SUB_ITERATOR_READ_ONLY, + GEE_TREE_SET_SUB_ITERATOR_VALID }; static gboolean gee_tree_set_sub_iterator_real_next (GeeIterator* base); -gboolean gee_iterator_first (GeeIterator* self); +gboolean gee_bidir_iterator_first (GeeBidirIterator* self); static gboolean gee_tree_set_sub_iterator_real_has_next (GeeIterator* base); -static gboolean gee_tree_set_sub_iterator_real_first (GeeIterator* base); +static gboolean gee_tree_set_sub_iterator_real_first (GeeBidirIterator* base); static gboolean gee_tree_set_sub_iterator_real_previous (GeeBidirIterator* base); gboolean gee_bidir_iterator_previous (GeeBidirIterator* self); static gboolean gee_tree_set_sub_iterator_real_has_previous (GeeBidirIterator* base); @@ -584,6 +777,7 @@ static gboolean gee_tree_set_sub_iterator_real_last (GeeBidirIterator* base); static gpointer gee_tree_set_sub_iterator_real_get (GeeIterator* base); gpointer gee_iterator_get (GeeIterator* self); static void gee_tree_set_sub_iterator_real_remove (GeeIterator* base); +static gboolean gee_tree_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); static void gee_tree_set_sub_iterator_finalize (GObject* obj); static void _vala_gee_tree_set_sub_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_tree_set_sub_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); @@ -613,28 +807,44 @@ static GType gee_tree_set_range_type_get_type (void) { * * @param compare_func an optional element comparator function */ -GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { +GeeTreeSet* gee_tree_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { GeeTreeSet * self = NULL; - GCompareFunc _tmp0_; - GCompareFunc _tmp2_; - self = (GeeTreeSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + self = (GeeTreeSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; _tmp0_ = compare_func; + _tmp0__target = compare_func_target; if (_tmp0_ == NULL) { - GCompareFunc _tmp1_ = NULL; - _tmp1_ = gee_functions_get_compare_func_for (g_type); - compare_func = _tmp1_; + void* _tmp1_ = NULL; + GDestroyNotify _tmp2_ = NULL; + GCompareDataFunc _tmp3_ = NULL; + _tmp3_ = gee_functions_get_compare_func_for (g_type, &_tmp1_, &_tmp2_); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; + compare_func = _tmp3_; + compare_func_target = _tmp1_; + compare_func_target_destroy_notify = _tmp2_; } - _tmp2_ = compare_func; - gee_tree_set_set_compare_func (self, _tmp2_); + _tmp4_ = compare_func; + _tmp4__target = compare_func_target; + gee_tree_set_set_compare_func (self, _tmp4_, _tmp4__target); + (compare_func_target_destroy_notify == NULL) ? NULL : (compare_func_target_destroy_notify (compare_func_target), NULL); + compare_func = NULL; + compare_func_target = NULL; + compare_func_target_destroy_notify = NULL; return self; } -GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareFunc compare_func) { - return gee_tree_set_construct (GEE_TYPE_TREE_SET, g_type, g_dup_func, g_destroy_func, compare_func); +GeeTreeSet* gee_tree_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) { + return gee_tree_set_construct (GEE_TYPE_TREE_SET, g_type, g_dup_func, g_destroy_func, compare_func, compare_func_target, compare_func_target_destroy_notify); } @@ -651,8 +861,10 @@ static gboolean gee_tree_set_real_contains (GeeAbstractCollection* base, gconstp cur = _tmp0_; while (TRUE) { GeeTreeSetNode* _tmp1_; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; gconstpointer _tmp4_; GeeTreeSetNode* _tmp5_; gconstpointer _tmp6_; @@ -663,12 +875,13 @@ static gboolean gee_tree_set_real_contains (GeeAbstractCollection* base, gconstp if (!(_tmp1_ != NULL)) { break; } - _tmp2_ = gee_tree_set_get_compare_func (self); + _tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target); _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; _tmp4_ = item; _tmp5_ = cur; _tmp6_ = _tmp5_->key; - _tmp7_ = _tmp3_ (_tmp4_, _tmp6_); + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); res = _tmp7_; _tmp8_ = res; if (_tmp8_ == 0) { @@ -913,8 +1126,10 @@ static inline void gee_tree_set_fix_up (GeeTreeSet* self, GeeTreeSetNode** node) static gboolean gee_tree_set_add_to_node (GeeTreeSet* self, GeeTreeSetNode** node, gpointer item, GeeTreeSetNode* prev, GeeTreeSetNode* next) { gboolean result = FALSE; GeeTreeSetNode* _tmp0_; - GCompareFunc _tmp10_; - GCompareFunc _tmp11_; + GCompareDataFunc _tmp10_; + void* _tmp10__target; + GCompareDataFunc _tmp11_; + void* _tmp11__target; gconstpointer _tmp12_; GeeTreeSetNode* _tmp13_; gconstpointer _tmp14_; @@ -956,12 +1171,13 @@ static gboolean gee_tree_set_add_to_node (GeeTreeSet* self, GeeTreeSetNode** nod ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); return result; } - _tmp10_ = gee_tree_set_get_compare_func (self); + _tmp10_ = gee_tree_set_get_compare_func (self, &_tmp10__target); _tmp11_ = _tmp10_; + _tmp11__target = _tmp10__target; _tmp12_ = item; _tmp13_ = *node; _tmp14_ = _tmp13_->key; - _tmp15_ = _tmp11_ (_tmp12_, _tmp14_); + _tmp15_ = _tmp11_ (_tmp12_, _tmp14_, _tmp11__target); cmp = _tmp15_; _tmp16_ = cmp; if (_tmp16_ == 0) { @@ -1101,72 +1317,65 @@ static inline void gee_tree_set_fix_removal (GeeTreeSet* self, GeeTreeSetNode** gpointer _vala_key = NULL; GeeTreeSetNode* _tmp0_; GeeTreeSetNode* n; + GeeTreeSetNode* _tmp1_; + gpointer _tmp2_; + GeeTreeSetNode* _tmp3_; GeeTreeSetNode* _tmp4_; - GeeTreeSetNode* _tmp5_; + GeeTreeSetNode* _tmp11_; GeeTreeSetNode* _tmp12_; - GeeTreeSetNode* _tmp13_; - gint _tmp20_; + gint _tmp19_; g_return_if_fail (self != NULL); g_return_if_fail (*node != NULL); _tmp0_ = *node; *node = NULL; n = _tmp0_; - if ((&_vala_key) != NULL) { - GeeTreeSetNode* _tmp1_; - gpointer _tmp2_; - _tmp1_ = n; - _tmp2_ = _tmp1_->key; - _tmp1_->key = NULL; - ((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL)); - _vala_key = _tmp2_; - } else { - GeeTreeSetNode* _tmp3_; - _tmp3_ = n; - ((_tmp3_->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp3_->key = (self->priv->g_destroy_func (_tmp3_->key), NULL)); - _tmp3_->key = NULL; - } - _tmp4_ = n; - _tmp5_ = _tmp4_->prev; - if (_tmp5_ != NULL) { + _tmp1_ = n; + _tmp2_ = _tmp1_->key; + _tmp1_->key = NULL; + ((_vala_key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_vala_key = (self->priv->g_destroy_func (_vala_key), NULL)); + _vala_key = _tmp2_; + _tmp3_ = n; + _tmp4_ = _tmp3_->prev; + if (_tmp4_ != NULL) { + GeeTreeSetNode* _tmp5_; GeeTreeSetNode* _tmp6_; GeeTreeSetNode* _tmp7_; GeeTreeSetNode* _tmp8_; - GeeTreeSetNode* _tmp9_; - _tmp6_ = n; - _tmp7_ = _tmp6_->prev; - _tmp8_ = n; - _tmp9_ = _tmp8_->next; - _tmp7_->next = _tmp9_; + _tmp5_ = n; + _tmp6_ = _tmp5_->prev; + _tmp7_ = n; + _tmp8_ = _tmp7_->next; + _tmp6_->next = _tmp8_; } else { + GeeTreeSetNode* _tmp9_; GeeTreeSetNode* _tmp10_; - GeeTreeSetNode* _tmp11_; - _tmp10_ = n; - _tmp11_ = _tmp10_->next; - self->priv->_first = _tmp11_; + _tmp9_ = n; + _tmp10_ = _tmp9_->next; + self->priv->_first = _tmp10_; } - _tmp12_ = n; - _tmp13_ = _tmp12_->next; - if (_tmp13_ != NULL) { + _tmp11_ = n; + _tmp12_ = _tmp11_->next; + if (_tmp12_ != NULL) { + GeeTreeSetNode* _tmp13_; GeeTreeSetNode* _tmp14_; GeeTreeSetNode* _tmp15_; GeeTreeSetNode* _tmp16_; - GeeTreeSetNode* _tmp17_; - _tmp14_ = n; - _tmp15_ = _tmp14_->next; - _tmp16_ = n; - _tmp17_ = _tmp16_->prev; - _tmp15_->prev = _tmp17_; + _tmp13_ = n; + _tmp14_ = _tmp13_->next; + _tmp15_ = n; + _tmp16_ = _tmp15_->prev; + _tmp14_->prev = _tmp16_; } else { + GeeTreeSetNode* _tmp17_; GeeTreeSetNode* _tmp18_; - GeeTreeSetNode* _tmp19_; - _tmp18_ = n; - _tmp19_ = _tmp18_->prev; - self->priv->_last = _tmp19_; + _tmp17_ = n; + _tmp18_ = _tmp17_->prev; + self->priv->_last = _tmp18_; } _gee_tree_set_node_free0 (*node); *node = NULL; - _tmp20_ = self->priv->_size; - self->priv->_size = _tmp20_ - 1; + _tmp19_ = self->priv->_size; + self->priv->_size = _tmp19_ - 1; _gee_tree_set_node_free0 (n); if (key) { *key = _vala_key; @@ -1244,6 +1453,8 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = *node; if (_tmp0_ == NULL) { + _vala_prev = NULL; + _vala_next = NULL; result = FALSE; if (prev) { *prev = _vala_prev; @@ -1253,18 +1464,21 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* } return result; } else { - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; gconstpointer _tmp3_; GeeTreeSetNode* _tmp4_; gconstpointer _tmp5_; gint _tmp6_ = 0; - _tmp1_ = gee_tree_set_get_compare_func (self); + _tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target); _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; _tmp3_ = item; _tmp4_ = *node; _tmp5_ = _tmp4_->key; - _tmp6_ = _tmp2_ (_tmp3_, _tmp5_); + _tmp6_ = _tmp2_ (_tmp3_, _tmp5_, _tmp2__target); if (_tmp6_ < 0) { GeeTreeSetNode* _tmp7_; GeeTreeSetNode* _tmp8_; @@ -1285,6 +1499,8 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* left = _tmp8_; _tmp9_ = left; if (_tmp9_ == NULL) { + _vala_prev = NULL; + _vala_next = NULL; result = FALSE; if (prev) { *prev = _vala_prev; @@ -1334,8 +1550,10 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* GeeTreeSetNode* _tmp26_; GeeTreeSetNode* r; gboolean _tmp27_ = FALSE; - GCompareFunc _tmp28_; - GCompareFunc _tmp29_; + GCompareDataFunc _tmp28_; + void* _tmp28__target; + GCompareDataFunc _tmp29_; + void* _tmp29__target; gconstpointer _tmp30_; GeeTreeSetNode* _tmp31_; gconstpointer _tmp32_; @@ -1347,8 +1565,10 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* gboolean _tmp43_ = FALSE; gboolean _tmp45_; gboolean _tmp49_; - GCompareFunc _tmp50_; - GCompareFunc _tmp51_; + GCompareDataFunc _tmp50_; + void* _tmp50__target; + GCompareDataFunc _tmp51_; + void* _tmp51__target; gconstpointer _tmp52_; GeeTreeSetNode* _tmp53_; gconstpointer _tmp54_; @@ -1362,12 +1582,13 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* _tmp25_ = *node; _tmp26_ = _tmp25_->right; r = _tmp26_; - _tmp28_ = gee_tree_set_get_compare_func (self); + _tmp28_ = gee_tree_set_get_compare_func (self, &_tmp28__target); _tmp29_ = _tmp28_; + _tmp29__target = _tmp28__target; _tmp30_ = item; _tmp31_ = *node; _tmp32_ = _tmp31_->key; - _tmp33_ = _tmp29_ (_tmp30_, _tmp32_); + _tmp33_ = _tmp29_ (_tmp30_, _tmp32_, _tmp29__target); if (_tmp33_ == 0) { GeeTreeSetNode* _tmp34_; _tmp34_ = r; @@ -1377,20 +1598,16 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* } _tmp35_ = _tmp27_; if (_tmp35_) { - if ((&_vala_prev) != NULL) { - GeeTreeSetNode* _tmp36_; - GeeTreeSetNode* _tmp37_; - _tmp36_ = *node; - _tmp37_ = _tmp36_->prev; - _vala_prev = _tmp37_; - } - if ((&_vala_next) != NULL) { - GeeTreeSetNode* _tmp38_; - GeeTreeSetNode* _tmp39_; - _tmp38_ = *node; - _tmp39_ = _tmp38_->next; - _vala_next = _tmp39_; - } + GeeTreeSetNode* _tmp36_; + GeeTreeSetNode* _tmp37_; + GeeTreeSetNode* _tmp38_; + GeeTreeSetNode* _tmp39_; + _tmp36_ = *node; + _tmp37_ = _tmp36_->prev; + _vala_prev = _tmp37_; + _tmp38_ = *node; + _tmp39_ = _tmp38_->next; + _vala_next = _tmp39_; gee_tree_set_fix_removal (self, node, NULL); result = TRUE; if (prev) { @@ -1426,28 +1643,25 @@ static gboolean gee_tree_set_remove_from_node (GeeTreeSet* self, GeeTreeSetNode* if (_tmp49_) { gee_tree_set_move_red_right (self, node); } - _tmp50_ = gee_tree_set_get_compare_func (self); + _tmp50_ = gee_tree_set_get_compare_func (self, &_tmp50__target); _tmp51_ = _tmp50_; + _tmp51__target = _tmp50__target; _tmp52_ = item; _tmp53_ = *node; _tmp54_ = _tmp53_->key; - _tmp55_ = _tmp51_ (_tmp52_, _tmp54_); + _tmp55_ = _tmp51_ (_tmp52_, _tmp54_, _tmp51__target); if (_tmp55_ == 0) { + GeeTreeSetNode* _tmp56_; + GeeTreeSetNode* _tmp57_; + GeeTreeSetNode* _tmp58_; GeeTreeSetNode* _tmp59_; GeeTreeSetNode* _tmp60_; gpointer _tmp61_ = NULL; - if ((&_vala_prev) != NULL) { - GeeTreeSetNode* _tmp56_; - GeeTreeSetNode* _tmp57_; - _tmp56_ = *node; - _tmp57_ = _tmp56_->prev; - _vala_prev = _tmp57_; - } - if ((&_vala_next) != NULL) { - GeeTreeSetNode* _tmp58_; - _tmp58_ = *node; - _vala_next = _tmp58_; - } + _tmp56_ = *node; + _tmp57_ = _tmp56_->prev; + _vala_prev = _tmp57_; + _tmp58_ = *node; + _vala_next = _tmp58_; _tmp59_ = *node; _tmp60_ = *node; gee_tree_set_remove_minimal (self, &_tmp59_->right, &_tmp61_); @@ -1601,7 +1815,7 @@ static GeeIterator* gee_tree_set_real_iterator (GeeAbstractCollection* base) { /** * {@inheritDoc} */ -static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeSortedSet* base) { +static GeeBidirIterator* gee_tree_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { GeeTreeSet * self; GeeBidirIterator* result = NULL; GeeTreeSetIterator* _tmp0_; @@ -1639,7 +1853,7 @@ static inline gpointer gee_tree_set_lift_null_get (GeeTreeSet* self, GeeTreeSetN /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_first (GeeSortedSet* base) { +static gpointer gee_tree_set_real_first (GeeAbstractSortedSet* base) { GeeTreeSet * self; gpointer result = NULL; GeeTreeSetNode* _tmp0_; @@ -1660,7 +1874,7 @@ static gpointer gee_tree_set_real_first (GeeSortedSet* base) { /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_last (GeeSortedSet* base) { +static gpointer gee_tree_set_real_last (GeeAbstractSortedSet* base) { GeeTreeSet * self; gpointer result = NULL; GeeTreeSetNode* _tmp0_; @@ -1681,7 +1895,7 @@ static gpointer gee_tree_set_real_last (GeeSortedSet* base) { /** * {@inheritDoc} */ -static GeeSortedSet* gee_tree_set_real_head_set (GeeSortedSet* base, gconstpointer before) { +static GeeSortedSet* gee_tree_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { GeeTreeSet * self; GeeSortedSet* result = NULL; gconstpointer _tmp0_; @@ -1697,7 +1911,7 @@ static GeeSortedSet* gee_tree_set_real_head_set (GeeSortedSet* base, gconstpoint /** * {@inheritDoc} */ -static GeeSortedSet* gee_tree_set_real_tail_set (GeeSortedSet* base, gconstpointer after) { +static GeeSortedSet* gee_tree_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { GeeTreeSet * self; GeeSortedSet* result = NULL; gconstpointer _tmp0_; @@ -1713,7 +1927,7 @@ static GeeSortedSet* gee_tree_set_real_tail_set (GeeSortedSet* base, gconstpoint /** * {@inheritDoc} */ -static GeeSortedSet* gee_tree_set_real_sub_set (GeeSortedSet* base, gconstpointer after, gconstpointer before) { +static GeeSortedSet* gee_tree_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) { GeeTreeSet * self; GeeSortedSet* result = NULL; gconstpointer _tmp0_; @@ -1737,8 +1951,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpo cur = _tmp0_; while (TRUE) { GeeTreeSetNode* _tmp1_; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; gconstpointer _tmp4_; GeeTreeSetNode* _tmp5_; gconstpointer _tmp6_; @@ -1749,12 +1965,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpo if (!(_tmp1_ != NULL)) { break; } - _tmp2_ = gee_tree_set_get_compare_func (self); + _tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target); _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; _tmp4_ = item; _tmp5_ = cur; _tmp6_ = _tmp5_->key; - _tmp7_ = _tmp3_ (_tmp4_, _tmp6_); + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); res = _tmp7_; _tmp8_ = res; if (_tmp8_ == 0) { @@ -1788,9 +2005,9 @@ static inline GeeTreeSetNode* gee_tree_set_find_node (GeeTreeSet* self, gconstpo /** * {@inheritDoc} */ -static GeeBidirIterator* gee_tree_set_real_iterator_at (GeeSortedSet* base, gconstpointer item) { +static GeeIterator* gee_tree_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSet * self; - GeeBidirIterator* result = NULL; + GeeIterator* result = NULL; gconstpointer _tmp0_; GeeTreeSetNode* _tmp1_ = NULL; GeeTreeSetNode* node; @@ -1812,7 +2029,7 @@ static GeeBidirIterator* gee_tree_set_real_iterator_at (GeeSortedSet* base, gcon _g_object_unref0 (_tmp2_); _tmp2_ = NULL; } - result = (GeeBidirIterator*) _tmp2_; + result = (GeeIterator*) _tmp2_; return result; } @@ -1826,8 +2043,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_nearest (GeeTreeSet* self, gcons cur = _tmp0_; while (TRUE) { GeeTreeSetNode* _tmp1_; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; + GCompareDataFunc _tmp2_; + void* _tmp2__target; + GCompareDataFunc _tmp3_; + void* _tmp3__target; gconstpointer _tmp4_; GeeTreeSetNode* _tmp5_; gconstpointer _tmp6_; @@ -1838,12 +2057,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_nearest (GeeTreeSet* self, gcons if (!(_tmp1_ != NULL)) { break; } - _tmp2_ = gee_tree_set_get_compare_func (self); + _tmp2_ = gee_tree_set_get_compare_func (self, &_tmp2__target); _tmp3_ = _tmp2_; + _tmp3__target = _tmp2__target; _tmp4_ = item; _tmp5_ = cur; _tmp6_ = _tmp5_->key; - _tmp7_ = _tmp3_ (_tmp4_, _tmp6_); + _tmp7_ = _tmp3_ (_tmp4_, _tmp6_, _tmp3__target); res = _tmp7_; _tmp8_ = res; if (_tmp8_ == 0) { @@ -1901,8 +2121,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_lower (GeeTreeSet* self, gconstp GeeTreeSetNode* node; GeeTreeSetNode* _tmp2_; GeeTreeSetNode* _tmp3_ = NULL; - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; gconstpointer _tmp6_; GeeTreeSetNode* _tmp7_; gconstpointer _tmp8_; @@ -1917,12 +2139,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_lower (GeeTreeSet* self, gconstp result = NULL; return result; } - _tmp4_ = gee_tree_set_get_compare_func (self); + _tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = item; _tmp7_ = node; _tmp8_ = _tmp7_->key; - _tmp9_ = _tmp5_ (_tmp6_, _tmp8_); + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); if (_tmp9_ <= 0) { GeeTreeSetNode* _tmp10_; GeeTreeSetNode* _tmp11_; @@ -1947,8 +2170,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_higher (GeeTreeSet* self, gconst GeeTreeSetNode* node; GeeTreeSetNode* _tmp2_; GeeTreeSetNode* _tmp3_ = NULL; - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; gconstpointer _tmp6_; GeeTreeSetNode* _tmp7_; gconstpointer _tmp8_; @@ -1963,12 +2188,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_higher (GeeTreeSet* self, gconst result = NULL; return result; } - _tmp4_ = gee_tree_set_get_compare_func (self); + _tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = item; _tmp7_ = node; _tmp8_ = _tmp7_->key; - _tmp9_ = _tmp5_ (_tmp6_, _tmp8_); + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); if (_tmp9_ >= 0) { GeeTreeSetNode* _tmp10_; GeeTreeSetNode* _tmp11_; @@ -1993,8 +2219,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_floor (GeeTreeSet* self, gconstp GeeTreeSetNode* node; GeeTreeSetNode* _tmp2_; GeeTreeSetNode* _tmp3_ = NULL; - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; gconstpointer _tmp6_; GeeTreeSetNode* _tmp7_; gconstpointer _tmp8_; @@ -2009,12 +2237,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_floor (GeeTreeSet* self, gconstp result = NULL; return result; } - _tmp4_ = gee_tree_set_get_compare_func (self); + _tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = item; _tmp7_ = node; _tmp8_ = _tmp7_->key; - _tmp9_ = _tmp5_ (_tmp6_, _tmp8_); + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); if (_tmp9_ < 0) { GeeTreeSetNode* _tmp10_; GeeTreeSetNode* _tmp11_; @@ -2039,8 +2268,10 @@ static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpo GeeTreeSetNode* node; GeeTreeSetNode* _tmp2_; GeeTreeSetNode* _tmp3_ = NULL; - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; + GCompareDataFunc _tmp4_; + void* _tmp4__target; + GCompareDataFunc _tmp5_; + void* _tmp5__target; gconstpointer _tmp6_; GeeTreeSetNode* _tmp7_; gconstpointer _tmp8_; @@ -2055,12 +2286,13 @@ static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpo result = NULL; return result; } - _tmp4_ = gee_tree_set_get_compare_func (self); + _tmp4_ = gee_tree_set_get_compare_func (self, &_tmp4__target); _tmp5_ = _tmp4_; + _tmp5__target = _tmp4__target; _tmp6_ = item; _tmp7_ = node; _tmp8_ = _tmp7_->key; - _tmp9_ = _tmp5_ (_tmp6_, _tmp8_); + _tmp9_ = _tmp5_ (_tmp6_, _tmp8_, _tmp5__target); if (_tmp9_ > 0) { GeeTreeSetNode* _tmp10_; GeeTreeSetNode* _tmp11_; @@ -2081,7 +2313,7 @@ static inline GeeTreeSetNode* gee_tree_set_find_ceil (GeeTreeSet* self, gconstpo /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_lower (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSet * self; gpointer result = NULL; gconstpointer _tmp0_; @@ -2099,7 +2331,7 @@ static gpointer gee_tree_set_real_lower (GeeSortedSet* base, gconstpointer item) /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_higher (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSet * self; gpointer result = NULL; gconstpointer _tmp0_; @@ -2117,7 +2349,7 @@ static gpointer gee_tree_set_real_higher (GeeSortedSet* base, gconstpointer item /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_floor (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSet * self; gpointer result = NULL; gconstpointer _tmp0_; @@ -2135,7 +2367,7 @@ static gpointer gee_tree_set_real_floor (GeeSortedSet* base, gconstpointer item) /** * {@inheritDoc} */ -static gpointer gee_tree_set_real_ceil (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSet * self; gpointer result = NULL; gconstpointer _tmp0_; @@ -2153,19 +2385,22 @@ static gpointer gee_tree_set_real_ceil (GeeSortedSet* base, gconstpointer item) static inline gpointer gee_tree_set_min (GeeTreeSet* self, gconstpointer a, gconstpointer b) { gpointer result = NULL; gconstpointer _tmp0_ = NULL; - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; gconstpointer _tmp3_; gconstpointer _tmp4_; gint _tmp5_ = 0; gconstpointer _tmp8_; gpointer _tmp9_; g_return_val_if_fail (self != NULL, NULL); - _tmp1_ = gee_tree_set_get_compare_func (self); + _tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target); _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; _tmp3_ = a; _tmp4_ = b; - _tmp5_ = _tmp2_ (_tmp3_, _tmp4_); + _tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target); if (_tmp5_ <= 0) { gconstpointer _tmp6_; _tmp6_ = a; @@ -2185,19 +2420,22 @@ static inline gpointer gee_tree_set_min (GeeTreeSet* self, gconstpointer a, gcon static inline gpointer gee_tree_set_max (GeeTreeSet* self, gconstpointer a, gconstpointer b) { gpointer result = NULL; gconstpointer _tmp0_ = NULL; - GCompareFunc _tmp1_; - GCompareFunc _tmp2_; + GCompareDataFunc _tmp1_; + void* _tmp1__target; + GCompareDataFunc _tmp2_; + void* _tmp2__target; gconstpointer _tmp3_; gconstpointer _tmp4_; gint _tmp5_ = 0; gconstpointer _tmp8_; gpointer _tmp9_; g_return_val_if_fail (self != NULL, NULL); - _tmp1_ = gee_tree_set_get_compare_func (self); + _tmp1_ = gee_tree_set_get_compare_func (self, &_tmp1__target); _tmp2_ = _tmp1_; + _tmp2__target = _tmp1__target; _tmp3_ = a; _tmp4_ = b; - _tmp5_ = _tmp2_ (_tmp3_, _tmp4_); + _tmp5_ = _tmp2_ (_tmp3_, _tmp4_, _tmp2__target); if (_tmp5_ > 0) { gconstpointer _tmp6_; _tmp6_ = a; @@ -2225,22 +2463,45 @@ static gint gee_tree_set_real_get_size (GeeAbstractCollection* base) { } -GCompareFunc gee_tree_set_get_compare_func (GeeTreeSet* self) { - GCompareFunc result; - GCompareFunc _tmp0_; +static gboolean gee_tree_set_real_get_read_only (GeeAbstractCollection* base) { + gboolean result; + GeeTreeSet* self; + self = (GeeTreeSet*) base; + result = FALSE; + return result; +} + + +GCompareDataFunc gee_tree_set_get_compare_func (GeeTreeSet* self, gpointer* result_target) { + GCompareDataFunc result; + GCompareDataFunc _tmp0_; + void* _tmp0__target; + GCompareDataFunc _tmp1_; + void* _tmp1__target; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->_compare_func; - result = _tmp0_; + _tmp0__target = self->priv->_compare_func_target; + _tmp1_ = _tmp0_; + _tmp1__target = _tmp0__target; + *result_target = _tmp1__target; + result = _tmp1_; return result; } -static void gee_tree_set_set_compare_func (GeeTreeSet* self, GCompareFunc value) { - GCompareFunc _tmp0_; +static void gee_tree_set_set_compare_func (GeeTreeSet* self, GCompareDataFunc value, gpointer value_target) { + GCompareDataFunc _tmp0_; + void* _tmp0__target; g_return_if_fail (self != NULL); _tmp0_ = value; + _tmp0__target = value_target; + (self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL); + self->priv->_compare_func = NULL; + self->priv->_compare_func_target = NULL; + self->priv->_compare_func_target_destroy_notify = NULL; self->priv->_compare_func = _tmp0_; - g_object_notify ((GObject *) self, "compare-func"); + self->priv->_compare_func_target = _tmp0__target; + self->priv->_compare_func_target_destroy_notify = NULL; } @@ -2547,7 +2808,7 @@ static gboolean gee_tree_set_iterator_real_has_next (GeeIterator* base) { } -static gboolean gee_tree_set_iterator_real_first (GeeIterator* base) { +static gboolean gee_tree_set_iterator_real_first (GeeBidirIterator* base) { GeeTreeSetIterator * self; gboolean result = FALSE; gint _tmp0_; @@ -2889,6 +3150,115 @@ static gboolean gee_tree_set_iterator_safe_previous_get (GeeTreeSetIterator* sel } +static gboolean gee_tree_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeSetIterator * self; + gboolean result = FALSE; + gint _tmp0_; + GeeTreeSet* _tmp1_; + gint _tmp2_; + GeeTreeSetNode* _tmp3_; + self = (GeeTreeSetIterator*) base; + _tmp0_ = self->priv->stamp; + _tmp1_ = self->priv->_set; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp"); + _tmp3_ = self->priv->current; + if (_tmp3_ != NULL) { + GeeForallFunc _tmp4_; + void* _tmp4__target; + GeeTreeSetNode* _tmp5_; + gconstpointer _tmp6_; + gpointer _tmp7_; + gboolean _tmp8_ = FALSE; + GeeTreeSetNode* _tmp9_; + GeeTreeSetNode* _tmp10_; + _tmp4_ = f; + _tmp4__target = f_target; + _tmp5_ = self->priv->current; + _tmp6_ = _tmp5_->key; + _tmp7_ = ((_tmp6_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_); + _tmp8_ = _tmp4_ (_tmp7_, _tmp4__target); + if (!_tmp8_) { + result = FALSE; + return result; + } + _tmp9_ = self->priv->current; + _tmp10_ = _tmp9_->next; + self->priv->_next = _tmp10_; + } else { + gboolean _tmp11_; + _tmp11_ = self->priv->started; + if (!_tmp11_) { + GeeTreeSet* _tmp12_; + GeeTreeSetNode* _tmp13_; + _tmp12_ = self->priv->_set; + _tmp13_ = _tmp12_->priv->_first; + self->priv->_next = _tmp13_; + } + } + while (TRUE) { + GeeTreeSetNode* _tmp14_; + GeeTreeSetNode* _tmp15_; + GeeForallFunc _tmp16_; + void* _tmp16__target; + GeeTreeSetNode* _tmp17_; + gconstpointer _tmp18_; + gpointer _tmp19_; + gboolean _tmp20_ = FALSE; + GeeTreeSetNode* _tmp21_; + GeeTreeSetNode* _tmp22_; + _tmp14_ = self->priv->_next; + if (!(_tmp14_ != NULL)) { + break; + } + _tmp15_ = self->priv->_next; + self->priv->current = _tmp15_; + _tmp16_ = f; + _tmp16__target = f_target; + _tmp17_ = self->priv->current; + _tmp18_ = _tmp17_->key; + _tmp19_ = ((_tmp18_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp18_) : ((gpointer) _tmp18_); + _tmp20_ = _tmp16_ (_tmp19_, _tmp16__target); + if (!_tmp20_) { + result = FALSE; + return result; + } + _tmp21_ = self->priv->current; + _tmp22_ = _tmp21_->next; + self->priv->_next = _tmp22_; + } + result = TRUE; + return result; +} + + +static gboolean gee_tree_set_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeTreeSetIterator* self; + gint _tmp0_; + GeeTreeSet* _tmp1_; + gint _tmp2_; + GeeTreeSetNode* _tmp3_; + self = (GeeTreeSetIterator*) base; + _tmp0_ = self->priv->stamp; + _tmp1_ = self->priv->_set; + _tmp2_ = _tmp1_->priv->stamp; + _vala_assert (_tmp0_ == _tmp2_, "stamp == _set.stamp"); + _tmp3_ = self->priv->current; + result = _tmp3_ != NULL; + return result; +} + + +static gboolean gee_tree_set_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeTreeSetIterator* self; + self = (GeeTreeSetIterator*) base; + result = FALSE; + return result; +} + + static void gee_tree_set_iterator_class_init (GeeTreeSetIteratorClass * klass) { gee_tree_set_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeTreeSetIteratorPrivate)); @@ -2898,6 +3268,32 @@ static void gee_tree_set_iterator_class_init (GeeTreeSetIteratorClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_tree_set_iterator_gee_traversable_get_g_type (GeeTreeSetIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_tree_set_iterator_gee_traversable_get_g_dup_func (GeeTreeSetIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_tree_set_iterator_gee_traversable_get_g_destroy_func (GeeTreeSetIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_tree_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_set_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_set_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_set_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_set_iterator_gee_traversable_get_g_destroy_func; } @@ -2905,17 +3301,37 @@ static void gee_tree_set_iterator_gee_iterator_interface_init (GeeIteratorIface gee_tree_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_tree_set_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_set_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_tree_set_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_tree_set_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_tree_set_iterator_real_remove; + iface->get_valid = gee_tree_set_iterator_real_get_valid; + iface->get_read_only = gee_tree_set_iterator_real_get_read_only; +} + + +static GType gee_tree_set_iterator_gee_bidir_iterator_get_g_type (GeeTreeSetIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_tree_set_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeSetIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_tree_set_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeSetIterator* self) { + return self->priv->g_destroy_func; } static void gee_tree_set_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { gee_tree_set_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_iterator_real_first; iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_iterator_real_previous; iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_iterator_real_has_previous; iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_set_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_set_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_set_iterator_gee_bidir_iterator_get_g_destroy_func; } @@ -2940,10 +3356,12 @@ static GType gee_tree_set_iterator_get_type (void) { static volatile gsize gee_tree_set_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_tree_set_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetIterator), 0, (GInstanceInitFunc) gee_tree_set_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_set_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_tree_set_iterator_type_id; gee_tree_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeSetIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_type_add_interface_static (gee_tree_set_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); g_once_init_leave (&gee_tree_set_iterator_type_id__volatile, gee_tree_set_iterator_type_id); @@ -2956,6 +3374,12 @@ static void _vala_gee_tree_set_iterator_get_property (GObject * object, guint pr GeeTreeSetIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_ITERATOR, GeeTreeSetIterator); switch (property_id) { + case GEE_TREE_SET_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_TREE_SET_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -2988,8 +3412,10 @@ static GeeTreeSetRange* gee_tree_set_range_construct (GType object_type, GType g GeeTreeSet* _tmp0_; GeeTreeSet* _tmp1_; GeeTreeSet* _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; gconstpointer _tmp5_; gconstpointer _tmp6_; gint _tmp7_ = 0; @@ -3003,11 +3429,12 @@ static GeeTreeSetRange* gee_tree_set_range_construct (GType object_type, GType g _g_object_unref0 (self->priv->set); self->priv->set = _tmp1_; _tmp2_ = set; - _tmp3_ = gee_tree_set_get_compare_func (_tmp2_); + _tmp3_ = gee_tree_set_get_compare_func (_tmp2_, &_tmp3__target); _tmp4_ = _tmp3_; + _tmp4__target = _tmp3__target; _tmp5_ = after; _tmp6_ = before; - _tmp7_ = _tmp4_ (_tmp5_, _tmp6_); + _tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target); if (_tmp7_ < 0) { gconstpointer _tmp8_; gpointer _tmp9_; @@ -3373,18 +3800,21 @@ static gint gee_tree_set_range_compare_range (GeeTreeSetRange* self, gconstpoint { gint _tmp1_ = 0; GeeTreeSet* _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; + GCompareDataFunc _tmp3_; + void* _tmp3__target; + GCompareDataFunc _tmp4_; + void* _tmp4__target; gconstpointer _tmp5_; gconstpointer _tmp6_; gint _tmp7_ = 0; gint _tmp8_; _tmp2_ = self->priv->set; - _tmp3_ = gee_tree_set_get_compare_func (_tmp2_); + _tmp3_ = gee_tree_set_get_compare_func (_tmp2_, &_tmp3__target); _tmp4_ = _tmp3_; + _tmp4__target = _tmp3__target; _tmp5_ = item; _tmp6_ = self->priv->before; - _tmp7_ = _tmp4_ (_tmp5_, _tmp6_); + _tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target); if (_tmp7_ < 0) { _tmp1_ = 0; } else { @@ -3398,18 +3828,21 @@ static gint gee_tree_set_range_compare_range (GeeTreeSetRange* self, gconstpoint { gint _tmp9_ = 0; GeeTreeSet* _tmp10_; - GCompareFunc _tmp11_; - GCompareFunc _tmp12_; + GCompareDataFunc _tmp11_; + void* _tmp11__target; + GCompareDataFunc _tmp12_; + void* _tmp12__target; gconstpointer _tmp13_; gconstpointer _tmp14_; gint _tmp15_ = 0; gint _tmp16_; _tmp10_ = self->priv->set; - _tmp11_ = gee_tree_set_get_compare_func (_tmp10_); + _tmp11_ = gee_tree_set_get_compare_func (_tmp10_, &_tmp11__target); _tmp12_ = _tmp11_; + _tmp12__target = _tmp11__target; _tmp13_ = item; _tmp14_ = self->priv->after; - _tmp15_ = _tmp12_ (_tmp13_, _tmp14_); + _tmp15_ = _tmp12_ (_tmp13_, _tmp14_, _tmp12__target); if (_tmp15_ >= 0) { _tmp9_ = 0; } else { @@ -3428,33 +3861,39 @@ static gint gee_tree_set_range_compare_range (GeeTreeSetRange* self, gconstpoint { gint _tmp17_ = 0; GeeTreeSet* _tmp18_; - GCompareFunc _tmp19_; - GCompareFunc _tmp20_; + GCompareDataFunc _tmp19_; + void* _tmp19__target; + GCompareDataFunc _tmp20_; + void* _tmp20__target; gconstpointer _tmp21_; gconstpointer _tmp22_; gint _tmp23_ = 0; gint _tmp32_; _tmp18_ = self->priv->set; - _tmp19_ = gee_tree_set_get_compare_func (_tmp18_); + _tmp19_ = gee_tree_set_get_compare_func (_tmp18_, &_tmp19__target); _tmp20_ = _tmp19_; + _tmp20__target = _tmp19__target; _tmp21_ = item; _tmp22_ = self->priv->after; - _tmp23_ = _tmp20_ (_tmp21_, _tmp22_); + _tmp23_ = _tmp20_ (_tmp21_, _tmp22_, _tmp20__target); if (_tmp23_ >= 0) { gint _tmp24_ = 0; GeeTreeSet* _tmp25_; - GCompareFunc _tmp26_; - GCompareFunc _tmp27_; + GCompareDataFunc _tmp26_; + void* _tmp26__target; + GCompareDataFunc _tmp27_; + void* _tmp27__target; gconstpointer _tmp28_; gconstpointer _tmp29_; gint _tmp30_ = 0; gint _tmp31_; _tmp25_ = self->priv->set; - _tmp26_ = gee_tree_set_get_compare_func (_tmp25_); + _tmp26_ = gee_tree_set_get_compare_func (_tmp25_, &_tmp26__target); _tmp27_ = _tmp26_; + _tmp27__target = _tmp26__target; _tmp28_ = item; _tmp29_ = self->priv->before; - _tmp30_ = _tmp27_ (_tmp28_, _tmp29_); + _tmp30_ = _tmp27_ (_tmp28_, _tmp29_, _tmp27__target); if (_tmp30_ < 0) { _tmp24_ = 0; } else { @@ -3796,7 +4235,7 @@ static GeeTreeSetSubSet* gee_tree_set_sub_set_construct (GType object_type, GTyp gconstpointer _tmp4_; GeeTreeSetRange* _tmp5_; g_return_val_if_fail (set != NULL, NULL); - self = (GeeTreeSetSubSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; @@ -3827,7 +4266,7 @@ static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_head (GType object_type, gconstpointer _tmp3_; GeeTreeSetRange* _tmp4_; g_return_val_if_fail (set != NULL, NULL); - self = (GeeTreeSetSubSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; @@ -3857,7 +4296,7 @@ static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_tail (GType object_type, gconstpointer _tmp3_; GeeTreeSetRange* _tmp4_; g_return_val_if_fail (set != NULL, NULL); - self = (GeeTreeSetSubSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; @@ -3887,7 +4326,7 @@ static GeeTreeSetSubSet* gee_tree_set_sub_set_construct_from_range (GType object GeeTreeSetRange* _tmp3_; g_return_val_if_fail (set != NULL, NULL); g_return_val_if_fail (range != NULL, NULL); - self = (GeeTreeSetSubSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); + self = (GeeTreeSetSubSet*) gee_abstract_bidir_sorted_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func); self->priv->g_type = g_type; self->priv->g_dup_func = g_dup_func; self->priv->g_destroy_func = g_destroy_func; @@ -4033,7 +4472,7 @@ static GeeIterator* gee_tree_set_sub_set_real_iterator (GeeAbstractCollection* b } -static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeSortedSet* base) { +static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeAbstractBidirSortedSet* base) { GeeTreeSetSubSet * self; GeeBidirIterator* result = NULL; GeeTreeSet* _tmp0_; @@ -4048,7 +4487,7 @@ static GeeBidirIterator* gee_tree_set_sub_set_real_bidir_iterator (GeeSortedSet* } -static gpointer gee_tree_set_sub_set_real_first (GeeSortedSet* base) { +static gpointer gee_tree_set_sub_set_real_first (GeeAbstractSortedSet* base) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4068,7 +4507,7 @@ static gpointer gee_tree_set_sub_set_real_first (GeeSortedSet* base) { } -static gpointer gee_tree_set_sub_set_real_last (GeeSortedSet* base) { +static gpointer gee_tree_set_sub_set_real_last (GeeAbstractSortedSet* base) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4088,7 +4527,7 @@ static gpointer gee_tree_set_sub_set_real_last (GeeSortedSet* base) { } -static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeSortedSet* base, gconstpointer before) { +static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeAbstractSortedSet* base, gconstpointer before) { GeeTreeSetSubSet * self; GeeSortedSet* result = NULL; GeeTreeSet* _tmp0_; @@ -4112,7 +4551,7 @@ static GeeSortedSet* gee_tree_set_sub_set_real_head_set (GeeSortedSet* base, gco } -static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeSortedSet* base, gconstpointer after) { +static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeAbstractSortedSet* base, gconstpointer after) { GeeTreeSetSubSet * self; GeeSortedSet* result = NULL; GeeTreeSet* _tmp0_; @@ -4136,7 +4575,7 @@ static GeeSortedSet* gee_tree_set_sub_set_real_tail_set (GeeSortedSet* base, gco } -static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeSortedSet* base, gconstpointer after, gconstpointer before) { +static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeAbstractSortedSet* base, gconstpointer after, gconstpointer before) { GeeTreeSetSubSet * self; GeeSortedSet* result = NULL; GeeTreeSet* _tmp0_; @@ -4162,9 +4601,9 @@ static GeeSortedSet* gee_tree_set_sub_set_real_sub_set (GeeSortedSet* base, gcon } -static GeeBidirIterator* gee_tree_set_sub_set_real_iterator_at (GeeSortedSet* base, gconstpointer item) { +static GeeIterator* gee_tree_set_sub_set_real_iterator_at (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSetSubSet * self; - GeeBidirIterator* result = NULL; + GeeIterator* result = NULL; GeeTreeSetRange* _tmp0_; gconstpointer _tmp1_; gboolean _tmp2_ = FALSE; @@ -4198,12 +4637,12 @@ static GeeBidirIterator* gee_tree_set_sub_set_real_iterator_at (GeeSortedSet* ba _tmp8_ = self->priv->range; _tmp9_ = n; _tmp10_ = gee_tree_set_sub_iterator_new_pointing (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp7_, _tmp8_, _tmp9_); - result = (GeeBidirIterator*) _tmp10_; + result = (GeeIterator*) _tmp10_; return result; } -static gpointer gee_tree_set_sub_set_real_lower (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_sub_set_real_lower (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4229,13 +4668,13 @@ static gpointer gee_tree_set_sub_set_real_lower (GeeSortedSet* base, gconstpoint _tmp3_ = res; if (_tmp3_ > 0) { gpointer _tmp4_ = NULL; - _tmp4_ = gee_sorted_set_last ((GeeSortedSet*) self); + _tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); result = _tmp4_; return result; } _tmp5_ = self->priv->set; _tmp6_ = item; - _tmp7_ = gee_sorted_set_lower ((GeeSortedSet*) _tmp5_, _tmp6_); + _tmp7_ = gee_abstract_sorted_set_lower ((GeeAbstractSortedSet*) _tmp5_, _tmp6_); l = _tmp7_; _tmp10_ = l; if (_tmp10_ != NULL) { @@ -4265,7 +4704,7 @@ static gpointer gee_tree_set_sub_set_real_lower (GeeSortedSet* base, gconstpoint } -static gpointer gee_tree_set_sub_set_real_higher (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_sub_set_real_higher (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4291,13 +4730,13 @@ static gpointer gee_tree_set_sub_set_real_higher (GeeSortedSet* base, gconstpoin _tmp3_ = res; if (_tmp3_ < 0) { gpointer _tmp4_ = NULL; - _tmp4_ = gee_sorted_set_first ((GeeSortedSet*) self); + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); result = _tmp4_; return result; } _tmp5_ = self->priv->set; _tmp6_ = item; - _tmp7_ = gee_sorted_set_higher ((GeeSortedSet*) _tmp5_, _tmp6_); + _tmp7_ = gee_abstract_sorted_set_higher ((GeeAbstractSortedSet*) _tmp5_, _tmp6_); h = _tmp7_; _tmp10_ = h; if (_tmp10_ != NULL) { @@ -4327,7 +4766,7 @@ static gpointer gee_tree_set_sub_set_real_higher (GeeSortedSet* base, gconstpoin } -static gpointer gee_tree_set_sub_set_real_floor (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_sub_set_real_floor (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4353,13 +4792,13 @@ static gpointer gee_tree_set_sub_set_real_floor (GeeSortedSet* base, gconstpoint _tmp3_ = res; if (_tmp3_ > 0) { gpointer _tmp4_ = NULL; - _tmp4_ = gee_sorted_set_last ((GeeSortedSet*) self); + _tmp4_ = gee_abstract_sorted_set_last ((GeeAbstractSortedSet*) self); result = _tmp4_; return result; } _tmp5_ = self->priv->set; _tmp6_ = item; - _tmp7_ = gee_sorted_set_floor ((GeeSortedSet*) _tmp5_, _tmp6_); + _tmp7_ = gee_abstract_sorted_set_floor ((GeeAbstractSortedSet*) _tmp5_, _tmp6_); l = _tmp7_; _tmp10_ = l; if (_tmp10_ != NULL) { @@ -4389,7 +4828,7 @@ static gpointer gee_tree_set_sub_set_real_floor (GeeSortedSet* base, gconstpoint } -static gpointer gee_tree_set_sub_set_real_ceil (GeeSortedSet* base, gconstpointer item) { +static gpointer gee_tree_set_sub_set_real_ceil (GeeAbstractSortedSet* base, gconstpointer item) { GeeTreeSetSubSet * self; gpointer result = NULL; GeeTreeSetRange* _tmp0_; @@ -4415,13 +4854,13 @@ static gpointer gee_tree_set_sub_set_real_ceil (GeeSortedSet* base, gconstpointe _tmp3_ = res; if (_tmp3_ < 0) { gpointer _tmp4_ = NULL; - _tmp4_ = gee_sorted_set_first ((GeeSortedSet*) self); + _tmp4_ = gee_abstract_sorted_set_first ((GeeAbstractSortedSet*) self); result = _tmp4_; return result; } _tmp5_ = self->priv->set; _tmp6_ = item; - _tmp7_ = gee_sorted_set_ceil ((GeeSortedSet*) _tmp5_, _tmp6_); + _tmp7_ = gee_abstract_sorted_set_ceil ((GeeAbstractSortedSet*) _tmp5_, _tmp6_); h = _tmp7_; _tmp10_ = h; if (_tmp10_ != NULL) { @@ -4481,12 +4920,20 @@ static gint gee_tree_set_sub_set_real_get_size (GeeAbstractCollection* base) { } -static gboolean gee_tree_set_sub_set_real_get_is_empty (GeeAbstractCollection* base) { +static gboolean gee_tree_set_sub_set_real_get_read_only (GeeAbstractCollection* base) { gboolean result; GeeTreeSetSubSet* self; + self = (GeeTreeSetSubSet*) base; + result = TRUE; + return result; +} + + +static gboolean gee_tree_set_sub_set_get_is_empty (GeeTreeSetSubSet* self) { + gboolean result; GeeTreeSetRange* _tmp0_; gboolean _tmp1_ = FALSE; - self = (GeeTreeSetSubSet*) base; + g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->priv->range; _tmp1_ = gee_tree_set_range_empty_subset (_tmp0_); result = _tmp1_; @@ -4502,8 +4949,19 @@ static void gee_tree_set_sub_set_class_init (GeeTreeSetSubSetClass * klass) { GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_set_sub_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_set_sub_set_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_set_sub_set_real_iterator; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_set_sub_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_set_sub_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_set_sub_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_set_sub_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_set_sub_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_set_sub_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_set_sub_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_set_sub_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_set_sub_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_set_sub_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_set_sub_set_real_ceil; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_set_sub_set_real_get_size; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_is_empty = gee_tree_set_sub_set_real_get_is_empty; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_set_sub_set_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_sub_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_sub_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_tree_set_sub_set_finalize; @@ -4511,26 +4969,11 @@ static void gee_tree_set_sub_set_class_init (GeeTreeSetSubSetClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_SET_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } -static void gee_tree_set_sub_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface) { - gee_tree_set_sub_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface); - iface->bidir_iterator = (GeeBidirIterator* (*)(GeeSortedSet*)) gee_tree_set_sub_set_real_bidir_iterator; - iface->first = (gpointer (*)(GeeSortedSet*)) gee_tree_set_sub_set_real_first; - iface->last = (gpointer (*)(GeeSortedSet*)) gee_tree_set_sub_set_real_last; - iface->head_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_head_set; - iface->tail_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_tail_set; - iface->sub_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer, gconstpointer)) gee_tree_set_sub_set_real_sub_set; - iface->iterator_at = (GeeBidirIterator* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_iterator_at; - iface->lower = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_lower; - iface->higher = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_higher; - iface->floor = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_floor; - iface->ceil = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_sub_set_real_ceil; -} - - static void gee_tree_set_sub_set_instance_init (GeeTreeSetSubSet * self) { self->priv = GEE_TREE_SET_SUB_SET_GET_PRIVATE (self); } @@ -4549,10 +4992,8 @@ static GType gee_tree_set_sub_set_get_type (void) { static volatile gsize gee_tree_set_sub_set_type_id__volatile = 0; if (g_once_init_enter (&gee_tree_set_sub_set_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetSubSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_sub_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetSubSet), 0, (GInstanceInitFunc) gee_tree_set_sub_set_instance_init, NULL }; - static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_tree_set_sub_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_tree_set_sub_set_type_id; - gee_tree_set_sub_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeTreeSetSubSet", &g_define_type_info, 0); - g_type_add_interface_static (gee_tree_set_sub_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info); + gee_tree_set_sub_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeSetSubSet", &g_define_type_info, 0); g_once_init_leave (&gee_tree_set_sub_set_type_id__volatile, gee_tree_set_sub_set_type_id); } return gee_tree_set_sub_set_type_id__volatile; @@ -4566,8 +5007,11 @@ static void _vala_gee_tree_set_sub_set_get_property (GObject * object, guint pro case GEE_TREE_SET_SUB_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; + case GEE_TREE_SET_SUB_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); + break; case GEE_TREE_SET_SUB_SET_IS_EMPTY: - g_value_set_boolean (value, gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) self)); + g_value_set_boolean (value, gee_tree_set_sub_set_get_is_empty (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -4709,7 +5153,7 @@ static gboolean gee_tree_set_sub_iterator_real_next (GeeIterator* base) { ((next == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (next = (self->priv->g_destroy_func (next), NULL)); } else { gboolean _tmp11_ = FALSE; - _tmp11_ = gee_iterator_first ((GeeIterator*) self); + _tmp11_ = gee_bidir_iterator_first ((GeeBidirIterator*) self); result = _tmp11_; return result; } @@ -4759,7 +5203,7 @@ static gboolean gee_tree_set_sub_iterator_real_has_next (GeeIterator* base) { } -static gboolean gee_tree_set_sub_iterator_real_first (GeeIterator* base) { +static gboolean gee_tree_set_sub_iterator_real_first (GeeBidirIterator* base) { GeeTreeSetSubIterator * self; gboolean result = FALSE; GeeTreeSetRange* _tmp0_; @@ -4933,6 +5377,76 @@ static void gee_tree_set_sub_iterator_real_remove (GeeIterator* base) { } +static gboolean gee_tree_set_sub_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeTreeSetSubIterator * self; + gboolean result = FALSE; + gboolean _tmp0_; + gboolean _tmp1_; + self = (GeeTreeSetSubIterator*) base; + _tmp0_ = gee_iterator_get_valid ((GeeIterator*) self); + _tmp1_ = _tmp0_; + if (_tmp1_) { + GeeForallFunc _tmp2_; + void* _tmp2__target; + gpointer _tmp3_ = NULL; + gboolean _tmp4_ = FALSE; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_iterator_get ((GeeIterator*) self); + _tmp4_ = _tmp2_ (_tmp3_, _tmp2__target); + if (!_tmp4_) { + result = FALSE; + return result; + } + } + while (TRUE) { + gboolean _tmp5_ = FALSE; + GeeForallFunc _tmp6_; + void* _tmp6__target; + gpointer _tmp7_ = NULL; + gboolean _tmp8_ = FALSE; + _tmp5_ = gee_iterator_next ((GeeIterator*) self); + if (!_tmp5_) { + break; + } + _tmp6_ = f; + _tmp6__target = f_target; + _tmp7_ = gee_iterator_get ((GeeIterator*) self); + _tmp8_ = _tmp6_ (_tmp7_, _tmp6__target); + if (!_tmp8_) { + result = FALSE; + return result; + } + } + result = TRUE; + return result; +} + + +static gboolean gee_tree_set_sub_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeTreeSetSubIterator* self; + self = (GeeTreeSetSubIterator*) base; + result = FALSE; + return result; +} + + +static gboolean gee_tree_set_sub_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeTreeSetSubIterator* self; + GeeTreeSetIterator* _tmp0_; + gboolean _tmp1_; + gboolean _tmp2_; + self = (GeeTreeSetSubIterator*) base; + _tmp0_ = self->priv->iterator; + _tmp1_ = gee_iterator_get_valid ((GeeIterator*) _tmp0_); + _tmp2_ = _tmp1_; + result = _tmp2_; + return result; +} + + static void gee_tree_set_sub_iterator_class_init (GeeTreeSetSubIteratorClass * klass) { gee_tree_set_sub_iterator_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GeeTreeSetSubIteratorPrivate)); @@ -4942,6 +5456,32 @@ static void gee_tree_set_sub_iterator_class_init (GeeTreeSetSubIteratorClass * k g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SUB_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_tree_set_sub_iterator_gee_traversable_get_g_type (GeeTreeSetSubIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_tree_set_sub_iterator_gee_traversable_get_g_dup_func (GeeTreeSetSubIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_tree_set_sub_iterator_gee_traversable_get_g_destroy_func (GeeTreeSetSubIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_tree_set_sub_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_tree_set_sub_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tree_set_sub_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tree_set_sub_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tree_set_sub_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tree_set_sub_iterator_gee_traversable_get_g_destroy_func; } @@ -4949,17 +5489,37 @@ static void gee_tree_set_sub_iterator_gee_iterator_interface_init (GeeIteratorIf gee_tree_set_sub_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); iface->next = (gboolean (*)(GeeIterator*)) gee_tree_set_sub_iterator_real_next; iface->has_next = (gboolean (*)(GeeIterator*)) gee_tree_set_sub_iterator_real_has_next; - iface->first = (gboolean (*)(GeeIterator*)) gee_tree_set_sub_iterator_real_first; iface->get = (gpointer (*)(GeeIterator*)) gee_tree_set_sub_iterator_real_get; iface->remove = (void (*)(GeeIterator*)) gee_tree_set_sub_iterator_real_remove; + iface->get_read_only = gee_tree_set_sub_iterator_real_get_read_only; + iface->get_valid = gee_tree_set_sub_iterator_real_get_valid; +} + + +static GType gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_type (GeeTreeSetSubIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_dup_func (GeeTreeSetSubIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_destroy_func (GeeTreeSetSubIterator* self) { + return self->priv->g_destroy_func; } static void gee_tree_set_sub_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) { gee_tree_set_sub_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->first = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_real_first; iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_real_previous; iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_real_has_previous; iface->last = (gboolean (*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_real_last; + iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_tree_set_sub_iterator_gee_bidir_iterator_get_g_destroy_func; } @@ -4983,10 +5543,12 @@ static GType gee_tree_set_sub_iterator_get_type (void) { static volatile gsize gee_tree_set_sub_iterator_type_id__volatile = 0; if (g_once_init_enter (&gee_tree_set_sub_iterator_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetSubIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_sub_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSetSubIterator), 0, (GInstanceInitFunc) gee_tree_set_sub_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_tree_set_sub_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_tree_set_sub_iterator_type_id; gee_tree_set_sub_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTreeSetSubIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); g_type_add_interface_static (gee_tree_set_sub_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info); g_once_init_leave (&gee_tree_set_sub_iterator_type_id__volatile, gee_tree_set_sub_iterator_type_id); @@ -4999,6 +5561,12 @@ static void _vala_gee_tree_set_sub_iterator_get_property (GObject * object, guin GeeTreeSetSubIterator * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_SET_TYPE_SUB_ITERATOR, GeeTreeSetSubIterator); switch (property_id) { + case GEE_TREE_SET_SUB_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + case GEE_TREE_SET_SUB_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -5034,7 +5602,19 @@ static void gee_tree_set_class_init (GeeTreeSetClass * klass) { GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_tree_set_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_tree_set_real_clear; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_tree_set_real_iterator; + GEE_ABSTRACT_BIDIR_SORTED_SET_CLASS (klass)->bidir_iterator = gee_tree_set_real_bidir_iterator; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->first = gee_tree_set_real_first; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->last = gee_tree_set_real_last; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->head_set = gee_tree_set_real_head_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->tail_set = gee_tree_set_real_tail_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->sub_set = gee_tree_set_real_sub_set; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->iterator_at = gee_tree_set_real_iterator_at; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->lower = gee_tree_set_real_lower; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->higher = gee_tree_set_real_higher; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->floor = gee_tree_set_real_floor; + GEE_ABSTRACT_SORTED_SET_CLASS (klass)->ceil = gee_tree_set_real_ceil; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_tree_set_real_get_size; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_tree_set_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_gee_tree_set_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_tree_set_set_property; G_OBJECT_CLASS (klass)->finalize = gee_tree_set_finalize; @@ -5046,25 +5626,9 @@ static void gee_tree_set_class_init (GeeTreeSetClass * klass) { */ g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); /** - * The elements' comparator function. + * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_COMPARE_FUNC, g_param_spec_pointer ("compare-func", "compare-func", "compare-func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); -} - - -static void gee_tree_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface) { - gee_tree_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface); - iface->bidir_iterator = (GeeBidirIterator* (*)(GeeSortedSet*)) gee_tree_set_real_bidir_iterator; - iface->first = (gpointer (*)(GeeSortedSet*)) gee_tree_set_real_first; - iface->last = (gpointer (*)(GeeSortedSet*)) gee_tree_set_real_last; - iface->head_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_head_set; - iface->tail_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_tail_set; - iface->sub_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer, gconstpointer)) gee_tree_set_real_sub_set; - iface->iterator_at = (GeeBidirIterator* (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_iterator_at; - iface->lower = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_lower; - iface->higher = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_higher; - iface->floor = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_floor; - iface->ceil = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_tree_set_real_ceil; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TREE_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -5081,6 +5645,11 @@ static void gee_tree_set_instance_init (GeeTreeSet * self) { static void gee_tree_set_finalize (GObject* obj) { GeeTreeSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TREE_SET, GeeTreeSet); + gee_abstract_collection_clear ((GeeAbstractCollection*) self); + (self->priv->_compare_func_target_destroy_notify == NULL) ? NULL : (self->priv->_compare_func_target_destroy_notify (self->priv->_compare_func_target), NULL); + self->priv->_compare_func = NULL; + self->priv->_compare_func_target = NULL; + self->priv->_compare_func_target_destroy_notify = NULL; _gee_tree_set_node_free0 (self->priv->root); G_OBJECT_CLASS (gee_tree_set_parent_class)->finalize (obj); } @@ -5100,10 +5669,8 @@ GType gee_tree_set_get_type (void) { static volatile gsize gee_tree_set_type_id__volatile = 0; if (g_once_init_enter (&gee_tree_set_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeTreeSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tree_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTreeSet), 0, (GInstanceInitFunc) gee_tree_set_instance_init, NULL }; - static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_tree_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_tree_set_type_id; - gee_tree_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeTreeSet", &g_define_type_info, 0); - g_type_add_interface_static (gee_tree_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info); + gee_tree_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_SORTED_SET, "GeeTreeSet", &g_define_type_info, 0); g_once_init_leave (&gee_tree_set_type_id__volatile, gee_tree_set_type_id); } return gee_tree_set_type_id__volatile; @@ -5117,8 +5684,8 @@ static void _vala_gee_tree_set_get_property (GObject * object, guint property_id case GEE_TREE_SET_SIZE: g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self)); break; - case GEE_TREE_SET_COMPARE_FUNC: - g_value_set_pointer (value, gee_tree_set_get_compare_func (self)); + case GEE_TREE_SET_READ_ONLY: + g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -5131,9 +5698,6 @@ static void _vala_gee_tree_set_set_property (GObject * object, guint property_id GeeTreeSet * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TREE_SET, GeeTreeSet); switch (property_id) { - case GEE_TREE_SET_COMPARE_FUNC: - gee_tree_set_set_compare_func (self, g_value_get_pointer (value)); - break; case GEE_TREE_SET_G_TYPE: self->priv->g_type = g_value_get_gtype (value); break; diff --git a/gee/treeset.vala b/gee/treeset.vala index 3548cf1..1a19acc 100644 --- a/gee/treeset.vala +++ b/gee/treeset.vala @@ -1,6 +1,6 @@ /* treeset.vala * - * Copyright (C) 2009 Maciej Piechotka + * Copyright (C) 2009-2011 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,18 +32,26 @@ using GLib; * * @see HashSet */ -public class Gee.TreeSet : AbstractSet, SortedSet { +public class Gee.TreeSet : AbstractBidirSortedSet { /** * {@inheritDoc} */ public override int size { get {return _size;} } + + /** + * {@inheritDoc} + */ + public override bool read_only { + get { return false; } + } /** * The elements' comparator function. */ - public CompareFunc compare_func { private set; get; } + [CCode (notify = false)] + public CompareDataFunc compare_func { private set; get; } private int _size = 0; @@ -56,13 +64,17 @@ public class Gee.TreeSet : AbstractSet, SortedSet { * * @param compare_func an optional element comparator function */ - public TreeSet (CompareFunc? compare_func = null) { + public TreeSet (owned CompareDataFunc? compare_func = null) { if (compare_func == null) { compare_func = Functions.get_compare_func_for (typeof (G)); } this.compare_func = compare_func; } + ~TreeSet () { + clear (); + } + /** * {@inheritDoc} */ @@ -212,10 +224,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { private inline void fix_removal (ref Node node, out G? key = null) { Node n = (owned)node; - if (&key != null) - key = (owned) n.key; - else - n.key = null; + key = (owned) n.key; if (n.prev != null) { n.prev.next = n.next; } else { @@ -250,10 +259,14 @@ public class Gee.TreeSet : AbstractSet, SortedSet { stdout.printf ("Removing %s from %s\n", (string)item, node != null ? (string)node.key : null); #endif if (node == null) { + prev = null; + next = null; return false; } else if (compare_func (item, node.key) < 0) { weak Node left = node.left; if (left == null) { + prev = null; + next = null; return false; } if (is_black (left) && is_black (left.left)) { @@ -269,10 +282,8 @@ public class Gee.TreeSet : AbstractSet, SortedSet { weak Node? r = node.right; if (compare_func (item, node.key) == 0 && r == null) { - if (&prev != null) - prev = node.prev; - if (&next != null) - next = node.next; + prev = node.prev; + next = node.next; fix_removal (ref node, null); return true; } @@ -280,10 +291,8 @@ public class Gee.TreeSet : AbstractSet, SortedSet { move_red_right (ref node); } if (compare_func (item, node.key) == 0) { - if (&prev != null) - prev = node.prev; - if (&next != null) - next = node; + prev = node.prev; + next = node; remove_minimal (ref node.right, out node.key); fix_up (ref node); return true; @@ -343,7 +352,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public BidirIterator bidir_iterator () { + public override BidirIterator bidir_iterator () { return new Iterator (this); } @@ -354,7 +363,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public G first () { + public override G first () { assert (_first != null); return _first.key; } @@ -362,7 +371,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public G last () { + public override G last () { assert (_last != null); return _last.key; } @@ -370,21 +379,21 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public SortedSet head_set (G before) { + public override SortedSet head_set (G before) { return new SubSet.head (this, before); } /** * {@inheritDoc} */ - public SortedSet tail_set (G after) { + public override SortedSet tail_set (G after) { return new SubSet.tail (this, after); } /** * {@inheritDoc} */ - public SortedSet sub_set (G after, G before) { + public override SortedSet sub_set (G after, G before) { return new SubSet (this, after, before); } @@ -406,7 +415,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public BidirIterator? iterator_at (G item) { + public override Gee.Iterator? iterator_at (G item) { weak Node? node = find_node (item); return node != null ? new Iterator.pointing (this, node) : null; } @@ -461,28 +470,28 @@ public class Gee.TreeSet : AbstractSet, SortedSet { /** * {@inheritDoc} */ - public G? lower (G item) { + public override G? lower (G item) { return lift_null_get (find_lower (item)); } /** * {@inheritDoc} */ - public G? higher (G item) { + public override G? higher (G item) { return lift_null_get (find_higher (item)); } /** * {@inheritDoc} */ - public G? floor (G item) { + public override G? floor (G item) { return lift_null_get (find_floor (item)); } /** * {@inheritDoc} */ - public G? ceil (G item) { + public override G? ceil (G item) { return lift_null_get (find_ceil (item)); } @@ -568,7 +577,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { public weak Node? next; } - private class Iterator : Object, Gee.Iterator, BidirIterator { + private class Iterator : Object, Traversable, Gee.Iterator, BidirIterator { private TreeSet _set; // concurrent modification protection @@ -697,6 +706,39 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return _next != null; } } + + public bool valid { + get { + assert (stamp == _set.stamp); + return current != null; + } + } + + public bool read_only { + get { + return false; + } + } + + public bool foreach (ForallFunc f) { + assert (stamp == _set.stamp); + if (current != null) { + if (!f (current.key)) { + return false; + } + _next = current.next; + } else if (!started) { + _next = _set._first; + } + while (_next != null) { + current = _next; + if (!f (current.key)) { + return false; + } + _next = current.next; + } + return true; + } private weak Node? current = null; private weak Node? _next = null; @@ -853,7 +895,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { BOUNDED } - private class SubSet : AbstractSet, SortedSet { + private class SubSet : AbstractBidirSortedSet { public SubSet (TreeSet set, G after, G before) { this.set = set; this.range = new Range (set, after, before); @@ -884,7 +926,11 @@ public class Gee.TreeSet : AbstractSet, SortedSet { } } - public override bool is_empty { + public override bool read_only { + get { return true; } + } + + public bool is_empty { get { return range.empty_subset (); } @@ -913,35 +959,35 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return new SubIterator (set, range); } - public BidirIterator bidir_iterator () { + public override BidirIterator bidir_iterator () { return new SubIterator (set, range); } - public G first () { + public override G first () { weak Node? _first = range.first (); assert (_first != null); return _first.key; } - public G last () { + public override G last () { weak Node? _last = range.last (); assert (_last != null); return _last.key; } - public SortedSet head_set (G before) { + public override SortedSet head_set (G before) { return new SubSet.from_range (set, range.cut_tail (before)); } - public SortedSet tail_set (G after) { + public override SortedSet tail_set (G after) { return new SubSet.from_range (set, range.cut_head (after)); } - public SortedSet sub_set (G after, G before) { + public override SortedSet sub_set (G after, G before) { return new SubSet.from_range (set, range.cut (after, before)); } - public BidirIterator? iterator_at (G item) { + public override Gee.Iterator? iterator_at (G item) { if (!range.in_range (item)) return null; weak Node? n = set.find_node (item); @@ -950,7 +996,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return new SubIterator.pointing (set, range, n); } - public G? lower (G item) { + public override G? lower (G item) { var res = range.compare_range (item); if (res > 0) return last (); @@ -958,7 +1004,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return l != null && range.in_range (l) ? l : null; } - public G? higher (G item) { + public override G? higher (G item) { var res = range.compare_range (item); if (res < 0) return first (); @@ -966,7 +1012,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return h != null && range.in_range (h) ? h : null; } - public G? floor (G item) { + public override G? floor (G item) { var res = range.compare_range (item); if (res > 0) return last (); @@ -974,7 +1020,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { return l != null && range.in_range (l) ? l : null; } - public G? ceil (G item) { + public override G? ceil (G item) { var res = range.compare_range (item); if (res < 0) return first (); @@ -986,7 +1032,7 @@ public class Gee.TreeSet : AbstractSet, SortedSet { private Range range; } - private class SubIterator : Object, Gee.Iterator, BidirIterator { + private class SubIterator : Object, Traversable, Gee.Iterator, BidirIterator { public SubIterator (TreeSet set, Range range) { this.set = set; this.range = range; @@ -1065,6 +1111,32 @@ public class Gee.TreeSet : AbstractSet, SortedSet { assert (iterator != null); iterator.remove (); } + + public bool read_only { + get { + return false; + } + } + + public bool valid { + get { + return iterator.valid; + } + } + + public bool foreach(ForallFunc f) { + if(valid) { + if (!f(get())) { + return false; + } + } + while(next()) { + if (!f(get())) { + return false; + } + } + return true; + } private new TreeSet set; private Range range; diff --git a/gee/unfolditerator.c b/gee/unfolditerator.c new file mode 100644 index 0000000..46c5ce9 --- /dev/null +++ b/gee/unfolditerator.c @@ -0,0 +1,567 @@ +/* unfolditerator.c generated by valac 0.18.0, the Vala compiler + * generated from unfolditerator.vala, do not modify */ + +/* unfolditerator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include + + +#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ()) +#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable)) +#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE)) +#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface)) + +typedef struct _GeeTraversable GeeTraversable; +typedef struct _GeeTraversableIface GeeTraversableIface; + +#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ()) + +#define GEE_TYPE_LAZY (gee_lazy_get_type ()) +#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy)) +#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass)) +#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY)) +#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY)) +#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass)) + +typedef struct _GeeLazy GeeLazy; +typedef struct _GeeLazyClass GeeLazyClass; + +#define GEE_TYPE_ITERATOR (gee_iterator_get_type ()) +#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator)) +#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR)) +#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface)) + +typedef struct _GeeIterator GeeIterator; +typedef struct _GeeIteratorIface GeeIteratorIface; + +#define GEE_TYPE_UNFOLD_ITERATOR (gee_unfold_iterator_get_type ()) +#define GEE_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator)) +#define GEE_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) +#define GEE_IS_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_IS_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_UNFOLD_ITERATOR)) +#define GEE_UNFOLD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass)) + +typedef struct _GeeUnfoldIterator GeeUnfoldIterator; +typedef struct _GeeUnfoldIteratorClass GeeUnfoldIteratorClass; +typedef struct _GeeUnfoldIteratorPrivate GeeUnfoldIteratorPrivate; +#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} GeeTraversableStream; + +typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data); +struct _GeeIteratorIface { + GTypeInterface parent_iface; + gboolean (*next) (GeeIterator* self); + gboolean (*has_next) (GeeIterator* self); + gpointer (*get) (GeeIterator* self); + void (*remove) (GeeIterator* self); + gboolean (*get_valid) (GeeIterator* self); + gboolean (*get_read_only) (GeeIterator* self); +}; + +typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data); +typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data); +typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data); +struct _GeeTraversableIface { + GTypeInterface parent_iface; + GType (*get_g_type) (GeeTraversable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self); + GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self); + gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target); + GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify); + gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target); + GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed); + GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify); + GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length); + GType (*get_element_type) (GeeTraversable* self); +}; + +struct _GeeUnfoldIterator { + GObject parent_instance; + GeeUnfoldIteratorPrivate * priv; +}; + +struct _GeeUnfoldIteratorClass { + GObjectClass parent_class; +}; + +typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data); +struct _GeeUnfoldIteratorPrivate { + GType g_type; + GBoxedCopyFunc g_dup_func; + GDestroyNotify g_destroy_func; + GeeUnfoldFunc _func; + gpointer _func_target; + GDestroyNotify _func_target_destroy_notify; + GeeLazy* _current; + GeeLazy* _next; + gboolean _end; +}; + + +static gpointer gee_unfold_iterator_parent_class = NULL; +static GeeTraversableIface* gee_unfold_iterator_gee_traversable_parent_iface = NULL; +static GeeIteratorIface* gee_unfold_iterator_gee_iterator_parent_iface = NULL; + +GType gee_traversable_stream_get_type (void) G_GNUC_CONST; +gpointer gee_lazy_ref (gpointer instance); +void gee_lazy_unref (gpointer instance); +GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void gee_value_set_lazy (GValue* value, gpointer v_object); +void gee_value_take_lazy (GValue* value, gpointer v_object); +gpointer gee_value_get_lazy (const GValue* value); +GType gee_lazy_get_type (void) G_GNUC_CONST; +GType gee_iterator_get_type (void) G_GNUC_CONST; +GType gee_traversable_get_type (void) G_GNUC_CONST; +GType gee_unfold_iterator_get_type (void) G_GNUC_CONST; +#define GEE_UNFOLD_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorPrivate)) +enum { + GEE_UNFOLD_ITERATOR_DUMMY_PROPERTY, + GEE_UNFOLD_ITERATOR_G_TYPE, + GEE_UNFOLD_ITERATOR_G_DUP_FUNC, + GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC, + GEE_UNFOLD_ITERATOR_VALID, + GEE_UNFOLD_ITERATOR_READ_ONLY +}; +GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); +GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current); +static gboolean gee_unfold_iterator_real_next (GeeIterator* base); +gboolean gee_iterator_has_next (GeeIterator* self); +void gee_lazy_eval (GeeLazy* self); +static gboolean gee_unfold_iterator_real_has_next (GeeIterator* base); +static gpointer gee_unfold_iterator_real_get (GeeIterator* base); +gconstpointer gee_lazy_get_value (GeeLazy* self); +static void gee_unfold_iterator_real_remove (GeeIterator* base); +static gboolean gee_unfold_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target); +static void gee_unfold_iterator_finalize (GObject* obj); +gboolean gee_iterator_get_valid (GeeIterator* self); +gboolean gee_iterator_get_read_only (GeeIterator* self); +static void _vala_gee_unfold_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void _vala_gee_unfold_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); + + +GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current) { + GeeUnfoldIterator * self = NULL; + GeeLazy* _tmp0_; + GeeUnfoldFunc _tmp1_; + void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; + self = (GeeUnfoldIterator*) g_object_new (object_type, NULL); + self->priv->g_type = g_type; + self->priv->g_dup_func = g_dup_func; + self->priv->g_destroy_func = g_destroy_func; + _tmp0_ = current; + current = NULL; + _gee_lazy_unref0 (self->priv->_current); + self->priv->_current = _tmp0_; + _tmp1_ = func; + _tmp1__target = func_target; + _tmp1__target_destroy_notify = func_target_destroy_notify; + func_target_destroy_notify = NULL; + (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL); + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + self->priv->_func = _tmp1_; + self->priv->_func_target = _tmp1__target; + self->priv->_func_target_destroy_notify = _tmp1__target_destroy_notify; + self->priv->_end = FALSE; + (func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL); + func = NULL; + func_target = NULL; + func_target_destroy_notify = NULL; + _gee_lazy_unref0 (current); + return self; +} + + +GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current) { + return gee_unfold_iterator_construct (GEE_TYPE_UNFOLD_ITERATOR, g_type, g_dup_func, g_destroy_func, func, func_target, func_target_destroy_notify, current); +} + + +static gboolean gee_unfold_iterator_real_next (GeeIterator* base) { + GeeUnfoldIterator * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + self = (GeeUnfoldIterator*) base; + _tmp0_ = gee_iterator_has_next ((GeeIterator*) self); + if (_tmp0_) { + GeeLazy* _tmp1_; + GeeLazy* _tmp3_; + _tmp1_ = self->priv->_current; + if (_tmp1_ != NULL) { + GeeLazy* _tmp2_; + _tmp2_ = self->priv->_current; + gee_lazy_eval (_tmp2_); + } + _tmp3_ = self->priv->_next; + self->priv->_next = NULL; + _gee_lazy_unref0 (self->priv->_current); + self->priv->_current = _tmp3_; + result = TRUE; + return result; + } + result = FALSE; + return result; +} + + +static gboolean gee_unfold_iterator_real_has_next (GeeIterator* base) { + GeeUnfoldIterator * self; + gboolean result = FALSE; + gboolean _tmp0_; + GeeLazy* _tmp1_; + GeeUnfoldFunc _tmp2_; + void* _tmp2__target; + GeeLazy* _tmp3_ = NULL; + GeeLazy* _tmp4_; + GeeLazy* _tmp5_; + self = (GeeUnfoldIterator*) base; + _tmp0_ = self->priv->_end; + if (_tmp0_) { + result = FALSE; + return result; + } + _tmp1_ = self->priv->_next; + if (_tmp1_ != NULL) { + result = TRUE; + return result; + } + _tmp2_ = self->priv->_func; + _tmp2__target = self->priv->_func_target; + _tmp3_ = _tmp2_ (_tmp2__target); + _gee_lazy_unref0 (self->priv->_next); + self->priv->_next = _tmp3_; + _tmp4_ = self->priv->_next; + if (_tmp4_ == NULL) { + self->priv->_end = TRUE; + } + _tmp5_ = self->priv->_next; + result = _tmp5_ != NULL; + return result; +} + + +static gpointer gee_unfold_iterator_real_get (GeeIterator* base) { + GeeUnfoldIterator * self; + gpointer result = NULL; + GeeLazy* _tmp0_; + GeeLazy* _tmp1_; + gconstpointer _tmp2_; + gconstpointer _tmp3_; + gpointer _tmp4_; + self = (GeeUnfoldIterator*) base; + _tmp0_ = self->priv->_current; + _vala_assert (_tmp0_ != NULL, "_current != null"); + _tmp1_ = self->priv->_current; + _tmp2_ = gee_lazy_get_value (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_); + result = _tmp4_; + return result; +} + + +static void gee_unfold_iterator_real_remove (GeeIterator* base) { + GeeUnfoldIterator * self; + self = (GeeUnfoldIterator*) base; + g_assert_not_reached (); +} + + +static gboolean gee_unfold_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) { + GeeUnfoldIterator * self; + gboolean result = FALSE; + GeeLazy* _tmp0_; + GeeLazy* _tmp5_; + GeeLazy* _tmp12_; + self = (GeeUnfoldIterator*) base; + _tmp0_ = self->priv->_current; + if (_tmp0_ != NULL) { + GeeForallFunc _tmp1_; + void* _tmp1__target; + GeeLazy* _tmp2_; + gpointer _tmp3_; + gboolean _tmp4_ = FALSE; + _tmp1_ = f; + _tmp1__target = f_target; + _tmp2_ = self->priv->_current; + _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_); + _tmp4_ = _tmp1_ (_tmp3_, _tmp1__target); + if (!_tmp4_) { + result = FALSE; + return result; + } + } + _tmp5_ = self->priv->_next; + if (_tmp5_ != NULL) { + GeeLazy* _tmp6_; + GeeForallFunc _tmp7_; + void* _tmp7__target; + GeeLazy* _tmp8_; + gpointer _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp6_ = self->priv->_next; + self->priv->_next = NULL; + _gee_lazy_unref0 (self->priv->_current); + self->priv->_current = _tmp6_; + _tmp7_ = f; + _tmp7__target = f_target; + _tmp8_ = self->priv->_current; + _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_); + _tmp10_ = _tmp7_ (_tmp9_, _tmp7__target); + if (!_tmp10_) { + result = FALSE; + return result; + } + } else { + gboolean _tmp11_; + _tmp11_ = self->priv->_end; + if (_tmp11_) { + result = TRUE; + return result; + } + } + _tmp12_ = self->priv->_current; + if (_tmp12_ == NULL) { + GeeUnfoldFunc _tmp13_; + void* _tmp13__target; + GeeLazy* _tmp14_ = NULL; + GeeLazy* _tmp15_; + _tmp13_ = self->priv->_func; + _tmp13__target = self->priv->_func_target; + _tmp14_ = _tmp13_ (_tmp13__target); + _gee_lazy_unref0 (self->priv->_current); + self->priv->_current = _tmp14_; + _tmp15_ = self->priv->_current; + if (_tmp15_ == NULL) { + self->priv->_end = TRUE; + result = TRUE; + return result; + } else { + GeeForallFunc _tmp16_; + void* _tmp16__target; + GeeLazy* _tmp17_; + gpointer _tmp18_; + gboolean _tmp19_ = FALSE; + _tmp16_ = f; + _tmp16__target = f_target; + _tmp17_ = self->priv->_current; + _tmp18_ = ((_tmp17_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp17_) : ((gpointer) _tmp17_); + _tmp19_ = _tmp16_ (_tmp18_, _tmp16__target); + if (!_tmp19_) { + result = FALSE; + return result; + } + } + } + while (TRUE) { + GeeUnfoldFunc _tmp20_; + void* _tmp20__target; + GeeLazy* _tmp21_ = NULL; + GeeLazy* _tmp22_; + GeeLazy* _tmp23_; + GeeForallFunc _tmp24_; + void* _tmp24__target; + GeeLazy* _tmp25_; + gpointer _tmp26_; + gboolean _tmp27_ = FALSE; + _tmp20_ = self->priv->_func; + _tmp20__target = self->priv->_func_target; + _tmp21_ = _tmp20_ (_tmp20__target); + _gee_lazy_unref0 (self->priv->_next); + self->priv->_next = _tmp21_; + _tmp22_ = self->priv->_next; + if (!(_tmp22_ != NULL)) { + break; + } + _tmp23_ = self->priv->_next; + self->priv->_next = NULL; + _gee_lazy_unref0 (self->priv->_current); + self->priv->_current = _tmp23_; + _tmp24_ = f; + _tmp24__target = f_target; + _tmp25_ = self->priv->_current; + _tmp26_ = ((_tmp25_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp25_) : ((gpointer) _tmp25_); + _tmp27_ = _tmp24_ (_tmp26_, _tmp24__target); + if (!_tmp27_) { + result = FALSE; + return result; + } + } + self->priv->_end = TRUE; + result = TRUE; + return result; +} + + +static gboolean gee_unfold_iterator_real_get_valid (GeeIterator* base) { + gboolean result; + GeeUnfoldIterator* self; + GeeLazy* _tmp0_; + self = (GeeUnfoldIterator*) base; + _tmp0_ = self->priv->_current; + result = _tmp0_ != NULL; + return result; +} + + +static gboolean gee_unfold_iterator_real_get_read_only (GeeIterator* base) { + gboolean result; + GeeUnfoldIterator* self; + self = (GeeUnfoldIterator*) base; + result = TRUE; + return result; +} + + +static void gee_unfold_iterator_class_init (GeeUnfoldIteratorClass * klass) { + gee_unfold_iterator_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeUnfoldIteratorPrivate)); + G_OBJECT_CLASS (klass)->get_property = _vala_gee_unfold_iterator_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_gee_unfold_iterator_set_property; + G_OBJECT_CLASS (klass)->finalize = gee_unfold_iterator_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static GType gee_unfold_iterator_gee_traversable_get_g_type (GeeUnfoldIterator* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_unfold_iterator_gee_traversable_get_g_dup_func (GeeUnfoldIterator* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_unfold_iterator_gee_traversable_get_g_destroy_func (GeeUnfoldIterator* self) { + return self->priv->g_destroy_func; +} + + +static void gee_unfold_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_unfold_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_unfold_iterator_real_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_destroy_func; +} + + +static void gee_unfold_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) { + gee_unfold_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface); + iface->next = (gboolean (*)(GeeIterator*)) gee_unfold_iterator_real_next; + iface->has_next = (gboolean (*)(GeeIterator*)) gee_unfold_iterator_real_has_next; + iface->get = (gpointer (*)(GeeIterator*)) gee_unfold_iterator_real_get; + iface->remove = (void (*)(GeeIterator*)) gee_unfold_iterator_real_remove; + iface->get_valid = gee_unfold_iterator_real_get_valid; + iface->get_read_only = gee_unfold_iterator_real_get_read_only; +} + + +static void gee_unfold_iterator_instance_init (GeeUnfoldIterator * self) { + self->priv = GEE_UNFOLD_ITERATOR_GET_PRIVATE (self); +} + + +static void gee_unfold_iterator_finalize (GObject* obj) { + GeeUnfoldIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator); + (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL); + self->priv->_func = NULL; + self->priv->_func_target = NULL; + self->priv->_func_target_destroy_notify = NULL; + _gee_lazy_unref0 (self->priv->_current); + _gee_lazy_unref0 (self->priv->_next); + G_OBJECT_CLASS (gee_unfold_iterator_parent_class)->finalize (obj); +} + + +GType gee_unfold_iterator_get_type (void) { + static volatile gsize gee_unfold_iterator_type_id__volatile = 0; + if (g_once_init_enter (&gee_unfold_iterator_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeUnfoldIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_unfold_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeUnfoldIterator), 0, (GInstanceInitFunc) gee_unfold_iterator_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType gee_unfold_iterator_type_id; + gee_unfold_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeUnfoldIterator", &g_define_type_info, 0); + g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); + g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info); + g_once_init_leave (&gee_unfold_iterator_type_id__volatile, gee_unfold_iterator_type_id); + } + return gee_unfold_iterator_type_id__volatile; +} + + +static void _vala_gee_unfold_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + GeeUnfoldIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator); + switch (property_id) { + case GEE_UNFOLD_ITERATOR_VALID: + g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self)); + break; + case GEE_UNFOLD_ITERATOR_READ_ONLY: + g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void _vala_gee_unfold_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + GeeUnfoldIterator * self; + self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator); + switch (property_id) { + case GEE_UNFOLD_ITERATOR_G_TYPE: + self->priv->g_type = g_value_get_gtype (value); + break; + case GEE_UNFOLD_ITERATOR_G_DUP_FUNC: + self->priv->g_dup_func = g_value_get_pointer (value); + break; + case GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC: + self->priv->g_destroy_func = g_value_get_pointer (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + diff --git a/gee/unfolditerator.vala b/gee/unfolditerator.vala new file mode 100644 index 0000000..30dcd74 --- /dev/null +++ b/gee/unfolditerator.vala @@ -0,0 +1,102 @@ +/* unfolditerator.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +internal class Gee.UnfoldIterator : Object, Traversable, Iterator { + public UnfoldIterator (owned UnfoldFunc func, owned Lazy? current = null) { + _current = (owned)current; + _func = (owned)func; + _end = false; + } + + public bool next () { + if (has_next ()) { + if (_current != null) + _current.eval (); + _current = (owned)_next; + return true; + } + return false; + } + + public bool has_next () { + if (_end) + return false; + if (_next != null) + return true; + _next = _func (); + if (_next == null) + _end = true; + return _next != null; + } + + public new G get () { + assert (_current != null); + return _current.value; + } + + public void remove () { + assert_not_reached (); + } + + public bool valid { get { return _current != null; } } + public bool read_only { get { return true; } } + + public bool foreach (ForallFunc f) { + if (_current != null) { + if (!f (_current)) { + return false; + } + } + if (_next != null) { + _current = (owned)_next; + if (!f (_current)) { + return false; + } + } else if (_end) { + return true; + } + if (_current == null) { + _current = _func (); + if (_current == null) { + _end = true; + return true; + } else { + if (!f (_current)) { + return false; + } + } + } + while ((_next = _func ()) != null) { + _current = (owned)_next; + if (!f (_current)) { + return false; + } + } + _end = true; + return true; + } + + private UnfoldFunc _func; + private Lazy? _current; + private Lazy? _next; + private bool _end; +} diff --git a/packaging/libgee.spec b/packaging/libgee.spec index 83a5d1f..9e73631 100644 --- a/packaging/libgee.spec +++ b/packaging/libgee.spec @@ -7,12 +7,12 @@ Name: libgee Summary: GObject collection library -Version: 0.6.6 +Version: 0.9.92 Release: 1 Group: System/Libraries License: LGPLv2+ URL: http://live.gnome.org/Libgee -Source0: http://download.gnome.org/sources/%{name}/0.6/%{name}-%{version}.tar.bz2 +Source0: http://download.gnome.org/sources/%{name}/0.9/%{name}-%{version}.tar.bz2 Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: pkgconfig(glib-2.0) @@ -87,6 +87,6 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' # >> files devel %{_includedir}/* %{_libdir}/*.so -%{_libdir}/pkgconfig/gee-1.0.pc -%{_datadir}/vala/vapi/gee-1.0.vapi +%{_libdir}/pkgconfig/gee-0.8.pc +%{_datadir}/vala/vapi/gee-0.8.vapi # << files devel diff --git a/tests/Makefile.am b/tests/Makefile.am index b4bfffd..2a9abe3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,25 +1,22 @@ include $(top_srcdir)/Makefile.decl -NULL = - -AM_CPPFLAGS = \ - -I$(top_srcdir)/gee \ - $(GLIB_CFLAGS) \ - $(NULL) - noinst_PROGRAMS = $(TEST_PROGS) -progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la - -BUILT_SOURCES = tests.vala.stamp - TEST_PROGS += tests -tests_VALASOURCES = \ + +tests_SOURCES = \ testarraylist.vala \ + testarrayqueue.vala \ + testbidirlist.vala \ + testbidirsortedset.vala \ + testbidirsortedmap.vala \ testcase.vala \ testcollection.vala \ - testcomparable.vala \ + testconcurrentlist.vala \ + testconcurrentset.vala \ + testdata.vala \ testdeque.vala \ + testfunctions.vala \ testhashmap.vala \ testhashmultimap.vala \ testhashmultiset.vala \ @@ -33,26 +30,39 @@ tests_VALASOURCES = \ testmultiset.vala \ testpriorityqueue.vala \ testqueue.vala \ + testreadonlybidirlist.vala \ testreadonlycollection.vala \ testreadonlylist.vala \ testreadonlymap.vala \ testreadonlyset.vala \ testset.vala \ testsortedset.vala \ + testsortedmap.vala \ testtreemap.vala \ testtreemultimap.vala \ testtreemultiset.vala \ testtreeset.vala \ $(NULL) -tests_DEPENDENCIES = $(top_srcdir)/gee/gee-1.0.vapi +tests_DEPENDENCIES = \ + $(top_srcdir)/gee/gee-0.8.vapi \ + $(NULL) + +tests_VALAFLAGS = \ + --basedir $(top_srcdir) \ + --vapidir $(top_srcdir)/gee \ + --pkg gee-0.8 --pkg posix \ + $(VALAFLAGS) \ + $(NULL) -tests_SOURCES = tests.vala.stamp $(tests_VALASOURCES:.vala=.c) -tests.vala.stamp: $(tests_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 --pkg posix $^ - touch $@ -tests_LDADD = $(progs_ldadd) -EXTRA_DIST += $(tests_VALASOURCES) +tests_CPPFLAGS = \ + -I$(top_srcdir)/gee \ + $(GLIB_CFLAGS) \ + $(NULL) + +tests_LDADD = \ + $(GLIB_LIBS) ../gee/libgee-0.8.la \ + $(NULL) coverage-reset: lcov --base-directory=@top_srcdir@ --directory @top_srcdir@/gee --zerocounters @@ -76,11 +86,6 @@ coverage-report: @echo 'file://@abs_top_builddir@/tests/coverage/index.html' @echo -MAINTAINERCLEANFILES = \ - $(tests_VALASOURCES:.vala=.c) \ - tests.vala.stamp \ - $(NULL) - clean-local: -rm -rf coverage diff --git a/tests/Makefile.in b/tests/Makefile.in index 405ce55..7d55b79 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -54,7 +54,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/Makefile.decl + $(top_srcdir)/Makefile.decl testarraylist.c testarrayqueue.c \ + testbidirlist.c testbidirsortedmap.c testbidirsortedset.c \ + testcase.c testcollection.c testconcurrentlist.c \ + testconcurrentset.c testdata.c testdeque.c testfunctions.c \ + testhashmap.c testhashmultimap.c testhashmultiset.c \ + testhashset.c testlinkedlist.c testlinkedlistasdeque.c \ + testlist.c testmain.c testmap.c testmultimap.c testmultiset.c \ + testpriorityqueue.c testqueue.c testreadonlybidirlist.c \ + testreadonlycollection.c testreadonlylist.c testreadonlymap.c \ + testreadonlyset.c tests_vala.stamp testset.c testsortedmap.c \ + testsortedset.c testtreemap.c testtreemultimap.c \ + testtreemultiset.c testtreeset.c noinst_PROGRAMS = $(am__EXEEXT_1) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -71,24 +82,32 @@ CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = tests$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am__objects_1 = -am__objects_2 = testarraylist.$(OBJEXT) testcase.$(OBJEXT) \ - testcollection.$(OBJEXT) testcomparable.$(OBJEXT) \ - testdeque.$(OBJEXT) testhashmap.$(OBJEXT) \ - testhashmultimap.$(OBJEXT) testhashmultiset.$(OBJEXT) \ - testhashset.$(OBJEXT) testlinkedlist.$(OBJEXT) \ - testlinkedlistasdeque.$(OBJEXT) testlist.$(OBJEXT) \ - testmain.$(OBJEXT) testmap.$(OBJEXT) testmultimap.$(OBJEXT) \ - testmultiset.$(OBJEXT) testpriorityqueue.$(OBJEXT) \ - testqueue.$(OBJEXT) testreadonlycollection.$(OBJEXT) \ - testreadonlylist.$(OBJEXT) testreadonlymap.$(OBJEXT) \ - testreadonlyset.$(OBJEXT) testset.$(OBJEXT) \ - testsortedset.$(OBJEXT) testtreemap.$(OBJEXT) \ - testtreemultimap.$(OBJEXT) testtreemultiset.$(OBJEXT) \ - testtreeset.$(OBJEXT) $(am__objects_1) -am_tests_OBJECTS = $(am__objects_2) +am_tests_OBJECTS = tests-testarraylist.$(OBJEXT) \ + tests-testarrayqueue.$(OBJEXT) tests-testbidirlist.$(OBJEXT) \ + tests-testbidirsortedset.$(OBJEXT) \ + tests-testbidirsortedmap.$(OBJEXT) tests-testcase.$(OBJEXT) \ + tests-testcollection.$(OBJEXT) \ + tests-testconcurrentlist.$(OBJEXT) \ + tests-testconcurrentset.$(OBJEXT) tests-testdata.$(OBJEXT) \ + tests-testdeque.$(OBJEXT) tests-testfunctions.$(OBJEXT) \ + tests-testhashmap.$(OBJEXT) tests-testhashmultimap.$(OBJEXT) \ + tests-testhashmultiset.$(OBJEXT) tests-testhashset.$(OBJEXT) \ + tests-testlinkedlist.$(OBJEXT) \ + tests-testlinkedlistasdeque.$(OBJEXT) tests-testlist.$(OBJEXT) \ + tests-testmain.$(OBJEXT) tests-testmap.$(OBJEXT) \ + tests-testmultimap.$(OBJEXT) tests-testmultiset.$(OBJEXT) \ + tests-testpriorityqueue.$(OBJEXT) tests-testqueue.$(OBJEXT) \ + tests-testreadonlybidirlist.$(OBJEXT) \ + tests-testreadonlycollection.$(OBJEXT) \ + tests-testreadonlylist.$(OBJEXT) \ + tests-testreadonlymap.$(OBJEXT) \ + tests-testreadonlyset.$(OBJEXT) tests-testset.$(OBJEXT) \ + tests-testsortedset.$(OBJEXT) tests-testsortedmap.$(OBJEXT) \ + tests-testtreemap.$(OBJEXT) tests-testtreemultimap.$(OBJEXT) \ + tests-testtreemultiset.$(OBJEXT) tests-testtreeset.$(OBJEXT) \ + $(am__objects_1) tests_OBJECTS = $(am_tests_OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) ../gee/libgee.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -115,6 +134,13 @@ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; +VALACOMPILE = $(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS) +LTVALACOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(VALAC) $(AM_VALAFLAGS) \ + $(VALAFLAGS) +AM_V_VALAC = $(am__v_VALAC_@AM_V@) +am__v_VALAC_ = $(am__v_VALAC_@AM_DEFAULT_V@) +am__v_VALAC_0 = @echo " VALAC " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; @@ -267,22 +293,24 @@ GTESTER = gtester GTESTER_REPORT = gtester-report # initialize variables for unconditional += appending -EXTRA_DIST = $(tests_VALASOURCES) +EXTRA_DIST = TEST_PROGS = tests -NULL = -AM_CPPFLAGS = \ - -I$(top_srcdir)/gee \ - $(GLIB_CFLAGS) \ - $(NULL) -progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la -BUILT_SOURCES = tests.vala.stamp -tests_VALASOURCES = \ +# useful constants +NULL = +tests_SOURCES = \ testarraylist.vala \ + testarrayqueue.vala \ + testbidirlist.vala \ + testbidirsortedset.vala \ + testbidirsortedmap.vala \ testcase.vala \ testcollection.vala \ - testcomparable.vala \ + testconcurrentlist.vala \ + testconcurrentset.vala \ + testdata.vala \ testdeque.vala \ + testfunctions.vala \ testhashmap.vala \ testhashmultimap.vala \ testhashmultiset.vala \ @@ -296,28 +324,41 @@ tests_VALASOURCES = \ testmultiset.vala \ testpriorityqueue.vala \ testqueue.vala \ + testreadonlybidirlist.vala \ testreadonlycollection.vala \ testreadonlylist.vala \ testreadonlymap.vala \ testreadonlyset.vala \ testset.vala \ testsortedset.vala \ + testsortedmap.vala \ testtreemap.vala \ testtreemultimap.vala \ testtreemultiset.vala \ testtreeset.vala \ $(NULL) -tests_DEPENDENCIES = $(top_srcdir)/gee/gee-1.0.vapi -tests_SOURCES = tests.vala.stamp $(tests_VALASOURCES:.vala=.c) -tests_LDADD = $(progs_ldadd) -MAINTAINERCLEANFILES = \ - $(tests_VALASOURCES:.vala=.c) \ - tests.vala.stamp \ +tests_DEPENDENCIES = \ + $(top_srcdir)/gee/gee-0.8.vapi \ + $(NULL) + +tests_VALAFLAGS = \ + --basedir $(top_srcdir) \ + --vapidir $(top_srcdir)/gee \ + --pkg gee-0.8 --pkg posix \ + $(VALAFLAGS) \ + $(NULL) + +tests_CPPFLAGS = \ + -I$(top_srcdir)/gee \ + $(GLIB_CFLAGS) \ + $(NULL) + +tests_LDADD = \ + $(GLIB_LIBS) ../gee/libgee-0.8.la \ $(NULL) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -371,34 +412,43 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testarraylist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcase.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcollection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcomparable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdeque.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhashmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhashmultimap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhashmultiset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhashset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlinkedlist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlinkedlistasdeque.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmain.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmultimap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmultiset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpriorityqueue.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testqueue.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreadonlycollection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreadonlylist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreadonlymap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreadonlyset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsortedset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtreemap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtreemultimap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtreemultiset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtreeset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testarraylist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testarrayqueue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testbidirlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testbidirsortedmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testbidirsortedset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testcase.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testcollection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testconcurrentlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testconcurrentset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testdata.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testdeque.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testfunctions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testhashmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testhashmultimap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testhashmultiset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testhashset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testlinkedlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testlinkedlistasdeque.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testmain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testmultimap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testmultiset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testpriorityqueue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testqueue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testreadonlybidirlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testreadonlycollection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testreadonlylist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testreadonlymap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testreadonlyset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testsortedmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testsortedset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testtreemap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testtreemultimap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testtreemultiset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests-testtreeset.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -421,6 +471,713 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +tests-testarraylist.o: testarraylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testarraylist.o -MD -MP -MF $(DEPDIR)/tests-testarraylist.Tpo -c -o tests-testarraylist.o `test -f 'testarraylist.c' || echo '$(srcdir)/'`testarraylist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testarraylist.Tpo $(DEPDIR)/tests-testarraylist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testarraylist.c' object='tests-testarraylist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testarraylist.o `test -f 'testarraylist.c' || echo '$(srcdir)/'`testarraylist.c + +tests-testarraylist.obj: testarraylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testarraylist.obj -MD -MP -MF $(DEPDIR)/tests-testarraylist.Tpo -c -o tests-testarraylist.obj `if test -f 'testarraylist.c'; then $(CYGPATH_W) 'testarraylist.c'; else $(CYGPATH_W) '$(srcdir)/testarraylist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testarraylist.Tpo $(DEPDIR)/tests-testarraylist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testarraylist.c' object='tests-testarraylist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testarraylist.obj `if test -f 'testarraylist.c'; then $(CYGPATH_W) 'testarraylist.c'; else $(CYGPATH_W) '$(srcdir)/testarraylist.c'; fi` + +tests-testarrayqueue.o: testarrayqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testarrayqueue.o -MD -MP -MF $(DEPDIR)/tests-testarrayqueue.Tpo -c -o tests-testarrayqueue.o `test -f 'testarrayqueue.c' || echo '$(srcdir)/'`testarrayqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testarrayqueue.Tpo $(DEPDIR)/tests-testarrayqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testarrayqueue.c' object='tests-testarrayqueue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testarrayqueue.o `test -f 'testarrayqueue.c' || echo '$(srcdir)/'`testarrayqueue.c + +tests-testarrayqueue.obj: testarrayqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testarrayqueue.obj -MD -MP -MF $(DEPDIR)/tests-testarrayqueue.Tpo -c -o tests-testarrayqueue.obj `if test -f 'testarrayqueue.c'; then $(CYGPATH_W) 'testarrayqueue.c'; else $(CYGPATH_W) '$(srcdir)/testarrayqueue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testarrayqueue.Tpo $(DEPDIR)/tests-testarrayqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testarrayqueue.c' object='tests-testarrayqueue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testarrayqueue.obj `if test -f 'testarrayqueue.c'; then $(CYGPATH_W) 'testarrayqueue.c'; else $(CYGPATH_W) '$(srcdir)/testarrayqueue.c'; fi` + +tests-testbidirlist.o: testbidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirlist.o -MD -MP -MF $(DEPDIR)/tests-testbidirlist.Tpo -c -o tests-testbidirlist.o `test -f 'testbidirlist.c' || echo '$(srcdir)/'`testbidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirlist.Tpo $(DEPDIR)/tests-testbidirlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirlist.c' object='tests-testbidirlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirlist.o `test -f 'testbidirlist.c' || echo '$(srcdir)/'`testbidirlist.c + +tests-testbidirlist.obj: testbidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirlist.obj -MD -MP -MF $(DEPDIR)/tests-testbidirlist.Tpo -c -o tests-testbidirlist.obj `if test -f 'testbidirlist.c'; then $(CYGPATH_W) 'testbidirlist.c'; else $(CYGPATH_W) '$(srcdir)/testbidirlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirlist.Tpo $(DEPDIR)/tests-testbidirlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirlist.c' object='tests-testbidirlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirlist.obj `if test -f 'testbidirlist.c'; then $(CYGPATH_W) 'testbidirlist.c'; else $(CYGPATH_W) '$(srcdir)/testbidirlist.c'; fi` + +tests-testbidirsortedset.o: testbidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirsortedset.o -MD -MP -MF $(DEPDIR)/tests-testbidirsortedset.Tpo -c -o tests-testbidirsortedset.o `test -f 'testbidirsortedset.c' || echo '$(srcdir)/'`testbidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirsortedset.Tpo $(DEPDIR)/tests-testbidirsortedset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirsortedset.c' object='tests-testbidirsortedset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirsortedset.o `test -f 'testbidirsortedset.c' || echo '$(srcdir)/'`testbidirsortedset.c + +tests-testbidirsortedset.obj: testbidirsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirsortedset.obj -MD -MP -MF $(DEPDIR)/tests-testbidirsortedset.Tpo -c -o tests-testbidirsortedset.obj `if test -f 'testbidirsortedset.c'; then $(CYGPATH_W) 'testbidirsortedset.c'; else $(CYGPATH_W) '$(srcdir)/testbidirsortedset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirsortedset.Tpo $(DEPDIR)/tests-testbidirsortedset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirsortedset.c' object='tests-testbidirsortedset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirsortedset.obj `if test -f 'testbidirsortedset.c'; then $(CYGPATH_W) 'testbidirsortedset.c'; else $(CYGPATH_W) '$(srcdir)/testbidirsortedset.c'; fi` + +tests-testbidirsortedmap.o: testbidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirsortedmap.o -MD -MP -MF $(DEPDIR)/tests-testbidirsortedmap.Tpo -c -o tests-testbidirsortedmap.o `test -f 'testbidirsortedmap.c' || echo '$(srcdir)/'`testbidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirsortedmap.Tpo $(DEPDIR)/tests-testbidirsortedmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirsortedmap.c' object='tests-testbidirsortedmap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirsortedmap.o `test -f 'testbidirsortedmap.c' || echo '$(srcdir)/'`testbidirsortedmap.c + +tests-testbidirsortedmap.obj: testbidirsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testbidirsortedmap.obj -MD -MP -MF $(DEPDIR)/tests-testbidirsortedmap.Tpo -c -o tests-testbidirsortedmap.obj `if test -f 'testbidirsortedmap.c'; then $(CYGPATH_W) 'testbidirsortedmap.c'; else $(CYGPATH_W) '$(srcdir)/testbidirsortedmap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testbidirsortedmap.Tpo $(DEPDIR)/tests-testbidirsortedmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testbidirsortedmap.c' object='tests-testbidirsortedmap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testbidirsortedmap.obj `if test -f 'testbidirsortedmap.c'; then $(CYGPATH_W) 'testbidirsortedmap.c'; else $(CYGPATH_W) '$(srcdir)/testbidirsortedmap.c'; fi` + +tests-testcase.o: testcase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testcase.o -MD -MP -MF $(DEPDIR)/tests-testcase.Tpo -c -o tests-testcase.o `test -f 'testcase.c' || echo '$(srcdir)/'`testcase.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testcase.Tpo $(DEPDIR)/tests-testcase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcase.c' object='tests-testcase.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testcase.o `test -f 'testcase.c' || echo '$(srcdir)/'`testcase.c + +tests-testcase.obj: testcase.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testcase.obj -MD -MP -MF $(DEPDIR)/tests-testcase.Tpo -c -o tests-testcase.obj `if test -f 'testcase.c'; then $(CYGPATH_W) 'testcase.c'; else $(CYGPATH_W) '$(srcdir)/testcase.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testcase.Tpo $(DEPDIR)/tests-testcase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcase.c' object='tests-testcase.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testcase.obj `if test -f 'testcase.c'; then $(CYGPATH_W) 'testcase.c'; else $(CYGPATH_W) '$(srcdir)/testcase.c'; fi` + +tests-testcollection.o: testcollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testcollection.o -MD -MP -MF $(DEPDIR)/tests-testcollection.Tpo -c -o tests-testcollection.o `test -f 'testcollection.c' || echo '$(srcdir)/'`testcollection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testcollection.Tpo $(DEPDIR)/tests-testcollection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcollection.c' object='tests-testcollection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testcollection.o `test -f 'testcollection.c' || echo '$(srcdir)/'`testcollection.c + +tests-testcollection.obj: testcollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testcollection.obj -MD -MP -MF $(DEPDIR)/tests-testcollection.Tpo -c -o tests-testcollection.obj `if test -f 'testcollection.c'; then $(CYGPATH_W) 'testcollection.c'; else $(CYGPATH_W) '$(srcdir)/testcollection.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testcollection.Tpo $(DEPDIR)/tests-testcollection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcollection.c' object='tests-testcollection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testcollection.obj `if test -f 'testcollection.c'; then $(CYGPATH_W) 'testcollection.c'; else $(CYGPATH_W) '$(srcdir)/testcollection.c'; fi` + +tests-testconcurrentlist.o: testconcurrentlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testconcurrentlist.o -MD -MP -MF $(DEPDIR)/tests-testconcurrentlist.Tpo -c -o tests-testconcurrentlist.o `test -f 'testconcurrentlist.c' || echo '$(srcdir)/'`testconcurrentlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testconcurrentlist.Tpo $(DEPDIR)/tests-testconcurrentlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testconcurrentlist.c' object='tests-testconcurrentlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testconcurrentlist.o `test -f 'testconcurrentlist.c' || echo '$(srcdir)/'`testconcurrentlist.c + +tests-testconcurrentlist.obj: testconcurrentlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testconcurrentlist.obj -MD -MP -MF $(DEPDIR)/tests-testconcurrentlist.Tpo -c -o tests-testconcurrentlist.obj `if test -f 'testconcurrentlist.c'; then $(CYGPATH_W) 'testconcurrentlist.c'; else $(CYGPATH_W) '$(srcdir)/testconcurrentlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testconcurrentlist.Tpo $(DEPDIR)/tests-testconcurrentlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testconcurrentlist.c' object='tests-testconcurrentlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testconcurrentlist.obj `if test -f 'testconcurrentlist.c'; then $(CYGPATH_W) 'testconcurrentlist.c'; else $(CYGPATH_W) '$(srcdir)/testconcurrentlist.c'; fi` + +tests-testconcurrentset.o: testconcurrentset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testconcurrentset.o -MD -MP -MF $(DEPDIR)/tests-testconcurrentset.Tpo -c -o tests-testconcurrentset.o `test -f 'testconcurrentset.c' || echo '$(srcdir)/'`testconcurrentset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testconcurrentset.Tpo $(DEPDIR)/tests-testconcurrentset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testconcurrentset.c' object='tests-testconcurrentset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testconcurrentset.o `test -f 'testconcurrentset.c' || echo '$(srcdir)/'`testconcurrentset.c + +tests-testconcurrentset.obj: testconcurrentset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testconcurrentset.obj -MD -MP -MF $(DEPDIR)/tests-testconcurrentset.Tpo -c -o tests-testconcurrentset.obj `if test -f 'testconcurrentset.c'; then $(CYGPATH_W) 'testconcurrentset.c'; else $(CYGPATH_W) '$(srcdir)/testconcurrentset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testconcurrentset.Tpo $(DEPDIR)/tests-testconcurrentset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testconcurrentset.c' object='tests-testconcurrentset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testconcurrentset.obj `if test -f 'testconcurrentset.c'; then $(CYGPATH_W) 'testconcurrentset.c'; else $(CYGPATH_W) '$(srcdir)/testconcurrentset.c'; fi` + +tests-testdata.o: testdata.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testdata.o -MD -MP -MF $(DEPDIR)/tests-testdata.Tpo -c -o tests-testdata.o `test -f 'testdata.c' || echo '$(srcdir)/'`testdata.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testdata.Tpo $(DEPDIR)/tests-testdata.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdata.c' object='tests-testdata.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testdata.o `test -f 'testdata.c' || echo '$(srcdir)/'`testdata.c + +tests-testdata.obj: testdata.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testdata.obj -MD -MP -MF $(DEPDIR)/tests-testdata.Tpo -c -o tests-testdata.obj `if test -f 'testdata.c'; then $(CYGPATH_W) 'testdata.c'; else $(CYGPATH_W) '$(srcdir)/testdata.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testdata.Tpo $(DEPDIR)/tests-testdata.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdata.c' object='tests-testdata.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testdata.obj `if test -f 'testdata.c'; then $(CYGPATH_W) 'testdata.c'; else $(CYGPATH_W) '$(srcdir)/testdata.c'; fi` + +tests-testdeque.o: testdeque.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testdeque.o -MD -MP -MF $(DEPDIR)/tests-testdeque.Tpo -c -o tests-testdeque.o `test -f 'testdeque.c' || echo '$(srcdir)/'`testdeque.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testdeque.Tpo $(DEPDIR)/tests-testdeque.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdeque.c' object='tests-testdeque.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testdeque.o `test -f 'testdeque.c' || echo '$(srcdir)/'`testdeque.c + +tests-testdeque.obj: testdeque.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testdeque.obj -MD -MP -MF $(DEPDIR)/tests-testdeque.Tpo -c -o tests-testdeque.obj `if test -f 'testdeque.c'; then $(CYGPATH_W) 'testdeque.c'; else $(CYGPATH_W) '$(srcdir)/testdeque.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testdeque.Tpo $(DEPDIR)/tests-testdeque.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdeque.c' object='tests-testdeque.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testdeque.obj `if test -f 'testdeque.c'; then $(CYGPATH_W) 'testdeque.c'; else $(CYGPATH_W) '$(srcdir)/testdeque.c'; fi` + +tests-testfunctions.o: testfunctions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testfunctions.o -MD -MP -MF $(DEPDIR)/tests-testfunctions.Tpo -c -o tests-testfunctions.o `test -f 'testfunctions.c' || echo '$(srcdir)/'`testfunctions.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testfunctions.Tpo $(DEPDIR)/tests-testfunctions.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testfunctions.c' object='tests-testfunctions.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testfunctions.o `test -f 'testfunctions.c' || echo '$(srcdir)/'`testfunctions.c + +tests-testfunctions.obj: testfunctions.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testfunctions.obj -MD -MP -MF $(DEPDIR)/tests-testfunctions.Tpo -c -o tests-testfunctions.obj `if test -f 'testfunctions.c'; then $(CYGPATH_W) 'testfunctions.c'; else $(CYGPATH_W) '$(srcdir)/testfunctions.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testfunctions.Tpo $(DEPDIR)/tests-testfunctions.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testfunctions.c' object='tests-testfunctions.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testfunctions.obj `if test -f 'testfunctions.c'; then $(CYGPATH_W) 'testfunctions.c'; else $(CYGPATH_W) '$(srcdir)/testfunctions.c'; fi` + +tests-testhashmap.o: testhashmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmap.o -MD -MP -MF $(DEPDIR)/tests-testhashmap.Tpo -c -o tests-testhashmap.o `test -f 'testhashmap.c' || echo '$(srcdir)/'`testhashmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmap.Tpo $(DEPDIR)/tests-testhashmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmap.c' object='tests-testhashmap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmap.o `test -f 'testhashmap.c' || echo '$(srcdir)/'`testhashmap.c + +tests-testhashmap.obj: testhashmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmap.obj -MD -MP -MF $(DEPDIR)/tests-testhashmap.Tpo -c -o tests-testhashmap.obj `if test -f 'testhashmap.c'; then $(CYGPATH_W) 'testhashmap.c'; else $(CYGPATH_W) '$(srcdir)/testhashmap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmap.Tpo $(DEPDIR)/tests-testhashmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmap.c' object='tests-testhashmap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmap.obj `if test -f 'testhashmap.c'; then $(CYGPATH_W) 'testhashmap.c'; else $(CYGPATH_W) '$(srcdir)/testhashmap.c'; fi` + +tests-testhashmultimap.o: testhashmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmultimap.o -MD -MP -MF $(DEPDIR)/tests-testhashmultimap.Tpo -c -o tests-testhashmultimap.o `test -f 'testhashmultimap.c' || echo '$(srcdir)/'`testhashmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmultimap.Tpo $(DEPDIR)/tests-testhashmultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmultimap.c' object='tests-testhashmultimap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmultimap.o `test -f 'testhashmultimap.c' || echo '$(srcdir)/'`testhashmultimap.c + +tests-testhashmultimap.obj: testhashmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmultimap.obj -MD -MP -MF $(DEPDIR)/tests-testhashmultimap.Tpo -c -o tests-testhashmultimap.obj `if test -f 'testhashmultimap.c'; then $(CYGPATH_W) 'testhashmultimap.c'; else $(CYGPATH_W) '$(srcdir)/testhashmultimap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmultimap.Tpo $(DEPDIR)/tests-testhashmultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmultimap.c' object='tests-testhashmultimap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmultimap.obj `if test -f 'testhashmultimap.c'; then $(CYGPATH_W) 'testhashmultimap.c'; else $(CYGPATH_W) '$(srcdir)/testhashmultimap.c'; fi` + +tests-testhashmultiset.o: testhashmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmultiset.o -MD -MP -MF $(DEPDIR)/tests-testhashmultiset.Tpo -c -o tests-testhashmultiset.o `test -f 'testhashmultiset.c' || echo '$(srcdir)/'`testhashmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmultiset.Tpo $(DEPDIR)/tests-testhashmultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmultiset.c' object='tests-testhashmultiset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmultiset.o `test -f 'testhashmultiset.c' || echo '$(srcdir)/'`testhashmultiset.c + +tests-testhashmultiset.obj: testhashmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashmultiset.obj -MD -MP -MF $(DEPDIR)/tests-testhashmultiset.Tpo -c -o tests-testhashmultiset.obj `if test -f 'testhashmultiset.c'; then $(CYGPATH_W) 'testhashmultiset.c'; else $(CYGPATH_W) '$(srcdir)/testhashmultiset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashmultiset.Tpo $(DEPDIR)/tests-testhashmultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashmultiset.c' object='tests-testhashmultiset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashmultiset.obj `if test -f 'testhashmultiset.c'; then $(CYGPATH_W) 'testhashmultiset.c'; else $(CYGPATH_W) '$(srcdir)/testhashmultiset.c'; fi` + +tests-testhashset.o: testhashset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashset.o -MD -MP -MF $(DEPDIR)/tests-testhashset.Tpo -c -o tests-testhashset.o `test -f 'testhashset.c' || echo '$(srcdir)/'`testhashset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashset.Tpo $(DEPDIR)/tests-testhashset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashset.c' object='tests-testhashset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashset.o `test -f 'testhashset.c' || echo '$(srcdir)/'`testhashset.c + +tests-testhashset.obj: testhashset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testhashset.obj -MD -MP -MF $(DEPDIR)/tests-testhashset.Tpo -c -o tests-testhashset.obj `if test -f 'testhashset.c'; then $(CYGPATH_W) 'testhashset.c'; else $(CYGPATH_W) '$(srcdir)/testhashset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testhashset.Tpo $(DEPDIR)/tests-testhashset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testhashset.c' object='tests-testhashset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testhashset.obj `if test -f 'testhashset.c'; then $(CYGPATH_W) 'testhashset.c'; else $(CYGPATH_W) '$(srcdir)/testhashset.c'; fi` + +tests-testlinkedlist.o: testlinkedlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlinkedlist.o -MD -MP -MF $(DEPDIR)/tests-testlinkedlist.Tpo -c -o tests-testlinkedlist.o `test -f 'testlinkedlist.c' || echo '$(srcdir)/'`testlinkedlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlinkedlist.Tpo $(DEPDIR)/tests-testlinkedlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinkedlist.c' object='tests-testlinkedlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlinkedlist.o `test -f 'testlinkedlist.c' || echo '$(srcdir)/'`testlinkedlist.c + +tests-testlinkedlist.obj: testlinkedlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlinkedlist.obj -MD -MP -MF $(DEPDIR)/tests-testlinkedlist.Tpo -c -o tests-testlinkedlist.obj `if test -f 'testlinkedlist.c'; then $(CYGPATH_W) 'testlinkedlist.c'; else $(CYGPATH_W) '$(srcdir)/testlinkedlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlinkedlist.Tpo $(DEPDIR)/tests-testlinkedlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinkedlist.c' object='tests-testlinkedlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlinkedlist.obj `if test -f 'testlinkedlist.c'; then $(CYGPATH_W) 'testlinkedlist.c'; else $(CYGPATH_W) '$(srcdir)/testlinkedlist.c'; fi` + +tests-testlinkedlistasdeque.o: testlinkedlistasdeque.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlinkedlistasdeque.o -MD -MP -MF $(DEPDIR)/tests-testlinkedlistasdeque.Tpo -c -o tests-testlinkedlistasdeque.o `test -f 'testlinkedlistasdeque.c' || echo '$(srcdir)/'`testlinkedlistasdeque.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlinkedlistasdeque.Tpo $(DEPDIR)/tests-testlinkedlistasdeque.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinkedlistasdeque.c' object='tests-testlinkedlistasdeque.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlinkedlistasdeque.o `test -f 'testlinkedlistasdeque.c' || echo '$(srcdir)/'`testlinkedlistasdeque.c + +tests-testlinkedlistasdeque.obj: testlinkedlistasdeque.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlinkedlistasdeque.obj -MD -MP -MF $(DEPDIR)/tests-testlinkedlistasdeque.Tpo -c -o tests-testlinkedlistasdeque.obj `if test -f 'testlinkedlistasdeque.c'; then $(CYGPATH_W) 'testlinkedlistasdeque.c'; else $(CYGPATH_W) '$(srcdir)/testlinkedlistasdeque.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlinkedlistasdeque.Tpo $(DEPDIR)/tests-testlinkedlistasdeque.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinkedlistasdeque.c' object='tests-testlinkedlistasdeque.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlinkedlistasdeque.obj `if test -f 'testlinkedlistasdeque.c'; then $(CYGPATH_W) 'testlinkedlistasdeque.c'; else $(CYGPATH_W) '$(srcdir)/testlinkedlistasdeque.c'; fi` + +tests-testlist.o: testlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlist.o -MD -MP -MF $(DEPDIR)/tests-testlist.Tpo -c -o tests-testlist.o `test -f 'testlist.c' || echo '$(srcdir)/'`testlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlist.Tpo $(DEPDIR)/tests-testlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlist.c' object='tests-testlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlist.o `test -f 'testlist.c' || echo '$(srcdir)/'`testlist.c + +tests-testlist.obj: testlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testlist.obj -MD -MP -MF $(DEPDIR)/tests-testlist.Tpo -c -o tests-testlist.obj `if test -f 'testlist.c'; then $(CYGPATH_W) 'testlist.c'; else $(CYGPATH_W) '$(srcdir)/testlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testlist.Tpo $(DEPDIR)/tests-testlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlist.c' object='tests-testlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testlist.obj `if test -f 'testlist.c'; then $(CYGPATH_W) 'testlist.c'; else $(CYGPATH_W) '$(srcdir)/testlist.c'; fi` + +tests-testmain.o: testmain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmain.o -MD -MP -MF $(DEPDIR)/tests-testmain.Tpo -c -o tests-testmain.o `test -f 'testmain.c' || echo '$(srcdir)/'`testmain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmain.Tpo $(DEPDIR)/tests-testmain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmain.c' object='tests-testmain.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmain.o `test -f 'testmain.c' || echo '$(srcdir)/'`testmain.c + +tests-testmain.obj: testmain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmain.obj -MD -MP -MF $(DEPDIR)/tests-testmain.Tpo -c -o tests-testmain.obj `if test -f 'testmain.c'; then $(CYGPATH_W) 'testmain.c'; else $(CYGPATH_W) '$(srcdir)/testmain.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmain.Tpo $(DEPDIR)/tests-testmain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmain.c' object='tests-testmain.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmain.obj `if test -f 'testmain.c'; then $(CYGPATH_W) 'testmain.c'; else $(CYGPATH_W) '$(srcdir)/testmain.c'; fi` + +tests-testmap.o: testmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmap.o -MD -MP -MF $(DEPDIR)/tests-testmap.Tpo -c -o tests-testmap.o `test -f 'testmap.c' || echo '$(srcdir)/'`testmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmap.Tpo $(DEPDIR)/tests-testmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmap.c' object='tests-testmap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmap.o `test -f 'testmap.c' || echo '$(srcdir)/'`testmap.c + +tests-testmap.obj: testmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmap.obj -MD -MP -MF $(DEPDIR)/tests-testmap.Tpo -c -o tests-testmap.obj `if test -f 'testmap.c'; then $(CYGPATH_W) 'testmap.c'; else $(CYGPATH_W) '$(srcdir)/testmap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmap.Tpo $(DEPDIR)/tests-testmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmap.c' object='tests-testmap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmap.obj `if test -f 'testmap.c'; then $(CYGPATH_W) 'testmap.c'; else $(CYGPATH_W) '$(srcdir)/testmap.c'; fi` + +tests-testmultimap.o: testmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmultimap.o -MD -MP -MF $(DEPDIR)/tests-testmultimap.Tpo -c -o tests-testmultimap.o `test -f 'testmultimap.c' || echo '$(srcdir)/'`testmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmultimap.Tpo $(DEPDIR)/tests-testmultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmultimap.c' object='tests-testmultimap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmultimap.o `test -f 'testmultimap.c' || echo '$(srcdir)/'`testmultimap.c + +tests-testmultimap.obj: testmultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmultimap.obj -MD -MP -MF $(DEPDIR)/tests-testmultimap.Tpo -c -o tests-testmultimap.obj `if test -f 'testmultimap.c'; then $(CYGPATH_W) 'testmultimap.c'; else $(CYGPATH_W) '$(srcdir)/testmultimap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmultimap.Tpo $(DEPDIR)/tests-testmultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmultimap.c' object='tests-testmultimap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmultimap.obj `if test -f 'testmultimap.c'; then $(CYGPATH_W) 'testmultimap.c'; else $(CYGPATH_W) '$(srcdir)/testmultimap.c'; fi` + +tests-testmultiset.o: testmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmultiset.o -MD -MP -MF $(DEPDIR)/tests-testmultiset.Tpo -c -o tests-testmultiset.o `test -f 'testmultiset.c' || echo '$(srcdir)/'`testmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmultiset.Tpo $(DEPDIR)/tests-testmultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmultiset.c' object='tests-testmultiset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmultiset.o `test -f 'testmultiset.c' || echo '$(srcdir)/'`testmultiset.c + +tests-testmultiset.obj: testmultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testmultiset.obj -MD -MP -MF $(DEPDIR)/tests-testmultiset.Tpo -c -o tests-testmultiset.obj `if test -f 'testmultiset.c'; then $(CYGPATH_W) 'testmultiset.c'; else $(CYGPATH_W) '$(srcdir)/testmultiset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testmultiset.Tpo $(DEPDIR)/tests-testmultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmultiset.c' object='tests-testmultiset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testmultiset.obj `if test -f 'testmultiset.c'; then $(CYGPATH_W) 'testmultiset.c'; else $(CYGPATH_W) '$(srcdir)/testmultiset.c'; fi` + +tests-testpriorityqueue.o: testpriorityqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testpriorityqueue.o -MD -MP -MF $(DEPDIR)/tests-testpriorityqueue.Tpo -c -o tests-testpriorityqueue.o `test -f 'testpriorityqueue.c' || echo '$(srcdir)/'`testpriorityqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testpriorityqueue.Tpo $(DEPDIR)/tests-testpriorityqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testpriorityqueue.c' object='tests-testpriorityqueue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testpriorityqueue.o `test -f 'testpriorityqueue.c' || echo '$(srcdir)/'`testpriorityqueue.c + +tests-testpriorityqueue.obj: testpriorityqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testpriorityqueue.obj -MD -MP -MF $(DEPDIR)/tests-testpriorityqueue.Tpo -c -o tests-testpriorityqueue.obj `if test -f 'testpriorityqueue.c'; then $(CYGPATH_W) 'testpriorityqueue.c'; else $(CYGPATH_W) '$(srcdir)/testpriorityqueue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testpriorityqueue.Tpo $(DEPDIR)/tests-testpriorityqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testpriorityqueue.c' object='tests-testpriorityqueue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testpriorityqueue.obj `if test -f 'testpriorityqueue.c'; then $(CYGPATH_W) 'testpriorityqueue.c'; else $(CYGPATH_W) '$(srcdir)/testpriorityqueue.c'; fi` + +tests-testqueue.o: testqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testqueue.o -MD -MP -MF $(DEPDIR)/tests-testqueue.Tpo -c -o tests-testqueue.o `test -f 'testqueue.c' || echo '$(srcdir)/'`testqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testqueue.Tpo $(DEPDIR)/tests-testqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testqueue.c' object='tests-testqueue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testqueue.o `test -f 'testqueue.c' || echo '$(srcdir)/'`testqueue.c + +tests-testqueue.obj: testqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testqueue.obj -MD -MP -MF $(DEPDIR)/tests-testqueue.Tpo -c -o tests-testqueue.obj `if test -f 'testqueue.c'; then $(CYGPATH_W) 'testqueue.c'; else $(CYGPATH_W) '$(srcdir)/testqueue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testqueue.Tpo $(DEPDIR)/tests-testqueue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testqueue.c' object='tests-testqueue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testqueue.obj `if test -f 'testqueue.c'; then $(CYGPATH_W) 'testqueue.c'; else $(CYGPATH_W) '$(srcdir)/testqueue.c'; fi` + +tests-testreadonlybidirlist.o: testreadonlybidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlybidirlist.o -MD -MP -MF $(DEPDIR)/tests-testreadonlybidirlist.Tpo -c -o tests-testreadonlybidirlist.o `test -f 'testreadonlybidirlist.c' || echo '$(srcdir)/'`testreadonlybidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlybidirlist.Tpo $(DEPDIR)/tests-testreadonlybidirlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlybidirlist.c' object='tests-testreadonlybidirlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlybidirlist.o `test -f 'testreadonlybidirlist.c' || echo '$(srcdir)/'`testreadonlybidirlist.c + +tests-testreadonlybidirlist.obj: testreadonlybidirlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlybidirlist.obj -MD -MP -MF $(DEPDIR)/tests-testreadonlybidirlist.Tpo -c -o tests-testreadonlybidirlist.obj `if test -f 'testreadonlybidirlist.c'; then $(CYGPATH_W) 'testreadonlybidirlist.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlybidirlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlybidirlist.Tpo $(DEPDIR)/tests-testreadonlybidirlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlybidirlist.c' object='tests-testreadonlybidirlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlybidirlist.obj `if test -f 'testreadonlybidirlist.c'; then $(CYGPATH_W) 'testreadonlybidirlist.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlybidirlist.c'; fi` + +tests-testreadonlycollection.o: testreadonlycollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlycollection.o -MD -MP -MF $(DEPDIR)/tests-testreadonlycollection.Tpo -c -o tests-testreadonlycollection.o `test -f 'testreadonlycollection.c' || echo '$(srcdir)/'`testreadonlycollection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlycollection.Tpo $(DEPDIR)/tests-testreadonlycollection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlycollection.c' object='tests-testreadonlycollection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlycollection.o `test -f 'testreadonlycollection.c' || echo '$(srcdir)/'`testreadonlycollection.c + +tests-testreadonlycollection.obj: testreadonlycollection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlycollection.obj -MD -MP -MF $(DEPDIR)/tests-testreadonlycollection.Tpo -c -o tests-testreadonlycollection.obj `if test -f 'testreadonlycollection.c'; then $(CYGPATH_W) 'testreadonlycollection.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlycollection.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlycollection.Tpo $(DEPDIR)/tests-testreadonlycollection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlycollection.c' object='tests-testreadonlycollection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlycollection.obj `if test -f 'testreadonlycollection.c'; then $(CYGPATH_W) 'testreadonlycollection.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlycollection.c'; fi` + +tests-testreadonlylist.o: testreadonlylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlylist.o -MD -MP -MF $(DEPDIR)/tests-testreadonlylist.Tpo -c -o tests-testreadonlylist.o `test -f 'testreadonlylist.c' || echo '$(srcdir)/'`testreadonlylist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlylist.Tpo $(DEPDIR)/tests-testreadonlylist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlylist.c' object='tests-testreadonlylist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlylist.o `test -f 'testreadonlylist.c' || echo '$(srcdir)/'`testreadonlylist.c + +tests-testreadonlylist.obj: testreadonlylist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlylist.obj -MD -MP -MF $(DEPDIR)/tests-testreadonlylist.Tpo -c -o tests-testreadonlylist.obj `if test -f 'testreadonlylist.c'; then $(CYGPATH_W) 'testreadonlylist.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlylist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlylist.Tpo $(DEPDIR)/tests-testreadonlylist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlylist.c' object='tests-testreadonlylist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlylist.obj `if test -f 'testreadonlylist.c'; then $(CYGPATH_W) 'testreadonlylist.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlylist.c'; fi` + +tests-testreadonlymap.o: testreadonlymap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlymap.o -MD -MP -MF $(DEPDIR)/tests-testreadonlymap.Tpo -c -o tests-testreadonlymap.o `test -f 'testreadonlymap.c' || echo '$(srcdir)/'`testreadonlymap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlymap.Tpo $(DEPDIR)/tests-testreadonlymap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlymap.c' object='tests-testreadonlymap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlymap.o `test -f 'testreadonlymap.c' || echo '$(srcdir)/'`testreadonlymap.c + +tests-testreadonlymap.obj: testreadonlymap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlymap.obj -MD -MP -MF $(DEPDIR)/tests-testreadonlymap.Tpo -c -o tests-testreadonlymap.obj `if test -f 'testreadonlymap.c'; then $(CYGPATH_W) 'testreadonlymap.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlymap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlymap.Tpo $(DEPDIR)/tests-testreadonlymap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlymap.c' object='tests-testreadonlymap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlymap.obj `if test -f 'testreadonlymap.c'; then $(CYGPATH_W) 'testreadonlymap.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlymap.c'; fi` + +tests-testreadonlyset.o: testreadonlyset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlyset.o -MD -MP -MF $(DEPDIR)/tests-testreadonlyset.Tpo -c -o tests-testreadonlyset.o `test -f 'testreadonlyset.c' || echo '$(srcdir)/'`testreadonlyset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlyset.Tpo $(DEPDIR)/tests-testreadonlyset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlyset.c' object='tests-testreadonlyset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlyset.o `test -f 'testreadonlyset.c' || echo '$(srcdir)/'`testreadonlyset.c + +tests-testreadonlyset.obj: testreadonlyset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testreadonlyset.obj -MD -MP -MF $(DEPDIR)/tests-testreadonlyset.Tpo -c -o tests-testreadonlyset.obj `if test -f 'testreadonlyset.c'; then $(CYGPATH_W) 'testreadonlyset.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlyset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testreadonlyset.Tpo $(DEPDIR)/tests-testreadonlyset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreadonlyset.c' object='tests-testreadonlyset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testreadonlyset.obj `if test -f 'testreadonlyset.c'; then $(CYGPATH_W) 'testreadonlyset.c'; else $(CYGPATH_W) '$(srcdir)/testreadonlyset.c'; fi` + +tests-testset.o: testset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testset.o -MD -MP -MF $(DEPDIR)/tests-testset.Tpo -c -o tests-testset.o `test -f 'testset.c' || echo '$(srcdir)/'`testset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testset.Tpo $(DEPDIR)/tests-testset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testset.c' object='tests-testset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testset.o `test -f 'testset.c' || echo '$(srcdir)/'`testset.c + +tests-testset.obj: testset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testset.obj -MD -MP -MF $(DEPDIR)/tests-testset.Tpo -c -o tests-testset.obj `if test -f 'testset.c'; then $(CYGPATH_W) 'testset.c'; else $(CYGPATH_W) '$(srcdir)/testset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testset.Tpo $(DEPDIR)/tests-testset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testset.c' object='tests-testset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testset.obj `if test -f 'testset.c'; then $(CYGPATH_W) 'testset.c'; else $(CYGPATH_W) '$(srcdir)/testset.c'; fi` + +tests-testsortedset.o: testsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testsortedset.o -MD -MP -MF $(DEPDIR)/tests-testsortedset.Tpo -c -o tests-testsortedset.o `test -f 'testsortedset.c' || echo '$(srcdir)/'`testsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testsortedset.Tpo $(DEPDIR)/tests-testsortedset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsortedset.c' object='tests-testsortedset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testsortedset.o `test -f 'testsortedset.c' || echo '$(srcdir)/'`testsortedset.c + +tests-testsortedset.obj: testsortedset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testsortedset.obj -MD -MP -MF $(DEPDIR)/tests-testsortedset.Tpo -c -o tests-testsortedset.obj `if test -f 'testsortedset.c'; then $(CYGPATH_W) 'testsortedset.c'; else $(CYGPATH_W) '$(srcdir)/testsortedset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testsortedset.Tpo $(DEPDIR)/tests-testsortedset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsortedset.c' object='tests-testsortedset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testsortedset.obj `if test -f 'testsortedset.c'; then $(CYGPATH_W) 'testsortedset.c'; else $(CYGPATH_W) '$(srcdir)/testsortedset.c'; fi` + +tests-testsortedmap.o: testsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testsortedmap.o -MD -MP -MF $(DEPDIR)/tests-testsortedmap.Tpo -c -o tests-testsortedmap.o `test -f 'testsortedmap.c' || echo '$(srcdir)/'`testsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testsortedmap.Tpo $(DEPDIR)/tests-testsortedmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsortedmap.c' object='tests-testsortedmap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testsortedmap.o `test -f 'testsortedmap.c' || echo '$(srcdir)/'`testsortedmap.c + +tests-testsortedmap.obj: testsortedmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testsortedmap.obj -MD -MP -MF $(DEPDIR)/tests-testsortedmap.Tpo -c -o tests-testsortedmap.obj `if test -f 'testsortedmap.c'; then $(CYGPATH_W) 'testsortedmap.c'; else $(CYGPATH_W) '$(srcdir)/testsortedmap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testsortedmap.Tpo $(DEPDIR)/tests-testsortedmap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsortedmap.c' object='tests-testsortedmap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testsortedmap.obj `if test -f 'testsortedmap.c'; then $(CYGPATH_W) 'testsortedmap.c'; else $(CYGPATH_W) '$(srcdir)/testsortedmap.c'; fi` + +tests-testtreemap.o: testtreemap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemap.o -MD -MP -MF $(DEPDIR)/tests-testtreemap.Tpo -c -o tests-testtreemap.o `test -f 'testtreemap.c' || echo '$(srcdir)/'`testtreemap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemap.Tpo $(DEPDIR)/tests-testtreemap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemap.c' object='tests-testtreemap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemap.o `test -f 'testtreemap.c' || echo '$(srcdir)/'`testtreemap.c + +tests-testtreemap.obj: testtreemap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemap.obj -MD -MP -MF $(DEPDIR)/tests-testtreemap.Tpo -c -o tests-testtreemap.obj `if test -f 'testtreemap.c'; then $(CYGPATH_W) 'testtreemap.c'; else $(CYGPATH_W) '$(srcdir)/testtreemap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemap.Tpo $(DEPDIR)/tests-testtreemap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemap.c' object='tests-testtreemap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemap.obj `if test -f 'testtreemap.c'; then $(CYGPATH_W) 'testtreemap.c'; else $(CYGPATH_W) '$(srcdir)/testtreemap.c'; fi` + +tests-testtreemultimap.o: testtreemultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemultimap.o -MD -MP -MF $(DEPDIR)/tests-testtreemultimap.Tpo -c -o tests-testtreemultimap.o `test -f 'testtreemultimap.c' || echo '$(srcdir)/'`testtreemultimap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemultimap.Tpo $(DEPDIR)/tests-testtreemultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemultimap.c' object='tests-testtreemultimap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemultimap.o `test -f 'testtreemultimap.c' || echo '$(srcdir)/'`testtreemultimap.c + +tests-testtreemultimap.obj: testtreemultimap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemultimap.obj -MD -MP -MF $(DEPDIR)/tests-testtreemultimap.Tpo -c -o tests-testtreemultimap.obj `if test -f 'testtreemultimap.c'; then $(CYGPATH_W) 'testtreemultimap.c'; else $(CYGPATH_W) '$(srcdir)/testtreemultimap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemultimap.Tpo $(DEPDIR)/tests-testtreemultimap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemultimap.c' object='tests-testtreemultimap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemultimap.obj `if test -f 'testtreemultimap.c'; then $(CYGPATH_W) 'testtreemultimap.c'; else $(CYGPATH_W) '$(srcdir)/testtreemultimap.c'; fi` + +tests-testtreemultiset.o: testtreemultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemultiset.o -MD -MP -MF $(DEPDIR)/tests-testtreemultiset.Tpo -c -o tests-testtreemultiset.o `test -f 'testtreemultiset.c' || echo '$(srcdir)/'`testtreemultiset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemultiset.Tpo $(DEPDIR)/tests-testtreemultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemultiset.c' object='tests-testtreemultiset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemultiset.o `test -f 'testtreemultiset.c' || echo '$(srcdir)/'`testtreemultiset.c + +tests-testtreemultiset.obj: testtreemultiset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreemultiset.obj -MD -MP -MF $(DEPDIR)/tests-testtreemultiset.Tpo -c -o tests-testtreemultiset.obj `if test -f 'testtreemultiset.c'; then $(CYGPATH_W) 'testtreemultiset.c'; else $(CYGPATH_W) '$(srcdir)/testtreemultiset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreemultiset.Tpo $(DEPDIR)/tests-testtreemultiset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreemultiset.c' object='tests-testtreemultiset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreemultiset.obj `if test -f 'testtreemultiset.c'; then $(CYGPATH_W) 'testtreemultiset.c'; else $(CYGPATH_W) '$(srcdir)/testtreemultiset.c'; fi` + +tests-testtreeset.o: testtreeset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreeset.o -MD -MP -MF $(DEPDIR)/tests-testtreeset.Tpo -c -o tests-testtreeset.o `test -f 'testtreeset.c' || echo '$(srcdir)/'`testtreeset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreeset.Tpo $(DEPDIR)/tests-testtreeset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreeset.c' object='tests-testtreeset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreeset.o `test -f 'testtreeset.c' || echo '$(srcdir)/'`testtreeset.c + +tests-testtreeset.obj: testtreeset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests-testtreeset.obj -MD -MP -MF $(DEPDIR)/tests-testtreeset.Tpo -c -o tests-testtreeset.obj `if test -f 'testtreeset.c'; then $(CYGPATH_W) 'testtreeset.c'; else $(CYGPATH_W) '$(srcdir)/testtreeset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests-testtreeset.Tpo $(DEPDIR)/tests-testtreeset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testtreeset.c' object='tests-testtreeset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests-testtreeset.obj `if test -f 'testtreeset.c'; then $(CYGPATH_W) 'testtreeset.c'; else $(CYGPATH_W) '$(srcdir)/testtreeset.c'; fi` +$(srcdir)/testarraylist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testarrayqueue.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testbidirlist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testbidirsortedset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testbidirsortedmap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testcase.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testcollection.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testconcurrentlist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testconcurrentset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testdata.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testdeque.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testfunctions.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testhashmap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testhashmultimap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testhashmultiset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testhashset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testlinkedlist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testlinkedlistasdeque.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testlist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testmain.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testmap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testmultimap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testmultiset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testpriorityqueue.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testqueue.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testreadonlybidirlist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testreadonlycollection.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testreadonlylist.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testreadonlymap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testreadonlyset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testsortedset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testsortedmap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testtreemap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testtreemultimap.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testtreemultiset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/testtreeset.c: $(srcdir)/tests_vala.stamp + @if test -f $@; then :; else rm -f $(srcdir)/tests_vala.stamp; fi + @if test -f $@; then :; else \ + $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/tests_vala.stamp; \ + fi +$(srcdir)/tests_vala.stamp: testarraylist.vala testarrayqueue.vala testbidirlist.vala testbidirsortedset.vala testbidirsortedmap.vala testcase.vala testcollection.vala testconcurrentlist.vala testconcurrentset.vala testdata.vala testdeque.vala testfunctions.vala testhashmap.vala testhashmultimap.vala testhashmultiset.vala testhashset.vala testlinkedlist.vala testlinkedlistasdeque.vala testlist.vala testmain.vala testmap.vala testmultimap.vala testmultiset.vala testpriorityqueue.vala testqueue.vala testreadonlybidirlist.vala testreadonlycollection.vala testreadonlylist.vala testreadonlymap.vala testreadonlyset.vala testset.vala testsortedset.vala testsortedmap.vala testtreemap.vala testtreemultimap.vala testtreemultiset.vala testtreeset.vala + $(AM_V_at)rm -f $@ && echo stamp > $@-t + $(AM_V_VALAC)$(am__cd) $(srcdir) && $(VALAC) $(tests_VALAFLAGS) $(VALAFLAGS) -C testarraylist.vala testarrayqueue.vala testbidirlist.vala testbidirsortedset.vala testbidirsortedmap.vala testcase.vala testcollection.vala testconcurrentlist.vala testconcurrentset.vala testdata.vala testdeque.vala testfunctions.vala testhashmap.vala testhashmultimap.vala testhashmultiset.vala testhashset.vala testlinkedlist.vala testlinkedlistasdeque.vala testlist.vala testmain.vala testmap.vala testmultimap.vala testmultiset.vala testpriorityqueue.vala testqueue.vala testreadonlybidirlist.vala testreadonlycollection.vala testreadonlylist.vala testreadonlymap.vala testreadonlyset.vala testset.vala testsortedset.vala testsortedmap.vala testtreemap.vala testtreemultimap.vala testtreemultiset.vala testtreeset.vala + $(AM_V_at)mv -f $@-t $@ + mostlyclean-libtool: -rm -f *.lo @@ -511,12 +1268,10 @@ distdir: $(DISTFILES) done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am +check: check-am all-am: Makefile $(PROGRAMS) installdirs: -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am +install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -546,8 +1301,44 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -rm -f testarraylist.c + -rm -f testarrayqueue.c + -rm -f testbidirlist.c + -rm -f testbidirsortedmap.c + -rm -f testbidirsortedset.c + -rm -f testcase.c + -rm -f testcollection.c + -rm -f testconcurrentlist.c + -rm -f testconcurrentset.c + -rm -f testdata.c + -rm -f testdeque.c + -rm -f testfunctions.c + -rm -f testhashmap.c + -rm -f testhashmultimap.c + -rm -f testhashmultiset.c + -rm -f testhashset.c + -rm -f testlinkedlist.c + -rm -f testlinkedlistasdeque.c + -rm -f testlist.c + -rm -f testmain.c + -rm -f testmap.c + -rm -f testmultimap.c + -rm -f testmultiset.c + -rm -f testpriorityqueue.c + -rm -f testqueue.c + -rm -f testreadonlybidirlist.c + -rm -f testreadonlycollection.c + -rm -f testreadonlylist.c + -rm -f testreadonlymap.c + -rm -f testreadonlyset.c + -rm -f tests_vala.stamp + -rm -f testset.c + -rm -f testsortedmap.c + -rm -f testsortedset.c + -rm -f testtreemap.c + -rm -f testtreemultimap.c + -rm -f testtreemultiset.c + -rm -f testtreeset.c clean: clean-am clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ @@ -619,7 +1410,7 @@ ps-am: uninstall-am: -.MAKE: all check check-am install install-am install-strip +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ @@ -684,9 +1475,6 @@ test-report perf-report full-report: ${TEST_PROGS} .PHONY: test test-report perf-report full-report # run make test as part of make check check-local: test -tests.vala.stamp: $(tests_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 --pkg posix $^ - touch $@ coverage-reset: lcov --base-directory=@top_srcdir@ --directory @top_srcdir@/gee --zerocounters diff --git a/tests/testarraylist.c b/tests/testarraylist.c index 423396e..6a7b2e6 100644 --- a/tests/testarraylist.c +++ b/tests/testarraylist.c @@ -68,6 +68,17 @@ typedef struct _ListTests ListTests; typedef struct _ListTestsClass ListTestsClass; typedef struct _ListTestsPrivate ListTestsPrivate; +#define TYPE_BIDIR_LIST_TESTS (bidir_list_tests_get_type ()) +#define BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTests)) +#define BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) +#define IS_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_LIST_TESTS)) +#define IS_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_LIST_TESTS)) +#define BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) + +typedef struct _BidirListTests BidirListTests; +typedef struct _BidirListTestsClass BidirListTestsClass; +typedef struct _BidirListTestsPrivate BidirListTestsPrivate; + #define TYPE_ARRAY_LIST_TESTS (array_list_tests_get_type ()) #define ARRAY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ARRAY_LIST_TESTS, ArrayListTests)) #define ARRAY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ARRAY_LIST_TESTS, ArrayListTestsClass)) @@ -113,13 +124,22 @@ struct _ListTestsClass { void (*test_duplicates_are_retained) (ListTests* self); }; -struct _ArrayListTests { +struct _BidirListTests { ListTests parent_instance; + BidirListTestsPrivate * priv; +}; + +struct _BidirListTestsClass { + ListTestsClass parent_class; +}; + +struct _ArrayListTests { + BidirListTests parent_instance; ArrayListTestsPrivate * priv; }; struct _ArrayListTestsClass { - ListTestsClass parent_class; + BidirListTestsClass parent_class; }; typedef void (*GeeTestCaseTestMethod) (void* user_data); @@ -129,6 +149,7 @@ static gpointer array_list_tests_parent_class = NULL; GType gee_test_case_get_type (void) G_GNUC_CONST; GType collection_tests_get_type (void) G_GNUC_CONST; GType list_tests_get_type (void) G_GNUC_CONST; +GType bidir_list_tests_get_type (void) G_GNUC_CONST; GType array_list_tests_get_type (void) G_GNUC_CONST; enum { ARRAY_LIST_TESTS_DUMMY_PROPERTY @@ -136,12 +157,10 @@ enum { #define ARRAY_LIST_TESTS_BIG_SORT_SIZE 1000000 ArrayListTests* array_list_tests_new (void); ArrayListTests* array_list_tests_construct (GType object_type); -ListTests* list_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +BidirListTests* bidir_list_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void array_list_tests_test_selected_functions (ArrayListTests* self); static void _array_list_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void array_list_tests_test_gobject_properties (ArrayListTests* self); -static void _array_list_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); static void array_list_tests_test_small_sort (ArrayListTests* self); static void _array_list_tests_test_small_sort_gee_test_case_test_method (gpointer self); static void array_list_tests_test_big_sort (ArrayListTests* self); @@ -160,11 +179,6 @@ static void _array_list_tests_test_selected_functions_gee_test_case_test_method } -static void _array_list_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - array_list_tests_test_gobject_properties (self); -} - - static void _array_list_tests_test_small_sort_gee_test_case_test_method (gpointer self) { array_list_tests_test_small_sort (self); } @@ -182,12 +196,11 @@ static void _array_list_tests_test_typed_to_array_gee_test_case_test_method (gpo ArrayListTests* array_list_tests_construct (GType object_type) { ArrayListTests * self = NULL; - self = (ArrayListTests*) list_tests_construct (object_type, "ArrayList"); - gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] selected functions", _array_list_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] GObject properties", _array_list_tests_test_gobject_properties_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] small sort (insertion)", _array_list_tests_test_small_sort_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] big sort (timsort)", _array_list_tests_test_big_sort_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] typed to_array calls", _array_list_tests_test_typed_to_array_gee_test_case_test_method, self); + self = (ArrayListTests*) bidir_list_tests_construct (object_type, "ArrayList"); + gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] selected functions", _array_list_tests_test_selected_functions_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] small sort (insertion)", _array_list_tests_test_small_sort_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] big sort (timsort)", _array_list_tests_test_big_sort_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ArrayList] typed to_array calls", _array_list_tests_test_typed_to_array_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -201,7 +214,7 @@ static void array_list_tests_real_set_up (GeeTestCase* base) { ArrayListTests * self; GeeArrayList* _tmp0_; self = (ArrayListTests*) base; - _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -224,48 +237,11 @@ void array_list_tests_test_selected_functions (ArrayListTests* self) { GeeCollection* _tmp0_; GeeArrayList* _tmp1_; GeeArrayList* test_list; - GEqualFunc _tmp2_; - GEqualFunc _tmp3_; - GEqualFunc _tmp4_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST) ? ((GeeArrayList*) _tmp0_) : NULL); - test_list = _tmp1_; - _vala_assert (test_list != NULL, "test_list != null"); - _tmp2_ = gee_array_list_get_equal_func (test_list); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_equal; - _vala_assert (_tmp3_ == _tmp4_, "test_list.equal_func == str_equal"); - _g_object_unref0 (test_list); -} - - -void array_list_tests_test_gobject_properties (ArrayListTests* self) { - GeeCollection* _tmp0_; - GeeArrayList* _tmp1_; - GeeArrayList* test_list; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST) ? ((GeeArrayList*) _tmp0_) : NULL); test_list = _tmp1_; _vala_assert (test_list != NULL, "test_list != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_list, "equal-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_array_list_get_equal_func (test_list); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_list.equal_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; _g_object_unref0 (test_list); } @@ -315,7 +291,7 @@ static void array_list_tests_test_small_sort (ArrayListTests* self) { gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "ten"); gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "eleven"); gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "twelve"); - gee_list_sort ((GeeList*) test_list, NULL); + gee_list_sort ((GeeList*) test_list, NULL, NULL, NULL); _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) test_list, 0); _tmp3_ = (gchar*) _tmp2_; _vala_assert (g_strcmp0 (_tmp3_, "eight") == 0, "test_list.get (0) == \"eight\""); @@ -373,7 +349,7 @@ static void array_list_tests_test_big_sort (ArrayListTests* self) { GeeList* big_test_list; GeeList* _tmp7_; g_return_if_fail (self != NULL); - _tmp0_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL); + _tmp0_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL); big_test_list = (GeeList*) _tmp0_; { gint i; @@ -404,7 +380,7 @@ static void array_list_tests_test_big_sort (ArrayListTests* self) { } } _tmp7_ = big_test_list; - gee_list_sort (_tmp7_, NULL); + gee_list_sort (_tmp7_, NULL, NULL, NULL); { gint i; i = 1; @@ -501,7 +477,7 @@ static void array_list_tests_test_typed_to_array (ArrayListTests* self) { gint double_array_length1; gint _double_array_size_; g_return_if_fail (self != NULL); - _tmp0_ = gee_array_list_new (G_TYPE_BOOLEAN, NULL, NULL, NULL); + _tmp0_ = gee_array_list_new (G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL); bool_list = (GeeList*) _tmp0_; _tmp1_ = bool_list; _tmp2_ = gee_collection_add ((GeeCollection*) _tmp1_, (gpointer) ((gintptr) TRUE)); @@ -569,7 +545,7 @@ static void array_list_tests_test_typed_to_array (ArrayListTests* self) { } _g_object_unref0 (_element_list); } - _tmp25_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL); + _tmp25_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL); int_list = (GeeList*) _tmp25_; _tmp26_ = int_list; _tmp27_ = gee_collection_add ((GeeCollection*) _tmp26_, (gpointer) ((gintptr) 1)); @@ -637,7 +613,7 @@ static void array_list_tests_test_typed_to_array (ArrayListTests* self) { } _g_object_unref0 (_element_list); } - _tmp50_ = gee_array_list_new (G_TYPE_DOUBLE, (GBoxedCopyFunc) _double_dup, g_free, NULL); + _tmp50_ = gee_array_list_new (G_TYPE_DOUBLE, (GBoxedCopyFunc) _double_dup, g_free, NULL, NULL, NULL); double_list = (GeeList*) _tmp50_; _tmp51_ = double_list; _tmp52_ = 1.0; @@ -738,7 +714,7 @@ GType array_list_tests_get_type (void) { if (g_once_init_enter (&array_list_tests_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (ArrayListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) array_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ArrayListTests), 0, (GInstanceInitFunc) array_list_tests_instance_init, NULL }; GType array_list_tests_type_id; - array_list_tests_type_id = g_type_register_static (TYPE_LIST_TESTS, "ArrayListTests", &g_define_type_info, 0); + array_list_tests_type_id = g_type_register_static (TYPE_BIDIR_LIST_TESTS, "ArrayListTests", &g_define_type_info, 0); g_once_init_leave (&array_list_tests_type_id__volatile, array_list_tests_type_id); } return array_list_tests_type_id__volatile; diff --git a/tests/testarraylist.vala b/tests/testarraylist.vala index 9537f79..381740e 100644 --- a/tests/testarraylist.vala +++ b/tests/testarraylist.vala @@ -25,12 +25,11 @@ using Gee; -public class ArrayListTests : ListTests { +public class ArrayListTests : BidirListTests { public ArrayListTests () { base ("ArrayList"); add_test ("[ArrayList] selected functions", test_selected_functions); - add_test ("[ArrayList] GObject properties", test_gobject_properties); add_test ("[ArrayList] small sort (insertion)", test_small_sort); add_test ("[ArrayList] big sort (timsort)", test_big_sort); add_test ("[ArrayList] typed to_array calls", test_typed_to_array); @@ -51,22 +50,6 @@ public class ArrayListTests : ListTests { // Check the collection exists assert (test_list != null); - - // Check the selected equal function - assert (test_list.equal_func == str_equal); - } - - public new void test_gobject_properties () { - var test_list = test_collection as ArrayList; - - // Check the list exists - assert (test_list != null); - Value value; - - value = Value (typeof (EqualFunc)); - test_list.get_property ("equal-func", ref value); - assert (value.get_pointer () == (void*) test_list.equal_func); - value.unset (); } private void test_small_sort () { diff --git a/tests/testarrayqueue.c b/tests/testarrayqueue.c new file mode 100644 index 0000000..7ebf2d9 --- /dev/null +++ b/tests/testarrayqueue.c @@ -0,0 +1,208 @@ +/* testarrayqueue.c generated by valac 0.18.0, the Vala compiler + * generated from testarrayqueue.vala, do not modify */ + +/* arrayqueue.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_COLLECTION_TESTS (collection_tests_get_type ()) +#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests)) +#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass)) +#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS)) +#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS)) +#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass)) + +typedef struct _CollectionTests CollectionTests; +typedef struct _CollectionTestsClass CollectionTestsClass; +typedef struct _CollectionTestsPrivate CollectionTestsPrivate; + +#define TYPE_QUEUE_TESTS (queue_tests_get_type ()) +#define QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_QUEUE_TESTS, QueueTests)) +#define QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_QUEUE_TESTS, QueueTestsClass)) +#define IS_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_QUEUE_TESTS)) +#define IS_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_QUEUE_TESTS)) +#define QUEUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_QUEUE_TESTS, QueueTestsClass)) + +typedef struct _QueueTests QueueTests; +typedef struct _QueueTestsClass QueueTestsClass; +typedef struct _QueueTestsPrivate QueueTestsPrivate; + +#define TYPE_DEQUE_TESTS (deque_tests_get_type ()) +#define DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEQUE_TESTS, DequeTests)) +#define DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEQUE_TESTS, DequeTestsClass)) +#define IS_DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEQUE_TESTS)) +#define IS_DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEQUE_TESTS)) +#define DEQUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEQUE_TESTS, DequeTestsClass)) + +typedef struct _DequeTests DequeTests; +typedef struct _DequeTestsClass DequeTestsClass; +typedef struct _DequeTestsPrivate DequeTestsPrivate; + +#define TYPE_ARRAY_QUEUE_TESTS (array_queue_tests_get_type ()) +#define ARRAY_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTests)) +#define ARRAY_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTestsClass)) +#define IS_ARRAY_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ARRAY_QUEUE_TESTS)) +#define IS_ARRAY_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ARRAY_QUEUE_TESTS)) +#define ARRAY_QUEUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTestsClass)) + +typedef struct _ArrayQueueTests ArrayQueueTests; +typedef struct _ArrayQueueTestsClass ArrayQueueTestsClass; +typedef struct _ArrayQueueTestsPrivate ArrayQueueTestsPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _CollectionTests { + GeeTestCase parent_instance; + CollectionTestsPrivate * priv; + GeeCollection* test_collection; +}; + +struct _CollectionTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _QueueTests { + CollectionTests parent_instance; + QueueTestsPrivate * priv; +}; + +struct _QueueTestsClass { + CollectionTestsClass parent_class; +}; + +struct _DequeTests { + QueueTests parent_instance; + DequeTestsPrivate * priv; +}; + +struct _DequeTestsClass { + QueueTestsClass parent_class; +}; + +struct _ArrayQueueTests { + DequeTests parent_instance; + ArrayQueueTestsPrivate * priv; +}; + +struct _ArrayQueueTestsClass { + DequeTestsClass parent_class; +}; + + +static gpointer array_queue_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType collection_tests_get_type (void) G_GNUC_CONST; +GType queue_tests_get_type (void) G_GNUC_CONST; +GType deque_tests_get_type (void) G_GNUC_CONST; +GType array_queue_tests_get_type (void) G_GNUC_CONST; +enum { + ARRAY_QUEUE_TESTS_DUMMY_PROPERTY +}; +ArrayQueueTests* array_queue_tests_new (void); +ArrayQueueTests* array_queue_tests_construct (GType object_type); +DequeTests* deque_tests_construct (GType object_type, const gchar* name); +static void array_queue_tests_real_set_up (GeeTestCase* base); +static void array_queue_tests_real_tear_down (GeeTestCase* base); + + +ArrayQueueTests* array_queue_tests_construct (GType object_type) { + ArrayQueueTests * self = NULL; + self = (ArrayQueueTests*) deque_tests_construct (object_type, "ArrayQueue"); + return self; +} + + +ArrayQueueTests* array_queue_tests_new (void) { + return array_queue_tests_construct (TYPE_ARRAY_QUEUE_TESTS); +} + + +static void array_queue_tests_real_set_up (GeeTestCase* base) { + ArrayQueueTests * self; + GeeArrayQueue* _tmp0_; + self = (ArrayQueueTests*) base; + _tmp0_ = gee_array_queue_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; +} + + +static void array_queue_tests_real_tear_down (GeeTestCase* base) { + ArrayQueueTests * self; + self = (ArrayQueueTests*) base; + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = NULL; +} + + +static void array_queue_tests_class_init (ArrayQueueTestsClass * klass) { + array_queue_tests_parent_class = g_type_class_peek_parent (klass); + GEE_TEST_CASE_CLASS (klass)->set_up = array_queue_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = array_queue_tests_real_tear_down; +} + + +static void array_queue_tests_instance_init (ArrayQueueTests * self) { +} + + +GType array_queue_tests_get_type (void) { + static volatile gsize array_queue_tests_type_id__volatile = 0; + if (g_once_init_enter (&array_queue_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (ArrayQueueTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) array_queue_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ArrayQueueTests), 0, (GInstanceInitFunc) array_queue_tests_instance_init, NULL }; + GType array_queue_tests_type_id; + array_queue_tests_type_id = g_type_register_static (TYPE_DEQUE_TESTS, "ArrayQueueTests", &g_define_type_info, 0); + g_once_init_leave (&array_queue_tests_type_id__volatile, array_queue_tests_type_id); + } + return array_queue_tests_type_id__volatile; +} + + + diff --git a/tests/testarrayqueue.vala b/tests/testarrayqueue.vala new file mode 100644 index 0000000..6122330 --- /dev/null +++ b/tests/testarrayqueue.vala @@ -0,0 +1,38 @@ +/* arrayqueue.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using Gee; + +public class ArrayQueueTests : DequeTests { + public ArrayQueueTests () { + base ("ArrayQueue"); + } + + public override void set_up () { + test_collection = new ArrayQueue (); + } + + public override void tear_down () { + test_collection = null; + } +} + diff --git a/tests/testbidirlist.c b/tests/testbidirlist.c new file mode 100644 index 0000000..7e9ba9e --- /dev/null +++ b/tests/testbidirlist.c @@ -0,0 +1,498 @@ +/* testbidirlist.c generated by valac 0.18.0, the Vala compiler + * generated from testbidirlist.vala, do not modify */ + +/* testbidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_COLLECTION_TESTS (collection_tests_get_type ()) +#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests)) +#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass)) +#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS)) +#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS)) +#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass)) + +typedef struct _CollectionTests CollectionTests; +typedef struct _CollectionTestsClass CollectionTestsClass; +typedef struct _CollectionTestsPrivate CollectionTestsPrivate; + +#define TYPE_LIST_TESTS (list_tests_get_type ()) +#define LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIST_TESTS, ListTests)) +#define LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIST_TESTS, ListTestsClass)) +#define IS_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIST_TESTS)) +#define IS_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIST_TESTS)) +#define LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIST_TESTS, ListTestsClass)) + +typedef struct _ListTests ListTests; +typedef struct _ListTestsClass ListTestsClass; +typedef struct _ListTestsPrivate ListTestsPrivate; + +#define TYPE_BIDIR_LIST_TESTS (bidir_list_tests_get_type ()) +#define BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTests)) +#define BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) +#define IS_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_LIST_TESTS)) +#define IS_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_LIST_TESTS)) +#define BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) + +typedef struct _BidirListTests BidirListTests; +typedef struct _BidirListTestsClass BidirListTestsClass; +typedef struct _BidirListTestsPrivate BidirListTestsPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _CollectionTests { + GeeTestCase parent_instance; + CollectionTestsPrivate * priv; + GeeCollection* test_collection; +}; + +struct _CollectionTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _ListTests { + CollectionTests parent_instance; + ListTestsPrivate * priv; +}; + +struct _ListTestsClass { + CollectionTestsClass parent_class; + void (*test_duplicates_are_retained) (ListTests* self); +}; + +struct _BidirListTests { + ListTests parent_instance; + BidirListTestsPrivate * priv; +}; + +struct _BidirListTestsClass { + ListTestsClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); + +static gpointer bidir_list_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType collection_tests_get_type (void) G_GNUC_CONST; +GType list_tests_get_type (void) G_GNUC_CONST; +GType bidir_list_tests_get_type (void) G_GNUC_CONST; +enum { + BIDIR_LIST_TESTS_DUMMY_PROPERTY +}; +BidirListTests* bidir_list_tests_construct (GType object_type, const gchar* name); +ListTests* list_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void bidir_list_tests_test_bidir_list_iterator (BidirListTests* self); +static void _bidir_list_tests_test_bidir_list_iterator_gee_test_case_test_method (gpointer self); + + +static void _bidir_list_tests_test_bidir_list_iterator_gee_test_case_test_method (gpointer self) { + bidir_list_tests_test_bidir_list_iterator (self); +} + + +BidirListTests* bidir_list_tests_construct (GType object_type, const gchar* name) { + BidirListTests * self = NULL; + const gchar* _tmp0_; + g_return_val_if_fail (name != NULL, NULL); + _tmp0_ = name; + self = (BidirListTests*) list_tests_construct (object_type, _tmp0_); + gee_test_case_add_test ((GeeTestCase*) self, "[List] bi-directional list iterator", _bidir_list_tests_test_bidir_list_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void bidir_list_tests_test_bidir_list_iterator (BidirListTests* self) { + GeeCollection* _tmp0_; + GeeBidirList* _tmp1_; + GeeBidirList* test_list; + GeeBidirListIterator* _tmp2_ = NULL; + GeeBidirListIterator* iterator; + GeeBidirListIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + GeeBidirListIterator* _tmp5_; + gboolean _tmp6_ = FALSE; + GeeBidirListIterator* _tmp7_; + gboolean _tmp8_ = FALSE; + GeeBidirListIterator* _tmp9_; + gboolean _tmp10_ = FALSE; + GeeBidirListIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + GeeBidirListIterator* _tmp13_; + gboolean _tmp14_ = FALSE; + gboolean _tmp15_ = FALSE; + gboolean _tmp16_ = FALSE; + gboolean _tmp17_ = FALSE; + GeeBidirListIterator* _tmp18_ = NULL; + GeeBidirListIterator* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeBidirListIterator* _tmp21_; + gpointer _tmp22_ = NULL; + gchar* _tmp23_; + GeeBidirListIterator* _tmp24_; + gint _tmp25_ = 0; + GeeBidirListIterator* _tmp26_; + GeeBidirListIterator* _tmp27_; + gboolean _tmp28_ = FALSE; + GeeBidirListIterator* _tmp29_; + gpointer _tmp30_ = NULL; + gchar* _tmp31_; + GeeBidirListIterator* _tmp32_; + gint _tmp33_ = 0; + GeeBidirListIterator* _tmp34_; + gint _tmp35_; + gint _tmp36_; + GeeBidirListIterator* _tmp37_; + gint _tmp38_ = 0; + GeeBidirListIterator* _tmp39_; + gint _tmp40_; + gint _tmp41_; + GeeBidirListIterator* _tmp42_; + gint _tmp43_ = 0; + GeeBidirListIterator* _tmp44_; + gint _tmp45_; + gint _tmp46_; + GeeBidirListIterator* _tmp47_; + gint _tmp48_ = 0; + GeeBidirListIterator* _tmp49_; + gboolean _tmp50_ = FALSE; + GeeBidirListIterator* _tmp51_; + gpointer _tmp52_ = NULL; + gchar* _tmp53_; + GeeBidirListIterator* _tmp54_; + gint _tmp55_ = 0; + GeeBidirListIterator* _tmp56_; + GeeBidirListIterator* _tmp57_; + gboolean _tmp58_ = FALSE; + GeeBidirListIterator* _tmp59_; + gboolean _tmp60_ = FALSE; + GeeBidirListIterator* _tmp61_; + gboolean _tmp62_ = FALSE; + GeeBidirListIterator* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + GeeBidirListIterator* _tmp66_; + gint _tmp67_ = 0; + GeeBidirListIterator* _tmp68_; + gboolean _tmp69_ = FALSE; + GeeBidirListIterator* _tmp70_; + gboolean _tmp71_ = FALSE; + GeeBidirListIterator* _tmp72_; + gboolean _tmp73_ = FALSE; + GeeBidirListIterator* _tmp74_; + gpointer _tmp75_ = NULL; + gchar* _tmp76_; + GeeBidirListIterator* _tmp77_; + gint _tmp78_ = 0; + GeeBidirListIterator* _tmp79_; + gboolean _tmp80_ = FALSE; + GeeBidirListIterator* _tmp81_; + gboolean _tmp82_ = FALSE; + GeeBidirListIterator* _tmp83_; + gboolean _tmp84_ = FALSE; + GeeBidirListIterator* _tmp85_; + gboolean _tmp86_ = FALSE; + GeeBidirListIterator* _tmp87_; + gpointer _tmp88_ = NULL; + gchar* _tmp89_; + GeeBidirListIterator* _tmp90_; + gint _tmp91_ = 0; + GeeBidirListIterator* _tmp92_; + gboolean _tmp93_ = FALSE; + GeeBidirListIterator* _tmp94_; + gboolean _tmp95_ = FALSE; + GeeBidirListIterator* _tmp96_; + gpointer _tmp97_ = NULL; + gchar* _tmp98_; + GeeBidirListIterator* _tmp99_; + gint _tmp100_ = 0; + GeeBidirListIterator* _tmp101_; + gboolean _tmp102_ = FALSE; + GeeBidirListIterator* _tmp103_; + gboolean _tmp104_ = FALSE; + GeeBidirListIterator* _tmp105_; + gpointer _tmp106_ = NULL; + gchar* _tmp107_; + GeeBidirListIterator* _tmp108_; + gint _tmp109_ = 0; + GeeBidirListIterator* _tmp110_; + gboolean _tmp111_ = FALSE; + GeeBidirListIterator* _tmp112_; + gboolean _tmp113_ = FALSE; + GeeBidirListIterator* _tmp114_; + gpointer _tmp115_ = NULL; + gchar* _tmp116_; + GeeBidirListIterator* _tmp117_; + gint _tmp118_ = 0; + g_return_if_fail (self != NULL); + _tmp0_ = ((CollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_LIST) ? ((GeeBidirList*) _tmp0_) : NULL); + test_list = _tmp1_; + _vala_assert (test_list != NULL, "test_list != null"); + _tmp2_ = gee_bidir_list_bidir_list_iterator (test_list); + iterator = _tmp2_; + _tmp3_ = iterator; + _tmp4_ = gee_iterator_has_next ((GeeIterator*) _tmp3_); + _vala_assert (!_tmp4_, "! iterator.has_next ()"); + _tmp5_ = iterator; + _tmp6_ = gee_iterator_next ((GeeIterator*) _tmp5_); + _vala_assert (!_tmp6_, "! iterator.next ()"); + _tmp7_ = iterator; + _tmp8_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp7_); + _vala_assert (!_tmp8_, "! iterator.has_previous ()"); + _tmp9_ = iterator; + _tmp10_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp9_); + _vala_assert (!_tmp10_, "! iterator.previous ()"); + _tmp11_ = iterator; + _tmp12_ = gee_bidir_iterator_first ((GeeBidirIterator*) _tmp11_); + _vala_assert (!_tmp12_, "! iterator.first ()"); + _tmp13_ = iterator; + _tmp14_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp13_); + _vala_assert (!_tmp14_, "! iterator.last ()"); + _tmp15_ = gee_collection_add ((GeeCollection*) test_list, "one"); + _vala_assert (_tmp15_, "test_list.add (\"one\")"); + _tmp16_ = gee_collection_add ((GeeCollection*) test_list, "two"); + _vala_assert (_tmp16_, "test_list.add (\"two\")"); + _tmp17_ = gee_collection_add ((GeeCollection*) test_list, "three"); + _vala_assert (_tmp17_, "test_list.add (\"three\")"); + _tmp18_ = gee_bidir_list_bidir_list_iterator (test_list); + _g_object_unref0 (iterator); + iterator = _tmp18_; + _tmp19_ = iterator; + _tmp20_ = gee_iterator_next ((GeeIterator*) _tmp19_); + _vala_assert (_tmp20_, "iterator.next()"); + _tmp21_ = iterator; + _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_); + _tmp23_ = (gchar*) _tmp22_; + _vala_assert (g_strcmp0 (_tmp23_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp23_); + _tmp24_ = iterator; + _tmp25_ = gee_list_iterator_index ((GeeListIterator*) _tmp24_); + _vala_assert (_tmp25_ == 0, "iterator.index () == 0"); + _tmp26_ = iterator; + gee_list_iterator_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_LIST_ITERATOR, GeeListIterator), "new one"); + _tmp27_ = iterator; + _tmp28_ = gee_iterator_next ((GeeIterator*) _tmp27_); + _vala_assert (_tmp28_, "iterator.next()"); + _tmp29_ = iterator; + _tmp30_ = gee_iterator_get ((GeeIterator*) _tmp29_); + _tmp31_ = (gchar*) _tmp30_; + _vala_assert (g_strcmp0 (_tmp31_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp31_); + _tmp32_ = iterator; + _tmp33_ = gee_list_iterator_index ((GeeListIterator*) _tmp32_); + _vala_assert (_tmp33_ == 1, "iterator.index () == 1"); + _tmp34_ = iterator; + gee_list_iterator_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_TYPE_LIST_ITERATOR, GeeListIterator), "new two"); + _tmp35_ = gee_collection_get_size ((GeeCollection*) test_list); + _tmp36_ = _tmp35_; + _vala_assert (_tmp36_ == 3, "test_list.size == 3"); + _tmp37_ = iterator; + _tmp38_ = gee_list_iterator_index ((GeeListIterator*) _tmp37_); + _vala_assert (_tmp38_ == 1, "iterator.index () == 1"); + _tmp39_ = iterator; + gee_bidir_list_iterator_insert (_tmp39_, "before two"); + _tmp40_ = gee_collection_get_size ((GeeCollection*) test_list); + _tmp41_ = _tmp40_; + _vala_assert (_tmp41_ == 4, "test_list.size == 4"); + _tmp42_ = iterator; + _tmp43_ = gee_list_iterator_index ((GeeListIterator*) _tmp42_); + _vala_assert (_tmp43_ == 2, "iterator.index () == 2"); + _tmp44_ = iterator; + gee_list_iterator_add ((GeeListIterator*) _tmp44_, "after two"); + _tmp45_ = gee_collection_get_size ((GeeCollection*) test_list); + _tmp46_ = _tmp45_; + _vala_assert (_tmp46_ == 5, "test_list.size == 5"); + _tmp47_ = iterator; + _tmp48_ = gee_list_iterator_index ((GeeListIterator*) _tmp47_); + _vala_assert (_tmp48_ == 3, "iterator.index () == 3"); + _tmp49_ = iterator; + _tmp50_ = gee_iterator_next ((GeeIterator*) _tmp49_); + _vala_assert (_tmp50_, "iterator.next()"); + _tmp51_ = iterator; + _tmp52_ = gee_iterator_get ((GeeIterator*) _tmp51_); + _tmp53_ = (gchar*) _tmp52_; + _vala_assert (g_strcmp0 (_tmp53_, "three") == 0, "iterator.get () == \"three\""); + _g_free0 (_tmp53_); + _tmp54_ = iterator; + _tmp55_ = gee_list_iterator_index ((GeeListIterator*) _tmp54_); + _vala_assert (_tmp55_ == 4, "iterator.index () == 4"); + _tmp56_ = iterator; + gee_list_iterator_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, GEE_TYPE_LIST_ITERATOR, GeeListIterator), "new three"); + _tmp57_ = iterator; + _tmp58_ = gee_iterator_has_next ((GeeIterator*) _tmp57_); + _vala_assert (!_tmp58_, "! iterator.has_next ()"); + _tmp59_ = iterator; + _tmp60_ = gee_iterator_next ((GeeIterator*) _tmp59_); + _vala_assert (!_tmp60_, "! iterator.next ()"); + _tmp61_ = iterator; + _tmp62_ = gee_bidir_iterator_first ((GeeBidirIterator*) _tmp61_); + _vala_assert (_tmp62_, "iterator.first ()"); + _tmp63_ = iterator; + _tmp64_ = gee_iterator_get ((GeeIterator*) _tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _vala_assert (g_strcmp0 (_tmp65_, "new one") == 0, "iterator.get () == \"new one\""); + _g_free0 (_tmp65_); + _tmp66_ = iterator; + _tmp67_ = gee_list_iterator_index ((GeeListIterator*) _tmp66_); + _vala_assert (_tmp67_ == 0, "iterator.index () == 0"); + _tmp68_ = iterator; + _tmp69_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp68_); + _vala_assert (!_tmp69_, "! iterator.has_previous ()"); + _tmp70_ = iterator; + _tmp71_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp70_); + _vala_assert (!_tmp71_, "! iterator.previous ()"); + _tmp72_ = iterator; + _tmp73_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp72_); + _vala_assert (_tmp73_, "iterator.last ()"); + _tmp74_ = iterator; + _tmp75_ = gee_iterator_get ((GeeIterator*) _tmp74_); + _tmp76_ = (gchar*) _tmp75_; + _vala_assert (g_strcmp0 (_tmp76_, "new three") == 0, "iterator.get () == \"new three\""); + _g_free0 (_tmp76_); + _tmp77_ = iterator; + _tmp78_ = gee_list_iterator_index ((GeeListIterator*) _tmp77_); + _vala_assert (_tmp78_ == 4, "iterator.index () == 4"); + _tmp79_ = iterator; + _tmp80_ = gee_iterator_has_next ((GeeIterator*) _tmp79_); + _vala_assert (!_tmp80_, "! iterator.has_next ()"); + _tmp81_ = iterator; + _tmp82_ = gee_iterator_next ((GeeIterator*) _tmp81_); + _vala_assert (!_tmp82_, "! iterator.next ()"); + _tmp83_ = iterator; + _tmp84_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp83_); + _vala_assert (_tmp84_, "iterator.has_previous ()"); + _tmp85_ = iterator; + _tmp86_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp85_); + _vala_assert (_tmp86_, "iterator.previous ()"); + _tmp87_ = iterator; + _tmp88_ = gee_iterator_get ((GeeIterator*) _tmp87_); + _tmp89_ = (gchar*) _tmp88_; + _vala_assert (g_strcmp0 (_tmp89_, "after two") == 0, "iterator.get () == \"after two\""); + _g_free0 (_tmp89_); + _tmp90_ = iterator; + _tmp91_ = gee_list_iterator_index ((GeeListIterator*) _tmp90_); + _vala_assert (_tmp91_ == 3, "iterator.index () == 3"); + _tmp92_ = iterator; + _tmp93_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp92_); + _vala_assert (_tmp93_, "iterator.has_previous ()"); + _tmp94_ = iterator; + _tmp95_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp94_); + _vala_assert (_tmp95_, "iterator.previous ()"); + _tmp96_ = iterator; + _tmp97_ = gee_iterator_get ((GeeIterator*) _tmp96_); + _tmp98_ = (gchar*) _tmp97_; + _vala_assert (g_strcmp0 (_tmp98_, "new two") == 0, "iterator.get () == \"new two\""); + _g_free0 (_tmp98_); + _tmp99_ = iterator; + _tmp100_ = gee_list_iterator_index ((GeeListIterator*) _tmp99_); + _vala_assert (_tmp100_ == 2, "iterator.index () == 2"); + _tmp101_ = iterator; + _tmp102_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp101_); + _vala_assert (_tmp102_, "iterator.has_previous ()"); + _tmp103_ = iterator; + _tmp104_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp103_); + _vala_assert (_tmp104_, "iterator.previous ()"); + _tmp105_ = iterator; + _tmp106_ = gee_iterator_get ((GeeIterator*) _tmp105_); + _tmp107_ = (gchar*) _tmp106_; + _vala_assert (g_strcmp0 (_tmp107_, "before two") == 0, "iterator.get () == \"before two\""); + _g_free0 (_tmp107_); + _tmp108_ = iterator; + _tmp109_ = gee_list_iterator_index ((GeeListIterator*) _tmp108_); + _vala_assert (_tmp109_ == 1, "iterator.index () == 1"); + _tmp110_ = iterator; + _tmp111_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp110_); + _vala_assert (_tmp111_, "iterator.has_previous ()"); + _tmp112_ = iterator; + _tmp113_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp112_); + _vala_assert (_tmp113_, "iterator.previous ()"); + _tmp114_ = iterator; + _tmp115_ = gee_iterator_get ((GeeIterator*) _tmp114_); + _tmp116_ = (gchar*) _tmp115_; + _vala_assert (g_strcmp0 (_tmp116_, "new one") == 0, "iterator.get () == \"new one\""); + _g_free0 (_tmp116_); + _tmp117_ = iterator; + _tmp118_ = gee_list_iterator_index ((GeeListIterator*) _tmp117_); + _vala_assert (_tmp118_ == 0, "iterator.index () == 0"); + _g_object_unref0 (iterator); + _g_object_unref0 (test_list); +} + + +static void bidir_list_tests_class_init (BidirListTestsClass * klass) { + bidir_list_tests_parent_class = g_type_class_peek_parent (klass); +} + + +static void bidir_list_tests_instance_init (BidirListTests * self) { +} + + +GType bidir_list_tests_get_type (void) { + static volatile gsize bidir_list_tests_type_id__volatile = 0; + if (g_once_init_enter (&bidir_list_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (BidirListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirListTests), 0, (GInstanceInitFunc) bidir_list_tests_instance_init, NULL }; + GType bidir_list_tests_type_id; + bidir_list_tests_type_id = g_type_register_static (TYPE_LIST_TESTS, "BidirListTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_once_init_leave (&bidir_list_tests_type_id__volatile, bidir_list_tests_type_id); + } + return bidir_list_tests_type_id__volatile; +} + + + diff --git a/tests/testbidirlist.vala b/tests/testbidirlist.vala new file mode 100644 index 0000000..7e53f5b --- /dev/null +++ b/tests/testbidirlist.vala @@ -0,0 +1,107 @@ +/* testbidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using GLib; +using Gee; + +public abstract class BidirListTests : ListTests { + + public BidirListTests (string name) { + base (name); + add_test ("[List] bi-directional list iterator", test_bidir_list_iterator); + } + + public void test_bidir_list_iterator () { + var test_list = test_collection as Gee.BidirList; + + // Check the test list is not null + assert (test_list != null); + + // Check iterate empty list + var iterator = test_list.bidir_list_iterator (); + assert (! iterator.has_next ()); + assert (! iterator.next ()); + assert (! iterator.has_previous ()); + assert (! iterator.previous ()); + assert (! iterator.first ()); + assert (! iterator.last ()); + + // Check iterate list + assert (test_list.add ("one")); + assert (test_list.add ("two")); + assert (test_list.add ("three")); + + iterator = test_list.bidir_list_iterator (); + assert (iterator.next()); + assert (iterator.get () == "one"); + assert (iterator.index () == 0); + ((ListIterator)iterator).set ("new one"); + assert (iterator.next()); + assert (iterator.get () == "two"); + assert (iterator.index () == 1); + ((ListIterator)iterator).set ("new two"); + assert (test_list.size == 3); + assert (iterator.index () == 1); + iterator.insert ("before two"); + assert (test_list.size == 4); + assert (iterator.index () == 2); + iterator.add ("after two"); + assert (test_list.size == 5); + assert (iterator.index () == 3); + assert (iterator.next()); + assert (iterator.get () == "three"); + assert (iterator.index () == 4); + ((ListIterator)iterator).set ("new three"); + assert (! iterator.has_next ()); + assert (! iterator.next ()); + + assert (iterator.first ()); + assert (iterator.get () == "new one"); + assert (iterator.index () == 0); + assert (! iterator.has_previous ()); + assert (! iterator.previous ()); + + assert (iterator.last ()); + assert (iterator.get () == "new three"); + assert (iterator.index () == 4); + assert (! iterator.has_next ()); + assert (! iterator.next ()); + + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "after two"); + assert (iterator.index () == 3); + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "new two"); + assert (iterator.index () == 2); + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "before two"); + assert (iterator.index () == 1); + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "new one"); + assert (iterator.index () == 0); + } +} + diff --git a/tests/testbidirsortedmap.c b/tests/testbidirsortedmap.c new file mode 100644 index 0000000..5c19452 --- /dev/null +++ b/tests/testbidirsortedmap.c @@ -0,0 +1,2251 @@ +/* testbidirsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from testbidirsortedmap.vala, do not modify */ + +/* testbidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_MAP_TESTS (map_tests_get_type ()) +#define MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_TESTS, MapTests)) +#define MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_TESTS, MapTestsClass)) +#define IS_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_TESTS)) +#define IS_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_TESTS)) +#define MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_TESTS, MapTestsClass)) + +typedef struct _MapTests MapTests; +typedef struct _MapTestsClass MapTestsClass; +typedef struct _MapTestsPrivate MapTestsPrivate; + +#define GEE_TYPE_SORTED_MAP_TESTS (gee_sorted_map_tests_get_type ()) +#define GEE_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTests)) +#define GEE_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) +#define GEE_IS_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_IS_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) + +typedef struct _GeeSortedMapTests GeeSortedMapTests; +typedef struct _GeeSortedMapTestsClass GeeSortedMapTestsClass; +typedef struct _GeeSortedMapTestsPrivate GeeSortedMapTestsPrivate; + +#define TYPE_BIDIR_SORTED_MAP_TESTS (bidir_sorted_map_tests_get_type ()) +#define BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTests)) +#define BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) +#define IS_BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define IS_BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define BIDIR_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) + +typedef struct _BidirSortedMapTests BidirSortedMapTests; +typedef struct _BidirSortedMapTestsClass BidirSortedMapTestsClass; +typedef struct _BidirSortedMapTestsPrivate BidirSortedMapTestsPrivate; + +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TYPE (gee_sorted_map_tests_sub_map_tests_type_get_type ()) + +#define BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS (bidir_sorted_map_tests_bidir_sub_map_tests_get_type ()) +#define BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, BidirSortedMapTestsBidirSubMapTests)) +#define BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, BidirSortedMapTestsBidirSubMapTestsClass)) +#define BIDIR_SORTED_MAP_TESTS_IS_BIDIR_SUB_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS)) +#define BIDIR_SORTED_MAP_TESTS_IS_BIDIR_SUB_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS)) +#define BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, BidirSortedMapTestsBidirSubMapTestsClass)) + +typedef struct _BidirSortedMapTestsBidirSubMapTests BidirSortedMapTestsBidirSubMapTests; +typedef struct _BidirSortedMapTestsBidirSubMapTestsClass BidirSortedMapTestsBidirSubMapTestsClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _BidirSortedMapTestsBidirSubMapTestsPrivate BidirSortedMapTestsBidirSubMapTestsPrivate; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _MapTests { + GeeTestCase parent_instance; + MapTestsPrivate * priv; + GeeMap* test_map; +}; + +struct _MapTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _GeeSortedMapTests { + MapTests parent_instance; + GeeSortedMapTestsPrivate * priv; +}; + +struct _GeeSortedMapTestsClass { + MapTestsClass parent_class; +}; + +struct _BidirSortedMapTests { + GeeSortedMapTests parent_instance; + BidirSortedMapTestsPrivate * priv; +}; + +struct _BidirSortedMapTestsClass { + GeeSortedMapTestsClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); +typedef enum { + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY +} GeeSortedMapTestsSubMapTestsType; + +struct _BidirSortedMapTestsBidirSubMapTests { + GeeTestCase parent_instance; + BidirSortedMapTestsBidirSubMapTestsPrivate * priv; +}; + +struct _BidirSortedMapTestsBidirSubMapTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _BidirSortedMapTestsBidirSubMapTestsPrivate { + GeeBidirSortedMap* master; + GeeBidirSortedMap* submap; + BidirSortedMapTests* test; + GeeSortedMapTestsSubMapTestsType type; +}; + + +static gpointer bidir_sorted_map_tests_parent_class = NULL; +static gpointer bidir_sorted_map_tests_bidir_sub_map_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType map_tests_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_map_tests_get_type (void) G_GNUC_CONST; +enum { + BIDIR_SORTED_MAP_TESTS_DUMMY_PROPERTY +}; +BidirSortedMapTests* bidir_sorted_map_tests_construct (GType object_type, const gchar* name); +GeeSortedMapTests* gee_sorted_map_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void bidir_sorted_map_tests_test_bidir_iterator_can_go_backward (BidirSortedMapTests* self); +static void _bidir_sorted_map_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self); +void bidir_sorted_map_tests_test_bidir_iterator_last (BidirSortedMapTests* self); +static void _bidir_sorted_map_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self); +GTestSuite* gee_test_case_get_suite (GeeTestCase* self); +GType gee_sorted_map_tests_sub_map_tests_type_get_type (void) G_GNUC_CONST; +BidirSortedMapTestsBidirSubMapTests* bidir_sorted_map_tests_bidir_sub_map_tests_new (BidirSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type); +BidirSortedMapTestsBidirSubMapTests* bidir_sorted_map_tests_bidir_sub_map_tests_construct (GType object_type, BidirSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type); +GType bidir_sorted_map_tests_bidir_sub_map_tests_get_type (void) G_GNUC_CONST; +void map_tests_assert_entry (GeeMapEntry* e, const gchar* key, const gchar* value); +#define BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, BidirSortedMapTestsBidirSubMapTestsPrivate)) +enum { + BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS_DUMMY_PROPERTY +}; +const gchar* gee_sorted_map_tests_sub_map_tests_type_to_string (GeeSortedMapTestsSubMapTestsType self); +GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); +void bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators (BidirSortedMapTestsBidirSubMapTests* self); +static void _bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators_gee_test_case_test_method (gpointer self); +static void bidir_sorted_map_tests_bidir_sub_map_tests_real_set_up (GeeTestCase* base); +void gee_test_case_set_up (GeeTestCase* self); +static void bidir_sorted_map_tests_bidir_sub_map_tests_real_tear_down (GeeTestCase* base); +void gee_test_case_tear_down (GeeTestCase* self); +void bidir_sorted_map_tests_bidir_sub_map_tests_set_default_values (BidirSortedMapTestsBidirSubMapTests* self, gchar*** contains, int* contains_length1, gchar*** not_contains, int* not_contains_length1); +static void bidir_sorted_map_tests_bidir_sub_map_tests_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +static void _bidir_sorted_map_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self) { + bidir_sorted_map_tests_test_bidir_iterator_can_go_backward (self); +} + + +static void _bidir_sorted_map_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self) { + bidir_sorted_map_tests_test_bidir_iterator_last (self); +} + + +BidirSortedMapTests* bidir_sorted_map_tests_construct (GType object_type, const gchar* name) { + BidirSortedMapTests * self = NULL; + const gchar* _tmp0_; + GTestSuite* _tmp1_ = NULL; + BidirSortedMapTestsBidirSubMapTests* _tmp2_; + BidirSortedMapTestsBidirSubMapTests* _tmp3_; + GTestSuite* _tmp4_ = NULL; + GTestSuite* _tmp5_ = NULL; + BidirSortedMapTestsBidirSubMapTests* _tmp6_; + BidirSortedMapTestsBidirSubMapTests* _tmp7_; + GTestSuite* _tmp8_ = NULL; + GTestSuite* _tmp9_ = NULL; + BidirSortedMapTestsBidirSubMapTests* _tmp10_; + BidirSortedMapTestsBidirSubMapTests* _tmp11_; + GTestSuite* _tmp12_ = NULL; + GTestSuite* _tmp13_ = NULL; + BidirSortedMapTestsBidirSubMapTests* _tmp14_; + BidirSortedMapTestsBidirSubMapTests* _tmp15_; + GTestSuite* _tmp16_ = NULL; + g_return_val_if_fail (name != NULL, NULL); + _tmp0_ = name; + self = (BidirSortedMapTests*) gee_sorted_map_tests_construct (object_type, _tmp0_); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] bi-directional iterators can go backward", _bidir_sorted_map_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to end", _bidir_sorted_map_tests_test_bidir_iterator_last_gee_test_case_test_method, g_object_ref (self), g_object_unref); + _tmp1_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp2_ = bidir_sorted_map_tests_bidir_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD); + _tmp3_ = _tmp2_; + _tmp4_ = gee_test_case_get_suite ((GeeTestCase*) _tmp3_); + g_test_suite_add_suite (_tmp1_, _tmp4_); + _g_object_unref0 (_tmp3_); + _tmp5_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp6_ = bidir_sorted_map_tests_bidir_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL); + _tmp7_ = _tmp6_; + _tmp8_ = gee_test_case_get_suite ((GeeTestCase*) _tmp7_); + g_test_suite_add_suite (_tmp5_, _tmp8_); + _g_object_unref0 (_tmp7_); + _tmp9_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp10_ = bidir_sorted_map_tests_bidir_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB); + _tmp11_ = _tmp10_; + _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) _tmp11_); + g_test_suite_add_suite (_tmp9_, _tmp12_); + _g_object_unref0 (_tmp11_); + _tmp13_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp14_ = bidir_sorted_map_tests_bidir_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY); + _tmp15_ = _tmp14_; + _tmp16_ = gee_test_case_get_suite ((GeeTestCase*) _tmp15_); + g_test_suite_add_suite (_tmp13_, _tmp16_); + _g_object_unref0 (_tmp15_); + return self; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void bidir_sorted_map_tests_test_bidir_iterator_can_go_backward (BidirSortedMapTests* self) { + GeeMap* _tmp0_; + GeeBidirSortedMap* _tmp1_; + GeeBidirSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeBidirSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeBidirSortedSet* entries; + GeeBidirIterator* _tmp6_ = NULL; + GeeBidirIterator* keys_iterator; + GeeBidirIterator* _tmp7_ = NULL; + GeeBidirIterator* entries_iterator; + GeeBidirMapIterator* _tmp8_ = NULL; + GeeBidirMapIterator* map_iterator; + GeeBidirIterator* _tmp9_; + gboolean _tmp10_ = FALSE; + GeeBidirIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + GeeBidirMapIterator* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeBidirIterator* _tmp15_; + gboolean _tmp16_ = FALSE; + GeeBidirIterator* _tmp17_; + gboolean _tmp18_ = FALSE; + GeeBidirMapIterator* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeBidirIterator* _tmp21_ = NULL; + GeeBidirIterator* _tmp22_ = NULL; + GeeBidirMapIterator* _tmp23_ = NULL; + GeeBidirIterator* _tmp24_; + gboolean _tmp25_ = FALSE; + GeeBidirIterator* _tmp26_; + gboolean _tmp27_ = FALSE; + GeeBidirMapIterator* _tmp28_; + gboolean _tmp29_ = FALSE; + GeeBidirIterator* _tmp30_; + gpointer _tmp31_ = NULL; + gchar* _tmp32_; + GeeBidirIterator* _tmp33_; + gpointer _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + GeeBidirMapIterator* _tmp36_; + gpointer _tmp37_ = NULL; + gchar* _tmp38_; + GeeBidirMapIterator* _tmp39_; + gpointer _tmp40_ = NULL; + gchar* _tmp41_; + GeeBidirIterator* _tmp42_; + gboolean _tmp43_ = FALSE; + GeeBidirIterator* _tmp44_; + gboolean _tmp45_ = FALSE; + GeeBidirMapIterator* _tmp46_; + gboolean _tmp47_ = FALSE; + GeeBidirIterator* _tmp48_; + gboolean _tmp49_ = FALSE; + GeeBidirIterator* _tmp50_; + gboolean _tmp51_ = FALSE; + GeeBidirMapIterator* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeBidirIterator* _tmp54_; + gpointer _tmp55_ = NULL; + gchar* _tmp56_; + GeeBidirIterator* _tmp57_; + gpointer _tmp58_ = NULL; + GeeMapEntry* _tmp59_; + GeeBidirMapIterator* _tmp60_; + gpointer _tmp61_ = NULL; + gchar* _tmp62_; + GeeBidirMapIterator* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + GeeBidirIterator* _tmp66_; + gboolean _tmp67_ = FALSE; + GeeBidirIterator* _tmp68_; + gboolean _tmp69_ = FALSE; + GeeBidirMapIterator* _tmp70_; + gboolean _tmp71_ = FALSE; + GeeBidirIterator* _tmp72_; + gboolean _tmp73_ = FALSE; + GeeBidirIterator* _tmp74_; + gboolean _tmp75_ = FALSE; + GeeBidirMapIterator* _tmp76_; + gboolean _tmp77_ = FALSE; + GeeBidirIterator* _tmp78_; + gpointer _tmp79_ = NULL; + gchar* _tmp80_; + GeeBidirIterator* _tmp81_; + gpointer _tmp82_ = NULL; + GeeMapEntry* _tmp83_; + GeeBidirMapIterator* _tmp84_; + gpointer _tmp85_ = NULL; + gchar* _tmp86_; + GeeBidirMapIterator* _tmp87_; + gpointer _tmp88_ = NULL; + gchar* _tmp89_; + GeeBidirIterator* _tmp90_; + gboolean _tmp91_ = FALSE; + GeeBidirIterator* _tmp92_; + gboolean _tmp93_ = FALSE; + GeeBidirMapIterator* _tmp94_; + gboolean _tmp95_ = FALSE; + GeeBidirIterator* _tmp96_; + gboolean _tmp97_ = FALSE; + GeeBidirIterator* _tmp98_; + gboolean _tmp99_ = FALSE; + GeeBidirMapIterator* _tmp100_; + gboolean _tmp101_ = FALSE; + GeeBidirIterator* _tmp102_; + gpointer _tmp103_ = NULL; + gchar* _tmp104_; + GeeBidirIterator* _tmp105_; + gpointer _tmp106_ = NULL; + GeeMapEntry* _tmp107_; + GeeBidirMapIterator* _tmp108_; + gpointer _tmp109_ = NULL; + gchar* _tmp110_; + GeeBidirMapIterator* _tmp111_; + gpointer _tmp112_ = NULL; + gchar* _tmp113_; + GeeBidirIterator* _tmp114_; + gboolean _tmp115_ = FALSE; + GeeBidirIterator* _tmp116_; + gboolean _tmp117_ = FALSE; + GeeBidirMapIterator* _tmp118_; + gboolean _tmp119_ = FALSE; + GeeBidirIterator* _tmp120_; + gboolean _tmp121_ = FALSE; + GeeBidirIterator* _tmp122_; + gboolean _tmp123_ = FALSE; + GeeBidirMapIterator* _tmp124_; + gboolean _tmp125_ = FALSE; + GeeBidirIterator* _tmp126_; + gpointer _tmp127_ = NULL; + gchar* _tmp128_; + GeeBidirIterator* _tmp129_; + gpointer _tmp130_ = NULL; + GeeMapEntry* _tmp131_; + GeeBidirMapIterator* _tmp132_; + gpointer _tmp133_ = NULL; + gchar* _tmp134_; + GeeBidirMapIterator* _tmp135_; + gpointer _tmp136_ = NULL; + gchar* _tmp137_; + GeeBidirIterator* _tmp138_; + gboolean _tmp139_ = FALSE; + GeeBidirIterator* _tmp140_; + gboolean _tmp141_ = FALSE; + GeeBidirMapIterator* _tmp142_; + gboolean _tmp143_ = FALSE; + GeeBidirIterator* _tmp144_; + gboolean _tmp145_ = FALSE; + GeeBidirIterator* _tmp146_; + gboolean _tmp147_ = FALSE; + GeeBidirMapIterator* _tmp148_; + gboolean _tmp149_ = FALSE; + GeeBidirIterator* _tmp150_; + gpointer _tmp151_ = NULL; + gchar* _tmp152_; + GeeBidirIterator* _tmp153_; + gpointer _tmp154_ = NULL; + GeeMapEntry* _tmp155_; + GeeBidirMapIterator* _tmp156_; + gpointer _tmp157_ = NULL; + gchar* _tmp158_; + GeeBidirMapIterator* _tmp159_; + gpointer _tmp160_ = NULL; + gchar* _tmp161_; + GeeBidirIterator* _tmp162_; + gboolean _tmp163_ = FALSE; + GeeBidirIterator* _tmp164_; + gboolean _tmp165_ = FALSE; + GeeBidirMapIterator* _tmp166_; + gboolean _tmp167_ = FALSE; + GeeBidirIterator* _tmp168_; + gboolean _tmp169_ = FALSE; + GeeBidirIterator* _tmp170_; + gboolean _tmp171_ = FALSE; + GeeBidirMapIterator* _tmp172_; + gboolean _tmp173_ = FALSE; + GeeBidirIterator* _tmp174_; + gboolean _tmp175_ = FALSE; + GeeBidirIterator* _tmp176_; + gboolean _tmp177_ = FALSE; + GeeBidirMapIterator* _tmp178_; + gboolean _tmp179_ = FALSE; + GeeBidirIterator* _tmp180_; + gpointer _tmp181_ = NULL; + gchar* _tmp182_; + GeeBidirIterator* _tmp183_; + gpointer _tmp184_ = NULL; + GeeMapEntry* _tmp185_; + GeeBidirMapIterator* _tmp186_; + gpointer _tmp187_ = NULL; + gchar* _tmp188_; + GeeBidirMapIterator* _tmp189_; + gpointer _tmp190_ = NULL; + gchar* _tmp191_; + GeeBidirIterator* _tmp192_; + gboolean _tmp193_ = FALSE; + GeeBidirIterator* _tmp194_; + gboolean _tmp195_ = FALSE; + GeeBidirMapIterator* _tmp196_; + gboolean _tmp197_ = FALSE; + GeeBidirIterator* _tmp198_; + gpointer _tmp199_ = NULL; + gchar* _tmp200_; + GeeBidirIterator* _tmp201_; + gpointer _tmp202_ = NULL; + GeeMapEntry* _tmp203_; + GeeBidirMapIterator* _tmp204_; + gpointer _tmp205_ = NULL; + gchar* _tmp206_; + GeeBidirMapIterator* _tmp207_; + gpointer _tmp208_ = NULL; + gchar* _tmp209_; + GeeBidirIterator* _tmp210_; + gboolean _tmp211_ = FALSE; + GeeBidirIterator* _tmp212_; + gboolean _tmp213_ = FALSE; + GeeBidirMapIterator* _tmp214_; + gboolean _tmp215_ = FALSE; + GeeBidirIterator* _tmp216_; + gpointer _tmp217_ = NULL; + gchar* _tmp218_; + GeeBidirIterator* _tmp219_; + gpointer _tmp220_ = NULL; + GeeMapEntry* _tmp221_; + GeeBidirMapIterator* _tmp222_; + gpointer _tmp223_ = NULL; + gchar* _tmp224_; + GeeBidirMapIterator* _tmp225_; + gpointer _tmp226_ = NULL; + gchar* _tmp227_; + GeeBidirIterator* _tmp228_; + gboolean _tmp229_ = FALSE; + GeeBidirIterator* _tmp230_; + gboolean _tmp231_ = FALSE; + GeeBidirMapIterator* _tmp232_; + gboolean _tmp233_ = FALSE; + GeeBidirIterator* _tmp234_; + gpointer _tmp235_ = NULL; + gchar* _tmp236_; + GeeBidirIterator* _tmp237_; + gpointer _tmp238_ = NULL; + GeeMapEntry* _tmp239_; + GeeBidirMapIterator* _tmp240_; + gpointer _tmp241_ = NULL; + gchar* _tmp242_; + GeeBidirMapIterator* _tmp243_; + gpointer _tmp244_ = NULL; + gchar* _tmp245_; + GeeBidirIterator* _tmp246_; + gboolean _tmp247_ = FALSE; + GeeBidirIterator* _tmp248_; + gboolean _tmp249_ = FALSE; + GeeBidirMapIterator* _tmp250_; + gboolean _tmp251_ = FALSE; + GeeBidirIterator* _tmp252_; + gpointer _tmp253_ = NULL; + gchar* _tmp254_; + GeeBidirIterator* _tmp255_; + gpointer _tmp256_ = NULL; + GeeMapEntry* _tmp257_; + GeeBidirMapIterator* _tmp258_; + gpointer _tmp259_ = NULL; + gchar* _tmp260_; + GeeBidirMapIterator* _tmp261_; + gpointer _tmp262_ = NULL; + gchar* _tmp263_; + GeeBidirIterator* _tmp264_; + gboolean _tmp265_ = FALSE; + GeeBidirIterator* _tmp266_; + gboolean _tmp267_ = FALSE; + GeeBidirMapIterator* _tmp268_; + gboolean _tmp269_ = FALSE; + GeeBidirIterator* _tmp270_; + gpointer _tmp271_ = NULL; + gchar* _tmp272_; + GeeBidirIterator* _tmp273_; + gpointer _tmp274_ = NULL; + GeeMapEntry* _tmp275_; + GeeBidirMapIterator* _tmp276_; + gpointer _tmp277_ = NULL; + gchar* _tmp278_; + GeeBidirMapIterator* _tmp279_; + gpointer _tmp280_ = NULL; + gchar* _tmp281_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys ((GeeSortedMap*) test_sorted_map); + _tmp3_ = _tmp2_; + keys = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp3_) : NULL; + _tmp4_ = gee_sorted_map_get_ascending_entries ((GeeSortedMap*) test_sorted_map); + _tmp5_ = _tmp4_; + entries = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp5_) : NULL; + _tmp6_ = gee_bidir_sorted_set_bidir_iterator (keys); + keys_iterator = _tmp6_; + _tmp7_ = gee_bidir_sorted_set_bidir_iterator (entries); + entries_iterator = _tmp7_; + _tmp8_ = gee_bidir_sorted_map_bidir_map_iterator (test_sorted_map); + map_iterator = _tmp8_; + _tmp9_ = keys_iterator; + _tmp10_ = gee_bidir_iterator_has_previous (_tmp9_); + _vala_assert (!_tmp10_, "!keys_iterator.has_previous ()"); + _tmp11_ = entries_iterator; + _tmp12_ = gee_bidir_iterator_has_previous (_tmp11_); + _vala_assert (!_tmp12_, "!entries_iterator.has_previous ()"); + _tmp13_ = map_iterator; + _tmp14_ = gee_bidir_map_iterator_has_previous (_tmp13_); + _vala_assert (!_tmp14_, "!map_iterator.has_previous ()"); + _tmp15_ = keys_iterator; + _tmp16_ = gee_bidir_iterator_previous (_tmp15_); + _vala_assert (!_tmp16_, "!keys_iterator.previous ()"); + _tmp17_ = entries_iterator; + _tmp18_ = gee_bidir_iterator_has_previous (_tmp17_); + _vala_assert (!_tmp18_, "!entries_iterator.has_previous ()"); + _tmp19_ = map_iterator; + _tmp20_ = gee_bidir_map_iterator_previous (_tmp19_); + _vala_assert (!_tmp20_, "!map_iterator.previous ()"); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp21_ = gee_bidir_sorted_set_bidir_iterator (keys); + _g_object_unref0 (keys_iterator); + keys_iterator = _tmp21_; + _tmp22_ = gee_bidir_sorted_set_bidir_iterator (entries); + _g_object_unref0 (entries_iterator); + entries_iterator = _tmp22_; + _tmp23_ = gee_bidir_sorted_map_bidir_map_iterator (test_sorted_map); + _g_object_unref0 (map_iterator); + map_iterator = _tmp23_; + _tmp24_ = keys_iterator; + _tmp25_ = gee_iterator_next ((GeeIterator*) _tmp24_); + _vala_assert (_tmp25_, "keys_iterator.next ()"); + _tmp26_ = entries_iterator; + _tmp27_ = gee_iterator_next ((GeeIterator*) _tmp26_); + _vala_assert (_tmp27_, "entries_iterator.next ()"); + _tmp28_ = map_iterator; + _tmp29_ = gee_map_iterator_next ((GeeMapIterator*) _tmp28_); + _vala_assert (_tmp29_, "map_iterator.next ()"); + _tmp30_ = keys_iterator; + _tmp31_ = gee_iterator_get ((GeeIterator*) _tmp30_); + _tmp32_ = (gchar*) _tmp31_; + _vala_assert (g_strcmp0 (_tmp32_, "five") == 0, "keys_iterator.get () == \"five\""); + _g_free0 (_tmp32_); + _tmp33_ = entries_iterator; + _tmp34_ = gee_iterator_get ((GeeIterator*) _tmp33_); + _tmp35_ = (GeeMapEntry*) _tmp34_; + map_tests_assert_entry (_tmp35_, "five", "five"); + _g_object_unref0 (_tmp35_); + _tmp36_ = map_iterator; + _tmp37_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp36_); + _tmp38_ = (gchar*) _tmp37_; + _vala_assert (g_strcmp0 (_tmp38_, "five") == 0, "map_iterator.get_key () == \"five\""); + _g_free0 (_tmp38_); + _tmp39_ = map_iterator; + _tmp40_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp39_); + _tmp41_ = (gchar*) _tmp40_; + _vala_assert (g_strcmp0 (_tmp41_, "five") == 0, "map_iterator.get_value () == \"five\""); + _g_free0 (_tmp41_); + _tmp42_ = keys_iterator; + _tmp43_ = gee_bidir_iterator_has_previous (_tmp42_); + _vala_assert (!_tmp43_, "!keys_iterator.has_previous ()"); + _tmp44_ = entries_iterator; + _tmp45_ = gee_bidir_iterator_has_previous (_tmp44_); + _vala_assert (!_tmp45_, "!entries_iterator.has_previous ()"); + _tmp46_ = map_iterator; + _tmp47_ = gee_bidir_map_iterator_has_previous (_tmp46_); + _vala_assert (!_tmp47_, "!map_iterator.has_previous ()"); + _tmp48_ = keys_iterator; + _tmp49_ = gee_iterator_next ((GeeIterator*) _tmp48_); + _vala_assert (_tmp49_, "keys_iterator.next ()"); + _tmp50_ = entries_iterator; + _tmp51_ = gee_iterator_next ((GeeIterator*) _tmp50_); + _vala_assert (_tmp51_, "entries_iterator.next ()"); + _tmp52_ = map_iterator; + _tmp53_ = gee_map_iterator_next ((GeeMapIterator*) _tmp52_); + _vala_assert (_tmp53_, "map_iterator.next ()"); + _tmp54_ = keys_iterator; + _tmp55_ = gee_iterator_get ((GeeIterator*) _tmp54_); + _tmp56_ = (gchar*) _tmp55_; + _vala_assert (g_strcmp0 (_tmp56_, "four") == 0, "keys_iterator.get () == \"four\""); + _g_free0 (_tmp56_); + _tmp57_ = entries_iterator; + _tmp58_ = gee_iterator_get ((GeeIterator*) _tmp57_); + _tmp59_ = (GeeMapEntry*) _tmp58_; + map_tests_assert_entry (_tmp59_, "four", "four"); + _g_object_unref0 (_tmp59_); + _tmp60_ = map_iterator; + _tmp61_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp60_); + _tmp62_ = (gchar*) _tmp61_; + _vala_assert (g_strcmp0 (_tmp62_, "four") == 0, "map_iterator.get_key () == \"four\""); + _g_free0 (_tmp62_); + _tmp63_ = map_iterator; + _tmp64_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _vala_assert (g_strcmp0 (_tmp65_, "four") == 0, "map_iterator.get_value () == \"four\""); + _g_free0 (_tmp65_); + _tmp66_ = keys_iterator; + _tmp67_ = gee_bidir_iterator_has_previous (_tmp66_); + _vala_assert (_tmp67_, "keys_iterator.has_previous ()"); + _tmp68_ = entries_iterator; + _tmp69_ = gee_bidir_iterator_has_previous (_tmp68_); + _vala_assert (_tmp69_, "entries_iterator.has_previous ()"); + _tmp70_ = map_iterator; + _tmp71_ = gee_bidir_map_iterator_has_previous (_tmp70_); + _vala_assert (_tmp71_, "map_iterator.has_previous ()"); + _tmp72_ = keys_iterator; + _tmp73_ = gee_iterator_next ((GeeIterator*) _tmp72_); + _vala_assert (_tmp73_, "keys_iterator.next ()"); + _tmp74_ = entries_iterator; + _tmp75_ = gee_iterator_next ((GeeIterator*) _tmp74_); + _vala_assert (_tmp75_, "entries_iterator.next ()"); + _tmp76_ = map_iterator; + _tmp77_ = gee_map_iterator_next ((GeeMapIterator*) _tmp76_); + _vala_assert (_tmp77_, "map_iterator.next ()"); + _tmp78_ = keys_iterator; + _tmp79_ = gee_iterator_get ((GeeIterator*) _tmp78_); + _tmp80_ = (gchar*) _tmp79_; + _vala_assert (g_strcmp0 (_tmp80_, "one") == 0, "keys_iterator.get () == \"one\""); + _g_free0 (_tmp80_); + _tmp81_ = entries_iterator; + _tmp82_ = gee_iterator_get ((GeeIterator*) _tmp81_); + _tmp83_ = (GeeMapEntry*) _tmp82_; + map_tests_assert_entry (_tmp83_, "one", "one"); + _g_object_unref0 (_tmp83_); + _tmp84_ = map_iterator; + _tmp85_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp84_); + _tmp86_ = (gchar*) _tmp85_; + _vala_assert (g_strcmp0 (_tmp86_, "one") == 0, "map_iterator.get_key () == \"one\""); + _g_free0 (_tmp86_); + _tmp87_ = map_iterator; + _tmp88_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp87_); + _tmp89_ = (gchar*) _tmp88_; + _vala_assert (g_strcmp0 (_tmp89_, "one") == 0, "map_iterator.get_value () == \"one\""); + _g_free0 (_tmp89_); + _tmp90_ = keys_iterator; + _tmp91_ = gee_bidir_iterator_has_previous (_tmp90_); + _vala_assert (_tmp91_, "keys_iterator.has_previous ()"); + _tmp92_ = entries_iterator; + _tmp93_ = gee_bidir_iterator_has_previous (_tmp92_); + _vala_assert (_tmp93_, "entries_iterator.has_previous ()"); + _tmp94_ = map_iterator; + _tmp95_ = gee_bidir_map_iterator_has_previous (_tmp94_); + _vala_assert (_tmp95_, "map_iterator.has_previous ()"); + _tmp96_ = keys_iterator; + _tmp97_ = gee_iterator_next ((GeeIterator*) _tmp96_); + _vala_assert (_tmp97_, "keys_iterator.next ()"); + _tmp98_ = entries_iterator; + _tmp99_ = gee_iterator_next ((GeeIterator*) _tmp98_); + _vala_assert (_tmp99_, "entries_iterator.next ()"); + _tmp100_ = map_iterator; + _tmp101_ = gee_map_iterator_next ((GeeMapIterator*) _tmp100_); + _vala_assert (_tmp101_, "map_iterator.next ()"); + _tmp102_ = keys_iterator; + _tmp103_ = gee_iterator_get ((GeeIterator*) _tmp102_); + _tmp104_ = (gchar*) _tmp103_; + _vala_assert (g_strcmp0 (_tmp104_, "six") == 0, "keys_iterator.get () == \"six\""); + _g_free0 (_tmp104_); + _tmp105_ = entries_iterator; + _tmp106_ = gee_iterator_get ((GeeIterator*) _tmp105_); + _tmp107_ = (GeeMapEntry*) _tmp106_; + map_tests_assert_entry (_tmp107_, "six", "six"); + _g_object_unref0 (_tmp107_); + _tmp108_ = map_iterator; + _tmp109_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp108_); + _tmp110_ = (gchar*) _tmp109_; + _vala_assert (g_strcmp0 (_tmp110_, "six") == 0, "map_iterator.get_key () == \"six\""); + _g_free0 (_tmp110_); + _tmp111_ = map_iterator; + _tmp112_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp111_); + _tmp113_ = (gchar*) _tmp112_; + _vala_assert (g_strcmp0 (_tmp113_, "six") == 0, "map_iterator.get_value () == \"six\""); + _g_free0 (_tmp113_); + _tmp114_ = keys_iterator; + _tmp115_ = gee_bidir_iterator_has_previous (_tmp114_); + _vala_assert (_tmp115_, "keys_iterator.has_previous ()"); + _tmp116_ = entries_iterator; + _tmp117_ = gee_bidir_iterator_has_previous (_tmp116_); + _vala_assert (_tmp117_, "entries_iterator.has_previous ()"); + _tmp118_ = map_iterator; + _tmp119_ = gee_bidir_map_iterator_has_previous (_tmp118_); + _vala_assert (_tmp119_, "map_iterator.has_previous ()"); + _tmp120_ = keys_iterator; + _tmp121_ = gee_iterator_next ((GeeIterator*) _tmp120_); + _vala_assert (_tmp121_, "keys_iterator.next ()"); + _tmp122_ = entries_iterator; + _tmp123_ = gee_iterator_next ((GeeIterator*) _tmp122_); + _vala_assert (_tmp123_, "entries_iterator.next ()"); + _tmp124_ = map_iterator; + _tmp125_ = gee_map_iterator_next ((GeeMapIterator*) _tmp124_); + _vala_assert (_tmp125_, "map_iterator.next ()"); + _tmp126_ = keys_iterator; + _tmp127_ = gee_iterator_get ((GeeIterator*) _tmp126_); + _tmp128_ = (gchar*) _tmp127_; + _vala_assert (g_strcmp0 (_tmp128_, "three") == 0, "keys_iterator.get () == \"three\""); + _g_free0 (_tmp128_); + _tmp129_ = entries_iterator; + _tmp130_ = gee_iterator_get ((GeeIterator*) _tmp129_); + _tmp131_ = (GeeMapEntry*) _tmp130_; + map_tests_assert_entry (_tmp131_, "three", "three"); + _g_object_unref0 (_tmp131_); + _tmp132_ = map_iterator; + _tmp133_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp132_); + _tmp134_ = (gchar*) _tmp133_; + _vala_assert (g_strcmp0 (_tmp134_, "three") == 0, "map_iterator.get_key () == \"three\""); + _g_free0 (_tmp134_); + _tmp135_ = map_iterator; + _tmp136_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp135_); + _tmp137_ = (gchar*) _tmp136_; + _vala_assert (g_strcmp0 (_tmp137_, "three") == 0, "map_iterator.get_value () == \"three\""); + _g_free0 (_tmp137_); + _tmp138_ = keys_iterator; + _tmp139_ = gee_bidir_iterator_has_previous (_tmp138_); + _vala_assert (_tmp139_, "keys_iterator.has_previous ()"); + _tmp140_ = entries_iterator; + _tmp141_ = gee_bidir_iterator_has_previous (_tmp140_); + _vala_assert (_tmp141_, "entries_iterator.has_previous ()"); + _tmp142_ = map_iterator; + _tmp143_ = gee_bidir_map_iterator_has_previous (_tmp142_); + _vala_assert (_tmp143_, "map_iterator.has_previous ()"); + _tmp144_ = keys_iterator; + _tmp145_ = gee_iterator_next ((GeeIterator*) _tmp144_); + _vala_assert (_tmp145_, "keys_iterator.next ()"); + _tmp146_ = entries_iterator; + _tmp147_ = gee_iterator_next ((GeeIterator*) _tmp146_); + _vala_assert (_tmp147_, "entries_iterator.next ()"); + _tmp148_ = map_iterator; + _tmp149_ = gee_map_iterator_next ((GeeMapIterator*) _tmp148_); + _vala_assert (_tmp149_, "map_iterator.next ()"); + _tmp150_ = keys_iterator; + _tmp151_ = gee_iterator_get ((GeeIterator*) _tmp150_); + _tmp152_ = (gchar*) _tmp151_; + _vala_assert (g_strcmp0 (_tmp152_, "two") == 0, "keys_iterator.get () == \"two\""); + _g_free0 (_tmp152_); + _tmp153_ = entries_iterator; + _tmp154_ = gee_iterator_get ((GeeIterator*) _tmp153_); + _tmp155_ = (GeeMapEntry*) _tmp154_; + map_tests_assert_entry (_tmp155_, "two", "two"); + _g_object_unref0 (_tmp155_); + _tmp156_ = map_iterator; + _tmp157_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp156_); + _tmp158_ = (gchar*) _tmp157_; + _vala_assert (g_strcmp0 (_tmp158_, "two") == 0, "map_iterator.get_key () == \"two\""); + _g_free0 (_tmp158_); + _tmp159_ = map_iterator; + _tmp160_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp159_); + _tmp161_ = (gchar*) _tmp160_; + _vala_assert (g_strcmp0 (_tmp161_, "two") == 0, "map_iterator.get_value () == \"two\""); + _g_free0 (_tmp161_); + _tmp162_ = keys_iterator; + _tmp163_ = gee_bidir_iterator_has_previous (_tmp162_); + _vala_assert (_tmp163_, "keys_iterator.has_previous ()"); + _tmp164_ = entries_iterator; + _tmp165_ = gee_bidir_iterator_has_previous (_tmp164_); + _vala_assert (_tmp165_, "entries_iterator.has_previous ()"); + _tmp166_ = map_iterator; + _tmp167_ = gee_bidir_map_iterator_has_previous (_tmp166_); + _vala_assert (_tmp167_, "map_iterator.has_previous ()"); + _tmp168_ = keys_iterator; + _tmp169_ = gee_iterator_next ((GeeIterator*) _tmp168_); + _vala_assert (!_tmp169_, "!keys_iterator.next ()"); + _tmp170_ = entries_iterator; + _tmp171_ = gee_iterator_next ((GeeIterator*) _tmp170_); + _vala_assert (!_tmp171_, "!entries_iterator.next ()"); + _tmp172_ = map_iterator; + _tmp173_ = gee_map_iterator_next ((GeeMapIterator*) _tmp172_); + _vala_assert (!_tmp173_, "!map_iterator.next ()"); + _tmp174_ = keys_iterator; + _tmp175_ = gee_bidir_iterator_previous (_tmp174_); + _vala_assert (_tmp175_, "keys_iterator.previous ()"); + _tmp176_ = entries_iterator; + _tmp177_ = gee_bidir_iterator_previous (_tmp176_); + _vala_assert (_tmp177_, "entries_iterator.previous ()"); + _tmp178_ = map_iterator; + _tmp179_ = gee_bidir_map_iterator_previous (_tmp178_); + _vala_assert (_tmp179_, "map_iterator.previous ()"); + _tmp180_ = keys_iterator; + _tmp181_ = gee_iterator_get ((GeeIterator*) _tmp180_); + _tmp182_ = (gchar*) _tmp181_; + _vala_assert (g_strcmp0 (_tmp182_, "three") == 0, "keys_iterator.get () == \"three\""); + _g_free0 (_tmp182_); + _tmp183_ = entries_iterator; + _tmp184_ = gee_iterator_get ((GeeIterator*) _tmp183_); + _tmp185_ = (GeeMapEntry*) _tmp184_; + map_tests_assert_entry (_tmp185_, "three", "three"); + _g_object_unref0 (_tmp185_); + _tmp186_ = map_iterator; + _tmp187_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp186_); + _tmp188_ = (gchar*) _tmp187_; + _vala_assert (g_strcmp0 (_tmp188_, "three") == 0, "map_iterator.get_key () == \"three\""); + _g_free0 (_tmp188_); + _tmp189_ = map_iterator; + _tmp190_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp189_); + _tmp191_ = (gchar*) _tmp190_; + _vala_assert (g_strcmp0 (_tmp191_, "three") == 0, "map_iterator.get_value () == \"three\""); + _g_free0 (_tmp191_); + _tmp192_ = keys_iterator; + _tmp193_ = gee_bidir_iterator_previous (_tmp192_); + _vala_assert (_tmp193_, "keys_iterator.previous ()"); + _tmp194_ = entries_iterator; + _tmp195_ = gee_bidir_iterator_previous (_tmp194_); + _vala_assert (_tmp195_, "entries_iterator.previous ()"); + _tmp196_ = map_iterator; + _tmp197_ = gee_bidir_map_iterator_previous (_tmp196_); + _vala_assert (_tmp197_, "map_iterator.previous ()"); + _tmp198_ = keys_iterator; + _tmp199_ = gee_iterator_get ((GeeIterator*) _tmp198_); + _tmp200_ = (gchar*) _tmp199_; + _vala_assert (g_strcmp0 (_tmp200_, "six") == 0, "keys_iterator.get () == \"six\""); + _g_free0 (_tmp200_); + _tmp201_ = entries_iterator; + _tmp202_ = gee_iterator_get ((GeeIterator*) _tmp201_); + _tmp203_ = (GeeMapEntry*) _tmp202_; + map_tests_assert_entry (_tmp203_, "six", "six"); + _g_object_unref0 (_tmp203_); + _tmp204_ = map_iterator; + _tmp205_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp204_); + _tmp206_ = (gchar*) _tmp205_; + _vala_assert (g_strcmp0 (_tmp206_, "six") == 0, "map_iterator.get_key () == \"six\""); + _g_free0 (_tmp206_); + _tmp207_ = map_iterator; + _tmp208_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp207_); + _tmp209_ = (gchar*) _tmp208_; + _vala_assert (g_strcmp0 (_tmp209_, "six") == 0, "map_iterator.get_value () == \"six\""); + _g_free0 (_tmp209_); + _tmp210_ = keys_iterator; + _tmp211_ = gee_bidir_iterator_previous (_tmp210_); + _vala_assert (_tmp211_, "keys_iterator.previous ()"); + _tmp212_ = entries_iterator; + _tmp213_ = gee_bidir_iterator_previous (_tmp212_); + _vala_assert (_tmp213_, "entries_iterator.previous ()"); + _tmp214_ = map_iterator; + _tmp215_ = gee_bidir_map_iterator_previous (_tmp214_); + _vala_assert (_tmp215_, "map_iterator.previous ()"); + _tmp216_ = keys_iterator; + _tmp217_ = gee_iterator_get ((GeeIterator*) _tmp216_); + _tmp218_ = (gchar*) _tmp217_; + _vala_assert (g_strcmp0 (_tmp218_, "one") == 0, "keys_iterator.get () == \"one\""); + _g_free0 (_tmp218_); + _tmp219_ = entries_iterator; + _tmp220_ = gee_iterator_get ((GeeIterator*) _tmp219_); + _tmp221_ = (GeeMapEntry*) _tmp220_; + map_tests_assert_entry (_tmp221_, "one", "one"); + _g_object_unref0 (_tmp221_); + _tmp222_ = map_iterator; + _tmp223_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp222_); + _tmp224_ = (gchar*) _tmp223_; + _vala_assert (g_strcmp0 (_tmp224_, "one") == 0, "map_iterator.get_key () == \"one\""); + _g_free0 (_tmp224_); + _tmp225_ = map_iterator; + _tmp226_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp225_); + _tmp227_ = (gchar*) _tmp226_; + _vala_assert (g_strcmp0 (_tmp227_, "one") == 0, "map_iterator.get_value () == \"one\""); + _g_free0 (_tmp227_); + _tmp228_ = keys_iterator; + _tmp229_ = gee_bidir_iterator_previous (_tmp228_); + _vala_assert (_tmp229_, "keys_iterator.previous ()"); + _tmp230_ = entries_iterator; + _tmp231_ = gee_bidir_iterator_previous (_tmp230_); + _vala_assert (_tmp231_, "entries_iterator.previous ()"); + _tmp232_ = map_iterator; + _tmp233_ = gee_bidir_map_iterator_previous (_tmp232_); + _vala_assert (_tmp233_, "map_iterator.previous ()"); + _tmp234_ = keys_iterator; + _tmp235_ = gee_iterator_get ((GeeIterator*) _tmp234_); + _tmp236_ = (gchar*) _tmp235_; + _vala_assert (g_strcmp0 (_tmp236_, "four") == 0, "keys_iterator.get () == \"four\""); + _g_free0 (_tmp236_); + _tmp237_ = entries_iterator; + _tmp238_ = gee_iterator_get ((GeeIterator*) _tmp237_); + _tmp239_ = (GeeMapEntry*) _tmp238_; + map_tests_assert_entry (_tmp239_, "four", "four"); + _g_object_unref0 (_tmp239_); + _tmp240_ = map_iterator; + _tmp241_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp240_); + _tmp242_ = (gchar*) _tmp241_; + _vala_assert (g_strcmp0 (_tmp242_, "four") == 0, "map_iterator.get_key () == \"four\""); + _g_free0 (_tmp242_); + _tmp243_ = map_iterator; + _tmp244_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp243_); + _tmp245_ = (gchar*) _tmp244_; + _vala_assert (g_strcmp0 (_tmp245_, "four") == 0, "map_iterator.get_value () == \"four\""); + _g_free0 (_tmp245_); + _tmp246_ = keys_iterator; + _tmp247_ = gee_bidir_iterator_previous (_tmp246_); + _vala_assert (_tmp247_, "keys_iterator.previous ()"); + _tmp248_ = entries_iterator; + _tmp249_ = gee_bidir_iterator_previous (_tmp248_); + _vala_assert (_tmp249_, "entries_iterator.previous ()"); + _tmp250_ = map_iterator; + _tmp251_ = gee_bidir_map_iterator_previous (_tmp250_); + _vala_assert (_tmp251_, "map_iterator.previous ()"); + _tmp252_ = keys_iterator; + _tmp253_ = gee_iterator_get ((GeeIterator*) _tmp252_); + _tmp254_ = (gchar*) _tmp253_; + _vala_assert (g_strcmp0 (_tmp254_, "five") == 0, "keys_iterator.get () == \"five\""); + _g_free0 (_tmp254_); + _tmp255_ = entries_iterator; + _tmp256_ = gee_iterator_get ((GeeIterator*) _tmp255_); + _tmp257_ = (GeeMapEntry*) _tmp256_; + map_tests_assert_entry (_tmp257_, "five", "five"); + _g_object_unref0 (_tmp257_); + _tmp258_ = map_iterator; + _tmp259_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp258_); + _tmp260_ = (gchar*) _tmp259_; + _vala_assert (g_strcmp0 (_tmp260_, "five") == 0, "map_iterator.get_key () == \"five\""); + _g_free0 (_tmp260_); + _tmp261_ = map_iterator; + _tmp262_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp261_); + _tmp263_ = (gchar*) _tmp262_; + _vala_assert (g_strcmp0 (_tmp263_, "five") == 0, "map_iterator.get_value () == \"five\""); + _g_free0 (_tmp263_); + _tmp264_ = keys_iterator; + _tmp265_ = gee_bidir_iterator_previous (_tmp264_); + _vala_assert (!_tmp265_, "!keys_iterator.previous ()"); + _tmp266_ = entries_iterator; + _tmp267_ = gee_bidir_iterator_previous (_tmp266_); + _vala_assert (!_tmp267_, "!entries_iterator.previous ()"); + _tmp268_ = map_iterator; + _tmp269_ = gee_bidir_map_iterator_previous (_tmp268_); + _vala_assert (!_tmp269_, "!map_iterator.previous ()"); + _tmp270_ = keys_iterator; + _tmp271_ = gee_iterator_get ((GeeIterator*) _tmp270_); + _tmp272_ = (gchar*) _tmp271_; + _vala_assert (g_strcmp0 (_tmp272_, "five") == 0, "keys_iterator.get () == \"five\""); + _g_free0 (_tmp272_); + _tmp273_ = entries_iterator; + _tmp274_ = gee_iterator_get ((GeeIterator*) _tmp273_); + _tmp275_ = (GeeMapEntry*) _tmp274_; + map_tests_assert_entry (_tmp275_, "five", "five"); + _g_object_unref0 (_tmp275_); + _tmp276_ = map_iterator; + _tmp277_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp276_); + _tmp278_ = (gchar*) _tmp277_; + _vala_assert (g_strcmp0 (_tmp278_, "five") == 0, "map_iterator.get_key () == \"five\""); + _g_free0 (_tmp278_); + _tmp279_ = map_iterator; + _tmp280_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp279_); + _tmp281_ = (gchar*) _tmp280_; + _vala_assert (g_strcmp0 (_tmp281_, "five") == 0, "map_iterator.get_value () == \"five\""); + _g_free0 (_tmp281_); + _g_object_unref0 (map_iterator); + _g_object_unref0 (entries_iterator); + _g_object_unref0 (keys_iterator); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void bidir_sorted_map_tests_test_bidir_iterator_last (BidirSortedMapTests* self) { + GeeMap* _tmp0_; + GeeBidirSortedMap* _tmp1_; + GeeBidirSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeBidirSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeBidirSortedSet* entries; + GeeBidirIterator* _tmp6_ = NULL; + GeeBidirIterator* keys_iterator; + GeeBidirIterator* _tmp7_ = NULL; + GeeBidirIterator* entries_iterator; + GeeBidirIterator* _tmp8_; + gboolean _tmp9_ = FALSE; + GeeBidirIterator* _tmp10_; + gboolean _tmp11_ = FALSE; + GeeBidirIterator* _tmp12_ = NULL; + GeeBidirIterator* _tmp13_ = NULL; + GeeBidirIterator* _tmp14_; + gboolean _tmp15_ = FALSE; + GeeBidirIterator* _tmp16_; + gboolean _tmp17_ = FALSE; + GeeBidirIterator* _tmp18_; + gpointer _tmp19_ = NULL; + gchar* _tmp20_; + GeeBidirIterator* _tmp21_; + gpointer _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys ((GeeSortedMap*) test_sorted_map); + _tmp3_ = _tmp2_; + keys = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp3_) : NULL; + _tmp4_ = gee_sorted_map_get_ascending_entries ((GeeSortedMap*) test_sorted_map); + _tmp5_ = _tmp4_; + entries = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp5_) : NULL; + _tmp6_ = gee_bidir_sorted_set_bidir_iterator (keys); + keys_iterator = _tmp6_; + _tmp7_ = gee_bidir_sorted_set_bidir_iterator (entries); + entries_iterator = _tmp7_; + _tmp8_ = keys_iterator; + _tmp9_ = gee_bidir_iterator_last (_tmp8_); + _vala_assert (!_tmp9_, "!keys_iterator.last ()"); + _tmp10_ = entries_iterator; + _tmp11_ = gee_bidir_iterator_last (_tmp10_); + _vala_assert (!_tmp11_, "!entries_iterator.last ()"); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp12_ = gee_bidir_sorted_set_bidir_iterator (keys); + _g_object_unref0 (keys_iterator); + keys_iterator = _tmp12_; + _tmp13_ = gee_bidir_sorted_set_bidir_iterator (entries); + _g_object_unref0 (entries_iterator); + entries_iterator = _tmp13_; + _tmp14_ = keys_iterator; + _tmp15_ = gee_bidir_iterator_last (_tmp14_); + _vala_assert (_tmp15_, "keys_iterator.last ()"); + _tmp16_ = entries_iterator; + _tmp17_ = gee_bidir_iterator_last (_tmp16_); + _vala_assert (_tmp17_, "entries_iterator.last ()"); + _tmp18_ = keys_iterator; + _tmp19_ = gee_iterator_get ((GeeIterator*) _tmp18_); + _tmp20_ = (gchar*) _tmp19_; + _vala_assert (g_strcmp0 (_tmp20_, "two") == 0, "keys_iterator.get () == \"two\""); + _g_free0 (_tmp20_); + _tmp21_ = entries_iterator; + _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_); + _tmp23_ = (GeeMapEntry*) _tmp22_; + map_tests_assert_entry (_tmp23_, "two", "two"); + _g_object_unref0 (_tmp23_); + _g_object_unref0 (entries_iterator); + _g_object_unref0 (keys_iterator); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +static void _bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators_gee_test_case_test_method (gpointer self) { + bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators (self); +} + + +BidirSortedMapTestsBidirSubMapTests* bidir_sorted_map_tests_bidir_sub_map_tests_construct (GType object_type, BidirSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type) { + BidirSortedMapTestsBidirSubMapTests * self = NULL; + GeeSortedMapTestsSubMapTestsType _tmp0_; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_; + BidirSortedMapTests* _tmp4_; + BidirSortedMapTests* _tmp5_; + GeeSortedMapTestsSubMapTestsType _tmp6_; + g_return_val_if_fail (test != NULL, NULL); + _tmp0_ = type; + _tmp1_ = gee_sorted_map_tests_sub_map_tests_type_to_string (_tmp0_); + _tmp2_ = g_strdup_printf ("%s Subset", _tmp1_); + _tmp3_ = _tmp2_; + self = (BidirSortedMapTestsBidirSubMapTests*) gee_test_case_construct (object_type, _tmp3_); + _g_free0 (_tmp3_); + _tmp4_ = test; + _tmp5_ = _g_object_ref0 (_tmp4_); + _g_object_unref0 (self->priv->test); + self->priv->test = _tmp5_; + _tmp6_ = type; + self->priv->type = _tmp6_; + gee_test_case_add_test ((GeeTestCase*) self, "[BidirSortedSet] bi-directional iterator", _bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +BidirSortedMapTestsBidirSubMapTests* bidir_sorted_map_tests_bidir_sub_map_tests_new (BidirSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type) { + return bidir_sorted_map_tests_bidir_sub_map_tests_construct (BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, test, type); +} + + +static void bidir_sorted_map_tests_bidir_sub_map_tests_real_set_up (GeeTestCase* base) { + BidirSortedMapTestsBidirSubMapTests * self; + BidirSortedMapTests* _tmp0_; + BidirSortedMapTests* _tmp1_; + GeeMap* _tmp2_; + GeeBidirSortedMap* _tmp3_; + GeeSortedMapTestsSubMapTestsType _tmp4_; + self = (BidirSortedMapTestsBidirSubMapTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_set_up ((GeeTestCase*) _tmp0_); + _tmp1_ = self->priv->test; + _tmp2_ = ((MapTests*) _tmp1_)->test_map; + _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp2_) : NULL); + _g_object_unref0 (self->priv->master); + self->priv->master = _tmp3_; + _tmp4_ = self->priv->type; + switch (_tmp4_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeBidirSortedMap* _tmp5_; + GeeSortedMap* _tmp6_ = NULL; + _tmp5_ = self->priv->master; + _tmp6_ = gee_sorted_map_head_map ((GeeSortedMap*) _tmp5_, "one"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp6_) : NULL; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeBidirSortedMap* _tmp7_; + GeeSortedMap* _tmp8_ = NULL; + _tmp7_ = self->priv->master; + _tmp8_ = gee_sorted_map_tail_map ((GeeSortedMap*) _tmp7_, "six"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp8_) : NULL; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeBidirSortedMap* _tmp9_; + GeeSortedMap* _tmp10_ = NULL; + _tmp9_ = self->priv->master; + _tmp10_ = gee_sorted_map_sub_map ((GeeSortedMap*) _tmp9_, "four", "three"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp10_) : NULL; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeBidirSortedMap* _tmp11_; + GeeSortedMap* _tmp12_ = NULL; + _tmp11_ = self->priv->master; + _tmp12_ = gee_sorted_map_sub_map ((GeeSortedMap*) _tmp11_, "three", "four"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GEE_TYPE_BIDIR_SORTED_MAP) ? ((GeeBidirSortedMap*) _tmp12_) : NULL; + break; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static void bidir_sorted_map_tests_bidir_sub_map_tests_real_tear_down (GeeTestCase* base) { + BidirSortedMapTestsBidirSubMapTests * self; + BidirSortedMapTests* _tmp0_; + self = (BidirSortedMapTestsBidirSubMapTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_tear_down ((GeeTestCase*) _tmp0_); +} + + +void bidir_sorted_map_tests_bidir_sub_map_tests_set_default_values (BidirSortedMapTestsBidirSubMapTests* self, gchar*** contains, int* contains_length1, gchar*** not_contains, int* not_contains_length1) { + gchar** _vala_contains = NULL; + int _vala_contains_length1 = 0; + gchar** _vala_not_contains = NULL; + int _vala_not_contains_length1 = 0; + GeeBidirSortedMap* _tmp0_; + GeeBidirSortedMap* _tmp1_; + GeeBidirSortedMap* _tmp2_; + GeeBidirSortedMap* _tmp3_; + GeeBidirSortedMap* _tmp4_; + GeeBidirSortedMap* _tmp5_; + GeeSortedMapTestsSubMapTestsType _tmp6_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp0_, "one", "one"); + _tmp1_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp1_, "two", "two"); + _tmp2_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp2_, "three", "three"); + _tmp3_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp3_, "four", "four"); + _tmp4_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp4_, "five", "five"); + _tmp5_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp5_, "six", "six"); + _tmp6_ = self->priv->type; + switch (_tmp6_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + gchar* _tmp7_; + gchar* _tmp8_; + gchar** _tmp9_ = NULL; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar** _tmp14_ = NULL; + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("four"); + _tmp9_ = g_new0 (gchar*, 2 + 1); + _tmp9_[0] = _tmp7_; + _tmp9_[1] = _tmp8_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp9_; + _vala_contains_length1 = 2; + _tmp10_ = g_strdup ("one"); + _tmp11_ = g_strdup ("two"); + _tmp12_ = g_strdup ("three"); + _tmp13_ = g_strdup ("six"); + _tmp14_ = g_new0 (gchar*, 4 + 1); + _tmp14_[0] = _tmp10_; + _tmp14_[1] = _tmp11_; + _tmp14_[2] = _tmp12_; + _tmp14_[3] = _tmp13_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp14_; + _vala_not_contains_length1 = 4; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + gchar* _tmp15_; + gchar* _tmp16_; + gchar* _tmp17_; + gchar** _tmp18_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; + gchar** _tmp22_ = NULL; + _tmp15_ = g_strdup ("six"); + _tmp16_ = g_strdup ("three"); + _tmp17_ = g_strdup ("two"); + _tmp18_ = g_new0 (gchar*, 3 + 1); + _tmp18_[0] = _tmp15_; + _tmp18_[1] = _tmp16_; + _tmp18_[2] = _tmp17_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp18_; + _vala_contains_length1 = 3; + _tmp19_ = g_strdup ("one"); + _tmp20_ = g_strdup ("four"); + _tmp21_ = g_strdup ("five"); + _tmp22_ = g_new0 (gchar*, 3 + 1); + _tmp22_[0] = _tmp19_; + _tmp22_[1] = _tmp20_; + _tmp22_[2] = _tmp21_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp22_; + _vala_not_contains_length1 = 3; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + gchar* _tmp23_; + gchar* _tmp24_; + gchar* _tmp25_; + gchar** _tmp26_ = NULL; + gchar* _tmp27_; + gchar* _tmp28_; + gchar* _tmp29_; + gchar** _tmp30_ = NULL; + _tmp23_ = g_strdup ("four"); + _tmp24_ = g_strdup ("one"); + _tmp25_ = g_strdup ("six"); + _tmp26_ = g_new0 (gchar*, 3 + 1); + _tmp26_[0] = _tmp23_; + _tmp26_[1] = _tmp24_; + _tmp26_[2] = _tmp25_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp26_; + _vala_contains_length1 = 3; + _tmp27_ = g_strdup ("two"); + _tmp28_ = g_strdup ("three"); + _tmp29_ = g_strdup ("five"); + _tmp30_ = g_new0 (gchar*, 3 + 1); + _tmp30_[0] = _tmp27_; + _tmp30_[1] = _tmp28_; + _tmp30_[2] = _tmp29_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp30_; + _vala_not_contains_length1 = 3; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + gchar** _tmp31_ = NULL; + gchar* _tmp32_; + gchar* _tmp33_; + gchar* _tmp34_; + gchar* _tmp35_; + gchar* _tmp36_; + gchar* _tmp37_; + gchar** _tmp38_ = NULL; + _tmp31_ = g_new0 (gchar*, 0 + 1); + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp31_; + _vala_contains_length1 = 0; + _tmp32_ = g_strdup ("one"); + _tmp33_ = g_strdup ("two"); + _tmp34_ = g_strdup ("three"); + _tmp35_ = g_strdup ("four"); + _tmp36_ = g_strdup ("five"); + _tmp37_ = g_strdup ("six"); + _tmp38_ = g_new0 (gchar*, 6 + 1); + _tmp38_[0] = _tmp32_; + _tmp38_[1] = _tmp33_; + _tmp38_[2] = _tmp34_; + _tmp38_[3] = _tmp35_; + _tmp38_[4] = _tmp36_; + _tmp38_[5] = _tmp37_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp38_; + _vala_not_contains_length1 = 6; + break; + } + default: + { + g_assert_not_reached (); + } + } + if (contains) { + *contains = _vala_contains; + } else { + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + } + if (contains_length1) { + *contains_length1 = _vala_contains_length1; + } + if (not_contains) { + *not_contains = _vala_not_contains; + } else { + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + } + if (not_contains_length1) { + *not_contains_length1 = _vala_not_contains_length1; + } +} + + +void bidir_sorted_map_tests_bidir_sub_map_tests_test_bidir_iterators (BidirSortedMapTestsBidirSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeBidirSortedMap* _tmp0_; + GeeBidirMapIterator* _tmp1_ = NULL; + GeeBidirMapIterator* _map_iter; + GeeBidirMapIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeBidirMapIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeBidirMapIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeBidirMapIterator* _tmp8_; + gboolean _tmp9_ = FALSE; + gchar** _tmp10_ = NULL; + gint _tmp11_ = 0; + gchar** _tmp12_ = NULL; + gint _tmp13_ = 0; + gint i; + GeeBidirSortedMap* _tmp14_; + GeeBidirMapIterator* _tmp15_ = NULL; + gint _tmp31_; + gchar** _tmp32_; + gint _tmp32__length1; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + gint _tmp67_; + gchar** _tmp68_; + gint _tmp68__length1; + GeeBidirSortedMap* _tmp69_; + GeeSortedSet* _tmp70_; + GeeSortedSet* _tmp71_; + GeeBidirSortedSet* _tmp72_; + GeeBidirIterator* _tmp73_ = NULL; + GeeBidirIterator* _tmp74_; + GeeBidirIterator* keys_iter; + GeeBidirSortedMap* _tmp75_; + GeeSortedSet* _tmp76_; + GeeSortedSet* _tmp77_; + GeeBidirSortedSet* _tmp78_; + GeeBidirIterator* _tmp79_ = NULL; + GeeBidirIterator* _tmp80_; + GeeBidirIterator* entries_iter; + GeeBidirSortedMap* _tmp81_; + GeeBidirMapIterator* _tmp82_ = NULL; + GeeBidirMapIterator* map_iter; + GeeSortedMapTestsSubMapTestsType _tmp83_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_bidir_sorted_map_bidir_map_iterator (_tmp0_); + _map_iter = _tmp1_; + _tmp2_ = _map_iter; + _tmp3_ = gee_map_iterator_has_next ((GeeMapIterator*) _tmp2_); + _vala_assert (!_tmp3_, "!_map_iter.has_next ()"); + _tmp4_ = _map_iter; + _tmp5_ = gee_map_iterator_next ((GeeMapIterator*) _tmp4_); + _vala_assert (!_tmp5_, "!_map_iter.next ()"); + _tmp6_ = _map_iter; + _tmp7_ = gee_bidir_map_iterator_has_previous (_tmp6_); + _vala_assert (!_tmp7_, "!_map_iter.has_previous ()"); + _tmp8_ = _map_iter; + _tmp9_ = gee_bidir_map_iterator_previous (_tmp8_); + _vala_assert (!_tmp9_, "!_map_iter.previous ()"); + bidir_sorted_map_tests_bidir_sub_map_tests_set_default_values (self, &_tmp10_, &_tmp11_, &_tmp12_, &_tmp13_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp10_; + contains_length1 = _tmp11_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp12_; + not_contains_length1 = _tmp13_; + _not_contains_size_ = not_contains_length1; + i = 0; + _tmp14_ = self->priv->submap; + _tmp15_ = gee_bidir_sorted_map_bidir_map_iterator (_tmp14_); + _g_object_unref0 (_map_iter); + _map_iter = _tmp15_; + while (TRUE) { + GeeBidirMapIterator* _tmp16_; + gboolean _tmp17_ = FALSE; + GeeBidirMapIterator* _tmp18_; + gpointer _tmp19_ = NULL; + gchar* _tmp20_; + gchar** _tmp21_; + gint _tmp21__length1; + gint _tmp22_; + const gchar* _tmp23_; + GeeBidirMapIterator* _tmp24_; + gpointer _tmp25_ = NULL; + gchar* _tmp26_; + gchar** _tmp27_; + gint _tmp27__length1; + gint _tmp28_; + const gchar* _tmp29_; + gint _tmp30_; + _tmp16_ = _map_iter; + _tmp17_ = gee_map_iterator_next ((GeeMapIterator*) _tmp16_); + if (!_tmp17_) { + break; + } + _tmp18_ = _map_iter; + _tmp19_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp18_); + _tmp20_ = (gchar*) _tmp19_; + _tmp21_ = contains; + _tmp21__length1 = contains_length1; + _tmp22_ = i; + _tmp23_ = _tmp21_[_tmp22_]; + _vala_assert (g_strcmp0 (_tmp20_, _tmp23_) == 0, "_map_iter.get_key () == contains[i]"); + _g_free0 (_tmp20_); + _tmp24_ = _map_iter; + _tmp25_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp24_); + _tmp26_ = (gchar*) _tmp25_; + _tmp27_ = contains; + _tmp27__length1 = contains_length1; + _tmp28_ = i; + _tmp29_ = _tmp27_[_tmp28_]; + _vala_assert (g_strcmp0 (_tmp26_, _tmp29_) == 0, "_map_iter.get_value () == contains[i]"); + _g_free0 (_tmp26_); + _tmp30_ = i; + i = _tmp30_ + 1; + } + _tmp31_ = i; + _tmp32_ = contains; + _tmp32__length1 = contains_length1; + _vala_assert (_tmp31_ == _tmp32__length1, "i == contains.length"); + i = 0; + { + GeeBidirSortedMap* _tmp33_; + GeeSet* _tmp34_; + GeeSet* _tmp35_; + GeeSet* _tmp36_; + GeeIterator* _tmp37_ = NULL; + GeeIterator* _tmp38_; + GeeIterator* _k_it; + _tmp33_ = self->priv->submap; + _tmp34_ = gee_map_get_keys ((GeeMap*) _tmp33_); + _tmp35_ = _tmp34_; + _tmp36_ = _tmp35_; + _tmp37_ = gee_iterable_iterator ((GeeIterable*) _tmp36_); + _tmp38_ = _tmp37_; + _g_object_unref0 (_tmp36_); + _k_it = _tmp38_; + while (TRUE) { + GeeIterator* _tmp39_; + gboolean _tmp40_ = FALSE; + GeeIterator* _tmp41_; + gpointer _tmp42_ = NULL; + gchar* k; + const gchar* _tmp43_; + gchar** _tmp44_; + gint _tmp44__length1; + gint _tmp45_; + const gchar* _tmp46_; + _tmp39_ = _k_it; + _tmp40_ = gee_iterator_next (_tmp39_); + if (!_tmp40_) { + break; + } + _tmp41_ = _k_it; + _tmp42_ = gee_iterator_get (_tmp41_); + k = (gchar*) _tmp42_; + _tmp43_ = k; + _tmp44_ = contains; + _tmp44__length1 = contains_length1; + _tmp45_ = i; + i = _tmp45_ + 1; + _tmp46_ = _tmp44_[_tmp45_]; + _vala_assert (g_strcmp0 (_tmp43_, _tmp46_) == 0, "k == contains[i++]"); + _g_free0 (k); + } + _g_object_unref0 (_k_it); + } + _tmp47_ = i; + _tmp48_ = contains; + _tmp48__length1 = contains_length1; + _vala_assert (_tmp47_ == _tmp48__length1, "i == contains.length"); + i = 0; + { + GeeBidirSortedMap* _tmp49_; + GeeSet* _tmp50_; + GeeSet* _tmp51_; + GeeSet* _tmp52_; + GeeIterator* _tmp53_ = NULL; + GeeIterator* _tmp54_; + GeeIterator* _e_it; + _tmp49_ = self->priv->submap; + _tmp50_ = gee_map_get_entries ((GeeMap*) _tmp49_); + _tmp51_ = _tmp50_; + _tmp52_ = _tmp51_; + _tmp53_ = gee_iterable_iterator ((GeeIterable*) _tmp52_); + _tmp54_ = _tmp53_; + _g_object_unref0 (_tmp52_); + _e_it = _tmp54_; + while (TRUE) { + GeeIterator* _tmp55_; + gboolean _tmp56_ = FALSE; + GeeIterator* _tmp57_; + gpointer _tmp58_ = NULL; + GeeMapEntry* e; + GeeMapEntry* _tmp59_; + gchar** _tmp60_; + gint _tmp60__length1; + gint _tmp61_; + const gchar* _tmp62_; + gchar** _tmp63_; + gint _tmp63__length1; + gint _tmp64_; + const gchar* _tmp65_; + gint _tmp66_; + _tmp55_ = _e_it; + _tmp56_ = gee_iterator_next (_tmp55_); + if (!_tmp56_) { + break; + } + _tmp57_ = _e_it; + _tmp58_ = gee_iterator_get (_tmp57_); + e = (GeeMapEntry*) _tmp58_; + _tmp59_ = e; + _tmp60_ = contains; + _tmp60__length1 = contains_length1; + _tmp61_ = i; + _tmp62_ = _tmp60_[_tmp61_]; + _tmp63_ = contains; + _tmp63__length1 = contains_length1; + _tmp64_ = i; + _tmp65_ = _tmp63_[_tmp64_]; + map_tests_assert_entry (_tmp59_, _tmp62_, _tmp65_); + _tmp66_ = i; + i = _tmp66_ + 1; + _g_object_unref0 (e); + } + _g_object_unref0 (_e_it); + } + _tmp67_ = i; + _tmp68_ = contains; + _tmp68__length1 = contains_length1; + _vala_assert (_tmp67_ == _tmp68__length1, "i == contains.length"); + _tmp69_ = self->priv->submap; + _tmp70_ = gee_sorted_map_get_ascending_keys ((GeeSortedMap*) _tmp69_); + _tmp71_ = _tmp70_; + _tmp72_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp71_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp71_) : NULL; + _tmp73_ = gee_bidir_sorted_set_bidir_iterator (_tmp72_); + _tmp74_ = _tmp73_; + _g_object_unref0 (_tmp72_); + keys_iter = _tmp74_; + _tmp75_ = self->priv->submap; + _tmp76_ = gee_sorted_map_get_ascending_entries ((GeeSortedMap*) _tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp77_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp77_) : NULL; + _tmp79_ = gee_bidir_sorted_set_bidir_iterator (_tmp78_); + _tmp80_ = _tmp79_; + _g_object_unref0 (_tmp78_); + entries_iter = _tmp80_; + _tmp81_ = self->priv->submap; + _tmp82_ = gee_bidir_sorted_map_bidir_map_iterator (_tmp81_); + map_iter = _tmp82_; + _tmp83_ = self->priv->type; + if (_tmp83_ != GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY) { + GeeBidirMapIterator* _tmp84_; + gboolean _tmp85_ = FALSE; + GeeBidirMapIterator* _tmp86_; + gpointer _tmp87_ = NULL; + gchar* _tmp88_; + gchar** _tmp89_; + gint _tmp89__length1; + gchar** _tmp90_; + gint _tmp90__length1; + const gchar* _tmp91_; + GeeBidirMapIterator* _tmp92_; + gpointer _tmp93_ = NULL; + gchar* _tmp94_; + gchar** _tmp95_; + gint _tmp95__length1; + gchar** _tmp96_; + gint _tmp96__length1; + const gchar* _tmp97_; + GeeBidirSortedMap* _tmp98_; + GeeBidirMapIterator* _tmp99_ = NULL; + GeeBidirMapIterator* _tmp100_; + gboolean _tmp101_ = FALSE; + GeeBidirMapIterator* _tmp102_; + gpointer _tmp103_ = NULL; + gchar* _tmp104_; + gchar** _tmp105_; + gint _tmp105__length1; + const gchar* _tmp106_; + GeeBidirMapIterator* _tmp107_; + gpointer _tmp108_ = NULL; + gchar* _tmp109_; + gchar** _tmp110_; + gint _tmp110__length1; + const gchar* _tmp111_; + GeeBidirMapIterator* _tmp112_; + gboolean _tmp113_ = FALSE; + GeeBidirMapIterator* _tmp114_; + gboolean _tmp115_ = FALSE; + GeeBidirMapIterator* _tmp116_; + gpointer _tmp117_ = NULL; + gchar* _tmp118_; + gchar** _tmp119_; + gint _tmp119__length1; + const gchar* _tmp120_; + GeeBidirMapIterator* _tmp121_; + gpointer _tmp122_ = NULL; + gchar* _tmp123_; + gchar** _tmp124_; + gint _tmp124__length1; + const gchar* _tmp125_; + GeeBidirMapIterator* _tmp126_; + gboolean _tmp127_ = FALSE; + GeeBidirMapIterator* _tmp128_; + GeeBidirMapIterator* _tmp129_; + gboolean _tmp130_ = FALSE; + GeeSortedMapTestsSubMapTestsType _tmp131_; + GeeBidirMapIterator* _tmp136_; + gboolean _tmp137_ = FALSE; + GeeBidirMapIterator* _tmp138_; + gpointer _tmp139_ = NULL; + gchar* _tmp140_; + gchar** _tmp141_; + gint _tmp141__length1; + const gchar* _tmp142_; + GeeBidirMapIterator* _tmp143_; + gpointer _tmp144_ = NULL; + gchar* _tmp145_; + gchar** _tmp146_; + gint _tmp146__length1; + const gchar* _tmp147_; + GeeBidirSortedMap* _tmp148_; + gchar** _tmp149_ = NULL; + gint _tmp150_ = 0; + gchar** _tmp151_ = NULL; + gint _tmp152_ = 0; + GeeBidirIterator* _tmp153_; + gboolean _tmp154_ = FALSE; + GeeBidirIterator* _tmp155_; + gpointer _tmp156_ = NULL; + gchar* _tmp157_; + gchar** _tmp158_; + gint _tmp158__length1; + gchar** _tmp159_; + gint _tmp159__length1; + const gchar* _tmp160_; + GeeBidirIterator* _tmp161_; + gboolean _tmp162_ = FALSE; + GeeBidirIterator* _tmp163_; + gpointer _tmp164_ = NULL; + gchar* _tmp165_; + gchar** _tmp166_; + gint _tmp166__length1; + const gchar* _tmp167_; + GeeBidirIterator* _tmp168_; + gboolean _tmp169_ = FALSE; + GeeBidirIterator* _tmp170_; + gboolean _tmp171_ = FALSE; + GeeBidirIterator* _tmp172_; + gpointer _tmp173_ = NULL; + gchar* _tmp174_; + gchar** _tmp175_; + gint _tmp175__length1; + const gchar* _tmp176_; + GeeBidirIterator* _tmp177_; + gboolean _tmp178_ = FALSE; + gboolean _tmp179_ = FALSE; + GeeBidirIterator* _tmp181_; + gboolean _tmp182_ = FALSE; + GeeSortedMapTestsSubMapTestsType _tmp183_; + GeeBidirIterator* _tmp188_; + gboolean _tmp189_ = FALSE; + GeeBidirIterator* _tmp190_; + gpointer _tmp191_ = NULL; + gchar* _tmp192_; + gchar** _tmp193_; + gint _tmp193__length1; + const gchar* _tmp194_; + GeeBidirSortedMap* _tmp195_; + gchar** _tmp196_ = NULL; + gint _tmp197_ = 0; + gchar** _tmp198_ = NULL; + gint _tmp199_ = 0; + GeeBidirIterator* _tmp200_; + gboolean _tmp201_ = FALSE; + GeeBidirIterator* _tmp202_; + gpointer _tmp203_ = NULL; + GeeMapEntry* _tmp204_; + gchar** _tmp205_; + gint _tmp205__length1; + gchar** _tmp206_; + gint _tmp206__length1; + const gchar* _tmp207_; + gchar** _tmp208_; + gint _tmp208__length1; + gchar** _tmp209_; + gint _tmp209__length1; + const gchar* _tmp210_; + GeeBidirIterator* _tmp211_; + gboolean _tmp212_ = FALSE; + GeeBidirIterator* _tmp213_; + gpointer _tmp214_ = NULL; + GeeMapEntry* _tmp215_; + gchar** _tmp216_; + gint _tmp216__length1; + const gchar* _tmp217_; + gchar** _tmp218_; + gint _tmp218__length1; + const gchar* _tmp219_; + GeeBidirIterator* _tmp220_; + gboolean _tmp221_ = FALSE; + GeeBidirIterator* _tmp222_; + gboolean _tmp223_ = FALSE; + GeeBidirIterator* _tmp224_; + gpointer _tmp225_ = NULL; + GeeMapEntry* _tmp226_; + gchar** _tmp227_; + gint _tmp227__length1; + const gchar* _tmp228_; + gchar** _tmp229_; + gint _tmp229__length1; + const gchar* _tmp230_; + GeeBidirIterator* _tmp231_; + gboolean _tmp232_ = FALSE; + GeeBidirIterator* _tmp233_; + GeeBidirIterator* _tmp234_; + gboolean _tmp235_ = FALSE; + GeeSortedMapTestsSubMapTestsType _tmp236_; + GeeBidirIterator* _tmp241_; + gboolean _tmp242_ = FALSE; + GeeBidirIterator* _tmp243_; + gpointer _tmp244_ = NULL; + GeeMapEntry* _tmp245_; + gchar** _tmp246_; + gint _tmp246__length1; + const gchar* _tmp247_; + gchar** _tmp248_; + gint _tmp248__length1; + const gchar* _tmp249_; + _tmp84_ = map_iter; + _tmp85_ = gee_bidir_map_iterator_last (_tmp84_); + _vala_assert (_tmp85_, "map_iter.last ()"); + _tmp86_ = map_iter; + _tmp87_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp86_); + _tmp88_ = (gchar*) _tmp87_; + _tmp89_ = contains; + _tmp89__length1 = contains_length1; + _tmp90_ = contains; + _tmp90__length1 = contains_length1; + _tmp91_ = _tmp89_[_tmp90__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp88_, _tmp91_) == 0, "map_iter.get_key () == contains[contains.length - 1]"); + _g_free0 (_tmp88_); + _tmp92_ = map_iter; + _tmp93_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp92_); + _tmp94_ = (gchar*) _tmp93_; + _tmp95_ = contains; + _tmp95__length1 = contains_length1; + _tmp96_ = contains; + _tmp96__length1 = contains_length1; + _tmp97_ = _tmp95_[_tmp96__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp94_, _tmp97_) == 0, "map_iter.get_value () == contains[contains.length - 1]"); + _g_free0 (_tmp94_); + _tmp98_ = self->priv->submap; + _tmp99_ = gee_bidir_sorted_map_bidir_map_iterator (_tmp98_); + _g_object_unref0 (map_iter); + map_iter = _tmp99_; + _tmp100_ = map_iter; + _tmp101_ = gee_map_iterator_next ((GeeMapIterator*) _tmp100_); + _vala_assert (_tmp101_, "map_iter.next ()"); + _tmp102_ = map_iter; + _tmp103_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp102_); + _tmp104_ = (gchar*) _tmp103_; + _tmp105_ = contains; + _tmp105__length1 = contains_length1; + _tmp106_ = _tmp105_[0]; + _vala_assert (g_strcmp0 (_tmp104_, _tmp106_) == 0, "map_iter.get_key () == contains[0]"); + _g_free0 (_tmp104_); + _tmp107_ = map_iter; + _tmp108_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp107_); + _tmp109_ = (gchar*) _tmp108_; + _tmp110_ = contains; + _tmp110__length1 = contains_length1; + _tmp111_ = _tmp110_[0]; + _vala_assert (g_strcmp0 (_tmp109_, _tmp111_) == 0, "map_iter.get_value () == contains[0]"); + _g_free0 (_tmp109_); + _tmp112_ = map_iter; + _tmp113_ = gee_map_iterator_has_next ((GeeMapIterator*) _tmp112_); + _vala_assert (_tmp113_, "map_iter.has_next ()"); + _tmp114_ = map_iter; + _tmp115_ = gee_map_iterator_next ((GeeMapIterator*) _tmp114_); + _vala_assert (_tmp115_, "map_iter.next ()"); + _tmp116_ = map_iter; + _tmp117_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp116_); + _tmp118_ = (gchar*) _tmp117_; + _tmp119_ = contains; + _tmp119__length1 = contains_length1; + _tmp120_ = _tmp119_[1]; + _vala_assert (g_strcmp0 (_tmp118_, _tmp120_) == 0, "map_iter.get_key () == contains[1]"); + _g_free0 (_tmp118_); + _tmp121_ = map_iter; + _tmp122_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp121_); + _tmp123_ = (gchar*) _tmp122_; + _tmp124_ = contains; + _tmp124__length1 = contains_length1; + _tmp125_ = _tmp124_[1]; + _vala_assert (g_strcmp0 (_tmp123_, _tmp125_) == 0, "map_iter.get_value () == contains[1]"); + _g_free0 (_tmp123_); + _tmp126_ = map_iter; + _tmp127_ = gee_bidir_map_iterator_has_previous (_tmp126_); + _vala_assert (_tmp127_, "map_iter.has_previous ()"); + _tmp128_ = map_iter; + gee_map_iterator_unset ((GeeMapIterator*) _tmp128_); + _tmp129_ = map_iter; + _tmp130_ = gee_bidir_map_iterator_has_previous (_tmp129_); + _vala_assert (_tmp130_, "map_iter.has_previous ()"); + _tmp131_ = self->priv->type; + if (_tmp131_ != GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD) { + GeeBidirMapIterator* _tmp132_; + gboolean _tmp133_ = FALSE; + _tmp132_ = map_iter; + _tmp133_ = gee_map_iterator_has_next ((GeeMapIterator*) _tmp132_); + _vala_assert (_tmp133_, "map_iter.has_next ()"); + } else { + GeeBidirMapIterator* _tmp134_; + gboolean _tmp135_ = FALSE; + _tmp134_ = map_iter; + _tmp135_ = gee_map_iterator_has_next ((GeeMapIterator*) _tmp134_); + _vala_assert (!_tmp135_, "!map_iter.has_next ()"); + } + _tmp136_ = map_iter; + _tmp137_ = gee_bidir_map_iterator_previous (_tmp136_); + _vala_assert (_tmp137_, "map_iter.previous ()"); + _tmp138_ = map_iter; + _tmp139_ = gee_map_iterator_get_key ((GeeMapIterator*) _tmp138_); + _tmp140_ = (gchar*) _tmp139_; + _tmp141_ = contains; + _tmp141__length1 = contains_length1; + _tmp142_ = _tmp141_[0]; + _vala_assert (g_strcmp0 (_tmp140_, _tmp142_) == 0, "map_iter.get_key () == contains[0]"); + _g_free0 (_tmp140_); + _tmp143_ = map_iter; + _tmp144_ = gee_map_iterator_get_value ((GeeMapIterator*) _tmp143_); + _tmp145_ = (gchar*) _tmp144_; + _tmp146_ = contains; + _tmp146__length1 = contains_length1; + _tmp147_ = _tmp146_[0]; + _vala_assert (g_strcmp0 (_tmp145_, _tmp147_) == 0, "map_iter.get_value () == contains[0]"); + _g_free0 (_tmp145_); + _tmp148_ = self->priv->master; + gee_map_clear ((GeeMap*) _tmp148_); + bidir_sorted_map_tests_bidir_sub_map_tests_set_default_values (self, &_tmp149_, &_tmp150_, &_tmp151_, &_tmp152_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp149_; + contains_length1 = _tmp150_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp151_; + not_contains_length1 = _tmp152_; + _not_contains_size_ = not_contains_length1; + _tmp153_ = keys_iter; + _tmp154_ = gee_bidir_iterator_last (_tmp153_); + _vala_assert (_tmp154_, "keys_iter.last ()"); + _tmp155_ = keys_iter; + _tmp156_ = gee_iterator_get ((GeeIterator*) _tmp155_); + _tmp157_ = (gchar*) _tmp156_; + _tmp158_ = contains; + _tmp158__length1 = contains_length1; + _tmp159_ = contains; + _tmp159__length1 = contains_length1; + _tmp160_ = _tmp158_[_tmp159__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp157_, _tmp160_) == 0, "keys_iter.get () == contains[contains.length - 1]"); + _g_free0 (_tmp157_); + _tmp161_ = keys_iter; + _tmp162_ = gee_bidir_iterator_first (_tmp161_); + _vala_assert (_tmp162_, "keys_iter.first ()"); + _tmp163_ = keys_iter; + _tmp164_ = gee_iterator_get ((GeeIterator*) _tmp163_); + _tmp165_ = (gchar*) _tmp164_; + _tmp166_ = contains; + _tmp166__length1 = contains_length1; + _tmp167_ = _tmp166_[0]; + _vala_assert (g_strcmp0 (_tmp165_, _tmp167_) == 0, "keys_iter.get () == contains[0]"); + _g_free0 (_tmp165_); + _tmp168_ = keys_iter; + _tmp169_ = gee_iterator_has_next ((GeeIterator*) _tmp168_); + _vala_assert (_tmp169_, "keys_iter.has_next ()"); + _tmp170_ = keys_iter; + _tmp171_ = gee_iterator_next ((GeeIterator*) _tmp170_); + _vala_assert (_tmp171_, "keys_iter.next ()"); + _tmp172_ = keys_iter; + _tmp173_ = gee_iterator_get ((GeeIterator*) _tmp172_); + _tmp174_ = (gchar*) _tmp173_; + _tmp175_ = contains; + _tmp175__length1 = contains_length1; + _tmp176_ = _tmp175_[1]; + _vala_assert (g_strcmp0 (_tmp174_, _tmp176_) == 0, "keys_iter.get () == contains[1]"); + _g_free0 (_tmp174_); + _tmp177_ = keys_iter; + _tmp178_ = gee_bidir_iterator_has_previous (_tmp177_); + _vala_assert (_tmp178_, "keys_iter.has_previous ()"); + _tmp179_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp179_) { + GeeBidirIterator* _tmp180_; + _tmp180_ = keys_iter; + gee_iterator_remove ((GeeIterator*) _tmp180_); + exit (0); + } + _tmp181_ = keys_iter; + _tmp182_ = gee_bidir_iterator_has_previous (_tmp181_); + _vala_assert (_tmp182_, "keys_iter.has_previous ()"); + _tmp183_ = self->priv->type; + if (_tmp183_ != GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD) { + GeeBidirIterator* _tmp184_; + gboolean _tmp185_ = FALSE; + _tmp184_ = keys_iter; + _tmp185_ = gee_iterator_has_next ((GeeIterator*) _tmp184_); + _vala_assert (_tmp185_, "keys_iter.has_next ()"); + } else { + GeeBidirIterator* _tmp186_; + gboolean _tmp187_ = FALSE; + _tmp186_ = keys_iter; + _tmp187_ = gee_iterator_has_next ((GeeIterator*) _tmp186_); + _vala_assert (!_tmp187_, "!keys_iter.has_next ()"); + } + _tmp188_ = keys_iter; + _tmp189_ = gee_bidir_iterator_previous (_tmp188_); + _vala_assert (_tmp189_, "keys_iter.previous ()"); + _tmp190_ = keys_iter; + _tmp191_ = gee_iterator_get ((GeeIterator*) _tmp190_); + _tmp192_ = (gchar*) _tmp191_; + _tmp193_ = contains; + _tmp193__length1 = contains_length1; + _tmp194_ = _tmp193_[0]; + _vala_assert (g_strcmp0 (_tmp192_, _tmp194_) == 0, "keys_iter.get () == contains[0]"); + _g_free0 (_tmp192_); + _tmp195_ = self->priv->master; + gee_map_clear ((GeeMap*) _tmp195_); + bidir_sorted_map_tests_bidir_sub_map_tests_set_default_values (self, &_tmp196_, &_tmp197_, &_tmp198_, &_tmp199_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp196_; + contains_length1 = _tmp197_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp198_; + not_contains_length1 = _tmp199_; + _not_contains_size_ = not_contains_length1; + _tmp200_ = entries_iter; + _tmp201_ = gee_bidir_iterator_last (_tmp200_); + _vala_assert (_tmp201_, "entries_iter.last ()"); + _tmp202_ = entries_iter; + _tmp203_ = gee_iterator_get ((GeeIterator*) _tmp202_); + _tmp204_ = (GeeMapEntry*) _tmp203_; + _tmp205_ = contains; + _tmp205__length1 = contains_length1; + _tmp206_ = contains; + _tmp206__length1 = contains_length1; + _tmp207_ = _tmp205_[_tmp206__length1 - 1]; + _tmp208_ = contains; + _tmp208__length1 = contains_length1; + _tmp209_ = contains; + _tmp209__length1 = contains_length1; + _tmp210_ = _tmp208_[_tmp209__length1 - 1]; + map_tests_assert_entry (_tmp204_, _tmp207_, _tmp210_); + _g_object_unref0 (_tmp204_); + _tmp211_ = entries_iter; + _tmp212_ = gee_bidir_iterator_first (_tmp211_); + _vala_assert (_tmp212_, "entries_iter.first ()"); + _tmp213_ = entries_iter; + _tmp214_ = gee_iterator_get ((GeeIterator*) _tmp213_); + _tmp215_ = (GeeMapEntry*) _tmp214_; + _tmp216_ = contains; + _tmp216__length1 = contains_length1; + _tmp217_ = _tmp216_[0]; + _tmp218_ = contains; + _tmp218__length1 = contains_length1; + _tmp219_ = _tmp218_[0]; + map_tests_assert_entry (_tmp215_, _tmp217_, _tmp219_); + _g_object_unref0 (_tmp215_); + _tmp220_ = entries_iter; + _tmp221_ = gee_iterator_has_next ((GeeIterator*) _tmp220_); + _vala_assert (_tmp221_, "entries_iter.has_next ()"); + _tmp222_ = entries_iter; + _tmp223_ = gee_iterator_next ((GeeIterator*) _tmp222_); + _vala_assert (_tmp223_, "entries_iter.next ()"); + _tmp224_ = entries_iter; + _tmp225_ = gee_iterator_get ((GeeIterator*) _tmp224_); + _tmp226_ = (GeeMapEntry*) _tmp225_; + _tmp227_ = contains; + _tmp227__length1 = contains_length1; + _tmp228_ = _tmp227_[1]; + _tmp229_ = contains; + _tmp229__length1 = contains_length1; + _tmp230_ = _tmp229_[1]; + map_tests_assert_entry (_tmp226_, _tmp228_, _tmp230_); + _g_object_unref0 (_tmp226_); + _tmp231_ = entries_iter; + _tmp232_ = gee_bidir_iterator_has_previous (_tmp231_); + _vala_assert (_tmp232_, "entries_iter.has_previous ()"); + _tmp233_ = entries_iter; + gee_iterator_remove ((GeeIterator*) _tmp233_); + _tmp234_ = entries_iter; + _tmp235_ = gee_bidir_iterator_has_previous (_tmp234_); + _vala_assert (_tmp235_, "entries_iter.has_previous ()"); + _tmp236_ = self->priv->type; + if (_tmp236_ != GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD) { + GeeBidirIterator* _tmp237_; + gboolean _tmp238_ = FALSE; + _tmp237_ = entries_iter; + _tmp238_ = gee_iterator_has_next ((GeeIterator*) _tmp237_); + _vala_assert (_tmp238_, "entries_iter.has_next ()"); + } else { + GeeBidirIterator* _tmp239_; + gboolean _tmp240_ = FALSE; + _tmp239_ = entries_iter; + _tmp240_ = gee_iterator_has_next ((GeeIterator*) _tmp239_); + _vala_assert (!_tmp240_, "!entries_iter.has_next ()"); + } + _tmp241_ = entries_iter; + _tmp242_ = gee_bidir_iterator_previous (_tmp241_); + _vala_assert (_tmp242_, "entries_iter.previous ()"); + _tmp243_ = entries_iter; + _tmp244_ = gee_iterator_get ((GeeIterator*) _tmp243_); + _tmp245_ = (GeeMapEntry*) _tmp244_; + _tmp246_ = contains; + _tmp246__length1 = contains_length1; + _tmp247_ = _tmp246_[0]; + _tmp248_ = contains; + _tmp248__length1 = contains_length1; + _tmp249_ = _tmp248_[0]; + map_tests_assert_entry (_tmp245_, _tmp247_, _tmp249_); + _g_object_unref0 (_tmp245_); + } else { + GeeBidirIterator* _tmp250_; + gboolean _tmp251_ = FALSE; + GeeBidirIterator* _tmp252_; + gboolean _tmp253_ = FALSE; + gboolean _tmp254_ = FALSE; + GeeBidirIterator* _tmp256_; + gboolean _tmp257_ = FALSE; + gboolean _tmp258_ = FALSE; + _tmp250_ = keys_iter; + _tmp251_ = gee_bidir_iterator_first (_tmp250_); + _vala_assert (!_tmp251_, "!keys_iter.first ()"); + _tmp252_ = keys_iter; + _tmp253_ = gee_bidir_iterator_last (_tmp252_); + _vala_assert (!_tmp253_, "!keys_iter.last ()"); + _tmp254_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp254_) { + GeeBidirIterator* _tmp255_; + _tmp255_ = keys_iter; + gee_iterator_remove ((GeeIterator*) _tmp255_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp256_ = entries_iter; + _tmp257_ = gee_bidir_iterator_first (_tmp256_); + _vala_assert (!_tmp257_, "!entries_iter.first ()"); + _tmp258_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp258_) { + GeeBidirIterator* _tmp259_; + _tmp259_ = entries_iter; + gee_iterator_remove ((GeeIterator*) _tmp259_); + exit (0); + } + g_test_trap_assert_failed (); + } + _g_object_unref0 (map_iter); + _g_object_unref0 (entries_iter); + _g_object_unref0 (keys_iter); + _g_object_unref0 (_map_iter); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +static void bidir_sorted_map_tests_bidir_sub_map_tests_class_init (BidirSortedMapTestsBidirSubMapTestsClass * klass) { + bidir_sorted_map_tests_bidir_sub_map_tests_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (BidirSortedMapTestsBidirSubMapTestsPrivate)); + GEE_TEST_CASE_CLASS (klass)->set_up = bidir_sorted_map_tests_bidir_sub_map_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = bidir_sorted_map_tests_bidir_sub_map_tests_real_tear_down; + G_OBJECT_CLASS (klass)->finalize = bidir_sorted_map_tests_bidir_sub_map_tests_finalize; +} + + +static void bidir_sorted_map_tests_bidir_sub_map_tests_instance_init (BidirSortedMapTestsBidirSubMapTests * self) { + self->priv = BIDIR_SORTED_MAP_TESTS_BIDIR_SUB_MAP_TESTS_GET_PRIVATE (self); +} + + +static void bidir_sorted_map_tests_bidir_sub_map_tests_finalize (GObject* obj) { + BidirSortedMapTestsBidirSubMapTests * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIDIR_SORTED_MAP_TESTS_TYPE_BIDIR_SUB_MAP_TESTS, BidirSortedMapTestsBidirSubMapTests); + _g_object_unref0 (self->priv->master); + _g_object_unref0 (self->priv->submap); + _g_object_unref0 (self->priv->test); + G_OBJECT_CLASS (bidir_sorted_map_tests_bidir_sub_map_tests_parent_class)->finalize (obj); +} + + +GType bidir_sorted_map_tests_bidir_sub_map_tests_get_type (void) { + static volatile gsize bidir_sorted_map_tests_bidir_sub_map_tests_type_id__volatile = 0; + if (g_once_init_enter (&bidir_sorted_map_tests_bidir_sub_map_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (BidirSortedMapTestsBidirSubMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_map_tests_bidir_sub_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedMapTestsBidirSubMapTests), 0, (GInstanceInitFunc) bidir_sorted_map_tests_bidir_sub_map_tests_instance_init, NULL }; + GType bidir_sorted_map_tests_bidir_sub_map_tests_type_id; + bidir_sorted_map_tests_bidir_sub_map_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "BidirSortedMapTestsBidirSubMapTests", &g_define_type_info, 0); + g_once_init_leave (&bidir_sorted_map_tests_bidir_sub_map_tests_type_id__volatile, bidir_sorted_map_tests_bidir_sub_map_tests_type_id); + } + return bidir_sorted_map_tests_bidir_sub_map_tests_type_id__volatile; +} + + +static void bidir_sorted_map_tests_class_init (BidirSortedMapTestsClass * klass) { + bidir_sorted_map_tests_parent_class = g_type_class_peek_parent (klass); +} + + +static void bidir_sorted_map_tests_instance_init (BidirSortedMapTests * self) { +} + + +GType bidir_sorted_map_tests_get_type (void) { + static volatile gsize bidir_sorted_map_tests_type_id__volatile = 0; + if (g_once_init_enter (&bidir_sorted_map_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (BidirSortedMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedMapTests), 0, (GInstanceInitFunc) bidir_sorted_map_tests_instance_init, NULL }; + GType bidir_sorted_map_tests_type_id; + bidir_sorted_map_tests_type_id = g_type_register_static (GEE_TYPE_SORTED_MAP_TESTS, "BidirSortedMapTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_once_init_leave (&bidir_sorted_map_tests_type_id__volatile, bidir_sorted_map_tests_type_id); + } + return bidir_sorted_map_tests_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/tests/testbidirsortedmap.vala b/tests/testbidirsortedmap.vala new file mode 100644 index 0000000..385d715 --- /dev/null +++ b/tests/testbidirsortedmap.vala @@ -0,0 +1,430 @@ +/* testbidirsortedmap.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +using GLib; +using Gee; + +public abstract class BidirSortedMapTests : SortedMapTests { + public BidirSortedMapTests(string name) { + base (name); + add_test ("[SortedMap] bi-directional iterators can go backward", + test_bidir_iterator_can_go_backward); + add_test ("[SortedSet] bi-directional iterators can to end", + test_bidir_iterator_last); + get_suite ().add_suite (new BidirSubMapTests (this, SortedMapTests.SubMapTests.Type.HEAD).get_suite ()); + get_suite ().add_suite (new BidirSubMapTests (this, SortedMapTests.SubMapTests.Type.TAIL).get_suite ()); + get_suite ().add_suite (new BidirSubMapTests (this, SortedMapTests.SubMapTests.Type.SUB).get_suite ()); + get_suite ().add_suite (new BidirSubMapTests (this, SortedMapTests.SubMapTests.Type.EMPTY).get_suite ()); + } + + public void test_bidir_iterator_can_go_backward () { + var test_sorted_map = test_map as BidirSortedMap; + var keys = (test_sorted_map.ascending_keys) as BidirSortedSet; + var entries = (test_sorted_map.ascending_entries) as BidirSortedSet>; + + var keys_iterator = keys.bidir_iterator (); + var entries_iterator = entries.bidir_iterator (); + var map_iterator = test_sorted_map.bidir_map_iterator (); + + assert (!keys_iterator.has_previous ()); + assert (!entries_iterator.has_previous ()); + + assert (!map_iterator.has_previous ()); + assert (!keys_iterator.previous ()); + assert (!entries_iterator.has_previous ()); + + assert (!map_iterator.previous ()); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + keys_iterator = keys.bidir_iterator (); + entries_iterator = entries.bidir_iterator (); + map_iterator = test_sorted_map.bidir_map_iterator (); + + assert (keys_iterator.next ()); + assert (entries_iterator.next ()); + + assert (map_iterator.next ()); + assert (keys_iterator.get () == "five"); + assert_entry (entries_iterator.get (), "five", "five"); + + assert (map_iterator.get_key () == "five"); + assert (map_iterator.get_value () == "five"); + + assert (!keys_iterator.has_previous ()); + assert (!entries_iterator.has_previous ()); + + assert (!map_iterator.has_previous ()); + assert (keys_iterator.next ()); + assert (entries_iterator.next ()); + + assert (map_iterator.next ()); + assert (keys_iterator.get () == "four"); + assert_entry (entries_iterator.get (), "four", "four"); + + assert (map_iterator.get_key () == "four"); + assert (map_iterator.get_value () == "four"); + + assert (keys_iterator.has_previous ()); + assert (entries_iterator.has_previous ()); + + assert (map_iterator.has_previous ()); + assert (keys_iterator.next ()); + assert (entries_iterator.next ()); + + assert (map_iterator.next ()); + assert (keys_iterator.get () == "one"); + assert_entry (entries_iterator.get (), "one", "one"); + + assert (map_iterator.get_key () == "one"); + assert (map_iterator.get_value () == "one"); + + assert (keys_iterator.has_previous ()); + assert (entries_iterator.has_previous ()); + + assert (map_iterator.has_previous ()); + assert (keys_iterator.next ()); + assert (entries_iterator.next ()); + + assert (map_iterator.next ()); + assert (keys_iterator.get () == "six"); + assert_entry (entries_iterator.get (), "six", "six"); + + assert (map_iterator.get_key () == "six"); + assert (map_iterator.get_value () == "six"); + assert (keys_iterator.has_previous ()); + + assert (entries_iterator.has_previous ()); + assert (map_iterator.has_previous ()); + assert (keys_iterator.next ()); + + assert (entries_iterator.next ()); + assert (map_iterator.next ()); + assert (keys_iterator.get () == "three"); + + assert_entry (entries_iterator.get (), "three", "three"); + assert (map_iterator.get_key () == "three"); + assert (map_iterator.get_value () == "three"); + + assert (keys_iterator.has_previous ()); + assert (entries_iterator.has_previous ()); + assert (map_iterator.has_previous ()); + + assert (keys_iterator.next ()); + assert (entries_iterator.next ()); + assert (map_iterator.next ()); + + assert (keys_iterator.get () == "two"); + assert_entry (entries_iterator.get (), "two", "two"); + assert (map_iterator.get_key () == "two"); + assert (map_iterator.get_value () == "two"); + + assert (keys_iterator.has_previous ()); + assert (entries_iterator.has_previous ()); + assert (map_iterator.has_previous ()); + + assert (!keys_iterator.next ()); + assert (!entries_iterator.next ()); + assert (!map_iterator.next ()); + + assert (keys_iterator.previous ()); + assert (entries_iterator.previous ()); + assert (map_iterator.previous ()); + + assert (keys_iterator.get () == "three"); + assert_entry (entries_iterator.get (), "three", "three"); + assert (map_iterator.get_key () == "three"); + assert (map_iterator.get_value () == "three"); + + assert (keys_iterator.previous ()); + assert (entries_iterator.previous ()); + assert (map_iterator.previous ()); + + assert (keys_iterator.get () == "six"); + assert_entry (entries_iterator.get (), "six", "six"); + assert (map_iterator.get_key () == "six"); + assert (map_iterator.get_value () == "six"); + + assert (keys_iterator.previous ()); + assert (entries_iterator.previous ()); + assert (map_iterator.previous ()); + + assert (keys_iterator.get () == "one"); + assert_entry (entries_iterator.get (), "one", "one"); + assert (map_iterator.get_key () == "one"); + assert (map_iterator.get_value () == "one"); + + assert (keys_iterator.previous ()); + assert (entries_iterator.previous ()); + assert (map_iterator.previous ()); + + assert (keys_iterator.get () == "four"); + assert_entry (entries_iterator.get (), "four", "four"); + assert (map_iterator.get_key () == "four"); + assert (map_iterator.get_value () == "four"); + + assert (keys_iterator.previous ()); + assert (entries_iterator.previous ()); + assert (map_iterator.previous ()); + + assert (keys_iterator.get () == "five"); + assert_entry (entries_iterator.get (), "five", "five"); + assert (map_iterator.get_key () == "five"); + assert (map_iterator.get_value () == "five"); + + assert (!keys_iterator.previous ()); + assert (!entries_iterator.previous ()); + assert (!map_iterator.previous ()); + + assert (keys_iterator.get () == "five"); + assert_entry (entries_iterator.get (), "five", "five"); + assert (map_iterator.get_key () == "five"); + assert (map_iterator.get_value () == "five"); + } + + public void test_bidir_iterator_last () { + var test_sorted_map = test_map as BidirSortedMap; + var keys = (test_sorted_map.ascending_keys) as BidirSortedSet; + var entries = (test_sorted_map.ascending_entries) as BidirSortedSet>; + + var keys_iterator = keys.bidir_iterator (); + var entries_iterator = entries.bidir_iterator (); + + assert (!keys_iterator.last ()); + assert (!entries_iterator.last ()); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + keys_iterator = keys.bidir_iterator (); + entries_iterator = entries.bidir_iterator (); + + assert (keys_iterator.last ()); + assert (entries_iterator.last ()); + + assert (keys_iterator.get () == "two"); + assert_entry (entries_iterator.get (), "two", "two"); + } + + + public class BidirSubMapTests : Gee.TestCase { + private BidirSortedMap master; + private BidirSortedMap submap; + private BidirSortedMapTests test; + private SortedMapTests.SubMapTests.Type type; + + public BidirSubMapTests (BidirSortedMapTests test, SortedMapTests.SubMapTests.Type type) { + base ("%s Subset".printf (type.to_string ())); + this.test = test; + this.type = type; + add_test ("[BidirSortedSet] bi-directional iterator", test_bidir_iterators); + } + + public override void set_up () { + test.set_up (); + master = test.test_map as BidirSortedMap; + switch (type) { + case SortedMapTests.SubMapTests.Type.HEAD: + submap = master.head_map ("one") as BidirSortedMap; break; + case SortedMapTests.SubMapTests.Type.TAIL: + submap = master.tail_map ("six") as BidirSortedMap; break; + case SortedMapTests.SubMapTests.Type.SUB: + submap = master.sub_map ("four", "three") as BidirSortedMap; break; + case SortedMapTests.SubMapTests.Type.EMPTY: + submap = master.sub_map ("three", "four") as BidirSortedMap; break; + default: + assert_not_reached (); + } + } + + public override void tear_down () { + test.tear_down (); + } + + protected void set_default_values (out string[] contains = null, out string[] not_contains = null) { + master.set ("one", "one"); + master.set ("two", "two"); + master.set ("three", "three"); + master.set ("four", "four"); + master.set ("five", "five"); + master.set ("six", "six"); + switch (type) { + case SortedMapTests.SubMapTests.Type.HEAD: + contains = {"five", "four"}; + not_contains = {"one", "two", "three", "six"}; + break; + case SortedMapTests.SubMapTests.Type.TAIL: + contains = {"six", "three", "two"}; + not_contains = {"one", "four", "five"}; + break; + case SortedMapTests.SubMapTests.Type.SUB: + contains = {"four", "one", "six"}; + not_contains = {"two", "three", "five"}; + break; + case SortedMapTests.SubMapTests.Type.EMPTY: + contains = {}; + not_contains = {"one", "two", "three", "four", "five", "six"}; + break; + default: + assert_not_reached (); + } + } + + public void test_bidir_iterators () { + string[] contains, not_contains; + + var _map_iter = submap.bidir_map_iterator (); + + assert (!_map_iter.has_next ()); + assert (!_map_iter.next ()); + assert (!_map_iter.has_previous ()); + assert (!_map_iter.previous ()); + + set_default_values (out contains, out not_contains); + + var i = 0; + _map_iter = submap.bidir_map_iterator (); + while (_map_iter.next ()) { + assert (_map_iter.get_key () == contains[i]); + assert (_map_iter.get_value () == contains[i]); + i++; + } + assert (i == contains.length); + + i = 0; + foreach (var k in submap.keys) + assert (k == contains[i++]); + assert (i == contains.length); + + i = 0; + foreach (var e in submap.entries) { + MapTests.assert_entry (e, contains[i], contains[i]); + i++; + } + assert (i == contains.length); + + var keys_iter = ((submap.ascending_keys) as BidirSortedSet).bidir_iterator (); + var entries_iter = ((submap.ascending_entries) as BidirSortedSet>).bidir_iterator (); + var map_iter = submap.bidir_map_iterator (); + if (type != SortedMapTests.SubMapTests.Type.EMPTY) { + assert (map_iter.last ()); + assert (map_iter.get_key () == contains[contains.length - 1]); + assert (map_iter.get_value () == contains[contains.length - 1]); + + map_iter = submap.bidir_map_iterator (); + assert (map_iter.next ()); + + assert (map_iter.get_key () == contains[0]); + assert (map_iter.get_value () == contains[0]); + + assert (map_iter.has_next ()); + assert (map_iter.next ()); + assert (map_iter.get_key () == contains[1]); + assert (map_iter.get_value () == contains[1]); + + assert (map_iter.has_previous ()); + map_iter.unset (); + assert (map_iter.has_previous ()); + if (type != SortedMapTests.SubMapTests.Type.HEAD) + assert (map_iter.has_next ()); + else + assert (!map_iter.has_next ()); + assert (map_iter.previous ()); + assert (map_iter.get_key () == contains[0]); + assert (map_iter.get_value () == contains[0]); + + // Repeat for keys + master.clear (); + set_default_values (out contains, out not_contains); + + assert (keys_iter.last ()); + assert (keys_iter.get () == contains[contains.length - 1]); + assert (keys_iter.first ()); + + assert (keys_iter.get () == contains[0]); + assert (keys_iter.has_next ()); + assert (keys_iter.next ()); + assert (keys_iter.get () == contains[1]); + assert (keys_iter.has_previous ()); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys_iter.remove (); + Posix.exit (0); + } + assert (keys_iter.has_previous ()); + if (type != SortedMapTests.SubMapTests.Type.HEAD) + assert (keys_iter.has_next ()); + else + assert (!keys_iter.has_next ()); + assert (keys_iter.previous ()); + assert (keys_iter.get () == contains[0]); + + // Repeat for entries + master.clear (); + set_default_values (out contains, out not_contains); + + assert (entries_iter.last ()); + MapTests.assert_entry (entries_iter.get (), contains[contains.length - 1], contains[contains.length - 1]); + assert (entries_iter.first ()); + + MapTests.assert_entry (entries_iter.get (), contains[0], contains[0]); + assert (entries_iter.has_next ()); + assert (entries_iter.next ()); + MapTests.assert_entry (entries_iter.get (), contains[1], contains[1]); + assert (entries_iter.has_previous ()); + entries_iter.remove (); + assert (entries_iter.has_previous ()); + if (type != SortedMapTests.SubMapTests.Type.HEAD) + assert (entries_iter.has_next ()); + else + assert (!entries_iter.has_next ()); + assert (entries_iter.previous ()); + MapTests.assert_entry (entries_iter.get (), contains[0], contains[0]); + } else { + assert (!keys_iter.first ()); + assert (!keys_iter.last ()); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys_iter.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + assert (!entries_iter.first ()); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries_iter.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + } + } +} + diff --git a/tests/testbidirsortedset.c b/tests/testbidirsortedset.c new file mode 100644 index 0000000..659f62c --- /dev/null +++ b/tests/testbidirsortedset.c @@ -0,0 +1,1326 @@ +/* testbidirsortedset.c generated by valac 0.18.0, the Vala compiler + * generated from testbidirsortedset.vala, do not modify */ + +/* testbidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_COLLECTION_TESTS (collection_tests_get_type ()) +#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests)) +#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass)) +#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS)) +#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS)) +#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass)) + +typedef struct _CollectionTests CollectionTests; +typedef struct _CollectionTestsClass CollectionTestsClass; +typedef struct _CollectionTestsPrivate CollectionTestsPrivate; + +#define TYPE_SET_TESTS (set_tests_get_type ()) +#define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests)) +#define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass)) +#define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS)) +#define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS)) +#define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass)) + +typedef struct _SetTests SetTests; +typedef struct _SetTestsClass SetTestsClass; +typedef struct _SetTestsPrivate SetTestsPrivate; + +#define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ()) +#define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests)) +#define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) +#define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS)) +#define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS)) +#define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) + +typedef struct _SortedSetTests SortedSetTests; +typedef struct _SortedSetTestsClass SortedSetTestsClass; +typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate; + +#define TYPE_BIDIR_SORTED_SET_TESTS (bidir_sorted_set_tests_get_type ()) +#define BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests)) +#define BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) +#define IS_BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_SET_TESTS)) +#define IS_BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_SET_TESTS)) +#define BIDIR_SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) + +typedef struct _BidirSortedSetTests BidirSortedSetTests; +typedef struct _BidirSortedSetTestsClass BidirSortedSetTestsClass; +typedef struct _BidirSortedSetTestsPrivate BidirSortedSetTestsPrivate; + +#define SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TYPE (sorted_set_tests_sub_set_tests_type_get_type ()) + +#define BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS (bidir_sorted_set_tests_bidir_sub_set_tests_get_type ()) +#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTests)) +#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsClass)) +#define BIDIR_SORTED_SET_TESTS_IS_BIDIR_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS)) +#define BIDIR_SORTED_SET_TESTS_IS_BIDIR_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS)) +#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsClass)) + +typedef struct _BidirSortedSetTestsBidirSubSetTests BidirSortedSetTestsBidirSubSetTests; +typedef struct _BidirSortedSetTestsBidirSubSetTestsClass BidirSortedSetTestsBidirSubSetTestsClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _BidirSortedSetTestsBidirSubSetTestsPrivate BidirSortedSetTestsBidirSubSetTestsPrivate; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _CollectionTests { + GeeTestCase parent_instance; + CollectionTestsPrivate * priv; + GeeCollection* test_collection; +}; + +struct _CollectionTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _SetTests { + CollectionTests parent_instance; + SetTestsPrivate * priv; +}; + +struct _SetTestsClass { + CollectionTestsClass parent_class; + void (*test_duplicates_are_ignored) (SetTests* self); +}; + +struct _SortedSetTests { + SetTests parent_instance; + SortedSetTestsPrivate * priv; +}; + +struct _SortedSetTestsClass { + SetTestsClass parent_class; +}; + +struct _BidirSortedSetTests { + SortedSetTests parent_instance; + BidirSortedSetTestsPrivate * priv; +}; + +struct _BidirSortedSetTestsClass { + SortedSetTestsClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); +typedef enum { + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY +} SortedSetTestsSubSetTestsType; + +struct _BidirSortedSetTestsBidirSubSetTests { + GeeTestCase parent_instance; + BidirSortedSetTestsBidirSubSetTestsPrivate * priv; +}; + +struct _BidirSortedSetTestsBidirSubSetTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _BidirSortedSetTestsBidirSubSetTestsPrivate { + GeeBidirSortedSet* master; + GeeBidirSortedSet* subset; + BidirSortedSetTests* test; + SortedSetTestsSubSetTestsType type; +}; + + +static gpointer bidir_sorted_set_tests_parent_class = NULL; +static gpointer bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType collection_tests_get_type (void) G_GNUC_CONST; +GType set_tests_get_type (void) G_GNUC_CONST; +GType sorted_set_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_set_tests_get_type (void) G_GNUC_CONST; +enum { + BIDIR_SORTED_SET_TESTS_DUMMY_PROPERTY +}; +BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type, const gchar* name); +SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self); +static void _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self); +void bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self); +static void _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self); +void bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self); +static void _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self); +void bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self); +static void _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self); +GTestSuite* gee_test_case_get_suite (GeeTestCase* self); +GType sorted_set_tests_sub_set_tests_type_get_type (void) G_GNUC_CONST; +BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type); +BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type, BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type); +GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void) G_GNUC_CONST; +#define BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTestsPrivate)) +enum { + BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_DUMMY_PROPERTY +}; +const gchar* sorted_set_tests_sub_set_tests_type_to_string (SortedSetTestsSubSetTestsType self); +GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); +void bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self); +static void _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self); +static void bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base); +void gee_test_case_set_up (GeeTestCase* self); +static void bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base); +void gee_test_case_tear_down (GeeTestCase* self); +static void bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +static void _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self) { + bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (self); +} + + +static void _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self) { + bidir_sorted_set_tests_test_mutable_bidir_iterator (self); +} + + +static void _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method (gpointer self) { + bidir_sorted_set_tests_test_bidir_iterator_first (self); +} + + +static void _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self) { + bidir_sorted_set_tests_test_bidir_iterator_last (self); +} + + +BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type, const gchar* name) { + BidirSortedSetTests * self = NULL; + const gchar* _tmp0_; + GTestSuite* _tmp1_ = NULL; + BidirSortedSetTestsBidirSubSetTests* _tmp2_; + BidirSortedSetTestsBidirSubSetTests* _tmp3_; + GTestSuite* _tmp4_ = NULL; + GTestSuite* _tmp5_ = NULL; + BidirSortedSetTestsBidirSubSetTests* _tmp6_; + BidirSortedSetTestsBidirSubSetTests* _tmp7_; + GTestSuite* _tmp8_ = NULL; + GTestSuite* _tmp9_ = NULL; + BidirSortedSetTestsBidirSubSetTests* _tmp10_; + BidirSortedSetTestsBidirSubSetTests* _tmp11_; + GTestSuite* _tmp12_ = NULL; + GTestSuite* _tmp13_ = NULL; + BidirSortedSetTestsBidirSubSetTests* _tmp14_; + BidirSortedSetTestsBidirSubSetTests* _tmp15_; + GTestSuite* _tmp16_ = NULL; + g_return_val_if_fail (name != NULL, NULL); + _tmp0_ = name; + self = (BidirSortedSetTests*) sorted_set_tests_construct (object_type, _tmp0_, TRUE); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can go backward", _bidir_sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators are mutable", _bidir_sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to beginning", _bidir_sorted_set_tests_test_bidir_iterator_first_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to end", _bidir_sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method, g_object_ref (self), g_object_unref); + _tmp1_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp2_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD); + _tmp3_ = _tmp2_; + _tmp4_ = gee_test_case_get_suite ((GeeTestCase*) _tmp3_); + g_test_suite_add_suite (_tmp1_, _tmp4_); + _g_object_unref0 (_tmp3_); + _tmp5_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp6_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL); + _tmp7_ = _tmp6_; + _tmp8_ = gee_test_case_get_suite ((GeeTestCase*) _tmp7_); + g_test_suite_add_suite (_tmp5_, _tmp8_); + _g_object_unref0 (_tmp7_); + _tmp9_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp10_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB); + _tmp11_ = _tmp10_; + _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) _tmp11_); + g_test_suite_add_suite (_tmp9_, _tmp12_); + _g_object_unref0 (_tmp11_); + _tmp13_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp14_ = bidir_sorted_set_tests_bidir_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY); + _tmp15_ = _tmp14_; + _tmp16_ = gee_test_case_get_suite ((GeeTestCase*) _tmp15_); + g_test_suite_add_suite (_tmp13_, _tmp16_); + _g_object_unref0 (_tmp15_); + return self; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void bidir_sorted_set_tests_test_bidir_iterator_can_go_backward (BidirSortedSetTests* self) { + GeeCollection* _tmp0_; + GeeBidirSortedSet* _tmp1_; + GeeBidirSortedSet* test_set; + GeeBidirIterator* _tmp2_ = NULL; + GeeBidirIterator* iterator; + GeeBidirIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_ = FALSE; + gboolean _tmp10_ = FALSE; + GeeBidirIterator* _tmp11_ = NULL; + GeeBidirIterator* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeBidirIterator* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + GeeBidirIterator* _tmp17_; + gboolean _tmp18_ = FALSE; + GeeBidirIterator* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeBidirIterator* _tmp21_; + gpointer _tmp22_ = NULL; + gchar* _tmp23_; + GeeBidirIterator* _tmp24_; + gboolean _tmp25_ = FALSE; + GeeBidirIterator* _tmp26_; + gboolean _tmp27_ = FALSE; + GeeBidirIterator* _tmp28_; + gpointer _tmp29_ = NULL; + gchar* _tmp30_; + GeeBidirIterator* _tmp31_; + gboolean _tmp32_ = FALSE; + GeeBidirIterator* _tmp33_; + gboolean _tmp34_ = FALSE; + GeeBidirIterator* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeBidirIterator* _tmp38_; + gboolean _tmp39_ = FALSE; + GeeBidirIterator* _tmp40_; + gboolean _tmp41_ = FALSE; + GeeBidirIterator* _tmp42_; + gpointer _tmp43_ = NULL; + gchar* _tmp44_; + GeeBidirIterator* _tmp45_; + gboolean _tmp46_ = FALSE; + GeeBidirIterator* _tmp47_; + gboolean _tmp48_ = FALSE; + GeeBidirIterator* _tmp49_; + gpointer _tmp50_ = NULL; + gchar* _tmp51_; + GeeBidirIterator* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeBidirIterator* _tmp54_; + gboolean _tmp55_ = FALSE; + GeeBidirIterator* _tmp56_; + gboolean _tmp57_ = FALSE; + GeeBidirIterator* _tmp58_; + gpointer _tmp59_ = NULL; + gchar* _tmp60_; + GeeBidirIterator* _tmp61_; + gboolean _tmp62_ = FALSE; + GeeBidirIterator* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + GeeBidirIterator* _tmp66_; + gboolean _tmp67_ = FALSE; + GeeBidirIterator* _tmp68_; + gpointer _tmp69_ = NULL; + gchar* _tmp70_; + GeeBidirIterator* _tmp71_; + gboolean _tmp72_ = FALSE; + GeeBidirIterator* _tmp73_; + gpointer _tmp74_ = NULL; + gchar* _tmp75_; + GeeBidirIterator* _tmp76_; + gboolean _tmp77_ = FALSE; + GeeBidirIterator* _tmp78_; + gpointer _tmp79_ = NULL; + gchar* _tmp80_; + GeeBidirIterator* _tmp81_; + gboolean _tmp82_ = FALSE; + GeeBidirIterator* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + g_return_if_fail (self != NULL); + _tmp0_ = ((CollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL); + test_set = _tmp1_; + _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set); + iterator = _tmp2_; + _tmp3_ = iterator; + _tmp4_ = gee_bidir_iterator_has_previous (_tmp3_); + _vala_assert (!_tmp4_, "!iterator.has_previous ()"); + _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one"); + _vala_assert (_tmp5_, "test_set.add (\"one\")"); + _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two"); + _vala_assert (_tmp6_, "test_set.add (\"two\")"); + _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three"); + _vala_assert (_tmp7_, "test_set.add (\"three\")"); + _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four"); + _vala_assert (_tmp8_, "test_set.add (\"four\")"); + _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five"); + _vala_assert (_tmp9_, "test_set.add (\"five\")"); + _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six"); + _vala_assert (_tmp10_, "test_set.add (\"six\")"); + _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set); + _g_object_unref0 (iterator); + iterator = _tmp11_; + _tmp12_ = iterator; + _tmp13_ = gee_iterator_next ((GeeIterator*) _tmp12_); + _vala_assert (_tmp13_, "iterator.next ()"); + _tmp14_ = iterator; + _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_); + _tmp16_ = (gchar*) _tmp15_; + _vala_assert (g_strcmp0 (_tmp16_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp16_); + _tmp17_ = iterator; + _tmp18_ = gee_bidir_iterator_has_previous (_tmp17_); + _vala_assert (!_tmp18_, "!iterator.has_previous ()"); + _tmp19_ = iterator; + _tmp20_ = gee_iterator_next ((GeeIterator*) _tmp19_); + _vala_assert (_tmp20_, "iterator.next ()"); + _tmp21_ = iterator; + _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_); + _tmp23_ = (gchar*) _tmp22_; + _vala_assert (g_strcmp0 (_tmp23_, "four") == 0, "iterator.get () == \"four\""); + _g_free0 (_tmp23_); + _tmp24_ = iterator; + _tmp25_ = gee_bidir_iterator_has_previous (_tmp24_); + _vala_assert (_tmp25_, "iterator.has_previous ()"); + _tmp26_ = iterator; + _tmp27_ = gee_iterator_next ((GeeIterator*) _tmp26_); + _vala_assert (_tmp27_, "iterator.next ()"); + _tmp28_ = iterator; + _tmp29_ = gee_iterator_get ((GeeIterator*) _tmp28_); + _tmp30_ = (gchar*) _tmp29_; + _vala_assert (g_strcmp0 (_tmp30_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp30_); + _tmp31_ = iterator; + _tmp32_ = gee_bidir_iterator_has_previous (_tmp31_); + _vala_assert (_tmp32_, "iterator.has_previous ()"); + _tmp33_ = iterator; + _tmp34_ = gee_iterator_next ((GeeIterator*) _tmp33_); + _vala_assert (_tmp34_, "iterator.next ()"); + _tmp35_ = iterator; + _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (g_strcmp0 (_tmp37_, "six") == 0, "iterator.get () == \"six\""); + _g_free0 (_tmp37_); + _tmp38_ = iterator; + _tmp39_ = gee_bidir_iterator_has_previous (_tmp38_); + _vala_assert (_tmp39_, "iterator.has_previous ()"); + _tmp40_ = iterator; + _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_); + _vala_assert (_tmp41_, "iterator.next ()"); + _tmp42_ = iterator; + _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_); + _tmp44_ = (gchar*) _tmp43_; + _vala_assert (g_strcmp0 (_tmp44_, "three") == 0, "iterator.get () == \"three\""); + _g_free0 (_tmp44_); + _tmp45_ = iterator; + _tmp46_ = gee_bidir_iterator_has_previous (_tmp45_); + _vala_assert (_tmp46_, "iterator.has_previous ()"); + _tmp47_ = iterator; + _tmp48_ = gee_iterator_next ((GeeIterator*) _tmp47_); + _vala_assert (_tmp48_, "iterator.next ()"); + _tmp49_ = iterator; + _tmp50_ = gee_iterator_get ((GeeIterator*) _tmp49_); + _tmp51_ = (gchar*) _tmp50_; + _vala_assert (g_strcmp0 (_tmp51_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp51_); + _tmp52_ = iterator; + _tmp53_ = gee_bidir_iterator_has_previous (_tmp52_); + _vala_assert (_tmp53_, "iterator.has_previous ()"); + _tmp54_ = iterator; + _tmp55_ = gee_iterator_next ((GeeIterator*) _tmp54_); + _vala_assert (!_tmp55_, "!iterator.next ()"); + _tmp56_ = iterator; + _tmp57_ = gee_bidir_iterator_previous (_tmp56_); + _vala_assert (_tmp57_, "iterator.previous ()"); + _tmp58_ = iterator; + _tmp59_ = gee_iterator_get ((GeeIterator*) _tmp58_); + _tmp60_ = (gchar*) _tmp59_; + _vala_assert (g_strcmp0 (_tmp60_, "three") == 0, "iterator.get () == \"three\""); + _g_free0 (_tmp60_); + _tmp61_ = iterator; + _tmp62_ = gee_bidir_iterator_previous (_tmp61_); + _vala_assert (_tmp62_, "iterator.previous ()"); + _tmp63_ = iterator; + _tmp64_ = gee_iterator_get ((GeeIterator*) _tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _vala_assert (g_strcmp0 (_tmp65_, "six") == 0, "iterator.get () == \"six\""); + _g_free0 (_tmp65_); + _tmp66_ = iterator; + _tmp67_ = gee_bidir_iterator_previous (_tmp66_); + _vala_assert (_tmp67_, "iterator.previous ()"); + _tmp68_ = iterator; + _tmp69_ = gee_iterator_get ((GeeIterator*) _tmp68_); + _tmp70_ = (gchar*) _tmp69_; + _vala_assert (g_strcmp0 (_tmp70_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp70_); + _tmp71_ = iterator; + _tmp72_ = gee_bidir_iterator_previous (_tmp71_); + _vala_assert (_tmp72_, "iterator.previous ()"); + _tmp73_ = iterator; + _tmp74_ = gee_iterator_get ((GeeIterator*) _tmp73_); + _tmp75_ = (gchar*) _tmp74_; + _vala_assert (g_strcmp0 (_tmp75_, "four") == 0, "iterator.get () == \"four\""); + _g_free0 (_tmp75_); + _tmp76_ = iterator; + _tmp77_ = gee_bidir_iterator_previous (_tmp76_); + _vala_assert (_tmp77_, "iterator.previous ()"); + _tmp78_ = iterator; + _tmp79_ = gee_iterator_get ((GeeIterator*) _tmp78_); + _tmp80_ = (gchar*) _tmp79_; + _vala_assert (g_strcmp0 (_tmp80_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp80_); + _tmp81_ = iterator; + _tmp82_ = gee_bidir_iterator_previous (_tmp81_); + _vala_assert (!_tmp82_, "!iterator.previous ()"); + _tmp83_ = iterator; + _tmp84_ = gee_iterator_get ((GeeIterator*) _tmp83_); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (g_strcmp0 (_tmp85_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp85_); + _g_object_unref0 (iterator); + _g_object_unref0 (test_set); +} + + +void bidir_sorted_set_tests_test_bidir_iterator_first (BidirSortedSetTests* self) { + GeeCollection* _tmp0_; + GeeBidirSortedSet* _tmp1_; + GeeBidirSortedSet* test_set; + GeeBidirIterator* _tmp2_ = NULL; + GeeBidirIterator* iterator; + GeeBidirIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_ = FALSE; + gboolean _tmp10_ = FALSE; + GeeBidirIterator* _tmp11_ = NULL; + GeeBidirIterator* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeBidirIterator* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + GeeBidirIterator* _tmp17_; + gboolean _tmp18_ = FALSE; + GeeBidirIterator* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + g_return_if_fail (self != NULL); + _tmp0_ = ((CollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL); + test_set = _tmp1_; + _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set); + iterator = _tmp2_; + _tmp3_ = iterator; + _tmp4_ = gee_bidir_iterator_first (_tmp3_); + _vala_assert (!_tmp4_, "!iterator.first ()"); + _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one"); + _vala_assert (_tmp5_, "test_set.add (\"one\")"); + _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two"); + _vala_assert (_tmp6_, "test_set.add (\"two\")"); + _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three"); + _vala_assert (_tmp7_, "test_set.add (\"three\")"); + _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four"); + _vala_assert (_tmp8_, "test_set.add (\"four\")"); + _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five"); + _vala_assert (_tmp9_, "test_set.add (\"five\")"); + _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six"); + _vala_assert (_tmp10_, "test_set.add (\"six\")"); + _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set); + _g_object_unref0 (iterator); + iterator = _tmp11_; + _tmp12_ = iterator; + _tmp13_ = gee_bidir_iterator_last (_tmp12_); + _vala_assert (_tmp13_, "iterator.last ()"); + _tmp14_ = iterator; + _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_); + _tmp16_ = (gchar*) _tmp15_; + _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp16_); + _tmp17_ = iterator; + _tmp18_ = gee_bidir_iterator_first (_tmp17_); + _vala_assert (_tmp18_, "iterator.first ()"); + _tmp19_ = iterator; + _tmp20_ = gee_iterator_get ((GeeIterator*) _tmp19_); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp21_); + _g_object_unref0 (iterator); + _g_object_unref0 (test_set); +} + + +void bidir_sorted_set_tests_test_bidir_iterator_last (BidirSortedSetTests* self) { + GeeCollection* _tmp0_; + GeeBidirSortedSet* _tmp1_; + GeeBidirSortedSet* test_set; + GeeBidirIterator* _tmp2_ = NULL; + GeeBidirIterator* iterator; + GeeBidirIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gboolean _tmp7_ = FALSE; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_ = FALSE; + gboolean _tmp10_ = FALSE; + GeeBidirIterator* _tmp11_ = NULL; + GeeBidirIterator* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeBidirIterator* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + g_return_if_fail (self != NULL); + _tmp0_ = ((CollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL); + test_set = _tmp1_; + _tmp2_ = gee_bidir_sorted_set_bidir_iterator (test_set); + iterator = _tmp2_; + _tmp3_ = iterator; + _tmp4_ = gee_bidir_iterator_last (_tmp3_); + _vala_assert (!_tmp4_, "!iterator.last ()"); + _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one"); + _vala_assert (_tmp5_, "test_set.add (\"one\")"); + _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two"); + _vala_assert (_tmp6_, "test_set.add (\"two\")"); + _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three"); + _vala_assert (_tmp7_, "test_set.add (\"three\")"); + _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four"); + _vala_assert (_tmp8_, "test_set.add (\"four\")"); + _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five"); + _vala_assert (_tmp9_, "test_set.add (\"five\")"); + _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six"); + _vala_assert (_tmp10_, "test_set.add (\"six\")"); + _tmp11_ = gee_bidir_sorted_set_bidir_iterator (test_set); + _g_object_unref0 (iterator); + iterator = _tmp11_; + _tmp12_ = iterator; + _tmp13_ = gee_bidir_iterator_last (_tmp12_); + _vala_assert (_tmp13_, "iterator.last ()"); + _tmp14_ = iterator; + _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_); + _tmp16_ = (gchar*) _tmp15_; + _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp16_); + _g_object_unref0 (iterator); + _g_object_unref0 (test_set); +} + + +void bidir_sorted_set_tests_test_mutable_bidir_iterator (BidirSortedSetTests* self) { + GeeCollection* _tmp0_; + GeeBidirSortedSet* _tmp1_; + GeeBidirSortedSet* test_set; + GeeBidirSortedSet* _tmp2_; + GeeBidirIterator* _tmp3_ = NULL; + GeeBidirIterator* iterator; + GeeBidirIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeBidirSortedSet* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeBidirSortedSet* _tmp8_; + gboolean _tmp9_ = FALSE; + GeeBidirSortedSet* _tmp10_; + gboolean _tmp11_ = FALSE; + GeeBidirSortedSet* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeBidirSortedSet* _tmp14_; + gboolean _tmp15_ = FALSE; + GeeBidirSortedSet* _tmp16_; + gboolean _tmp17_ = FALSE; + GeeBidirSortedSet* _tmp18_; + GeeBidirIterator* _tmp19_ = NULL; + gboolean _tmp20_ = FALSE; + GeeBidirIterator* _tmp22_; + gboolean _tmp23_ = FALSE; + GeeBidirIterator* _tmp24_; + gpointer _tmp25_ = NULL; + gchar* _tmp26_; + GeeBidirIterator* _tmp27_; + GeeBidirSortedSet* _tmp28_; + gboolean _tmp29_ = FALSE; + GeeBidirIterator* _tmp30_; + gboolean _tmp31_ = FALSE; + GeeBidirIterator* _tmp32_; + gboolean _tmp33_ = FALSE; + gboolean _tmp34_ = FALSE; + GeeBidirIterator* _tmp38_; + gboolean _tmp39_ = FALSE; + GeeBidirIterator* _tmp40_; + gboolean _tmp41_ = FALSE; + GeeBidirIterator* _tmp42_; + gpointer _tmp43_ = NULL; + gchar* _tmp44_; + GeeBidirIterator* _tmp45_; + gboolean _tmp46_ = FALSE; + GeeBidirIterator* _tmp47_; + gpointer _tmp48_ = NULL; + gchar* _tmp49_; + GeeBidirIterator* _tmp50_; + GeeBidirSortedSet* _tmp51_; + gboolean _tmp52_ = FALSE; + GeeBidirIterator* _tmp53_; + gboolean _tmp54_ = FALSE; + GeeBidirIterator* _tmp55_; + gboolean _tmp56_ = FALSE; + GeeBidirIterator* _tmp57_; + gboolean _tmp58_ = FALSE; + GeeBidirIterator* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + g_return_if_fail (self != NULL); + _tmp0_ = ((CollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp0_) : NULL); + test_set = _tmp1_; + _tmp2_ = test_set; + _tmp3_ = gee_bidir_sorted_set_bidir_iterator (_tmp2_); + iterator = _tmp3_; + _tmp4_ = iterator; + _tmp5_ = gee_bidir_iterator_has_previous (_tmp4_); + _vala_assert (!_tmp5_, "!iterator.has_previous ()"); + _tmp6_ = test_set; + _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "one"); + _vala_assert (_tmp7_, "test_set.add (\"one\")"); + _tmp8_ = test_set; + _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "two"); + _vala_assert (_tmp9_, "test_set.add (\"two\")"); + _tmp10_ = test_set; + _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "three"); + _vala_assert (_tmp11_, "test_set.add (\"three\")"); + _tmp12_ = test_set; + _tmp13_ = gee_collection_add ((GeeCollection*) _tmp12_, "four"); + _vala_assert (_tmp13_, "test_set.add (\"four\")"); + _tmp14_ = test_set; + _tmp15_ = gee_collection_add ((GeeCollection*) _tmp14_, "five"); + _vala_assert (_tmp15_, "test_set.add (\"five\")"); + _tmp16_ = test_set; + _tmp17_ = gee_collection_add ((GeeCollection*) _tmp16_, "six"); + _vala_assert (_tmp17_, "test_set.add (\"six\")"); + _tmp18_ = test_set; + _tmp19_ = gee_bidir_sorted_set_bidir_iterator (_tmp18_); + _g_object_unref0 (iterator); + iterator = _tmp19_; + _tmp20_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp20_) { + GeeBidirIterator* _tmp21_; + _tmp21_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp21_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp22_ = iterator; + _tmp23_ = gee_iterator_next ((GeeIterator*) _tmp22_); + _vala_assert (_tmp23_, "iterator.next ()"); + _tmp24_ = iterator; + _tmp25_ = gee_iterator_get ((GeeIterator*) _tmp24_); + _tmp26_ = (gchar*) _tmp25_; + _vala_assert (g_strcmp0 (_tmp26_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp26_); + _tmp27_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp27_); + _tmp28_ = test_set; + _tmp29_ = gee_collection_contains ((GeeCollection*) _tmp28_, "five"); + _vala_assert (!_tmp29_, "!test_set.contains (\"five\")"); + _tmp30_ = iterator; + _tmp31_ = gee_iterator_has_next ((GeeIterator*) _tmp30_); + _vala_assert (_tmp31_, "iterator.has_next ()"); + _tmp32_ = iterator; + _tmp33_ = gee_bidir_iterator_has_previous (_tmp32_); + _vala_assert (!_tmp33_, "!iterator.has_previous ()"); + _tmp34_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp34_) { + GeeBidirIterator* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + _tmp35_ = iterator; + _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_); + _tmp37_ = (gchar*) _tmp36_; + _g_free0 (_tmp37_); + exit (0); + } + _tmp38_ = iterator; + _tmp39_ = gee_bidir_iterator_previous (_tmp38_); + _vala_assert (!_tmp39_, "!iterator.previous ()"); + _tmp40_ = iterator; + _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_); + _vala_assert (_tmp41_, "iterator.next ()"); + _tmp42_ = iterator; + _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_); + _tmp44_ = (gchar*) _tmp43_; + _vala_assert (g_strcmp0 (_tmp44_, "four") == 0, "iterator.get () == \"four\""); + _g_free0 (_tmp44_); + _tmp45_ = iterator; + _tmp46_ = gee_iterator_next ((GeeIterator*) _tmp45_); + _vala_assert (_tmp46_, "iterator.next ()"); + _tmp47_ = iterator; + _tmp48_ = gee_iterator_get ((GeeIterator*) _tmp47_); + _tmp49_ = (gchar*) _tmp48_; + _vala_assert (g_strcmp0 (_tmp49_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp49_); + _tmp50_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp50_); + _tmp51_ = test_set; + _tmp52_ = gee_collection_contains ((GeeCollection*) _tmp51_, "one"); + _vala_assert (!_tmp52_, "!test_set.contains (\"one\")"); + _tmp53_ = iterator; + _tmp54_ = gee_iterator_has_next ((GeeIterator*) _tmp53_); + _vala_assert (_tmp54_, "iterator.has_next ()"); + _tmp55_ = iterator; + _tmp56_ = gee_bidir_iterator_has_previous (_tmp55_); + _vala_assert (_tmp56_, "iterator.has_previous ()"); + _tmp57_ = iterator; + _tmp58_ = gee_bidir_iterator_previous (_tmp57_); + _vala_assert (_tmp58_, "iterator.previous ()"); + _tmp59_ = iterator; + _tmp60_ = gee_iterator_get ((GeeIterator*) _tmp59_); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "four") == 0, "iterator.get () == \"four\""); + _g_free0 (_tmp61_); + _g_object_unref0 (iterator); + _g_object_unref0 (test_set); +} + + +static void _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method (gpointer self) { + bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (self); +} + + +BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_construct (GType object_type, BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type) { + BidirSortedSetTestsBidirSubSetTests * self = NULL; + SortedSetTestsSubSetTestsType _tmp0_; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_; + BidirSortedSetTests* _tmp4_; + BidirSortedSetTests* _tmp5_; + SortedSetTestsSubSetTestsType _tmp6_; + g_return_val_if_fail (test != NULL, NULL); + _tmp0_ = type; + _tmp1_ = sorted_set_tests_sub_set_tests_type_to_string (_tmp0_); + _tmp2_ = g_strdup_printf ("%s Subset", _tmp1_); + _tmp3_ = _tmp2_; + self = (BidirSortedSetTestsBidirSubSetTests*) gee_test_case_construct (object_type, _tmp3_); + _g_free0 (_tmp3_); + _tmp4_ = test; + _tmp5_ = _g_object_ref0 (_tmp4_); + _g_object_unref0 (self->priv->test); + self->priv->test = _tmp5_; + _tmp6_ = type; + self->priv->type = _tmp6_; + gee_test_case_add_test ((GeeTestCase*) self, "[BidirSortedSet] bi-directional iterator", _bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +BidirSortedSetTestsBidirSubSetTests* bidir_sorted_set_tests_bidir_sub_set_tests_new (BidirSortedSetTests* test, SortedSetTestsSubSetTestsType type) { + return bidir_sorted_set_tests_bidir_sub_set_tests_construct (BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, test, type); +} + + +static void bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up (GeeTestCase* base) { + BidirSortedSetTestsBidirSubSetTests * self; + BidirSortedSetTests* _tmp0_; + BidirSortedSetTests* _tmp1_; + GeeCollection* _tmp2_; + GeeBidirSortedSet* _tmp3_; + SortedSetTestsSubSetTestsType _tmp4_; + self = (BidirSortedSetTestsBidirSubSetTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_set_up ((GeeTestCase*) _tmp0_); + _tmp1_ = self->priv->test; + _tmp2_ = ((CollectionTests*) _tmp1_)->test_collection; + _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp2_) : NULL); + _g_object_unref0 (self->priv->master); + self->priv->master = _tmp3_; + _tmp4_ = self->priv->type; + switch (_tmp4_) { + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: + { + GeeBidirSortedSet* _tmp5_; + GeeSortedSet* _tmp6_ = NULL; + _tmp5_ = self->priv->master; + _tmp6_ = gee_sorted_set_head_set ((GeeSortedSet*) _tmp5_, "one"); + _g_object_unref0 (self->priv->subset); + self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp6_) : NULL; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: + { + GeeBidirSortedSet* _tmp7_; + GeeSortedSet* _tmp8_ = NULL; + _tmp7_ = self->priv->master; + _tmp8_ = gee_sorted_set_tail_set ((GeeSortedSet*) _tmp7_, "six"); + _g_object_unref0 (self->priv->subset); + self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp8_) : NULL; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: + { + GeeBidirSortedSet* _tmp9_; + GeeSortedSet* _tmp10_ = NULL; + _tmp9_ = self->priv->master; + _tmp10_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp9_, "four", "three"); + _g_object_unref0 (self->priv->subset); + self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp10_) : NULL; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: + { + GeeBidirSortedSet* _tmp11_; + GeeSortedSet* _tmp12_ = NULL; + _tmp11_ = self->priv->master; + _tmp12_ = gee_sorted_set_sub_set ((GeeSortedSet*) _tmp11_, "three", "four"); + _g_object_unref0 (self->priv->subset); + self->priv->subset = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GEE_TYPE_BIDIR_SORTED_SET) ? ((GeeBidirSortedSet*) _tmp12_) : NULL; + break; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static void bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down (GeeTestCase* base) { + BidirSortedSetTestsBidirSubSetTests * self; + BidirSortedSetTests* _tmp0_; + self = (BidirSortedSetTestsBidirSubSetTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_tear_down ((GeeTestCase*) _tmp0_); +} + + +void bidir_sorted_set_tests_bidir_sub_set_tests_test_bidir_iterator (BidirSortedSetTestsBidirSubSetTests* self) { + GeeBidirSortedSet* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeBidirSortedSet* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeBidirSortedSet* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeBidirSortedSet* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeBidirSortedSet* _tmp8_; + gboolean _tmp9_ = FALSE; + GeeBidirSortedSet* _tmp10_; + gboolean _tmp11_ = FALSE; + GeeBidirSortedSet* _tmp12_; + gint _tmp13_; + gint _tmp14_; + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + SortedSetTestsSubSetTestsType _tmp15_; + guint i; + guint _tmp38_; + gchar** _tmp39_; + gint _tmp39__length1; + GeeBidirSortedSet* _tmp40_; + GeeBidirIterator* _tmp41_ = NULL; + GeeBidirIterator* iter; + SortedSetTestsSubSetTestsType _tmp42_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->master; + _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); + _vala_assert (_tmp1_, "master.add (\"one\")"); + _tmp2_ = self->priv->master; + _tmp3_ = gee_collection_add ((GeeCollection*) _tmp2_, "two"); + _vala_assert (_tmp3_, "master.add (\"two\")"); + _tmp4_ = self->priv->master; + _tmp5_ = gee_collection_add ((GeeCollection*) _tmp4_, "three"); + _vala_assert (_tmp5_, "master.add (\"three\")"); + _tmp6_ = self->priv->master; + _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "four"); + _vala_assert (_tmp7_, "master.add (\"four\")"); + _tmp8_ = self->priv->master; + _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "five"); + _vala_assert (_tmp9_, "master.add (\"five\")"); + _tmp10_ = self->priv->master; + _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "six"); + _vala_assert (_tmp11_, "master.add (\"six\")"); + _tmp12_ = self->priv->master; + _tmp13_ = gee_collection_get_size ((GeeCollection*) _tmp12_); + _tmp14_ = _tmp13_; + _vala_assert (_tmp14_ == 6, "master.size == 6"); + _tmp15_ = self->priv->type; + switch (_tmp15_) { + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: + { + gchar* _tmp16_; + gchar* _tmp17_; + gchar** _tmp18_ = NULL; + _tmp16_ = g_strdup ("five"); + _tmp17_ = g_strdup ("four"); + _tmp18_ = g_new0 (gchar*, 2 + 1); + _tmp18_[0] = _tmp16_; + _tmp18_[1] = _tmp17_; + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp18_; + contains_length1 = 2; + _contains_size_ = contains_length1; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: + { + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; + gchar** _tmp22_ = NULL; + _tmp19_ = g_strdup ("six"); + _tmp20_ = g_strdup ("three"); + _tmp21_ = g_strdup ("two"); + _tmp22_ = g_new0 (gchar*, 3 + 1); + _tmp22_[0] = _tmp19_; + _tmp22_[1] = _tmp20_; + _tmp22_[2] = _tmp21_; + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp22_; + contains_length1 = 3; + _contains_size_ = contains_length1; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: + { + gchar* _tmp23_; + gchar* _tmp24_; + gchar* _tmp25_; + gchar** _tmp26_ = NULL; + _tmp23_ = g_strdup ("four"); + _tmp24_ = g_strdup ("one"); + _tmp25_ = g_strdup ("six"); + _tmp26_ = g_new0 (gchar*, 3 + 1); + _tmp26_[0] = _tmp23_; + _tmp26_[1] = _tmp24_; + _tmp26_[2] = _tmp25_; + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp26_; + contains_length1 = 3; + _contains_size_ = contains_length1; + break; + } + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: + { + gchar** _tmp27_ = NULL; + _tmp27_ = g_new0 (gchar*, 0 + 1); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp27_; + contains_length1 = 0; + _contains_size_ = contains_length1; + break; + } + default: + { + g_assert_not_reached (); + } + } + i = (guint) 0; + { + GeeBidirSortedSet* _tmp28_; + GeeIterator* _tmp29_ = NULL; + GeeIterator* _e_it; + _tmp28_ = self->priv->subset; + _tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_); + _e_it = _tmp29_; + while (TRUE) { + GeeIterator* _tmp30_; + gboolean _tmp31_ = FALSE; + GeeIterator* _tmp32_; + gpointer _tmp33_ = NULL; + gchar* e; + const gchar* _tmp34_; + gchar** _tmp35_; + gint _tmp35__length1; + guint _tmp36_; + const gchar* _tmp37_; + _tmp30_ = _e_it; + _tmp31_ = gee_iterator_next (_tmp30_); + if (!_tmp31_) { + break; + } + _tmp32_ = _e_it; + _tmp33_ = gee_iterator_get (_tmp32_); + e = (gchar*) _tmp33_; + _tmp34_ = e; + _tmp35_ = contains; + _tmp35__length1 = contains_length1; + _tmp36_ = i; + i = _tmp36_ + 1; + _tmp37_ = _tmp35_[_tmp36_]; + _vala_assert (g_strcmp0 (_tmp34_, _tmp37_) == 0, "e == contains[i++]"); + _g_free0 (e); + } + _g_object_unref0 (_e_it); + } + _tmp38_ = i; + _tmp39_ = contains; + _tmp39__length1 = contains_length1; + _vala_assert (_tmp38_ == ((guint) _tmp39__length1), "i == contains.length"); + _tmp40_ = self->priv->subset; + _tmp41_ = gee_bidir_sorted_set_bidir_iterator (_tmp40_); + iter = _tmp41_; + _tmp42_ = self->priv->type; + if (_tmp42_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY) { + GeeBidirIterator* _tmp43_; + gboolean _tmp44_ = FALSE; + GeeBidirIterator* _tmp45_; + gpointer _tmp46_ = NULL; + gchar* _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + gchar** _tmp49_; + gint _tmp49__length1; + const gchar* _tmp50_; + GeeBidirIterator* _tmp51_; + gboolean _tmp52_ = FALSE; + GeeBidirIterator* _tmp53_; + gpointer _tmp54_ = NULL; + gchar* _tmp55_; + gchar** _tmp56_; + gint _tmp56__length1; + const gchar* _tmp57_; + GeeBidirIterator* _tmp58_; + gboolean _tmp59_ = FALSE; + GeeBidirIterator* _tmp60_; + gboolean _tmp61_ = FALSE; + GeeBidirIterator* _tmp62_; + gpointer _tmp63_ = NULL; + gchar* _tmp64_; + gchar** _tmp65_; + gint _tmp65__length1; + const gchar* _tmp66_; + GeeBidirIterator* _tmp67_; + gboolean _tmp68_ = FALSE; + GeeBidirIterator* _tmp69_; + GeeBidirIterator* _tmp70_; + gboolean _tmp71_ = FALSE; + SortedSetTestsSubSetTestsType _tmp72_; + GeeBidirIterator* _tmp77_; + gboolean _tmp78_ = FALSE; + GeeBidirIterator* _tmp79_; + gpointer _tmp80_ = NULL; + gchar* _tmp81_; + gchar** _tmp82_; + gint _tmp82__length1; + const gchar* _tmp83_; + _tmp43_ = iter; + _tmp44_ = gee_bidir_iterator_last (_tmp43_); + _vala_assert (_tmp44_, "iter.last ()"); + _tmp45_ = iter; + _tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_); + _tmp47_ = (gchar*) _tmp46_; + _tmp48_ = contains; + _tmp48__length1 = contains_length1; + _tmp49_ = contains; + _tmp49__length1 = contains_length1; + _tmp50_ = _tmp48_[_tmp49__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp47_, _tmp50_) == 0, "iter.get () == contains[contains.length - 1]"); + _g_free0 (_tmp47_); + _tmp51_ = iter; + _tmp52_ = gee_bidir_iterator_first (_tmp51_); + _vala_assert (_tmp52_, "iter.first ()"); + _tmp53_ = iter; + _tmp54_ = gee_iterator_get ((GeeIterator*) _tmp53_); + _tmp55_ = (gchar*) _tmp54_; + _tmp56_ = contains; + _tmp56__length1 = contains_length1; + _tmp57_ = _tmp56_[0]; + _vala_assert (g_strcmp0 (_tmp55_, _tmp57_) == 0, "iter.get () == contains[0]"); + _g_free0 (_tmp55_); + _tmp58_ = iter; + _tmp59_ = gee_iterator_has_next ((GeeIterator*) _tmp58_); + _vala_assert (_tmp59_, "iter.has_next ()"); + _tmp60_ = iter; + _tmp61_ = gee_iterator_next ((GeeIterator*) _tmp60_); + _vala_assert (_tmp61_, "iter.next ()"); + _tmp62_ = iter; + _tmp63_ = gee_iterator_get ((GeeIterator*) _tmp62_); + _tmp64_ = (gchar*) _tmp63_; + _tmp65_ = contains; + _tmp65__length1 = contains_length1; + _tmp66_ = _tmp65_[1]; + _vala_assert (g_strcmp0 (_tmp64_, _tmp66_) == 0, "iter.get () == contains[1]"); + _g_free0 (_tmp64_); + _tmp67_ = iter; + _tmp68_ = gee_bidir_iterator_has_previous (_tmp67_); + _vala_assert (_tmp68_, "iter.has_previous ()"); + _tmp69_ = iter; + gee_iterator_remove ((GeeIterator*) _tmp69_); + _tmp70_ = iter; + _tmp71_ = gee_bidir_iterator_has_previous (_tmp70_); + _vala_assert (_tmp71_, "iter.has_previous ()"); + _tmp72_ = self->priv->type; + if (_tmp72_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD) { + GeeBidirIterator* _tmp73_; + gboolean _tmp74_ = FALSE; + _tmp73_ = iter; + _tmp74_ = gee_iterator_has_next ((GeeIterator*) _tmp73_); + _vala_assert (_tmp74_, "iter.has_next ()"); + } else { + GeeBidirIterator* _tmp75_; + gboolean _tmp76_ = FALSE; + _tmp75_ = iter; + _tmp76_ = gee_iterator_has_next ((GeeIterator*) _tmp75_); + _vala_assert (!_tmp76_, "!iter.has_next ()"); + } + _tmp77_ = iter; + _tmp78_ = gee_bidir_iterator_previous (_tmp77_); + _vala_assert (_tmp78_, "iter.previous ()"); + _tmp79_ = iter; + _tmp80_ = gee_iterator_get ((GeeIterator*) _tmp79_); + _tmp81_ = (gchar*) _tmp80_; + _tmp82_ = contains; + _tmp82__length1 = contains_length1; + _tmp83_ = _tmp82_[0]; + _vala_assert (g_strcmp0 (_tmp81_, _tmp83_) == 0, "iter.get () == contains[0]"); + _g_free0 (_tmp81_); + } else { + GeeBidirIterator* _tmp84_; + gboolean _tmp85_ = FALSE; + gboolean _tmp86_ = FALSE; + _tmp84_ = iter; + _tmp85_ = gee_bidir_iterator_first (_tmp84_); + _vala_assert (!_tmp85_, "!iter.first ()"); + _tmp86_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp86_) { + GeeBidirIterator* _tmp87_; + _tmp87_ = iter; + gee_iterator_remove ((GeeIterator*) _tmp87_); + exit (0); + } + g_test_trap_assert_failed (); + } + _g_object_unref0 (iter); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +static void bidir_sorted_set_tests_bidir_sub_set_tests_class_init (BidirSortedSetTestsBidirSubSetTestsClass * klass) { + bidir_sorted_set_tests_bidir_sub_set_tests_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (BidirSortedSetTestsBidirSubSetTestsPrivate)); + GEE_TEST_CASE_CLASS (klass)->set_up = bidir_sorted_set_tests_bidir_sub_set_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = bidir_sorted_set_tests_bidir_sub_set_tests_real_tear_down; + G_OBJECT_CLASS (klass)->finalize = bidir_sorted_set_tests_bidir_sub_set_tests_finalize; +} + + +static void bidir_sorted_set_tests_bidir_sub_set_tests_instance_init (BidirSortedSetTestsBidirSubSetTests * self) { + self->priv = BIDIR_SORTED_SET_TESTS_BIDIR_SUB_SET_TESTS_GET_PRIVATE (self); +} + + +static void bidir_sorted_set_tests_bidir_sub_set_tests_finalize (GObject* obj) { + BidirSortedSetTestsBidirSubSetTests * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIDIR_SORTED_SET_TESTS_TYPE_BIDIR_SUB_SET_TESTS, BidirSortedSetTestsBidirSubSetTests); + _g_object_unref0 (self->priv->master); + _g_object_unref0 (self->priv->subset); + _g_object_unref0 (self->priv->test); + G_OBJECT_CLASS (bidir_sorted_set_tests_bidir_sub_set_tests_parent_class)->finalize (obj); +} + + +GType bidir_sorted_set_tests_bidir_sub_set_tests_get_type (void) { + static volatile gsize bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile = 0; + if (g_once_init_enter (&bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (BidirSortedSetTestsBidirSubSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_set_tests_bidir_sub_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedSetTestsBidirSubSetTests), 0, (GInstanceInitFunc) bidir_sorted_set_tests_bidir_sub_set_tests_instance_init, NULL }; + GType bidir_sorted_set_tests_bidir_sub_set_tests_type_id; + bidir_sorted_set_tests_bidir_sub_set_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "BidirSortedSetTestsBidirSubSetTests", &g_define_type_info, 0); + g_once_init_leave (&bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile, bidir_sorted_set_tests_bidir_sub_set_tests_type_id); + } + return bidir_sorted_set_tests_bidir_sub_set_tests_type_id__volatile; +} + + +static void bidir_sorted_set_tests_class_init (BidirSortedSetTestsClass * klass) { + bidir_sorted_set_tests_parent_class = g_type_class_peek_parent (klass); +} + + +static void bidir_sorted_set_tests_instance_init (BidirSortedSetTests * self) { +} + + +GType bidir_sorted_set_tests_get_type (void) { + static volatile gsize bidir_sorted_set_tests_type_id__volatile = 0; + if (g_once_init_enter (&bidir_sorted_set_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (BidirSortedSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bidir_sorted_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BidirSortedSetTests), 0, (GInstanceInitFunc) bidir_sorted_set_tests_instance_init, NULL }; + GType bidir_sorted_set_tests_type_id; + bidir_sorted_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "BidirSortedSetTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_once_init_leave (&bidir_sorted_set_tests_type_id__volatile, bidir_sorted_set_tests_type_id); + } + return bidir_sorted_set_tests_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/tests/testbidirsortedset.vala b/tests/testbidirsortedset.vala new file mode 100644 index 0000000..df5da60 --- /dev/null +++ b/tests/testbidirsortedset.vala @@ -0,0 +1,275 @@ +/* testbidirsortedset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +using GLib; +using Gee; + +public abstract class BidirSortedSetTests : SortedSetTests { + public BidirSortedSetTests(string name) { + base (name); + add_test ("[SortedSet] bi-directional iterators can go backward", + test_bidir_iterator_can_go_backward); + add_test ("[SortedSet] bi-directional iterators are mutable", + test_mutable_bidir_iterator); + add_test ("[SortedSet] bi-directional iterators can to beginning", + test_bidir_iterator_first); + add_test ("[SortedSet] bi-directional iterators can to end", + test_bidir_iterator_last); + get_suite ().add_suite (new BidirSubSetTests (this, SortedSetTests.SubSetTests.Type.HEAD).get_suite ()); + get_suite ().add_suite (new BidirSubSetTests (this, SortedSetTests.SubSetTests.Type.TAIL).get_suite ()); + get_suite ().add_suite (new BidirSubSetTests (this, SortedSetTests.SubSetTests.Type.SUB).get_suite ()); + get_suite ().add_suite (new BidirSubSetTests (this, SortedSetTests.SubSetTests.Type.EMPTY).get_suite ()); + } + + public void test_bidir_iterator_can_go_backward () { + var test_set = test_collection as BidirSortedSet; + + var iterator = test_set.bidir_iterator (); + assert (!iterator.has_previous ()); + + assert (test_set.add ("one")); + assert (test_set.add ("two")); + assert (test_set.add ("three")); + assert (test_set.add ("four")); + assert (test_set.add ("five")); + assert (test_set.add ("six")); + + iterator = test_set.bidir_iterator (); + assert (iterator.next ()); + assert (iterator.get () == "five"); + assert (!iterator.has_previous ()); + assert (iterator.next ()); + assert (iterator.get () == "four"); + assert (iterator.has_previous ()); + assert (iterator.next ()); + assert (iterator.get () == "one"); + assert (iterator.has_previous ()); + assert (iterator.next ()); + assert (iterator.get () == "six"); + assert (iterator.has_previous ()); + assert (iterator.next ()); + assert (iterator.get () == "three"); + assert (iterator.has_previous ()); + assert (iterator.next ()); + assert (iterator.get () == "two"); + assert (iterator.has_previous ()); + assert (!iterator.next ()); + assert (iterator.previous ()); + assert (iterator.get () == "three"); + assert (iterator.previous ()); + assert (iterator.get () == "six"); + assert (iterator.previous ()); + assert (iterator.get () == "one"); + assert (iterator.previous ()); + assert (iterator.get () == "four"); + assert (iterator.previous ()); + assert (iterator.get () == "five"); + assert (!iterator.previous ()); + assert (iterator.get () == "five"); + } + + public void test_bidir_iterator_first () { + var test_set = test_collection as BidirSortedSet; + + var iterator = test_set.bidir_iterator (); + + assert (!iterator.first ()); + + assert (test_set.add ("one")); + assert (test_set.add ("two")); + assert (test_set.add ("three")); + assert (test_set.add ("four")); + assert (test_set.add ("five")); + assert (test_set.add ("six")); + + iterator = test_set.bidir_iterator (); + assert (iterator.last ()); + assert (iterator.get () == "two"); + assert (iterator.first ()); + assert (iterator.get () == "five"); + } + + public void test_bidir_iterator_last () { + var test_set = test_collection as BidirSortedSet; + + var iterator = test_set.bidir_iterator (); + + assert (!iterator.last ()); + + assert (test_set.add ("one")); + assert (test_set.add ("two")); + assert (test_set.add ("three")); + assert (test_set.add ("four")); + assert (test_set.add ("five")); + assert (test_set.add ("six")); + + iterator = test_set.bidir_iterator (); + assert (iterator.last ()); + assert (iterator.get () == "two"); + } + + public void test_mutable_bidir_iterator () { + var test_set = test_collection as BidirSortedSet; + + var iterator = test_set.bidir_iterator (); + assert (!iterator.has_previous ()); + + assert (test_set.add ("one")); + assert (test_set.add ("two")); + assert (test_set.add ("three")); + assert (test_set.add ("four")); + assert (test_set.add ("five")); + assert (test_set.add ("six")); + + iterator = test_set.bidir_iterator (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + + assert (iterator.next ()); + assert (iterator.get () == "five"); + iterator.remove (); + assert (!test_set.contains ("five")); + assert (iterator.has_next ()); + assert (!iterator.has_previous ()); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.get (); + Posix.exit (0); + } + assert (!iterator.previous ()); + + assert (iterator.next ()); + assert (iterator.get () == "four"); + assert (iterator.next ()); + assert (iterator.get () == "one"); + iterator.remove (); + assert (!test_set.contains ("one")); + assert (iterator.has_next ()); + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "four"); + } + + public class BidirSubSetTests : Gee.TestCase { + private BidirSortedSet master; + private BidirSortedSet subset; + private BidirSortedSetTests test; + private SortedSetTests.SubSetTests.Type type; + + public BidirSubSetTests(BidirSortedSetTests test, SortedSetTests.SubSetTests.Type type) { + base ("%s Subset".printf (type.to_string ())); + this.test = test; + this.type = type; + add_test ("[BidirSortedSet] bi-directional iterator", test_bidir_iterator); + } + + public override void set_up () { + test.set_up (); + master = test.test_collection as BidirSortedSet; + switch (type) { + case SortedSetTests.SubSetTests.Type.HEAD: + subset = master.head_set ("one") as BidirSortedSet; break; + case SortedSetTests.SubSetTests.Type.TAIL: + subset = master.tail_set ("six") as BidirSortedSet; break; + case SortedSetTests.SubSetTests.Type.SUB: + subset = master.sub_set ("four", "three") as BidirSortedSet; break; + case SortedSetTests.SubSetTests.Type.EMPTY: + subset = master.sub_set ("three", "four") as BidirSortedSet; break; + default: + assert_not_reached (); + } + } + + public override void tear_down () { + test.tear_down (); + } + + public void test_bidir_iterator () { + assert (master.add ("one")); + assert (master.add ("two")); + assert (master.add ("three")); + assert (master.add ("four")); + assert (master.add ("five")); + assert (master.add ("six")); + assert (master.size == 6); + + string[] contains; + switch (type) { + case SortedSetTests.SubSetTests.Type.HEAD: + contains = {"five", "four"}; + break; + case SortedSetTests.SubSetTests.Type.TAIL: + contains = {"six", "three", "two"}; + break; + case SortedSetTests.SubSetTests.Type.SUB: + contains = {"four", "one", "six"}; + break; + case SortedSetTests.SubSetTests.Type.EMPTY: + contains = {}; + break; + default: + assert_not_reached (); + } + + uint i = 0; + foreach (var e in subset) { + assert (e == contains[i++]); + } + assert (i == contains.length); + + + var iter = subset.bidir_iterator (); + if (type != SortedSetTests.SubSetTests.Type.EMPTY) { + assert (iter.last ()); + assert (iter.get () == contains[contains.length - 1]); + assert (iter.first ()); + + assert (iter.get () == contains[0]); + assert (iter.has_next ()); + assert (iter.next ()); + assert (iter.get () == contains[1]); + assert (iter.has_previous ()); + iter.remove (); + assert (iter.has_previous ()); + if (type != SortedSetTests.SubSetTests.Type.HEAD) + assert (iter.has_next ()); + else + assert (!iter.has_next ()); + assert (iter.previous ()); + assert (iter.get () == contains[0]); + } else { + assert (!iter.first ()); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iter.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + } + } +} + diff --git a/tests/testcase.c b/tests/testcase.c index 2418301..b863a0b 100644 --- a/tests/testcase.c +++ b/tests/testcase.c @@ -115,17 +115,17 @@ enum { GEE_TEST_CASE_DUMMY_PROPERTY }; GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -static GeeTestCaseAdaptor* gee_test_case_adaptor_new (const gchar* name, GeeTestCaseTestMethod test, void* test_target, GeeTestCase* test_case); -static GeeTestCaseAdaptor* gee_test_case_adaptor_construct (GType object_type, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GeeTestCase* test_case); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +static GeeTestCaseAdaptor* gee_test_case_adaptor_new (const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify, GeeTestCase* test_case); +static GeeTestCaseAdaptor* gee_test_case_adaptor_construct (GType object_type, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify, GeeTestCase* test_case); static void _vala_array_add1 (GeeTestCaseAdaptor*** array, int* length, int* size, GeeTestCaseAdaptor* value); static const gchar* gee_test_case_adaptor_get_name (GeeTestCaseAdaptor* self); static void gee_test_case_adaptor_set_up (GeeTestCaseAdaptor* self, void* fixture); -static void _gee_test_case_adaptor_set_up_gtest_func (void* fixture, gpointer self); +static void _gee_test_case_adaptor_set_up_gtest_fixture_func (void* fixture, gpointer self); static void gee_test_case_adaptor_run (GeeTestCaseAdaptor* self, void* fixture); -static void _gee_test_case_adaptor_run_gtest_func (void* fixture, gpointer self); +static void _gee_test_case_adaptor_run_gtest_fixture_func (void* fixture, gpointer self); static void gee_test_case_adaptor_tear_down (GeeTestCaseAdaptor* self, void* fixture); -static void _gee_test_case_adaptor_tear_down_gtest_func (void* fixture, gpointer self); +static void _gee_test_case_adaptor_tear_down_gtest_fixture_func (void* fixture, gpointer self); void gee_test_case_set_up (GeeTestCase* self); static void gee_test_case_real_set_up (GeeTestCase* self); void gee_test_case_tear_down (GeeTestCase* self); @@ -170,25 +170,26 @@ static void _vala_array_add1 (GeeTestCaseAdaptor*** array, int* length, int* siz } -static void _gee_test_case_adaptor_set_up_gtest_func (void* fixture, gpointer self) { +static void _gee_test_case_adaptor_set_up_gtest_fixture_func (void* fixture, gpointer self) { gee_test_case_adaptor_set_up (self, fixture); } -static void _gee_test_case_adaptor_run_gtest_func (void* fixture, gpointer self) { +static void _gee_test_case_adaptor_run_gtest_fixture_func (void* fixture, gpointer self) { gee_test_case_adaptor_run (self, fixture); } -static void _gee_test_case_adaptor_tear_down_gtest_func (void* fixture, gpointer self) { +static void _gee_test_case_adaptor_tear_down_gtest_fixture_func (void* fixture, gpointer self) { gee_test_case_adaptor_tear_down (self, fixture); } -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target) { +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify) { const gchar* _tmp0_; GeeTestCaseTestMethod _tmp1_; void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; GeeTestCaseAdaptor* _tmp2_; GeeTestCaseAdaptor* adaptor; GeeTestCaseAdaptor** _tmp3_; @@ -203,7 +204,9 @@ void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTe _tmp0_ = name; _tmp1_ = test; _tmp1__target = test_target; - _tmp2_ = gee_test_case_adaptor_new (_tmp0_, _tmp1_, _tmp1__target, self); + _tmp1__target_destroy_notify = test_target_destroy_notify; + test_target_destroy_notify = NULL; + _tmp2_ = gee_test_case_adaptor_new (_tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify, self); adaptor = _tmp2_; _tmp3_ = self->priv->adaptors; _tmp3__length1 = self->priv->adaptors_length1; @@ -212,9 +215,13 @@ void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTe _tmp5_ = self->priv->suite; _tmp6_ = gee_test_case_adaptor_get_name (adaptor); _tmp7_ = _tmp6_; - _tmp8_ = g_test_create_case (_tmp7_, (gsize) 0, adaptor, (void (*) (void)) _gee_test_case_adaptor_set_up_gtest_func, (void (*) (void)) _gee_test_case_adaptor_run_gtest_func, (void (*) (void)) _gee_test_case_adaptor_tear_down_gtest_func); + _tmp8_ = g_test_create_case (_tmp7_, (gsize) 0, adaptor, _gee_test_case_adaptor_set_up_gtest_fixture_func, _gee_test_case_adaptor_run_gtest_fixture_func, _gee_test_case_adaptor_tear_down_gtest_fixture_func); g_test_suite_add (_tmp5_, _tmp8_); _gee_test_case_adaptor_unref0 (adaptor); + (test_target_destroy_notify == NULL) ? NULL : (test_target_destroy_notify (test_target), NULL); + test = NULL; + test_target = NULL; + test_target_destroy_notify = NULL; } @@ -253,11 +260,12 @@ static gpointer _g_object_ref0 (gpointer self) { } -static GeeTestCaseAdaptor* gee_test_case_adaptor_construct (GType object_type, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GeeTestCase* test_case) { +static GeeTestCaseAdaptor* gee_test_case_adaptor_construct (GType object_type, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify, GeeTestCase* test_case) { GeeTestCaseAdaptor* self = NULL; const gchar* _tmp0_; GeeTestCaseTestMethod _tmp1_; void* _tmp1__target; + GDestroyNotify _tmp1__target_destroy_notify; GeeTestCase* _tmp2_; GeeTestCase* _tmp3_; g_return_val_if_fail (name != NULL, NULL); @@ -267,23 +275,29 @@ static GeeTestCaseAdaptor* gee_test_case_adaptor_construct (GType object_type, c gee_test_case_adaptor_set_name (self, _tmp0_); _tmp1_ = test; _tmp1__target = test_target; + _tmp1__target_destroy_notify = test_target_destroy_notify; + test_target_destroy_notify = NULL; (self->priv->test_target_destroy_notify == NULL) ? NULL : (self->priv->test_target_destroy_notify (self->priv->test_target), NULL); self->priv->test = NULL; self->priv->test_target = NULL; self->priv->test_target_destroy_notify = NULL; self->priv->test = _tmp1_; self->priv->test_target = _tmp1__target; - self->priv->test_target_destroy_notify = NULL; + self->priv->test_target_destroy_notify = _tmp1__target_destroy_notify; _tmp2_ = test_case; _tmp3_ = _g_object_ref0 (_tmp2_); _g_object_unref0 (self->priv->test_case); self->priv->test_case = _tmp3_; + (test_target_destroy_notify == NULL) ? NULL : (test_target_destroy_notify (test_target), NULL); + test = NULL; + test_target = NULL; + test_target_destroy_notify = NULL; return self; } -static GeeTestCaseAdaptor* gee_test_case_adaptor_new (const gchar* name, GeeTestCaseTestMethod test, void* test_target, GeeTestCase* test_case) { - return gee_test_case_adaptor_construct (GEE_TEST_CASE_TYPE_ADAPTOR, name, test, test_target, test_case); +static GeeTestCaseAdaptor* gee_test_case_adaptor_new (const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify, GeeTestCase* test_case) { + return gee_test_case_adaptor_construct (GEE_TEST_CASE_TYPE_ADAPTOR, name, test, test_target, test_target_destroy_notify, test_case); } diff --git a/tests/testcase.vala b/tests/testcase.vala index edcbe04..83a37ae 100644 --- a/tests/testcase.vala +++ b/tests/testcase.vala @@ -31,8 +31,8 @@ public abstract class Gee.TestCase : Object { this.suite = new GLib.TestSuite (name); } - public void add_test (string name, TestMethod test) { - var adaptor = new Adaptor (name, test, this); + public void add_test (string name, owned TestMethod test) { + var adaptor = new Adaptor (name, (owned)test, this); this.adaptors += adaptor; this.suite.add (new GLib.TestCase (adaptor.name, @@ -52,16 +52,16 @@ public abstract class Gee.TestCase : Object { } private class Adaptor { - + [CCode (notify = false)] public string name { get; private set; } private TestMethod test; private TestCase test_case; public Adaptor (string name, - TestMethod test, + owned TestMethod test, TestCase test_case) { this.name = name; - this.test = test; + this.test = (owned)test; this.test_case = test_case; } diff --git a/tests/testcollection.c b/tests/testcollection.c index 80c1a98..bd9122c 100644 --- a/tests/testcollection.c +++ b/tests/testcollection.c @@ -5,6 +5,7 @@ * * Copyright (C) 2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois, Julien Peeters + * Copyright (C) 2011-2012 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +25,7 @@ * Jürg Billeter * Didier 'Ptitjes' Villevalois * Julien Peeters + * Maciej Piechotka */ #include @@ -56,6 +58,10 @@ typedef struct _CollectionTestsClass CollectionTestsClass; typedef struct _CollectionTestsPrivate CollectionTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _Block1Data Block1Data; +typedef struct _Block2Data Block2Data; +typedef struct _Block3Data Block3Data; +typedef struct _Block4Data Block4Data; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { @@ -80,6 +86,37 @@ struct _CollectionTestsClass { }; typedef void (*GeeTestCaseTestMethod) (void* user_data); +struct _Block1Data { + int _ref_count_; + CollectionTests * self; + gint count; +}; + +struct _Block2Data { + int _ref_count_; + CollectionTests * self; + gboolean one; + gboolean two; + gboolean three; + gint i; +}; + +struct _Block3Data { + int _ref_count_; + CollectionTests * self; + gboolean one; + gboolean two; + gboolean three; +}; + +struct _Block4Data { + int _ref_count_; + CollectionTests * self; + gboolean one; + gboolean two; + gboolean three; +}; + static gpointer collection_tests_parent_class = NULL; @@ -90,7 +127,7 @@ enum { }; CollectionTests* collection_tests_construct (GType object_type, const gchar* name); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void collection_tests_test_type_correctness (CollectionTests* self); static void _collection_tests_test_type_correctness_gee_test_case_test_method (gpointer self); void collection_tests_test_iterator_returns_all_elements_once (CollectionTests* self); @@ -115,6 +152,52 @@ void collection_tests_test_to_array (CollectionTests* self); static void _collection_tests_test_to_array_gee_test_case_test_method (gpointer self); void collection_tests_test_gobject_properties (CollectionTests* self); static void _collection_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); +void collection_tests_test_fold (CollectionTests* self); +static void _collection_tests_test_fold_gee_test_case_test_method (gpointer self); +void collection_tests_test_foreach (CollectionTests* self); +static void _collection_tests_test_foreach_gee_test_case_test_method (gpointer self); +void collection_tests_test_map (CollectionTests* self); +static void _collection_tests_test_map_gee_test_case_test_method (gpointer self); +void collection_tests_test_scan (CollectionTests* self); +static void _collection_tests_test_scan_gee_test_case_test_method (gpointer self); +void collection_tests_test_filter (CollectionTests* self); +static void _collection_tests_test_filter_gee_test_case_test_method (gpointer self); +void collection_tests_test_chop (CollectionTests* self); +static void _collection_tests_test_chop_gee_test_case_test_method (gpointer self); +gchar** test_data_get_data (int* result_length1); +guint* test_data_get_drawn_numbers (int* result_length1); +static gint __lambda3_ (CollectionTests* self, gchar* x, gint y); +static gpointer ___lambda3__gee_fold_func (gpointer g, gpointer a, gpointer self); +static gint __lambda4_ (CollectionTests* self, gchar* x, gint y); +static gpointer ___lambda4__gee_fold_func (gpointer g, gpointer a, gpointer self); +static gint __lambda5_ (CollectionTests* self, gchar* x, gint y); +static gpointer ___lambda5__gee_fold_func (gpointer g, gpointer a, gpointer self); +static Block1Data* block1_data_ref (Block1Data* _data1_); +static void block1_data_unref (void * _userdata_); +static gboolean __lambda6_ (Block1Data* _data1_, gchar* x); +static gboolean ___lambda6__gee_forall_func (gpointer g, gpointer self); +static gboolean __lambda7_ (Block1Data* _data1_, gchar* x); +static gboolean ___lambda7__gee_forall_func (gpointer g, gpointer self); +static gboolean __lambda8_ (Block1Data* _data1_, gchar* x); +static gboolean ___lambda8__gee_forall_func (gpointer g, gpointer self); +static Block2Data* block2_data_ref (Block2Data* _data2_); +static void block2_data_unref (void * _userdata_); +static gint __lambda9_ (Block2Data* _data2_, gchar* str); +static gpointer ___lambda9__gee_map_func (gpointer g, gpointer self); +static gint __lambda10_ (Block2Data* _data2_, gchar* str); +static gpointer ___lambda10__gee_map_func (gpointer g, gpointer self); +static Block3Data* block3_data_ref (Block3Data* _data3_); +static void block3_data_unref (void * _userdata_); +static gint __lambda11_ (Block3Data* _data3_, gchar* str, gint cur); +static gpointer ___lambda11__gee_fold_func (gpointer g, gpointer a, gpointer self); +static gint __lambda12_ (Block3Data* _data3_, gchar* str, gint cur); +static gpointer ___lambda12__gee_fold_func (gpointer g, gpointer a, gpointer self); +static Block4Data* block4_data_ref (Block4Data* _data4_); +static void block4_data_unref (void * _userdata_); +static gboolean __lambda13_ (Block4Data* _data4_, const gchar* str); +static gboolean ___lambda13__gee_predicate (gconstpointer g, gpointer self); +static gboolean __lambda14_ (Block4Data* _data4_, const gchar* str); +static gboolean ___lambda14__gee_predicate (gconstpointer g, gpointer self); static void collection_tests_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); @@ -180,24 +263,60 @@ static void _collection_tests_test_gobject_properties_gee_test_case_test_method } +static void _collection_tests_test_fold_gee_test_case_test_method (gpointer self) { + collection_tests_test_fold (self); +} + + +static void _collection_tests_test_foreach_gee_test_case_test_method (gpointer self) { + collection_tests_test_foreach (self); +} + + +static void _collection_tests_test_map_gee_test_case_test_method (gpointer self) { + collection_tests_test_map (self); +} + + +static void _collection_tests_test_scan_gee_test_case_test_method (gpointer self) { + collection_tests_test_scan (self); +} + + +static void _collection_tests_test_filter_gee_test_case_test_method (gpointer self) { + collection_tests_test_filter (self); +} + + +static void _collection_tests_test_chop_gee_test_case_test_method (gpointer self) { + collection_tests_test_chop (self); +} + + CollectionTests* collection_tests_construct (GType object_type, const gchar* name) { CollectionTests * self = NULL; const gchar* _tmp0_; g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (CollectionTests*) gee_test_case_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] type correctness", _collection_tests_test_type_correctness_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] iterator returns all elements once", _collection_tests_test_iterator_returns_all_elements_once_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] mutable iterator", _collection_tests_test_mutable_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains, size and is_empty", _collection_tests_test_contains_size_and_is_empty_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add and remove", _collection_tests_test_add_remove_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] clear", _collection_tests_test_clear_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add_all", _collection_tests_test_add_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains_all", _collection_tests_test_contains_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] remove_all", _collection_tests_test_remove_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] retain_all", _collection_tests_test_retain_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] to_array", _collection_tests_test_to_array_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] GObject properties", _collection_tests_test_gobject_properties_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] type correctness", _collection_tests_test_type_correctness_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] iterator returns all elements once", _collection_tests_test_iterator_returns_all_elements_once_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] mutable iterator", _collection_tests_test_mutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains, size and is_empty", _collection_tests_test_contains_size_and_is_empty_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add and remove", _collection_tests_test_add_remove_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] clear", _collection_tests_test_clear_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add_all", _collection_tests_test_add_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains_all", _collection_tests_test_contains_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] remove_all", _collection_tests_test_remove_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] retain_all", _collection_tests_test_retain_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] to_array", _collection_tests_test_to_array_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] GObject properties", _collection_tests_test_gobject_properties_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] fold", _collection_tests_test_fold_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] foreach", _collection_tests_test_foreach_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] map", _collection_tests_test_map_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] scan", _collection_tests_test_scan_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] filter", _collection_tests_test_filter_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] chop", _collection_tests_test_chop_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -211,7 +330,7 @@ void collection_tests_test_type_correctness (CollectionTests* self) { _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); _tmp1_ = self->test_collection; - _tmp2_ = gee_iterable_get_element_type ((GeeIterable*) _tmp1_); + _tmp2_ = gee_traversable_get_element_type ((GeeTraversable*) _tmp1_); _tmp3_ = _tmp2_; _vala_assert (_tmp3_ == G_TYPE_STRING, "test_collection.element_type == typeof (string)"); } @@ -227,48 +346,19 @@ void collection_tests_test_iterator_returns_all_elements_once (CollectionTests* gboolean _tmp4_ = FALSE; GeeIterator* _tmp5_; gboolean _tmp6_ = FALSE; - GeeIterator* _tmp7_; - gboolean _tmp8_ = FALSE; - GeeCollection* _tmp9_; - gboolean _tmp10_ = FALSE; - GeeCollection* _tmp11_; - gboolean _tmp12_ = FALSE; - GeeCollection* _tmp13_; - gboolean _tmp14_ = FALSE; - gboolean one_found; - gboolean two_found; - gboolean three_found; - gboolean one_found_once; - gboolean two_found_once; - gboolean three_found_once; - GeeCollection* _tmp15_; - GeeIterator* _tmp16_ = NULL; - GeeIterator* _tmp31_; - gboolean _tmp32_ = FALSE; - gboolean _tmp33_; - gboolean _tmp34_; - GeeIterator* _tmp35_; - gboolean _tmp36_ = FALSE; - gboolean _tmp37_; - gboolean _tmp38_; - gboolean _tmp39_; - gboolean _tmp40_; - gboolean _tmp41_; - gboolean _tmp42_; - GeeIterator* _tmp43_; - gboolean _tmp44_ = FALSE; - GeeIterator* _tmp59_; - gboolean _tmp60_ = FALSE; - gboolean _tmp61_; - gboolean _tmp62_; - GeeIterator* _tmp63_; - gboolean _tmp64_ = FALSE; - gboolean _tmp65_; - gboolean _tmp66_; - gboolean _tmp67_; - gboolean _tmp68_; - gboolean _tmp69_; - gboolean _tmp70_; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gchar** data; + gint data_length1; + gint _data_size_; + gchar** _tmp9_; + gint _tmp9__length1; + gchar** _tmp13_; + gint _tmp13__length1; + guint* _tmp14_ = NULL; + guint* found_times; + gint found_times_length1; + gint _found_times_size_; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); @@ -281,196 +371,265 @@ void collection_tests_test_iterator_returns_all_elements_once (CollectionTests* _tmp5_ = iterator; _tmp6_ = gee_iterator_next (_tmp5_); _vala_assert (!_tmp6_, "! iterator.next ()"); - _tmp7_ = iterator; - _tmp8_ = gee_iterator_first (_tmp7_); - _vala_assert (!_tmp8_, "! iterator.first ()"); - _tmp9_ = self->test_collection; - _tmp10_ = gee_collection_add (_tmp9_, "one"); - _vala_assert (_tmp10_, "test_collection.add (\"one\")"); - _tmp11_ = self->test_collection; - _tmp12_ = gee_collection_add (_tmp11_, "two"); - _vala_assert (_tmp12_, "test_collection.add (\"two\")"); - _tmp13_ = self->test_collection; - _tmp14_ = gee_collection_add (_tmp13_, "three"); - _vala_assert (_tmp14_, "test_collection.add (\"three\")"); - one_found = FALSE; - two_found = FALSE; - three_found = FALSE; - one_found_once = TRUE; - two_found_once = TRUE; - three_found_once = TRUE; - _tmp15_ = self->test_collection; - _tmp16_ = gee_iterable_iterator ((GeeIterable*) _tmp15_); - _g_object_unref0 (iterator); - iterator = _tmp16_; - while (TRUE) { - GeeIterator* _tmp17_; - gboolean _tmp18_ = FALSE; - gboolean _tmp19_; - GeeIterator* _tmp20_; - gboolean _tmp21_ = FALSE; - gboolean _tmp22_; - GeeIterator* _tmp23_; - gpointer _tmp24_ = NULL; - gchar* element; - const gchar* _tmp25_; - _tmp17_ = iterator; - _tmp18_ = gee_iterator_has_next (_tmp17_); - has_next = _tmp18_; - _tmp19_ = has_next; - _tmp20_ = iterator; - _tmp21_ = gee_iterator_next (_tmp20_); - _vala_assert (_tmp19_ == _tmp21_, "has_next == iterator.next ()"); - _tmp22_ = has_next; - if (!_tmp22_) { - break; - } - _tmp23_ = iterator; - _tmp24_ = gee_iterator_get (_tmp23_); - element = (gchar*) _tmp24_; - _tmp25_ = element; - if (g_strcmp0 (_tmp25_, "one") == 0) { - gboolean _tmp26_; - _tmp26_ = one_found; - if (_tmp26_) { - one_found_once = FALSE; + _tmp8_ = test_data_get_data (&_tmp7_); + data = _tmp8_; + data_length1 = _tmp7_; + _data_size_ = data_length1; + _tmp9_ = data; + _tmp9__length1 = data_length1; + { + gchar** el_collection = NULL; + gint el_collection_length1 = 0; + gint _el_collection_size_ = 0; + gint el_it = 0; + el_collection = _tmp9_; + el_collection_length1 = _tmp9__length1; + for (el_it = 0; el_it < _tmp9__length1; el_it = el_it + 1) { + const gchar* el = NULL; + el = el_collection[el_it]; + { + GeeCollection* _tmp10_; + const gchar* _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp10_ = self->test_collection; + _tmp11_ = el; + _tmp12_ = gee_collection_add (_tmp10_, _tmp11_); + _vala_assert (_tmp12_, "test_collection.add (el)"); } - one_found = TRUE; - } else { - const gchar* _tmp27_; - _tmp27_ = element; - if (g_strcmp0 (_tmp27_, "two") == 0) { - gboolean _tmp28_; - _tmp28_ = two_found; - if (_tmp28_) { - two_found_once = FALSE; + } + } + _tmp13_ = data; + _tmp13__length1 = data_length1; + _tmp14_ = g_new0 (guint, _tmp13__length1); + found_times = _tmp14_; + found_times_length1 = _tmp13__length1; + _found_times_size_ = found_times_length1; + { + guint i; + i = (guint) 0; + { + gboolean _tmp15_; + _tmp15_ = TRUE; + while (TRUE) { + gboolean _tmp16_; + guint _tmp18_; + GeeCollection* _tmp27_; + GeeIterator* _tmp28_ = NULL; + GeeIterator* _tmp29_; + gboolean _tmp30_; + gboolean _tmp31_; + gboolean valid; + gboolean _tmp32_; + GeeIterator* _tmp64_; + gboolean _tmp65_ = FALSE; + gboolean _tmp66_; + GeeIterator* _tmp67_; + gboolean _tmp68_; + gboolean _tmp69_; + gboolean _tmp70_; + GeeIterator* _tmp71_; + gboolean _tmp72_ = FALSE; + GeeIterator* _tmp73_; + gboolean _tmp74_; + gboolean _tmp75_; + guint* _tmp76_; + gint _tmp76__length1; + _tmp16_ = _tmp15_; + if (!_tmp16_) { + guint _tmp17_; + _tmp17_ = i; + i = _tmp17_ + 1; } - two_found = TRUE; - } else { - const gchar* _tmp29_; - _tmp29_ = element; - if (g_strcmp0 (_tmp29_, "three") == 0) { - gboolean _tmp30_; - _tmp30_ = three_found; - if (_tmp30_) { - three_found_once = FALSE; + _tmp15_ = FALSE; + _tmp18_ = i; + if (!(_tmp18_ < ((guint) 2))) { + break; + } + { + guint j; + j = (guint) 0; + { + gboolean _tmp19_; + _tmp19_ = TRUE; + while (TRUE) { + gboolean _tmp20_; + guint _tmp22_; + guint* _tmp23_; + gint _tmp23__length1; + guint* _tmp24_; + gint _tmp24__length1; + guint _tmp25_; + guint _tmp26_; + _tmp20_ = _tmp19_; + if (!_tmp20_) { + guint _tmp21_; + _tmp21_ = j; + j = _tmp21_ + 1; + } + _tmp19_ = FALSE; + _tmp22_ = j; + _tmp23_ = found_times; + _tmp23__length1 = found_times_length1; + if (!(_tmp22_ < ((guint) _tmp23__length1))) { + break; + } + _tmp24_ = found_times; + _tmp24__length1 = found_times_length1; + _tmp25_ = j; + _tmp24_[_tmp25_] = (guint) 0; + _tmp26_ = _tmp24_[_tmp25_]; + } } - three_found = TRUE; } - } - } - _g_free0 (element); - } - _tmp31_ = iterator; - _tmp32_ = gee_iterator_has_next (_tmp31_); - has_next = _tmp32_; - _tmp33_ = has_next; - _vala_assert (!_tmp33_, "! has_next"); - _tmp34_ = has_next; - _tmp35_ = iterator; - _tmp36_ = gee_iterator_next (_tmp35_); - _vala_assert (_tmp34_ == _tmp36_, "has_next == iterator.next ()"); - _tmp37_ = one_found; - _vala_assert (_tmp37_, "one_found"); - _tmp38_ = one_found_once; - _vala_assert (_tmp38_, "one_found_once"); - _tmp39_ = two_found; - _vala_assert (_tmp39_, "two_found"); - _tmp40_ = two_found_once; - _vala_assert (_tmp40_, "two_found_once"); - _tmp41_ = three_found; - _vala_assert (_tmp41_, "three_found"); - _tmp42_ = three_found_once; - _vala_assert (_tmp42_, "three_found_once"); - _tmp43_ = iterator; - _tmp44_ = gee_iterator_first (_tmp43_); - _vala_assert (_tmp44_, "iterator.first ()"); - one_found = FALSE; - two_found = FALSE; - three_found = FALSE; - one_found_once = TRUE; - two_found_once = TRUE; - three_found_once = TRUE; - while (TRUE) { - GeeIterator* _tmp45_; - gpointer _tmp46_ = NULL; - gchar* element; - const gchar* _tmp47_; - GeeIterator* _tmp53_; - gboolean _tmp54_ = FALSE; - gboolean _tmp55_; - GeeIterator* _tmp56_; - gboolean _tmp57_ = FALSE; - gboolean _tmp58_; - _tmp45_ = iterator; - _tmp46_ = gee_iterator_get (_tmp45_); - element = (gchar*) _tmp46_; - _tmp47_ = element; - if (g_strcmp0 (_tmp47_, "one") == 0) { - gboolean _tmp48_; - _tmp48_ = one_found; - if (_tmp48_) { - one_found_once = FALSE; - } - one_found = TRUE; - } else { - const gchar* _tmp49_; - _tmp49_ = element; - if (g_strcmp0 (_tmp49_, "two") == 0) { - gboolean _tmp50_; - _tmp50_ = two_found; - if (_tmp50_) { - two_found_once = FALSE; + _tmp27_ = self->test_collection; + _tmp28_ = gee_iterable_iterator ((GeeIterable*) _tmp27_); + _g_object_unref0 (iterator); + iterator = _tmp28_; + _tmp29_ = iterator; + _tmp30_ = gee_iterator_get_valid (_tmp29_); + _tmp31_ = _tmp30_; + valid = _tmp31_; + _tmp32_ = valid; + _vala_assert (!_tmp32_, "! valid"); + while (TRUE) { + GeeIterator* _tmp33_; + gboolean _tmp34_ = FALSE; + gboolean _tmp35_; + GeeIterator* _tmp36_; + gboolean _tmp37_; + gboolean _tmp38_; + gboolean _tmp39_; + GeeIterator* _tmp40_; + gboolean _tmp41_ = FALSE; + GeeIterator* _tmp42_; + gboolean _tmp43_; + gboolean _tmp44_; + gboolean _tmp45_; + gboolean _tmp46_; + GeeIterator* _tmp47_; + gpointer _tmp48_ = NULL; + gchar* element; + GeeIterator* _tmp49_; + gboolean _tmp50_; + gboolean _tmp51_; + _tmp33_ = iterator; + _tmp34_ = gee_iterator_has_next (_tmp33_); + has_next = _tmp34_; + _tmp35_ = valid; + _tmp36_ = iterator; + _tmp37_ = gee_iterator_get_valid (_tmp36_); + _tmp38_ = _tmp37_; + _vala_assert (_tmp35_ == _tmp38_, "valid == iterator.valid"); + _tmp39_ = has_next; + _tmp40_ = iterator; + _tmp41_ = gee_iterator_next (_tmp40_); + _vala_assert (_tmp39_ == _tmp41_, "has_next == iterator.next ()"); + _tmp42_ = iterator; + _tmp43_ = gee_iterator_get_valid (_tmp42_); + _tmp44_ = _tmp43_; + valid = _tmp44_; + _tmp45_ = valid; + _vala_assert (_tmp45_, "valid = iterator.valid"); + _tmp46_ = has_next; + if (!_tmp46_) { + break; + } + _tmp47_ = iterator; + _tmp48_ = gee_iterator_get (_tmp47_); + element = (gchar*) _tmp48_; + _tmp49_ = iterator; + _tmp50_ = gee_iterator_get_valid (_tmp49_); + _tmp51_ = _tmp50_; + _vala_assert (_tmp51_, "iterator.valid"); + { + guint element_idx; + element_idx = (guint) 0; + { + gboolean _tmp52_; + _tmp52_ = TRUE; + while (TRUE) { + gboolean _tmp53_; + guint _tmp55_; + gchar** _tmp56_; + gint _tmp56__length1; + gchar** _tmp57_; + gint _tmp57__length1; + guint _tmp58_; + const gchar* _tmp59_; + const gchar* _tmp60_; + _tmp53_ = _tmp52_; + if (!_tmp53_) { + guint _tmp54_; + _tmp54_ = element_idx; + element_idx = _tmp54_ + 1; + } + _tmp52_ = FALSE; + _tmp55_ = element_idx; + _tmp56_ = data; + _tmp56__length1 = data_length1; + _vala_assert (_tmp55_ < ((guint) _tmp56__length1), "element_idx < data.length"); + _tmp57_ = data; + _tmp57__length1 = data_length1; + _tmp58_ = element_idx; + _tmp59_ = _tmp57_[_tmp58_]; + _tmp60_ = element; + if (g_strcmp0 (_tmp59_, _tmp60_) == 0) { + guint* _tmp61_; + gint _tmp61__length1; + guint _tmp62_; + guint _tmp63_; + _tmp61_ = found_times; + _tmp61__length1 = found_times_length1; + _tmp62_ = element_idx; + _tmp63_ = _tmp61_[_tmp62_]; + _tmp61_[_tmp62_] = _tmp63_ + 1; + break; + } + } + } + } + _g_free0 (element); } - two_found = TRUE; - } else { - const gchar* _tmp51_; - _tmp51_ = element; - if (g_strcmp0 (_tmp51_, "three") == 0) { - gboolean _tmp52_; - _tmp52_ = three_found; - if (_tmp52_) { - three_found_once = FALSE; + _tmp64_ = iterator; + _tmp65_ = gee_iterator_has_next (_tmp64_); + has_next = _tmp65_; + _tmp66_ = has_next; + _vala_assert (!_tmp66_, "! has_next"); + _tmp67_ = iterator; + _tmp68_ = gee_iterator_get_valid (_tmp67_); + _tmp69_ = _tmp68_; + _vala_assert (_tmp69_, "iterator.valid"); + _tmp70_ = has_next; + _tmp71_ = iterator; + _tmp72_ = gee_iterator_next (_tmp71_); + _vala_assert (_tmp70_ == _tmp72_, "has_next == iterator.next ()"); + _tmp73_ = iterator; + _tmp74_ = gee_iterator_get_valid (_tmp73_); + _tmp75_ = _tmp74_; + _vala_assert (_tmp75_, "iterator.valid"); + _tmp76_ = found_times; + _tmp76__length1 = found_times_length1; + { + guint* ft_collection = NULL; + gint ft_collection_length1 = 0; + gint _ft_collection_size_ = 0; + gint ft_it = 0; + ft_collection = _tmp76_; + ft_collection_length1 = _tmp76__length1; + for (ft_it = 0; ft_it < _tmp76__length1; ft_it = ft_it + 1) { + guint ft = 0U; + ft = ft_collection[ft_it]; + { + guint _tmp77_; + _tmp77_ = ft; + _vala_assert (_tmp77_ == ((guint) 1), "ft == 1"); + } } - three_found = TRUE; } } } - _tmp53_ = iterator; - _tmp54_ = gee_iterator_has_next (_tmp53_); - has_next = _tmp54_; - _tmp55_ = has_next; - _tmp56_ = iterator; - _tmp57_ = gee_iterator_next (_tmp56_); - _vala_assert (_tmp55_ == _tmp57_, "has_next == iterator.next ()"); - _tmp58_ = has_next; - if (!_tmp58_) { - _g_free0 (element); - break; - } - _g_free0 (element); } - _tmp59_ = iterator; - _tmp60_ = gee_iterator_has_next (_tmp59_); - has_next = _tmp60_; - _tmp61_ = has_next; - _vala_assert (!_tmp61_, "! has_next"); - _tmp62_ = has_next; - _tmp63_ = iterator; - _tmp64_ = gee_iterator_next (_tmp63_); - _vala_assert (_tmp62_ == _tmp64_, "has_next == iterator.next ()"); - _tmp65_ = one_found; - _vala_assert (_tmp65_, "one_found"); - _tmp66_ = one_found_once; - _vala_assert (_tmp66_, "one_found_once"); - _tmp67_ = two_found; - _vala_assert (_tmp67_, "two_found"); - _tmp68_ = two_found_once; - _vala_assert (_tmp68_, "two_found_once"); - _tmp69_ = three_found; - _vala_assert (_tmp69_, "three_found"); - _tmp70_ = three_found_once; - _vala_assert (_tmp70_, "three_found_once"); + found_times = (g_free (found_times), NULL); _g_object_unref0 (iterator); } @@ -481,1048 +640,1296 @@ void collection_tests_test_mutable_iterator (CollectionTests* self) { GeeCollection* _tmp1_; GeeIterator* _tmp2_ = NULL; GeeIterator* iterator; - GeeCollection* _tmp3_; - gboolean _tmp4_ = FALSE; - GeeCollection* _tmp5_; - gboolean _tmp6_ = FALSE; - GeeCollection* _tmp7_; - gboolean _tmp8_ = FALSE; - gboolean one_found; - gboolean two_found; - gboolean three_found; - gboolean one_found_once; - gboolean two_found_once; - gboolean three_found_once; - GeeCollection* _tmp9_; - GeeIterator* _tmp10_ = NULL; - GeeIterator* _tmp26_; - gboolean _tmp27_ = FALSE; - gboolean _tmp28_; - gboolean _tmp29_; - GeeIterator* _tmp30_; - gboolean _tmp31_ = FALSE; - gboolean _tmp32_; - gboolean _tmp33_; - gboolean _tmp34_; - gboolean _tmp35_; - gboolean _tmp36_; - gboolean _tmp37_; - GeeIterator* _tmp38_; - gboolean _tmp39_ = FALSE; - GeeIterator* _tmp53_; - gboolean _tmp54_ = FALSE; - gboolean _tmp55_; - gboolean _tmp56_; - GeeIterator* _tmp57_; - gboolean _tmp58_ = FALSE; - gboolean _tmp59_; - gboolean _tmp60_; - gboolean _tmp61_; - gboolean _tmp62_; - gboolean _tmp63_; + gint _tmp3_ = 0; + gchar** _tmp4_ = NULL; + gchar** data; + gint data_length1; + gint _data_size_; + gint _tmp5_ = 0; + guint* _tmp6_ = NULL; + guint* idx; + gint idx_length1; + gint _idx_size_; + gchar** _tmp7_; + gint _tmp7__length1; + GeeCollection* _tmp11_; + GeeIterator* _tmp12_ = NULL; + gchar** _tmp13_; + gint _tmp13__length1; + guint* _tmp14_ = NULL; + guint* found_times; + gint found_times_length1; + gint _found_times_size_; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); _tmp1_ = self->test_collection; _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); iterator = _tmp2_; - _tmp3_ = self->test_collection; - _tmp4_ = gee_collection_add (_tmp3_, "one"); - _vala_assert (_tmp4_, "test_collection.add (\"one\")"); - _tmp5_ = self->test_collection; - _tmp6_ = gee_collection_add (_tmp5_, "two"); - _vala_assert (_tmp6_, "test_collection.add (\"two\")"); - _tmp7_ = self->test_collection; - _tmp8_ = gee_collection_add (_tmp7_, "three"); - _vala_assert (_tmp8_, "test_collection.add (\"three\")"); - one_found = FALSE; - two_found = FALSE; - three_found = FALSE; - one_found_once = TRUE; - two_found_once = TRUE; - three_found_once = TRUE; - _tmp9_ = self->test_collection; - _tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_); - _g_object_unref0 (iterator); - iterator = _tmp10_; - while (TRUE) { - GeeIterator* _tmp11_; - gboolean _tmp12_ = FALSE; - gboolean _tmp13_; - GeeIterator* _tmp14_; - gboolean _tmp15_ = FALSE; - gboolean _tmp16_; - GeeIterator* _tmp17_; - gpointer _tmp18_ = NULL; - gchar* element; - const gchar* _tmp19_; - _tmp11_ = iterator; - _tmp12_ = gee_iterator_has_next (_tmp11_); - has_next = _tmp12_; - _tmp13_ = has_next; - _tmp14_ = iterator; - _tmp15_ = gee_iterator_next (_tmp14_); - _vala_assert (_tmp13_ == _tmp15_, "has_next == iterator.next ()"); - _tmp16_ = has_next; - if (!_tmp16_) { - break; - } - _tmp17_ = iterator; - _tmp18_ = gee_iterator_get (_tmp17_); - element = (gchar*) _tmp18_; - _tmp19_ = element; - if (g_strcmp0 (_tmp19_, "one") == 0) { - gboolean _tmp20_; - _tmp20_ = one_found; - if (_tmp20_) { - one_found_once = FALSE; + _tmp4_ = test_data_get_data (&_tmp3_); + data = _tmp4_; + data_length1 = _tmp3_; + _data_size_ = data_length1; + _tmp6_ = test_data_get_drawn_numbers (&_tmp5_); + idx = _tmp6_; + idx_length1 = _tmp5_; + _idx_size_ = idx_length1; + _tmp7_ = data; + _tmp7__length1 = data_length1; + { + gchar** el_collection = NULL; + gint el_collection_length1 = 0; + gint _el_collection_size_ = 0; + gint el_it = 0; + el_collection = _tmp7_; + el_collection_length1 = _tmp7__length1; + for (el_it = 0; el_it < _tmp7__length1; el_it = el_it + 1) { + const gchar* el = NULL; + el = el_collection[el_it]; + { + GeeCollection* _tmp8_; + const gchar* _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp8_ = self->test_collection; + _tmp9_ = el; + _tmp10_ = gee_collection_add (_tmp8_, _tmp9_); + _vala_assert (_tmp10_, "test_collection.add (el)"); } - one_found = TRUE; - } else { - const gchar* _tmp21_; - _tmp21_ = element; - if (g_strcmp0 (_tmp21_, "two") == 0) { - gboolean _tmp22_; - GeeIterator* _tmp23_; - _tmp22_ = two_found; - if (_tmp22_) { - two_found_once = FALSE; + } + } + _tmp11_ = self->test_collection; + _tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_); + _g_object_unref0 (iterator); + iterator = _tmp12_; + _tmp13_ = data; + _tmp13__length1 = data_length1; + _tmp14_ = g_new0 (guint, _tmp13__length1); + found_times = _tmp14_; + found_times_length1 = _tmp13__length1; + _found_times_size_ = found_times_length1; + { + guint i; + i = (guint) 0; + { + gboolean _tmp15_; + _tmp15_ = TRUE; + while (TRUE) { + gboolean _tmp16_; + guint _tmp18_; + guint* _tmp19_; + gint _tmp19__length1; + GeeCollection* _tmp28_; + GeeIterator* _tmp29_ = NULL; + GeeIterator* _tmp30_; + gboolean _tmp31_; + gboolean _tmp32_; + gboolean last_removed; + GeeIterator* _tmp72_; + gboolean _tmp73_ = FALSE; + gboolean _tmp74_; + GeeIterator* _tmp75_; + gboolean _tmp76_; + gboolean _tmp77_; + gboolean _tmp78_; + gboolean _tmp79_; + GeeIterator* _tmp80_; + gboolean _tmp81_ = FALSE; + GeeIterator* _tmp82_; + gboolean _tmp83_; + gboolean _tmp84_; + gboolean _tmp85_; + _tmp16_ = _tmp15_; + if (!_tmp16_) { + guint _tmp17_; + _tmp17_ = i; + i = _tmp17_ + 1; } - two_found = TRUE; - _tmp23_ = iterator; - gee_iterator_remove (_tmp23_); - } else { - const gchar* _tmp24_; - _tmp24_ = element; - if (g_strcmp0 (_tmp24_, "three") == 0) { - gboolean _tmp25_; - _tmp25_ = three_found; - if (_tmp25_) { - three_found_once = FALSE; + _tmp15_ = FALSE; + _tmp18_ = i; + _tmp19_ = idx; + _tmp19__length1 = idx_length1; + if (!(_tmp18_ <= ((guint) _tmp19__length1))) { + break; + } + { + guint j; + j = (guint) 0; + { + gboolean _tmp20_; + _tmp20_ = TRUE; + while (TRUE) { + gboolean _tmp21_; + guint _tmp23_; + guint* _tmp24_; + gint _tmp24__length1; + guint* _tmp25_; + gint _tmp25__length1; + guint _tmp26_; + guint _tmp27_; + _tmp21_ = _tmp20_; + if (!_tmp21_) { + guint _tmp22_; + _tmp22_ = j; + j = _tmp22_ + 1; + } + _tmp20_ = FALSE; + _tmp23_ = j; + _tmp24_ = found_times; + _tmp24__length1 = found_times_length1; + if (!(_tmp23_ < ((guint) _tmp24__length1))) { + break; + } + _tmp25_ = found_times; + _tmp25__length1 = found_times_length1; + _tmp26_ = j; + _tmp25_[_tmp26_] = (guint) 0; + _tmp27_ = _tmp25_[_tmp26_]; + } } - three_found = TRUE; } - } - } - _g_free0 (element); - } - _tmp26_ = iterator; - _tmp27_ = gee_iterator_has_next (_tmp26_); - has_next = _tmp27_; - _tmp28_ = has_next; - _vala_assert (!_tmp28_, "! has_next"); - _tmp29_ = has_next; - _tmp30_ = iterator; - _tmp31_ = gee_iterator_next (_tmp30_); - _vala_assert (_tmp29_ == _tmp31_, "has_next == iterator.next ()"); - _tmp32_ = one_found; - _vala_assert (_tmp32_, "one_found"); - _tmp33_ = one_found_once; - _vala_assert (_tmp33_, "one_found_once"); - _tmp34_ = two_found; - _vala_assert (_tmp34_, "two_found"); - _tmp35_ = two_found_once; - _vala_assert (_tmp35_, "two_found_once"); - _tmp36_ = three_found; - _vala_assert (_tmp36_, "three_found"); - _tmp37_ = three_found_once; - _vala_assert (_tmp37_, "three_found_once"); - _tmp38_ = iterator; - _tmp39_ = gee_iterator_first (_tmp38_); - _vala_assert (_tmp39_, "iterator.first ()"); - one_found = FALSE; - two_found = FALSE; - three_found = FALSE; - one_found_once = TRUE; - two_found_once = TRUE; - three_found_once = TRUE; - while (TRUE) { - GeeIterator* _tmp40_; - gpointer _tmp41_ = NULL; - gchar* element; - const gchar* _tmp42_; - GeeIterator* _tmp47_; - gboolean _tmp48_ = FALSE; - gboolean _tmp49_; - GeeIterator* _tmp50_; - gboolean _tmp51_ = FALSE; - gboolean _tmp52_; - _tmp40_ = iterator; - _tmp41_ = gee_iterator_get (_tmp40_); - element = (gchar*) _tmp41_; - _tmp42_ = element; - if (g_strcmp0 (_tmp42_, "one") == 0) { - gboolean _tmp43_; - _tmp43_ = one_found; - if (_tmp43_) { - one_found_once = FALSE; - } - one_found = TRUE; - } else { - const gchar* _tmp44_; - _tmp44_ = element; - if (g_strcmp0 (_tmp44_, "two") == 0) { - two_found = TRUE; - } else { - const gchar* _tmp45_; - _tmp45_ = element; - if (g_strcmp0 (_tmp45_, "three") == 0) { - gboolean _tmp46_; - _tmp46_ = three_found; - if (_tmp46_) { - three_found_once = FALSE; + _tmp28_ = self->test_collection; + _tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_); + _g_object_unref0 (iterator); + iterator = _tmp29_; + _tmp30_ = iterator; + _tmp31_ = gee_iterator_get_valid (_tmp30_); + _tmp32_ = _tmp31_; + _vala_assert (!_tmp32_, "! iterator.valid"); + last_removed = FALSE; + while (TRUE) { + GeeIterator* _tmp33_; + gboolean _tmp34_ = FALSE; + gboolean _tmp35_; + GeeIterator* _tmp36_; + gboolean _tmp37_ = FALSE; + gboolean _tmp38_; + GeeIterator* _tmp39_; + gpointer _tmp40_ = NULL; + gchar* element; + GeeIterator* _tmp41_; + gboolean _tmp42_; + gboolean _tmp43_; + _tmp33_ = iterator; + _tmp34_ = gee_iterator_has_next (_tmp33_); + has_next = _tmp34_; + _tmp35_ = has_next; + _tmp36_ = iterator; + _tmp37_ = gee_iterator_next (_tmp36_); + _vala_assert (_tmp35_ == _tmp37_, "has_next == iterator.next ()"); + _tmp38_ = has_next; + if (!_tmp38_) { + break; + } + _tmp39_ = iterator; + _tmp40_ = gee_iterator_get (_tmp39_); + element = (gchar*) _tmp40_; + _tmp41_ = iterator; + _tmp42_ = gee_iterator_get_valid (_tmp41_); + _tmp43_ = _tmp42_; + _vala_assert (_tmp43_, "iterator.valid"); + { + guint element_idx; + element_idx = (guint) 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + guint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + gchar** _tmp49_; + gint _tmp49__length1; + guint _tmp50_; + const gchar* _tmp51_; + const gchar* _tmp52_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + guint _tmp46_; + _tmp46_ = element_idx; + element_idx = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = element_idx; + _tmp48_ = data; + _tmp48__length1 = data_length1; + _vala_assert (_tmp47_ < ((guint) _tmp48__length1), "element_idx < data.length"); + _tmp49_ = data; + _tmp49__length1 = data_length1; + _tmp50_ = element_idx; + _tmp51_ = _tmp49_[_tmp50_]; + _tmp52_ = element; + if (g_strcmp0 (_tmp51_, _tmp52_) == 0) { + gboolean _tmp53_ = FALSE; + guint _tmp54_; + guint* _tmp55_; + gint _tmp55__length1; + gboolean _tmp64_; + guint* _tmp69_; + gint _tmp69__length1; + guint _tmp70_; + guint _tmp71_; + _tmp54_ = i; + _tmp55_ = idx; + _tmp55__length1 = idx_length1; + if (_tmp54_ != ((guint) _tmp55__length1)) { + gchar** _tmp56_; + gint _tmp56__length1; + guint _tmp57_; + const gchar* _tmp58_; + gchar** _tmp59_; + gint _tmp59__length1; + guint* _tmp60_; + gint _tmp60__length1; + guint _tmp61_; + guint _tmp62_; + const gchar* _tmp63_; + _tmp56_ = data; + _tmp56__length1 = data_length1; + _tmp57_ = element_idx; + _tmp58_ = _tmp56_[_tmp57_]; + _tmp59_ = data; + _tmp59__length1 = data_length1; + _tmp60_ = idx; + _tmp60__length1 = idx_length1; + _tmp61_ = i; + _tmp62_ = _tmp60_[_tmp61_]; + _tmp63_ = _tmp59_[_tmp62_]; + _tmp53_ = g_strcmp0 (_tmp58_, _tmp63_) == 0; + } else { + _tmp53_ = FALSE; + } + _tmp64_ = _tmp53_; + if (_tmp64_) { + GeeIterator* _tmp65_; + GeeIterator* _tmp66_; + gboolean _tmp67_; + gboolean _tmp68_; + _tmp65_ = iterator; + gee_iterator_remove (_tmp65_); + _tmp66_ = iterator; + _tmp67_ = gee_iterator_get_valid (_tmp66_); + _tmp68_ = _tmp67_; + _vala_assert (!_tmp68_, "! iterator.valid"); + last_removed = TRUE; + } else { + last_removed = FALSE; + } + _tmp69_ = found_times; + _tmp69__length1 = found_times_length1; + _tmp70_ = element_idx; + _tmp71_ = _tmp69_[_tmp70_]; + _tmp69_[_tmp70_] = _tmp71_ + 1; + break; + } + } + } + } + _g_free0 (element); + } + _tmp72_ = iterator; + _tmp73_ = gee_iterator_has_next (_tmp72_); + has_next = _tmp73_; + _tmp74_ = has_next; + _vala_assert (!_tmp74_, "! has_next"); + _tmp75_ = iterator; + _tmp76_ = gee_iterator_get_valid (_tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = last_removed; + _vala_assert (_tmp77_ == (!_tmp78_), "iterator.valid == !last_removed"); + _tmp79_ = has_next; + _tmp80_ = iterator; + _tmp81_ = gee_iterator_next (_tmp80_); + _vala_assert (_tmp79_ == _tmp81_, "has_next == iterator.next ()"); + _tmp82_ = iterator; + _tmp83_ = gee_iterator_get_valid (_tmp82_); + _tmp84_ = _tmp83_; + _tmp85_ = last_removed; + _vala_assert (_tmp84_ == (!_tmp85_), "iterator.valid == !last_removed"); + { + guint j; + j = (guint) 0; + { + gboolean _tmp86_; + _tmp86_ = TRUE; + while (TRUE) { + gboolean _tmp87_; + guint _tmp89_; + guint* _tmp90_; + gint _tmp90__length1; + gboolean removed; + gint _tmp100_ = 0; + gboolean _tmp101_; + guint* _tmp102_; + gint _tmp102__length1; + guint _tmp103_; + guint _tmp104_; + gint _tmp105_; + _tmp87_ = _tmp86_; + if (!_tmp87_) { + guint _tmp88_; + _tmp88_ = j; + j = _tmp88_ + 1; + } + _tmp86_ = FALSE; + _tmp89_ = j; + _tmp90_ = found_times; + _tmp90__length1 = found_times_length1; + if (!(_tmp89_ < ((guint) _tmp90__length1))) { + break; + } + removed = FALSE; + { + gint k; + k = 0; + { + gboolean _tmp91_; + _tmp91_ = TRUE; + while (TRUE) { + gboolean _tmp92_; + gint _tmp94_; + guint _tmp95_; + guint* _tmp96_; + gint _tmp96__length1; + gint _tmp97_; + guint _tmp98_; + guint _tmp99_; + _tmp92_ = _tmp91_; + if (!_tmp92_) { + gint _tmp93_; + _tmp93_ = k; + k = _tmp93_ + 1; + } + _tmp91_ = FALSE; + _tmp94_ = k; + _tmp95_ = i; + if (!(((guint) _tmp94_) < _tmp95_)) { + break; + } + _tmp96_ = idx; + _tmp96__length1 = idx_length1; + _tmp97_ = k; + _tmp98_ = _tmp96_[_tmp97_]; + _tmp99_ = j; + if (_tmp98_ == _tmp99_) { + removed = TRUE; + break; + } + } + } + } + _tmp101_ = removed; + if (_tmp101_) { + _tmp100_ = 0; + } else { + _tmp100_ = 1; + } + _tmp102_ = found_times; + _tmp102__length1 = found_times_length1; + _tmp103_ = j; + _tmp104_ = _tmp102_[_tmp103_]; + _tmp105_ = _tmp100_; + _vala_assert (_tmp104_ == ((guint) _tmp105_), "found_times[j] == (removed ? 0 : 1)"); + } } - three_found = TRUE; } } } - _tmp47_ = iterator; - _tmp48_ = gee_iterator_has_next (_tmp47_); - has_next = _tmp48_; - _tmp49_ = has_next; - _tmp50_ = iterator; - _tmp51_ = gee_iterator_next (_tmp50_); - _vala_assert (_tmp49_ == _tmp51_, "has_next == iterator.next ()"); - _tmp52_ = has_next; - if (!_tmp52_) { - _g_free0 (element); - break; - } - _g_free0 (element); } - _tmp53_ = iterator; - _tmp54_ = gee_iterator_has_next (_tmp53_); - has_next = _tmp54_; - _tmp55_ = has_next; - _vala_assert (!_tmp55_, "! has_next"); - _tmp56_ = has_next; - _tmp57_ = iterator; - _tmp58_ = gee_iterator_next (_tmp57_); - _vala_assert (_tmp56_ == _tmp58_, "has_next == iterator.next ()"); - _tmp59_ = one_found; - _vala_assert (_tmp59_, "one_found"); - _tmp60_ = one_found_once; - _vala_assert (_tmp60_, "one_found_once"); - _tmp61_ = two_found; - _vala_assert (!_tmp61_, "!two_found"); - _tmp62_ = three_found; - _vala_assert (_tmp62_, "three_found"); - _tmp63_ = three_found_once; - _vala_assert (_tmp63_, "three_found_once"); + found_times = (g_free (found_times), NULL); _g_object_unref0 (iterator); } void collection_tests_test_contains_size_and_is_empty (CollectionTests* self) { GeeCollection* _tmp0_; - GeeCollection* _tmp1_; - gboolean _tmp2_ = FALSE; - GeeCollection* _tmp3_; - gboolean _tmp4_ = FALSE; - GeeCollection* _tmp5_; - gboolean _tmp6_ = FALSE; - GeeCollection* _tmp7_; - gint _tmp8_; - gint _tmp9_; - GeeCollection* _tmp10_; - gboolean _tmp11_; - gboolean _tmp12_; - GeeCollection* _tmp13_; - gboolean _tmp14_ = FALSE; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gchar** data; + gint data_length1; + gint _data_size_; + gint _tmp3_ = 0; + guint* _tmp4_ = NULL; + guint* idx; + gint idx_length1; + gint _idx_size_; + gchar** _tmp5_; + gint _tmp5__length1; + GeeCollection* _tmp9_; + gint _tmp10_; + gint _tmp11_; + GeeCollection* _tmp12_; + gboolean _tmp13_; + gboolean _tmp14_; GeeCollection* _tmp15_; - gboolean _tmp16_ = FALSE; - GeeCollection* _tmp17_; + gchar** _tmp16_; + gint _tmp16__length1; + const gchar* _tmp17_; gboolean _tmp18_ = FALSE; GeeCollection* _tmp19_; - gboolean _tmp20_ = FALSE; - GeeCollection* _tmp21_; - gint _tmp22_; - gint _tmp23_; - GeeCollection* _tmp24_; - gboolean _tmp25_; - gboolean _tmp26_; - GeeCollection* _tmp27_; - gboolean _tmp28_ = FALSE; - GeeCollection* _tmp29_; - gboolean _tmp30_ = FALSE; - GeeCollection* _tmp31_; - gboolean _tmp32_ = FALSE; + gchar** _tmp20_; + gint _tmp20__length1; + const gchar* _tmp21_; + gboolean _tmp22_ = FALSE; GeeCollection* _tmp33_; - gboolean _tmp34_ = FALSE; - GeeCollection* _tmp35_; - gint _tmp36_; - gint _tmp37_; - GeeCollection* _tmp38_; - gboolean _tmp39_; - gboolean _tmp40_; - GeeCollection* _tmp41_; - gboolean _tmp42_ = FALSE; - GeeCollection* _tmp43_; - gboolean _tmp44_ = FALSE; + gint _tmp34_; + gint _tmp35_; + GeeCollection* _tmp36_; + gboolean _tmp37_; + gboolean _tmp38_; + GeeCollection* _tmp39_; + gboolean _tmp40_ = FALSE; + gchar** _tmp41_; + gint _tmp41__length1; GeeCollection* _tmp45_; - gboolean _tmp46_ = FALSE; - GeeCollection* _tmp47_; - gboolean _tmp48_ = FALSE; - GeeCollection* _tmp49_; - gint _tmp50_; - gint _tmp51_; - GeeCollection* _tmp52_; - gboolean _tmp53_; - gboolean _tmp54_; - GeeCollection* _tmp55_; - gboolean _tmp56_ = FALSE; - GeeCollection* _tmp57_; - gboolean _tmp58_ = FALSE; - GeeCollection* _tmp59_; - gboolean _tmp60_ = FALSE; - GeeCollection* _tmp61_; - gboolean _tmp62_ = FALSE; - GeeCollection* _tmp63_; - gint _tmp64_; - gint _tmp65_; - GeeCollection* _tmp66_; - gboolean _tmp67_; - gboolean _tmp68_; - GeeCollection* _tmp69_; - gboolean _tmp70_ = FALSE; - GeeCollection* _tmp71_; - gboolean _tmp72_ = FALSE; - GeeCollection* _tmp73_; - gboolean _tmp74_ = FALSE; - GeeCollection* _tmp75_; - gboolean _tmp76_ = FALSE; - GeeCollection* _tmp77_; - gint _tmp78_; - gint _tmp79_; - GeeCollection* _tmp80_; - gboolean _tmp81_; - gboolean _tmp82_; - GeeCollection* _tmp83_; - gboolean _tmp84_ = FALSE; - GeeCollection* _tmp85_; - gboolean _tmp86_ = FALSE; - GeeCollection* _tmp87_; - gboolean _tmp88_ = FALSE; - GeeCollection* _tmp89_; - gboolean _tmp90_ = FALSE; - GeeCollection* _tmp91_; - gint _tmp92_; - gint _tmp93_; - GeeCollection* _tmp94_; - gboolean _tmp95_; - gboolean _tmp96_; - GeeCollection* _tmp97_; - gboolean _tmp98_ = FALSE; - GeeCollection* _tmp99_; - gboolean _tmp100_ = FALSE; - GeeCollection* _tmp101_; - gboolean _tmp102_ = FALSE; - GeeCollection* _tmp103_; - gboolean _tmp104_ = FALSE; - GeeCollection* _tmp105_; - gint _tmp106_; - gint _tmp107_; - GeeCollection* _tmp108_; - gboolean _tmp109_; - gboolean _tmp110_; - GeeCollection* _tmp111_; - GeeCollection* _tmp112_; - gboolean _tmp113_ = FALSE; - GeeCollection* _tmp114_; - gboolean _tmp115_ = FALSE; - GeeCollection* _tmp116_; - gboolean _tmp117_ = FALSE; - GeeCollection* _tmp118_; - gint _tmp119_; - gint _tmp120_; - GeeCollection* _tmp121_; - gboolean _tmp122_; - gboolean _tmp123_; + gint _tmp46_; + gint _tmp47_; + GeeCollection* _tmp48_; + gboolean _tmp49_; + gboolean _tmp50_; + GeeCollection* _tmp158_; + gchar** _tmp159_; + gint _tmp159__length1; + GeeCollection* _tmp163_; + gint _tmp164_; + gint _tmp165_; + GeeCollection* _tmp166_; + gboolean _tmp167_; + gboolean _tmp168_; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = self->test_collection; - _tmp2_ = gee_collection_contains (_tmp1_, "one"); - _vala_assert (!_tmp2_, "! test_collection.contains (\"one\")"); - _tmp3_ = self->test_collection; - _tmp4_ = gee_collection_contains (_tmp3_, "two"); - _vala_assert (!_tmp4_, "! test_collection.contains (\"two\")"); - _tmp5_ = self->test_collection; - _tmp6_ = gee_collection_contains (_tmp5_, "three"); - _vala_assert (!_tmp6_, "! test_collection.contains (\"three\")"); - _tmp7_ = self->test_collection; - _tmp8_ = gee_collection_get_size (_tmp7_); - _tmp9_ = _tmp8_; - _vala_assert (_tmp9_ == 0, "test_collection.size == 0"); - _tmp10_ = self->test_collection; - _tmp11_ = gee_collection_get_is_empty (_tmp10_); - _tmp12_ = _tmp11_; - _vala_assert (_tmp12_, "test_collection.is_empty"); - _tmp13_ = self->test_collection; - _tmp14_ = gee_collection_add (_tmp13_, "one"); - _vala_assert (_tmp14_, "test_collection.add (\"one\")"); + _tmp2_ = test_data_get_data (&_tmp1_); + data = _tmp2_; + data_length1 = _tmp1_; + _data_size_ = data_length1; + _tmp4_ = test_data_get_drawn_numbers (&_tmp3_); + idx = _tmp4_; + idx_length1 = _tmp3_; + _idx_size_ = idx_length1; + _tmp5_ = data; + _tmp5__length1 = data_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp5_; + s_collection_length1 = _tmp5__length1; + for (s_it = 0; s_it < _tmp5__length1; s_it = s_it + 1) { + const gchar* s = NULL; + s = s_collection[s_it]; + { + GeeCollection* _tmp6_; + const gchar* _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp6_ = self->test_collection; + _tmp7_ = s; + _tmp8_ = gee_collection_contains (_tmp6_, _tmp7_); + _vala_assert (!_tmp8_, "! test_collection.contains (s)"); + } + } + } + _tmp9_ = self->test_collection; + _tmp10_ = gee_collection_get_size (_tmp9_); + _tmp11_ = _tmp10_; + _vala_assert (_tmp11_ == 0, "test_collection.size == 0"); + _tmp12_ = self->test_collection; + _tmp13_ = gee_collection_get_is_empty (_tmp12_); + _tmp14_ = _tmp13_; + _vala_assert (_tmp14_, "test_collection.is_empty"); _tmp15_ = self->test_collection; - _tmp16_ = gee_collection_contains (_tmp15_, "one"); - _vala_assert (_tmp16_, "test_collection.contains (\"one\")"); - _tmp17_ = self->test_collection; - _tmp18_ = gee_collection_contains (_tmp17_, "two"); - _vala_assert (!_tmp18_, "! test_collection.contains (\"two\")"); + _tmp16_ = data; + _tmp16__length1 = data_length1; + _tmp17_ = _tmp16_[0]; + _tmp18_ = gee_collection_add (_tmp15_, _tmp17_); + _vala_assert (_tmp18_, "test_collection.add (data[0])"); _tmp19_ = self->test_collection; - _tmp20_ = gee_collection_contains (_tmp19_, "three"); - _vala_assert (!_tmp20_, "! test_collection.contains (\"three\")"); - _tmp21_ = self->test_collection; - _tmp22_ = gee_collection_get_size (_tmp21_); - _tmp23_ = _tmp22_; - _vala_assert (_tmp23_ == 1, "test_collection.size == 1"); - _tmp24_ = self->test_collection; - _tmp25_ = gee_collection_get_is_empty (_tmp24_); - _tmp26_ = _tmp25_; - _vala_assert (!_tmp26_, "! test_collection.is_empty"); - _tmp27_ = self->test_collection; - _tmp28_ = gee_collection_remove (_tmp27_, "one"); - _vala_assert (_tmp28_, "test_collection.remove (\"one\")"); - _tmp29_ = self->test_collection; - _tmp30_ = gee_collection_contains (_tmp29_, "one"); - _vala_assert (!_tmp30_, "! test_collection.contains (\"one\")"); - _tmp31_ = self->test_collection; - _tmp32_ = gee_collection_contains (_tmp31_, "two"); - _vala_assert (!_tmp32_, "! test_collection.contains (\"two\")"); + _tmp20_ = data; + _tmp20__length1 = data_length1; + _tmp21_ = _tmp20_[0]; + _tmp22_ = gee_collection_contains (_tmp19_, _tmp21_); + _vala_assert (_tmp22_, "test_collection.contains (data[0])"); + { + guint i; + i = (guint) 1; + { + gboolean _tmp23_; + _tmp23_ = TRUE; + while (TRUE) { + gboolean _tmp24_; + guint _tmp26_; + gchar** _tmp27_; + gint _tmp27__length1; + GeeCollection* _tmp28_; + gchar** _tmp29_; + gint _tmp29__length1; + guint _tmp30_; + const gchar* _tmp31_; + gboolean _tmp32_ = FALSE; + _tmp24_ = _tmp23_; + if (!_tmp24_) { + guint _tmp25_; + _tmp25_ = i; + i = _tmp25_ + 1; + } + _tmp23_ = FALSE; + _tmp26_ = i; + _tmp27_ = data; + _tmp27__length1 = data_length1; + if (!(_tmp26_ < ((guint) _tmp27__length1))) { + break; + } + _tmp28_ = self->test_collection; + _tmp29_ = data; + _tmp29__length1 = data_length1; + _tmp30_ = i; + _tmp31_ = _tmp29_[_tmp30_]; + _tmp32_ = gee_collection_contains (_tmp28_, _tmp31_); + _vala_assert (!_tmp32_, "! test_collection.contains (data[i])"); + } + } + } _tmp33_ = self->test_collection; - _tmp34_ = gee_collection_contains (_tmp33_, "three"); - _vala_assert (!_tmp34_, "! test_collection.contains (\"three\")"); - _tmp35_ = self->test_collection; - _tmp36_ = gee_collection_get_size (_tmp35_); - _tmp37_ = _tmp36_; - _vala_assert (_tmp37_ == 0, "test_collection.size == 0"); - _tmp38_ = self->test_collection; - _tmp39_ = gee_collection_get_is_empty (_tmp38_); - _tmp40_ = _tmp39_; - _vala_assert (_tmp40_, "test_collection.is_empty"); - _tmp41_ = self->test_collection; - _tmp42_ = gee_collection_add (_tmp41_, "one"); - _vala_assert (_tmp42_, "test_collection.add (\"one\")"); - _tmp43_ = self->test_collection; - _tmp44_ = gee_collection_contains (_tmp43_, "one"); - _vala_assert (_tmp44_, "test_collection.contains (\"one\")"); + _tmp34_ = gee_collection_get_size (_tmp33_); + _tmp35_ = _tmp34_; + _vala_assert (_tmp35_ == 1, "test_collection.size == 1"); + _tmp36_ = self->test_collection; + _tmp37_ = gee_collection_get_is_empty (_tmp36_); + _tmp38_ = _tmp37_; + _vala_assert (!_tmp38_, "! test_collection.is_empty"); + _tmp39_ = self->test_collection; + _tmp40_ = gee_collection_remove (_tmp39_, "one"); + _vala_assert (_tmp40_, "test_collection.remove (\"one\")"); + _tmp41_ = data; + _tmp41__length1 = data_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp41_; + s_collection_length1 = _tmp41__length1; + for (s_it = 0; s_it < _tmp41__length1; s_it = s_it + 1) { + const gchar* s = NULL; + s = s_collection[s_it]; + { + GeeCollection* _tmp42_; + const gchar* _tmp43_; + gboolean _tmp44_ = FALSE; + _tmp42_ = self->test_collection; + _tmp43_ = s; + _tmp44_ = gee_collection_contains (_tmp42_, _tmp43_); + _vala_assert (!_tmp44_, "! test_collection.contains (s)"); + } + } + } _tmp45_ = self->test_collection; - _tmp46_ = gee_collection_contains (_tmp45_, "two"); - _vala_assert (!_tmp46_, "! test_collection.contains (\"two\")"); - _tmp47_ = self->test_collection; - _tmp48_ = gee_collection_contains (_tmp47_, "three"); - _vala_assert (!_tmp48_, "! test_collection.contains (\"three\")"); - _tmp49_ = self->test_collection; - _tmp50_ = gee_collection_get_size (_tmp49_); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 1, "test_collection.size == 1"); - _tmp52_ = self->test_collection; - _tmp53_ = gee_collection_get_is_empty (_tmp52_); - _tmp54_ = _tmp53_; - _vala_assert (!_tmp54_, "! test_collection.is_empty"); - _tmp55_ = self->test_collection; - _tmp56_ = gee_collection_add (_tmp55_, "two"); - _vala_assert (_tmp56_, "test_collection.add (\"two\")"); - _tmp57_ = self->test_collection; - _tmp58_ = gee_collection_contains (_tmp57_, "one"); - _vala_assert (_tmp58_, "test_collection.contains (\"one\")"); - _tmp59_ = self->test_collection; - _tmp60_ = gee_collection_contains (_tmp59_, "two"); - _vala_assert (_tmp60_, "test_collection.contains (\"two\")"); - _tmp61_ = self->test_collection; - _tmp62_ = gee_collection_contains (_tmp61_, "three"); - _vala_assert (!_tmp62_, "! test_collection.contains (\"three\")"); - _tmp63_ = self->test_collection; - _tmp64_ = gee_collection_get_size (_tmp63_); - _tmp65_ = _tmp64_; - _vala_assert (_tmp65_ == 2, "test_collection.size == 2"); - _tmp66_ = self->test_collection; - _tmp67_ = gee_collection_get_is_empty (_tmp66_); - _tmp68_ = _tmp67_; - _vala_assert (!_tmp68_, "! test_collection.is_empty"); - _tmp69_ = self->test_collection; - _tmp70_ = gee_collection_add (_tmp69_, "three"); - _vala_assert (_tmp70_, "test_collection.add (\"three\")"); - _tmp71_ = self->test_collection; - _tmp72_ = gee_collection_contains (_tmp71_, "one"); - _vala_assert (_tmp72_, "test_collection.contains (\"one\")"); - _tmp73_ = self->test_collection; - _tmp74_ = gee_collection_contains (_tmp73_, "two"); - _vala_assert (_tmp74_, "test_collection.contains (\"two\")"); - _tmp75_ = self->test_collection; - _tmp76_ = gee_collection_contains (_tmp75_, "three"); - _vala_assert (_tmp76_, "test_collection.contains (\"three\")"); - _tmp77_ = self->test_collection; - _tmp78_ = gee_collection_get_size (_tmp77_); - _tmp79_ = _tmp78_; - _vala_assert (_tmp79_ == 3, "test_collection.size == 3"); - _tmp80_ = self->test_collection; - _tmp81_ = gee_collection_get_is_empty (_tmp80_); - _tmp82_ = _tmp81_; - _vala_assert (!_tmp82_, "! test_collection.is_empty"); - _tmp83_ = self->test_collection; - _tmp84_ = gee_collection_remove (_tmp83_, "two"); - _vala_assert (_tmp84_, "test_collection.remove (\"two\")"); - _tmp85_ = self->test_collection; - _tmp86_ = gee_collection_contains (_tmp85_, "one"); - _vala_assert (_tmp86_, "test_collection.contains (\"one\")"); - _tmp87_ = self->test_collection; - _tmp88_ = gee_collection_contains (_tmp87_, "two"); - _vala_assert (!_tmp88_, "! test_collection.contains (\"two\")"); - _tmp89_ = self->test_collection; - _tmp90_ = gee_collection_contains (_tmp89_, "three"); - _vala_assert (_tmp90_, "test_collection.contains (\"three\")"); - _tmp91_ = self->test_collection; - _tmp92_ = gee_collection_get_size (_tmp91_); - _tmp93_ = _tmp92_; - _vala_assert (_tmp93_ == 2, "test_collection.size == 2"); - _tmp94_ = self->test_collection; - _tmp95_ = gee_collection_get_is_empty (_tmp94_); - _tmp96_ = _tmp95_; - _vala_assert (!_tmp96_, "! test_collection.is_empty"); - _tmp97_ = self->test_collection; - _tmp98_ = gee_collection_remove (_tmp97_, "two"); - _vala_assert (!_tmp98_, "! test_collection.remove (\"two\")"); - _tmp99_ = self->test_collection; - _tmp100_ = gee_collection_contains (_tmp99_, "one"); - _vala_assert (_tmp100_, "test_collection.contains (\"one\")"); - _tmp101_ = self->test_collection; - _tmp102_ = gee_collection_contains (_tmp101_, "two"); - _vala_assert (!_tmp102_, "! test_collection.contains (\"two\")"); - _tmp103_ = self->test_collection; - _tmp104_ = gee_collection_contains (_tmp103_, "three"); - _vala_assert (_tmp104_, "test_collection.contains (\"three\")"); - _tmp105_ = self->test_collection; - _tmp106_ = gee_collection_get_size (_tmp105_); - _tmp107_ = _tmp106_; - _vala_assert (_tmp107_ == 2, "test_collection.size == 2"); - _tmp108_ = self->test_collection; - _tmp109_ = gee_collection_get_is_empty (_tmp108_); - _tmp110_ = _tmp109_; - _vala_assert (!_tmp110_, "! test_collection.is_empty"); - _tmp111_ = self->test_collection; - gee_collection_clear (_tmp111_); - _tmp112_ = self->test_collection; - _tmp113_ = gee_collection_contains (_tmp112_, "one"); - _vala_assert (!_tmp113_, "! test_collection.contains (\"one\")"); - _tmp114_ = self->test_collection; - _tmp115_ = gee_collection_contains (_tmp114_, "two"); - _vala_assert (!_tmp115_, "! test_collection.contains (\"two\")"); - _tmp116_ = self->test_collection; - _tmp117_ = gee_collection_contains (_tmp116_, "three"); - _vala_assert (!_tmp117_, "! test_collection.contains (\"three\")"); - _tmp118_ = self->test_collection; - _tmp119_ = gee_collection_get_size (_tmp118_); - _tmp120_ = _tmp119_; - _vala_assert (_tmp120_ == 0, "test_collection.size == 0"); - _tmp121_ = self->test_collection; - _tmp122_ = gee_collection_get_is_empty (_tmp121_); - _tmp123_ = _tmp122_; - _vala_assert (_tmp123_, "test_collection.is_empty"); -} - - -void collection_tests_test_add_remove (CollectionTests* self) { - GeeCollection* _tmp0_; - gchar* _tmp1_; - gchar* _tmp2_; - gchar* _tmp3_; - gchar* _tmp4_; - gchar* _tmp5_; - gchar* _tmp6_; - gchar* _tmp7_; - gchar* _tmp8_; - gchar* _tmp9_; - gchar* _tmp10_; - gchar* _tmp11_; - gchar* _tmp12_; - gchar* _tmp13_; - gchar* _tmp14_; - gchar* _tmp15_; - gchar* _tmp16_; - gchar* _tmp17_; - gchar* _tmp18_; - gchar* _tmp19_; - gchar* _tmp20_; - gchar* _tmp21_; - gchar* _tmp22_; - gchar* _tmp23_; - gchar* _tmp24_; - gchar* _tmp25_; - gchar* _tmp26_; - gchar* _tmp27_; - gchar* _tmp28_; - gchar* _tmp29_; - gchar* _tmp30_; - gchar* _tmp31_; - gchar* _tmp32_; - gchar* _tmp33_; - gchar* _tmp34_; - gchar* _tmp35_; - gchar* _tmp36_; - gchar* _tmp37_; - gchar* _tmp38_; - gchar* _tmp39_; - gchar** _tmp40_ = NULL; + _tmp46_ = gee_collection_get_size (_tmp45_); + _tmp47_ = _tmp46_; + _vala_assert (_tmp47_ == 0, "test_collection.size == 0"); + _tmp48_ = self->test_collection; + _tmp49_ = gee_collection_get_is_empty (_tmp48_); + _tmp50_ = _tmp49_; + _vala_assert (_tmp50_, "test_collection.is_empty"); + { + guint i; + i = (guint) 0; + { + gboolean _tmp51_; + _tmp51_ = TRUE; + while (TRUE) { + gboolean _tmp52_; + guint _tmp54_; + gchar** _tmp55_; + gint _tmp55__length1; + GeeCollection* _tmp56_; + gchar** _tmp57_; + gint _tmp57__length1; + guint _tmp58_; + const gchar* _tmp59_; + gboolean _tmp60_ = FALSE; + GeeCollection* _tmp82_; + gint _tmp83_; + gint _tmp84_; + guint _tmp85_; + GeeCollection* _tmp86_; + gboolean _tmp87_; + gboolean _tmp88_; + _tmp52_ = _tmp51_; + if (!_tmp52_) { + guint _tmp53_; + _tmp53_ = i; + i = _tmp53_ + 1; + } + _tmp51_ = FALSE; + _tmp54_ = i; + _tmp55_ = data; + _tmp55__length1 = data_length1; + if (!(_tmp54_ < ((guint) _tmp55__length1))) { + break; + } + _tmp56_ = self->test_collection; + _tmp57_ = data; + _tmp57__length1 = data_length1; + _tmp58_ = i; + _tmp59_ = _tmp57_[_tmp58_]; + _tmp60_ = gee_collection_add (_tmp56_, _tmp59_); + _vala_assert (_tmp60_, "test_collection.add (data[i])"); + { + guint j; + j = (guint) 0; + { + gboolean _tmp61_; + _tmp61_ = TRUE; + while (TRUE) { + gboolean _tmp62_; + guint _tmp64_; + guint _tmp65_; + GeeCollection* _tmp66_; + gchar** _tmp67_; + gint _tmp67__length1; + guint _tmp68_; + const gchar* _tmp69_; + gboolean _tmp70_ = FALSE; + _tmp62_ = _tmp61_; + if (!_tmp62_) { + guint _tmp63_; + _tmp63_ = j; + j = _tmp63_ + 1; + } + _tmp61_ = FALSE; + _tmp64_ = j; + _tmp65_ = i; + if (!(_tmp64_ <= _tmp65_)) { + break; + } + _tmp66_ = self->test_collection; + _tmp67_ = data; + _tmp67__length1 = data_length1; + _tmp68_ = j; + _tmp69_ = _tmp67_[_tmp68_]; + _tmp70_ = gee_collection_contains (_tmp66_, _tmp69_); + _vala_assert (_tmp70_, "test_collection.contains (data[j])"); + } + } + } + { + guint _tmp71_; + guint j; + _tmp71_ = i; + j = _tmp71_ + 1; + { + gboolean _tmp72_; + _tmp72_ = TRUE; + while (TRUE) { + gboolean _tmp73_; + guint _tmp75_; + gchar** _tmp76_; + gint _tmp76__length1; + GeeCollection* _tmp77_; + gchar** _tmp78_; + gint _tmp78__length1; + guint _tmp79_; + const gchar* _tmp80_; + gboolean _tmp81_ = FALSE; + _tmp73_ = _tmp72_; + if (!_tmp73_) { + guint _tmp74_; + _tmp74_ = j; + j = _tmp74_ + 1; + } + _tmp72_ = FALSE; + _tmp75_ = j; + _tmp76_ = data; + _tmp76__length1 = data_length1; + if (!(_tmp75_ < ((guint) _tmp76__length1))) { + break; + } + _tmp77_ = self->test_collection; + _tmp78_ = data; + _tmp78__length1 = data_length1; + _tmp79_ = j; + _tmp80_ = _tmp78_[_tmp79_]; + _tmp81_ = gee_collection_contains (_tmp77_, _tmp80_); + _vala_assert (!_tmp81_, "! test_collection.contains (data[j])"); + } + } + } + _tmp82_ = self->test_collection; + _tmp83_ = gee_collection_get_size (_tmp82_); + _tmp84_ = _tmp83_; + _tmp85_ = i; + _vala_assert (((guint) _tmp84_) == (_tmp85_ + 1), "test_collection.size == i + 1"); + _tmp86_ = self->test_collection; + _tmp87_ = gee_collection_get_is_empty (_tmp86_); + _tmp88_ = _tmp87_; + _vala_assert (!_tmp88_, "! test_collection.is_empty"); + } + } + } + { + guint i; + i = (guint) 0; + { + gboolean _tmp89_; + _tmp89_ = TRUE; + while (TRUE) { + gboolean _tmp90_; + guint _tmp92_; + guint* _tmp93_; + gint _tmp93__length1; + GeeCollection* _tmp94_; + gchar** _tmp95_; + gint _tmp95__length1; + guint* _tmp96_; + gint _tmp96__length1; + guint _tmp97_; + guint _tmp98_; + const gchar* _tmp99_; + gboolean _tmp100_ = FALSE; + GeeCollection* _tmp121_; + gint _tmp122_; + gint _tmp123_; + gchar** _tmp124_; + gint _tmp124__length1; + guint _tmp125_; + GeeCollection* _tmp126_; + gchar** _tmp127_; + gint _tmp127__length1; + guint* _tmp128_; + gint _tmp128__length1; + guint _tmp129_; + guint _tmp130_; + const gchar* _tmp131_; + gboolean _tmp132_ = FALSE; + GeeCollection* _tmp153_; + gint _tmp154_; + gint _tmp155_; + gchar** _tmp156_; + gint _tmp156__length1; + guint _tmp157_; + _tmp90_ = _tmp89_; + if (!_tmp90_) { + guint _tmp91_; + _tmp91_ = i; + i = _tmp91_ + 1; + } + _tmp89_ = FALSE; + _tmp92_ = i; + _tmp93_ = idx; + _tmp93__length1 = idx_length1; + if (!(_tmp92_ < ((guint) _tmp93__length1))) { + break; + } + _tmp94_ = self->test_collection; + _tmp95_ = data; + _tmp95__length1 = data_length1; + _tmp96_ = idx; + _tmp96__length1 = idx_length1; + _tmp97_ = i; + _tmp98_ = _tmp96_[_tmp97_]; + _tmp99_ = _tmp95_[_tmp98_]; + _tmp100_ = gee_collection_remove (_tmp94_, _tmp99_); + _vala_assert (_tmp100_, "test_collection.remove (data[idx[i]])"); + { + guint j; + j = (guint) 0; + { + gboolean _tmp101_; + _tmp101_ = TRUE; + while (TRUE) { + gboolean _tmp102_; + guint _tmp104_; + gchar** _tmp105_; + gint _tmp105__length1; + gboolean removed; + GeeCollection* _tmp115_; + gchar** _tmp116_; + gint _tmp116__length1; + guint _tmp117_; + const gchar* _tmp118_; + gboolean _tmp119_ = FALSE; + gboolean _tmp120_; + _tmp102_ = _tmp101_; + if (!_tmp102_) { + guint _tmp103_; + _tmp103_ = j; + j = _tmp103_ + 1; + } + _tmp101_ = FALSE; + _tmp104_ = j; + _tmp105_ = data; + _tmp105__length1 = data_length1; + if (!(_tmp104_ < ((guint) _tmp105__length1))) { + break; + } + removed = FALSE; + { + guint k; + k = (guint) 0; + { + gboolean _tmp106_; + _tmp106_ = TRUE; + while (TRUE) { + gboolean _tmp107_; + guint _tmp109_; + guint _tmp110_; + guint* _tmp111_; + gint _tmp111__length1; + guint _tmp112_; + guint _tmp113_; + guint _tmp114_; + _tmp107_ = _tmp106_; + if (!_tmp107_) { + guint _tmp108_; + _tmp108_ = k; + k = _tmp108_ + 1; + } + _tmp106_ = FALSE; + _tmp109_ = k; + _tmp110_ = i; + if (!(_tmp109_ <= _tmp110_)) { + break; + } + _tmp111_ = idx; + _tmp111__length1 = idx_length1; + _tmp112_ = k; + _tmp113_ = _tmp111_[_tmp112_]; + _tmp114_ = j; + if (_tmp113_ == _tmp114_) { + removed = TRUE; + break; + } + } + } + } + _tmp115_ = self->test_collection; + _tmp116_ = data; + _tmp116__length1 = data_length1; + _tmp117_ = j; + _tmp118_ = _tmp116_[_tmp117_]; + _tmp119_ = gee_collection_contains (_tmp115_, _tmp118_); + _tmp120_ = removed; + _vala_assert (_tmp119_ == (!_tmp120_), "test_collection.contains (data[j]) == !removed"); + } + } + } + _tmp121_ = self->test_collection; + _tmp122_ = gee_collection_get_size (_tmp121_); + _tmp123_ = _tmp122_; + _tmp124_ = data; + _tmp124__length1 = data_length1; + _tmp125_ = i; + _vala_assert (((guint) _tmp123_) == (_tmp124__length1 - (_tmp125_ + 1)), "test_collection.size == data.length - (i + 1)"); + _tmp126_ = self->test_collection; + _tmp127_ = data; + _tmp127__length1 = data_length1; + _tmp128_ = idx; + _tmp128__length1 = idx_length1; + _tmp129_ = i; + _tmp130_ = _tmp128_[_tmp129_]; + _tmp131_ = _tmp127_[_tmp130_]; + _tmp132_ = gee_collection_remove (_tmp126_, _tmp131_); + _vala_assert (!_tmp132_, "! test_collection.remove (data[idx[i]])"); + { + guint j; + j = (guint) 0; + { + gboolean _tmp133_; + _tmp133_ = TRUE; + while (TRUE) { + gboolean _tmp134_; + guint _tmp136_; + gchar** _tmp137_; + gint _tmp137__length1; + gboolean removed; + GeeCollection* _tmp147_; + gchar** _tmp148_; + gint _tmp148__length1; + guint _tmp149_; + const gchar* _tmp150_; + gboolean _tmp151_ = FALSE; + gboolean _tmp152_; + _tmp134_ = _tmp133_; + if (!_tmp134_) { + guint _tmp135_; + _tmp135_ = j; + j = _tmp135_ + 1; + } + _tmp133_ = FALSE; + _tmp136_ = j; + _tmp137_ = data; + _tmp137__length1 = data_length1; + if (!(_tmp136_ < ((guint) _tmp137__length1))) { + break; + } + removed = FALSE; + { + guint k; + k = (guint) 0; + { + gboolean _tmp138_; + _tmp138_ = TRUE; + while (TRUE) { + gboolean _tmp139_; + guint _tmp141_; + guint _tmp142_; + guint* _tmp143_; + gint _tmp143__length1; + guint _tmp144_; + guint _tmp145_; + guint _tmp146_; + _tmp139_ = _tmp138_; + if (!_tmp139_) { + guint _tmp140_; + _tmp140_ = k; + k = _tmp140_ + 1; + } + _tmp138_ = FALSE; + _tmp141_ = k; + _tmp142_ = i; + if (!(_tmp141_ <= _tmp142_)) { + break; + } + _tmp143_ = idx; + _tmp143__length1 = idx_length1; + _tmp144_ = k; + _tmp145_ = _tmp143_[_tmp144_]; + _tmp146_ = j; + if (_tmp145_ == _tmp146_) { + removed = TRUE; + break; + } + } + } + } + _tmp147_ = self->test_collection; + _tmp148_ = data; + _tmp148__length1 = data_length1; + _tmp149_ = j; + _tmp150_ = _tmp148_[_tmp149_]; + _tmp151_ = gee_collection_contains (_tmp147_, _tmp150_); + _tmp152_ = removed; + _vala_assert (_tmp151_ == (!_tmp152_), "test_collection.contains (data[j]) == !removed"); + } + } + } + _tmp153_ = self->test_collection; + _tmp154_ = gee_collection_get_size (_tmp153_); + _tmp155_ = _tmp154_; + _tmp156_ = data; + _tmp156__length1 = data_length1; + _tmp157_ = i; + _vala_assert (((guint) _tmp155_) == (_tmp156__length1 - (_tmp157_ + 1)), "test_collection.size == data.length - (i + 1)"); + } + } + } + _tmp158_ = self->test_collection; + gee_collection_clear (_tmp158_); + _tmp159_ = data; + _tmp159__length1 = data_length1; + { + gchar** el_collection = NULL; + gint el_collection_length1 = 0; + gint _el_collection_size_ = 0; + gint el_it = 0; + el_collection = _tmp159_; + el_collection_length1 = _tmp159__length1; + for (el_it = 0; el_it < _tmp159__length1; el_it = el_it + 1) { + const gchar* el = NULL; + el = el_collection[el_it]; + { + GeeCollection* _tmp160_; + const gchar* _tmp161_; + gboolean _tmp162_ = FALSE; + _tmp160_ = self->test_collection; + _tmp161_ = el; + _tmp162_ = gee_collection_contains (_tmp160_, _tmp161_); + _vala_assert (!_tmp162_, "! test_collection.contains (el)"); + } + } + } + _tmp163_ = self->test_collection; + _tmp164_ = gee_collection_get_size (_tmp163_); + _tmp165_ = _tmp164_; + _vala_assert (_tmp165_ == 0, "test_collection.size == 0"); + _tmp166_ = self->test_collection; + _tmp167_ = gee_collection_get_is_empty (_tmp166_); + _tmp168_ = _tmp167_; + _vala_assert (_tmp168_, "test_collection.is_empty"); +} + + +void collection_tests_test_add_remove (CollectionTests* self) { + GeeCollection* _tmp0_; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; gchar** to_add; gint to_add_length1; gint _to_add_size_; gint expected_size; - gchar** _tmp41_; - gint _tmp41__length1; - GeeCollection* _tmp56_; - gint _tmp57_; - gint _tmp58_; - gchar** _tmp59_; - gint _tmp59__length1; - gchar** _tmp60_; - gint _tmp60__length1; - gchar** _tmp65_; - gint _tmp65__length1; - GeeCollection* _tmp80_; - gint _tmp81_; - gint _tmp82_; + gchar** _tmp3_; + gint _tmp3__length1; + GeeCollection* _tmp18_; + gint _tmp19_; + gint _tmp20_; + gchar** _tmp21_; + gint _tmp21__length1; + gchar** _tmp22_; + gint _tmp22__length1; + gchar** _tmp27_; + gint _tmp27__length1; + GeeCollection* _tmp42_; + gint _tmp43_; + gint _tmp44_; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = g_strdup ("one"); - _tmp2_ = g_strdup ("two"); - _tmp3_ = g_strdup ("three"); - _tmp4_ = g_strdup ("four"); - _tmp5_ = g_strdup ("five"); - _tmp6_ = g_strdup ("six"); - _tmp7_ = g_strdup ("seven"); - _tmp8_ = g_strdup ("eight"); - _tmp9_ = g_strdup ("nine"); - _tmp10_ = g_strdup ("ten"); - _tmp11_ = g_strdup ("eleven"); - _tmp12_ = g_strdup ("twelve"); - _tmp13_ = g_strdup ("thirteen"); - _tmp14_ = g_strdup ("fourteen"); - _tmp15_ = g_strdup ("fifteen"); - _tmp16_ = g_strdup ("sixteen"); - _tmp17_ = g_strdup ("seventeen"); - _tmp18_ = g_strdup ("eighteen"); - _tmp19_ = g_strdup ("nineteen"); - _tmp20_ = g_strdup ("twenty"); - _tmp21_ = g_strdup ("twenty one"); - _tmp22_ = g_strdup ("twenty two"); - _tmp23_ = g_strdup ("twenty three"); - _tmp24_ = g_strdup ("twenty four"); - _tmp25_ = g_strdup ("twenty five"); - _tmp26_ = g_strdup ("twenty six"); - _tmp27_ = g_strdup ("twenty seven"); - _tmp28_ = g_strdup ("twenty eight"); - _tmp29_ = g_strdup ("twenty nine"); - _tmp30_ = g_strdup ("thirty"); - _tmp31_ = g_strdup ("thirty one"); - _tmp32_ = g_strdup ("thirty two"); - _tmp33_ = g_strdup ("thirty four"); - _tmp34_ = g_strdup ("thirty five"); - _tmp35_ = g_strdup ("thirty six"); - _tmp36_ = g_strdup ("thirty seven"); - _tmp37_ = g_strdup ("thirty eight"); - _tmp38_ = g_strdup ("thirty nine"); - _tmp39_ = g_strdup ("fourty"); - _tmp40_ = g_new0 (gchar*, 39 + 1); - _tmp40_[0] = _tmp1_; - _tmp40_[1] = _tmp2_; - _tmp40_[2] = _tmp3_; - _tmp40_[3] = _tmp4_; - _tmp40_[4] = _tmp5_; - _tmp40_[5] = _tmp6_; - _tmp40_[6] = _tmp7_; - _tmp40_[7] = _tmp8_; - _tmp40_[8] = _tmp9_; - _tmp40_[9] = _tmp10_; - _tmp40_[10] = _tmp11_; - _tmp40_[11] = _tmp12_; - _tmp40_[12] = _tmp13_; - _tmp40_[13] = _tmp14_; - _tmp40_[14] = _tmp15_; - _tmp40_[15] = _tmp16_; - _tmp40_[16] = _tmp17_; - _tmp40_[17] = _tmp18_; - _tmp40_[18] = _tmp19_; - _tmp40_[19] = _tmp20_; - _tmp40_[20] = _tmp21_; - _tmp40_[21] = _tmp22_; - _tmp40_[22] = _tmp23_; - _tmp40_[23] = _tmp24_; - _tmp40_[24] = _tmp25_; - _tmp40_[25] = _tmp26_; - _tmp40_[26] = _tmp27_; - _tmp40_[27] = _tmp28_; - _tmp40_[28] = _tmp29_; - _tmp40_[29] = _tmp30_; - _tmp40_[30] = _tmp31_; - _tmp40_[31] = _tmp32_; - _tmp40_[32] = _tmp33_; - _tmp40_[33] = _tmp34_; - _tmp40_[34] = _tmp35_; - _tmp40_[35] = _tmp36_; - _tmp40_[36] = _tmp37_; - _tmp40_[37] = _tmp38_; - _tmp40_[38] = _tmp39_; - to_add = _tmp40_; - to_add_length1 = 39; + _tmp2_ = test_data_get_data (&_tmp1_); + to_add = _tmp2_; + to_add_length1 = _tmp1_; _to_add_size_ = to_add_length1; expected_size = 0; - _tmp41_ = to_add; - _tmp41__length1 = to_add_length1; + _tmp3_ = to_add; + _tmp3__length1 = to_add_length1; { gchar** a_collection = NULL; gint a_collection_length1 = 0; gint _a_collection_size_ = 0; gint a_it = 0; - a_collection = _tmp41_; - a_collection_length1 = _tmp41__length1; - for (a_it = 0; a_it < _tmp41__length1; a_it = a_it + 1) { - gchar* _tmp42_; + a_collection = _tmp3_; + a_collection_length1 = _tmp3__length1; + for (a_it = 0; a_it < _tmp3__length1; a_it = a_it + 1) { + gchar* _tmp4_; gchar* a = NULL; - _tmp42_ = g_strdup (a_collection[a_it]); - a = _tmp42_; + _tmp4_ = g_strdup (a_collection[a_it]); + a = _tmp4_; { - GeeCollection* _tmp43_; - const gchar* _tmp44_; - gboolean _tmp45_ = FALSE; - GeeCollection* _tmp46_; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_; - GeeCollection* _tmp50_; - const gchar* _tmp51_; - gboolean _tmp52_ = FALSE; - GeeCollection* _tmp53_; - const gchar* _tmp54_; - gboolean _tmp55_ = FALSE; - _tmp43_ = self->test_collection; - _tmp44_ = a; - _tmp45_ = gee_collection_contains (_tmp43_, _tmp44_); - _vala_assert (!_tmp45_, "!test_collection.contains (a)"); - _tmp46_ = self->test_collection; - _tmp47_ = gee_collection_get_size (_tmp46_); - _tmp48_ = _tmp47_; - _tmp49_ = expected_size; - expected_size = _tmp49_ + 1; - _vala_assert (_tmp48_ == _tmp49_, "test_collection.size == expected_size++"); - _tmp50_ = self->test_collection; - _tmp51_ = a; - _tmp52_ = gee_collection_add (_tmp50_, _tmp51_); - _vala_assert (_tmp52_, "test_collection.add (a)"); - _tmp53_ = self->test_collection; - _tmp54_ = a; - _tmp55_ = gee_collection_contains (_tmp53_, _tmp54_); - _vala_assert (_tmp55_, "test_collection.contains (a)"); + GeeCollection* _tmp5_; + const gchar* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeCollection* _tmp8_; + gint _tmp9_; + gint _tmp10_; + gint _tmp11_; + GeeCollection* _tmp12_; + const gchar* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeCollection* _tmp15_; + const gchar* _tmp16_; + gboolean _tmp17_ = FALSE; + _tmp5_ = self->test_collection; + _tmp6_ = a; + _tmp7_ = gee_collection_contains (_tmp5_, _tmp6_); + _vala_assert (!_tmp7_, "!test_collection.contains (a)"); + _tmp8_ = self->test_collection; + _tmp9_ = gee_collection_get_size (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = expected_size; + expected_size = _tmp11_ + 1; + _vala_assert (_tmp10_ == _tmp11_, "test_collection.size == expected_size++"); + _tmp12_ = self->test_collection; + _tmp13_ = a; + _tmp14_ = gee_collection_add (_tmp12_, _tmp13_); + _vala_assert (_tmp14_, "test_collection.add (a)"); + _tmp15_ = self->test_collection; + _tmp16_ = a; + _tmp17_ = gee_collection_contains (_tmp15_, _tmp16_); + _vala_assert (_tmp17_, "test_collection.contains (a)"); _g_free0 (a); } } } - _tmp56_ = self->test_collection; - _tmp57_ = gee_collection_get_size (_tmp56_); - _tmp58_ = _tmp57_; - _tmp59_ = to_add; - _tmp59__length1 = to_add_length1; - _vala_assert (_tmp58_ == _tmp59__length1, "test_collection.size == to_add.length"); - _tmp60_ = to_add; - _tmp60__length1 = to_add_length1; + _tmp18_ = self->test_collection; + _tmp19_ = gee_collection_get_size (_tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = to_add; + _tmp21__length1 = to_add_length1; + _vala_assert (_tmp20_ == _tmp21__length1, "test_collection.size == to_add.length"); + _tmp22_ = to_add; + _tmp22__length1 = to_add_length1; { gchar** a_collection = NULL; gint a_collection_length1 = 0; gint _a_collection_size_ = 0; gint a_it = 0; - a_collection = _tmp60_; - a_collection_length1 = _tmp60__length1; - for (a_it = 0; a_it < _tmp60__length1; a_it = a_it + 1) { - gchar* _tmp61_; + a_collection = _tmp22_; + a_collection_length1 = _tmp22__length1; + for (a_it = 0; a_it < _tmp22__length1; a_it = a_it + 1) { + gchar* _tmp23_; gchar* a = NULL; - _tmp61_ = g_strdup (a_collection[a_it]); - a = _tmp61_; + _tmp23_ = g_strdup (a_collection[a_it]); + a = _tmp23_; { - GeeCollection* _tmp62_; - const gchar* _tmp63_; - gboolean _tmp64_ = FALSE; - _tmp62_ = self->test_collection; - _tmp63_ = a; - _tmp64_ = gee_collection_contains (_tmp62_, _tmp63_); - _vala_assert (_tmp64_, "test_collection.contains (a)"); + GeeCollection* _tmp24_; + const gchar* _tmp25_; + gboolean _tmp26_ = FALSE; + _tmp24_ = self->test_collection; + _tmp25_ = a; + _tmp26_ = gee_collection_contains (_tmp24_, _tmp25_); + _vala_assert (_tmp26_, "test_collection.contains (a)"); _g_free0 (a); } } } - _tmp65_ = to_add; - _tmp65__length1 = to_add_length1; + _tmp27_ = to_add; + _tmp27__length1 = to_add_length1; { gchar** a_collection = NULL; gint a_collection_length1 = 0; gint _a_collection_size_ = 0; gint a_it = 0; - a_collection = _tmp65_; - a_collection_length1 = _tmp65__length1; - for (a_it = 0; a_it < _tmp65__length1; a_it = a_it + 1) { - gchar* _tmp66_; + a_collection = _tmp27_; + a_collection_length1 = _tmp27__length1; + for (a_it = 0; a_it < _tmp27__length1; a_it = a_it + 1) { + gchar* _tmp28_; gchar* a = NULL; - _tmp66_ = g_strdup (a_collection[a_it]); - a = _tmp66_; + _tmp28_ = g_strdup (a_collection[a_it]); + a = _tmp28_; { - GeeCollection* _tmp67_; - const gchar* _tmp68_; - gboolean _tmp69_ = FALSE; - GeeCollection* _tmp70_; - gint _tmp71_; - gint _tmp72_; - gint _tmp73_; - GeeCollection* _tmp74_; - const gchar* _tmp75_; - gboolean _tmp76_ = FALSE; - GeeCollection* _tmp77_; - const gchar* _tmp78_; - gboolean _tmp79_ = FALSE; - _tmp67_ = self->test_collection; - _tmp68_ = a; - _tmp69_ = gee_collection_contains (_tmp67_, _tmp68_); - _vala_assert (_tmp69_, "test_collection.contains (a)"); - _tmp70_ = self->test_collection; - _tmp71_ = gee_collection_get_size (_tmp70_); - _tmp72_ = _tmp71_; - _tmp73_ = expected_size; - expected_size = _tmp73_ - 1; - _vala_assert (_tmp72_ == _tmp73_, "test_collection.size == expected_size--"); - _tmp74_ = self->test_collection; - _tmp75_ = a; - _tmp76_ = gee_collection_remove (_tmp74_, _tmp75_); - _vala_assert (_tmp76_, "test_collection.remove (a)"); - _tmp77_ = self->test_collection; - _tmp78_ = a; - _tmp79_ = gee_collection_contains (_tmp77_, _tmp78_); - _vala_assert (!_tmp79_, "!test_collection.contains (a)"); + GeeCollection* _tmp29_; + const gchar* _tmp30_; + gboolean _tmp31_ = FALSE; + GeeCollection* _tmp32_; + gint _tmp33_; + gint _tmp34_; + gint _tmp35_; + GeeCollection* _tmp36_; + const gchar* _tmp37_; + gboolean _tmp38_ = FALSE; + GeeCollection* _tmp39_; + const gchar* _tmp40_; + gboolean _tmp41_ = FALSE; + _tmp29_ = self->test_collection; + _tmp30_ = a; + _tmp31_ = gee_collection_contains (_tmp29_, _tmp30_); + _vala_assert (_tmp31_, "test_collection.contains (a)"); + _tmp32_ = self->test_collection; + _tmp33_ = gee_collection_get_size (_tmp32_); + _tmp34_ = _tmp33_; + _tmp35_ = expected_size; + expected_size = _tmp35_ - 1; + _vala_assert (_tmp34_ == _tmp35_, "test_collection.size == expected_size--"); + _tmp36_ = self->test_collection; + _tmp37_ = a; + _tmp38_ = gee_collection_remove (_tmp36_, _tmp37_); + _vala_assert (_tmp38_, "test_collection.remove (a)"); + _tmp39_ = self->test_collection; + _tmp40_ = a; + _tmp41_ = gee_collection_contains (_tmp39_, _tmp40_); + _vala_assert (!_tmp41_, "!test_collection.contains (a)"); _g_free0 (a); } } } - _tmp80_ = self->test_collection; - _tmp81_ = gee_collection_get_size (_tmp80_); - _tmp82_ = _tmp81_; - _vala_assert (_tmp82_ == 0, "test_collection.size == 0"); - to_add = (_vala_array_free (to_add, to_add_length1, (GDestroyNotify) g_free), NULL); + _tmp42_ = self->test_collection; + _tmp43_ = gee_collection_get_size (_tmp42_); + _tmp44_ = _tmp43_; + _vala_assert (_tmp44_ == 0, "test_collection.size == 0"); } void collection_tests_test_clear (CollectionTests* self) { GeeCollection* _tmp0_; - gchar* _tmp1_; - gchar* _tmp2_; - gchar* _tmp3_; - gchar* _tmp4_; - gchar* _tmp5_; - gchar* _tmp6_; - gchar* _tmp7_; - gchar* _tmp8_; - gchar* _tmp9_; - gchar* _tmp10_; - gchar* _tmp11_; - gchar* _tmp12_; - gchar* _tmp13_; - gchar* _tmp14_; - gchar* _tmp15_; - gchar* _tmp16_; - gchar* _tmp17_; - gchar* _tmp18_; - gchar* _tmp19_; - gchar* _tmp20_; - gchar* _tmp21_; - gchar* _tmp22_; - gchar* _tmp23_; - gchar* _tmp24_; - gchar* _tmp25_; - gchar* _tmp26_; - gchar* _tmp27_; - gchar* _tmp28_; - gchar* _tmp29_; - gchar* _tmp30_; - gchar* _tmp31_; - gchar* _tmp32_; - gchar* _tmp33_; - gchar* _tmp34_; - gchar* _tmp35_; - gchar* _tmp36_; - gchar* _tmp37_; - gchar* _tmp38_; - gchar* _tmp39_; - gchar** _tmp40_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; gchar** to_add; gint to_add_length1; gint _to_add_size_; gint expected_size; - gchar** _tmp41_; - gint _tmp41__length1; - GeeCollection* _tmp56_; - gint _tmp57_; - gint _tmp58_; - gchar** _tmp59_; - gint _tmp59__length1; - GeeCollection* _tmp60_; - GeeCollection* _tmp61_; - gint _tmp62_; - gint _tmp63_; - GeeCollection* _tmp64_; - GeeIterator* _tmp65_ = NULL; + gchar** _tmp3_; + gint _tmp3__length1; + GeeCollection* _tmp18_; + gint _tmp19_; + gint _tmp20_; + gchar** _tmp21_; + gint _tmp21__length1; + GeeCollection* _tmp22_; + GeeCollection* _tmp23_; + gint _tmp24_; + gint _tmp25_; + GeeCollection* _tmp26_; + GeeIterator* _tmp27_ = NULL; GeeIterator* iter; - gboolean _tmp66_ = FALSE; + gboolean _tmp28_ = FALSE; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = g_strdup ("one"); - _tmp2_ = g_strdup ("two"); - _tmp3_ = g_strdup ("three"); - _tmp4_ = g_strdup ("four"); - _tmp5_ = g_strdup ("five"); - _tmp6_ = g_strdup ("six"); - _tmp7_ = g_strdup ("seven"); - _tmp8_ = g_strdup ("eight"); - _tmp9_ = g_strdup ("nine"); - _tmp10_ = g_strdup ("ten"); - _tmp11_ = g_strdup ("eleven"); - _tmp12_ = g_strdup ("twelve"); - _tmp13_ = g_strdup ("thirteen"); - _tmp14_ = g_strdup ("fourteen"); - _tmp15_ = g_strdup ("fifteen"); - _tmp16_ = g_strdup ("sixteen"); - _tmp17_ = g_strdup ("seventeen"); - _tmp18_ = g_strdup ("eighteen"); - _tmp19_ = g_strdup ("nineteen"); - _tmp20_ = g_strdup ("twenty"); - _tmp21_ = g_strdup ("twenty one"); - _tmp22_ = g_strdup ("twenty two"); - _tmp23_ = g_strdup ("twenty three"); - _tmp24_ = g_strdup ("twenty four"); - _tmp25_ = g_strdup ("twenty five"); - _tmp26_ = g_strdup ("twenty six"); - _tmp27_ = g_strdup ("twenty seven"); - _tmp28_ = g_strdup ("twenty eight"); - _tmp29_ = g_strdup ("twenty nine"); - _tmp30_ = g_strdup ("thirty"); - _tmp31_ = g_strdup ("thirty one"); - _tmp32_ = g_strdup ("thirty two"); - _tmp33_ = g_strdup ("thirty four"); - _tmp34_ = g_strdup ("thirty five"); - _tmp35_ = g_strdup ("thirty six"); - _tmp36_ = g_strdup ("thirty seven"); - _tmp37_ = g_strdup ("thirty eight"); - _tmp38_ = g_strdup ("thirty nine"); - _tmp39_ = g_strdup ("fourty"); - _tmp40_ = g_new0 (gchar*, 39 + 1); - _tmp40_[0] = _tmp1_; - _tmp40_[1] = _tmp2_; - _tmp40_[2] = _tmp3_; - _tmp40_[3] = _tmp4_; - _tmp40_[4] = _tmp5_; - _tmp40_[5] = _tmp6_; - _tmp40_[6] = _tmp7_; - _tmp40_[7] = _tmp8_; - _tmp40_[8] = _tmp9_; - _tmp40_[9] = _tmp10_; - _tmp40_[10] = _tmp11_; - _tmp40_[11] = _tmp12_; - _tmp40_[12] = _tmp13_; - _tmp40_[13] = _tmp14_; - _tmp40_[14] = _tmp15_; - _tmp40_[15] = _tmp16_; - _tmp40_[16] = _tmp17_; - _tmp40_[17] = _tmp18_; - _tmp40_[18] = _tmp19_; - _tmp40_[19] = _tmp20_; - _tmp40_[20] = _tmp21_; - _tmp40_[21] = _tmp22_; - _tmp40_[22] = _tmp23_; - _tmp40_[23] = _tmp24_; - _tmp40_[24] = _tmp25_; - _tmp40_[25] = _tmp26_; - _tmp40_[26] = _tmp27_; - _tmp40_[27] = _tmp28_; - _tmp40_[28] = _tmp29_; - _tmp40_[29] = _tmp30_; - _tmp40_[30] = _tmp31_; - _tmp40_[31] = _tmp32_; - _tmp40_[32] = _tmp33_; - _tmp40_[33] = _tmp34_; - _tmp40_[34] = _tmp35_; - _tmp40_[35] = _tmp36_; - _tmp40_[36] = _tmp37_; - _tmp40_[37] = _tmp38_; - _tmp40_[38] = _tmp39_; - to_add = _tmp40_; - to_add_length1 = 39; + _tmp2_ = test_data_get_data (&_tmp1_); + to_add = _tmp2_; + to_add_length1 = _tmp1_; _to_add_size_ = to_add_length1; expected_size = 0; - _tmp41_ = to_add; - _tmp41__length1 = to_add_length1; + _tmp3_ = to_add; + _tmp3__length1 = to_add_length1; { gchar** a_collection = NULL; gint a_collection_length1 = 0; gint _a_collection_size_ = 0; gint a_it = 0; - a_collection = _tmp41_; - a_collection_length1 = _tmp41__length1; - for (a_it = 0; a_it < _tmp41__length1; a_it = a_it + 1) { - gchar* _tmp42_; + a_collection = _tmp3_; + a_collection_length1 = _tmp3__length1; + for (a_it = 0; a_it < _tmp3__length1; a_it = a_it + 1) { + gchar* _tmp4_; gchar* a = NULL; - _tmp42_ = g_strdup (a_collection[a_it]); - a = _tmp42_; + _tmp4_ = g_strdup (a_collection[a_it]); + a = _tmp4_; { - GeeCollection* _tmp43_; - const gchar* _tmp44_; - gboolean _tmp45_ = FALSE; - GeeCollection* _tmp46_; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_; - GeeCollection* _tmp50_; - const gchar* _tmp51_; - gboolean _tmp52_ = FALSE; - GeeCollection* _tmp53_; - const gchar* _tmp54_; - gboolean _tmp55_ = FALSE; - _tmp43_ = self->test_collection; - _tmp44_ = a; - _tmp45_ = gee_collection_contains (_tmp43_, _tmp44_); - _vala_assert (!_tmp45_, "!test_collection.contains (a)"); - _tmp46_ = self->test_collection; - _tmp47_ = gee_collection_get_size (_tmp46_); - _tmp48_ = _tmp47_; - _tmp49_ = expected_size; - expected_size = _tmp49_ + 1; - _vala_assert (_tmp48_ == _tmp49_, "test_collection.size == expected_size++"); - _tmp50_ = self->test_collection; - _tmp51_ = a; - _tmp52_ = gee_collection_add (_tmp50_, _tmp51_); - _vala_assert (_tmp52_, "test_collection.add (a)"); - _tmp53_ = self->test_collection; - _tmp54_ = a; - _tmp55_ = gee_collection_contains (_tmp53_, _tmp54_); - _vala_assert (_tmp55_, "test_collection.contains (a)"); + GeeCollection* _tmp5_; + const gchar* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeCollection* _tmp8_; + gint _tmp9_; + gint _tmp10_; + gint _tmp11_; + GeeCollection* _tmp12_; + const gchar* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeCollection* _tmp15_; + const gchar* _tmp16_; + gboolean _tmp17_ = FALSE; + _tmp5_ = self->test_collection; + _tmp6_ = a; + _tmp7_ = gee_collection_contains (_tmp5_, _tmp6_); + _vala_assert (!_tmp7_, "!test_collection.contains (a)"); + _tmp8_ = self->test_collection; + _tmp9_ = gee_collection_get_size (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = expected_size; + expected_size = _tmp11_ + 1; + _vala_assert (_tmp10_ == _tmp11_, "test_collection.size == expected_size++"); + _tmp12_ = self->test_collection; + _tmp13_ = a; + _tmp14_ = gee_collection_add (_tmp12_, _tmp13_); + _vala_assert (_tmp14_, "test_collection.add (a)"); + _tmp15_ = self->test_collection; + _tmp16_ = a; + _tmp17_ = gee_collection_contains (_tmp15_, _tmp16_); + _vala_assert (_tmp17_, "test_collection.contains (a)"); _g_free0 (a); } } } - _tmp56_ = self->test_collection; - _tmp57_ = gee_collection_get_size (_tmp56_); - _tmp58_ = _tmp57_; - _tmp59_ = to_add; - _tmp59__length1 = to_add_length1; - _vala_assert (_tmp58_ == _tmp59__length1, "test_collection.size == to_add.length"); - _tmp60_ = self->test_collection; - gee_collection_clear (_tmp60_); - _tmp61_ = self->test_collection; - _tmp62_ = gee_collection_get_size (_tmp61_); - _tmp63_ = _tmp62_; - _vala_assert (_tmp63_ == 0, "test_collection.size == 0"); - _tmp64_ = self->test_collection; - _tmp65_ = gee_iterable_iterator ((GeeIterable*) _tmp64_); - iter = _tmp65_; + _tmp18_ = self->test_collection; + _tmp19_ = gee_collection_get_size (_tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = to_add; + _tmp21__length1 = to_add_length1; + _vala_assert (_tmp20_ == _tmp21__length1, "test_collection.size == to_add.length"); + _tmp22_ = self->test_collection; + gee_collection_clear (_tmp22_); + _tmp23_ = self->test_collection; + _tmp24_ = gee_collection_get_size (_tmp23_); + _tmp25_ = _tmp24_; + _vala_assert (_tmp25_ == 0, "test_collection.size == 0"); + _tmp26_ = self->test_collection; + _tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_); + iter = _tmp27_; _vala_assert (iter != NULL, "iter != null"); - _tmp66_ = gee_iterator_has_next (iter); - _vala_assert (!_tmp66_, "!iter.has_next ()"); + _tmp28_ = gee_iterator_has_next (iter); + _vala_assert (!_tmp28_, "!iter.has_next ()"); _g_object_unref0 (iter); - to_add = (_vala_array_free (to_add, to_add_length1, (GDestroyNotify) g_free), NULL); } @@ -1615,7 +2022,7 @@ void collection_tests_test_add_all (CollectionTests* self) { g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = _tmp1_; _tmp2_ = self->test_collection; _tmp3_ = gee_collection_add_all (_tmp2_, (GeeCollection*) dummy); @@ -1624,7 +2031,7 @@ void collection_tests_test_add_all (CollectionTests* self) { _tmp5_ = gee_collection_get_is_empty (_tmp4_); _tmp6_ = _tmp5_; _vala_assert (_tmp6_, "test_collection.is_empty"); - _tmp7_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) dummy); + _tmp7_ = gee_collection_get_is_empty ((GeeCollection*) dummy); _tmp8_ = _tmp7_; _vala_assert (_tmp8_, "dummy.is_empty"); _tmp9_ = self->test_collection; @@ -1788,7 +2195,7 @@ void collection_tests_test_contains_all (CollectionTests* self) { g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = _tmp1_; _tmp2_ = gee_abstract_collection_add ((GeeAbstractCollection*) dummy, "hello1"); _vala_assert (_tmp2_, "dummy.add (\"hello1\")"); @@ -1828,7 +2235,7 @@ void collection_tests_test_contains_all (CollectionTests* self) { _tmp25_ = gee_collection_contains_all (_tmp24_, (GeeCollection*) dummy); _vala_assert (_tmp25_, "test_collection.contains_all (dummy)"); _tmp26_ = self->test_collection; - _tmp27_ = gee_abstract_collection_contains_all ((GeeAbstractCollection*) dummy, _tmp26_); + _tmp27_ = gee_collection_contains_all ((GeeCollection*) dummy, _tmp26_); _vala_assert (!_tmp27_, "! dummy.contains_all (test_collection)"); _g_object_unref0 (dummy); } @@ -1889,7 +2296,7 @@ void collection_tests_test_remove_all (CollectionTests* self) { g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = _tmp1_; _tmp2_ = self->test_collection; _tmp3_ = gee_collection_remove_all (_tmp2_, (GeeCollection*) dummy); @@ -1898,7 +2305,7 @@ void collection_tests_test_remove_all (CollectionTests* self) { _tmp5_ = gee_collection_get_is_empty (_tmp4_); _tmp6_ = _tmp5_; _vala_assert (_tmp6_, "test_collection.is_empty"); - _tmp7_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) dummy); + _tmp7_ = gee_collection_get_is_empty ((GeeCollection*) dummy); _tmp8_ = _tmp7_; _vala_assert (_tmp8_, "dummy.is_empty"); _tmp9_ = gee_abstract_collection_add ((GeeAbstractCollection*) dummy, "hello1"); @@ -2082,7 +2489,7 @@ void collection_tests_test_retain_all (CollectionTests* self) { g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = _tmp1_; _tmp2_ = self->test_collection; _tmp3_ = gee_collection_retain_all (_tmp2_, (GeeCollection*) dummy); @@ -2091,7 +2498,7 @@ void collection_tests_test_retain_all (CollectionTests* self) { _tmp5_ = gee_collection_get_is_empty (_tmp4_); _tmp6_ = _tmp5_; _vala_assert (_tmp6_, "test_collection.is_empty"); - _tmp7_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) dummy); + _tmp7_ = gee_collection_get_is_empty ((GeeCollection*) dummy); _tmp8_ = _tmp7_; _vala_assert (_tmp8_, "dummy.is_empty"); _tmp9_ = self->test_collection; @@ -2107,7 +2514,7 @@ void collection_tests_test_retain_all (CollectionTests* self) { _tmp16_ = gee_collection_get_is_empty (_tmp15_); _tmp17_ = _tmp16_; _vala_assert (_tmp17_, "test_collection.is_empty"); - _tmp18_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) dummy); + _tmp18_ = gee_collection_get_is_empty ((GeeCollection*) dummy); _tmp19_ = _tmp18_; _vala_assert (_tmp19_, "dummy.is_empty"); _tmp20_ = self->test_collection; @@ -2343,64 +2750,1243 @@ void collection_tests_test_gobject_properties (CollectionTests* self) { GValue _tmp1_ = {0}; GValue _tmp2_; GeeCollection* _tmp3_; - GType _tmp4_ = 0UL; + gint _tmp4_ = 0; GeeCollection* _tmp5_; - GType _tmp6_; - GType _tmp7_; - GValue _tmp8_ = {0}; - GValue _tmp9_; - GeeCollection* _tmp10_; - gboolean _tmp11_ = FALSE; - GeeCollection* _tmp12_; - gboolean _tmp13_; - gboolean _tmp14_; - GValue _tmp15_ = {0}; - GValue _tmp16_; - GeeCollection* _tmp17_; - gint _tmp18_ = 0; - GeeCollection* _tmp19_; - gint _tmp20_; - gint _tmp21_; + gint _tmp6_; + gint _tmp7_; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _vala_assert (_tmp0_ != NULL, "test_collection != null"); - g_value_init (&_tmp1_, G_TYPE_GTYPE); + g_value_init (&_tmp1_, G_TYPE_INT); G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; value = _tmp1_; _tmp2_ = value; _tmp3_ = self->test_collection; - g_object_get_property ((GObject*) _tmp3_, "element-type", &value); - _tmp4_ = g_value_get_gtype (&value); + g_object_get_property ((GObject*) _tmp3_, "size", &value); + _tmp4_ = g_value_get_int (&value); _tmp5_ = self->test_collection; - _tmp6_ = gee_iterable_get_element_type ((GeeIterable*) _tmp5_); + _tmp6_ = gee_collection_get_size (_tmp5_); _tmp7_ = _tmp6_; - _vala_assert (_tmp4_ == _tmp7_, "value.get_gtype () == test_collection.element_type"); + _vala_assert (_tmp4_ == _tmp7_, "value.get_int () == test_collection.size"); g_value_unset (&value); - g_value_init (&_tmp8_, G_TYPE_BOOLEAN); G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp8_; - _tmp9_ = value; +} + + +static gint __lambda3_ (CollectionTests* self, gchar* x, gint y) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (x != NULL, 0); + _tmp0_ = y; + result = _tmp0_ + 1; + _g_free0 (x); + return result; +} + + +static gpointer ___lambda3__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda3_ (self, g, a); + return result; +} + + +static gint __lambda4_ (CollectionTests* self, gchar* x, gint y) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (x != NULL, 0); + _tmp0_ = y; + result = _tmp0_ + 1; + _g_free0 (x); + return result; +} + + +static gpointer ___lambda4__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda4_ (self, g, a); + return result; +} + + +static gint __lambda5_ (CollectionTests* self, gchar* x, gint y) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (x != NULL, 0); + _tmp0_ = y; + result = _tmp0_ + 1; + _g_free0 (x); + return result; +} + + +static gpointer ___lambda5__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda5_ (self, g, a); + return result; +} + + +void collection_tests_test_fold (CollectionTests* self) { + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + gint count = 0; + GeeCollection* _tmp6_; + gpointer _tmp7_ = NULL; + gint _tmp8_; + GeeCollection* _tmp9_; + GeeIterator* _tmp10_ = NULL; + GeeIterator* _tmp11_; + gpointer _tmp12_ = NULL; + gint _tmp13_; + GeeCollection* _tmp14_; + GeeIterator* _tmp15_ = NULL; + GeeIterator* iter; + gboolean _tmp16_ = FALSE; + gpointer _tmp17_ = NULL; + gint _tmp18_; + g_return_if_fail (self != NULL); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _tmp6_ = self->test_collection; + _tmp7_ = gee_traversable_fold ((GeeTraversable*) _tmp6_, G_TYPE_INT, NULL, NULL, ___lambda3__gee_fold_func, self, (gpointer) ((gintptr) 0)); + count = (gint) ((gintptr) _tmp7_); + _tmp8_ = count; + _vala_assert (_tmp8_ == 3, "count == 3"); + _tmp9_ = self->test_collection; + _tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_); + _tmp11_ = _tmp10_; + _tmp12_ = gee_traversable_fold ((GeeTraversable*) _tmp11_, G_TYPE_INT, NULL, NULL, ___lambda4__gee_fold_func, self, (gpointer) ((gintptr) 0)); + count = (gint) ((gintptr) _tmp12_); + _g_object_unref0 (_tmp11_); + _tmp13_ = count; + _vala_assert (_tmp13_ == 3, "count == 3"); + _tmp14_ = self->test_collection; + _tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_); + iter = _tmp15_; + _tmp16_ = gee_iterator_next (iter); + _vala_assert (_tmp16_, "iter.next ()"); + _tmp17_ = gee_traversable_fold ((GeeTraversable*) iter, G_TYPE_INT, NULL, NULL, ___lambda5__gee_fold_func, self, (gpointer) ((gintptr) 0)); + count = (gint) ((gintptr) _tmp17_); + _tmp18_ = count; + _vala_assert (_tmp18_ == 3, "count == 3"); + _g_object_unref0 (iter); +} + + +static Block1Data* block1_data_ref (Block1Data* _data1_) { + g_atomic_int_inc (&_data1_->_ref_count_); + return _data1_; +} + + +static void block1_data_unref (void * _userdata_) { + Block1Data* _data1_; + _data1_ = (Block1Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { + CollectionTests * self; + self = _data1_->self; + _g_object_unref0 (self); + g_slice_free (Block1Data, _data1_); + } +} + + +static gboolean __lambda6_ (Block1Data* _data1_, gchar* x) { + CollectionTests * self; + gboolean result = FALSE; + gint _tmp0_; + self = _data1_->self; + g_return_val_if_fail (x != NULL, FALSE); + _tmp0_ = _data1_->count; + _data1_->count = _tmp0_ + 1; + result = TRUE; + _g_free0 (x); + return result; +} + + +static gboolean ___lambda6__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda6_ (self, g); + return result; +} + + +static gboolean __lambda7_ (Block1Data* _data1_, gchar* x) { + CollectionTests * self; + gboolean result = FALSE; + gint _tmp0_; + self = _data1_->self; + g_return_val_if_fail (x != NULL, FALSE); + _tmp0_ = _data1_->count; + _data1_->count = _tmp0_ + 1; + result = TRUE; + _g_free0 (x); + return result; +} + + +static gboolean ___lambda7__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda7_ (self, g); + return result; +} + + +static gboolean __lambda8_ (Block1Data* _data1_, gchar* x) { + CollectionTests * self; + gboolean result = FALSE; + gint _tmp0_; + self = _data1_->self; + g_return_val_if_fail (x != NULL, FALSE); + _tmp0_ = _data1_->count; + _data1_->count = _tmp0_ + 1; + result = TRUE; + _g_free0 (x); + return result; +} + + +static gboolean ___lambda8__gee_forall_func (gpointer g, gpointer self) { + gboolean result; + result = __lambda8_ (self, g); + return result; +} + + +void collection_tests_test_foreach (CollectionTests* self) { + Block1Data* _data1_; + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeCollection* _tmp6_; + GeeCollection* _tmp7_; + GeeIterator* _tmp8_ = NULL; + GeeIterator* _tmp9_; + GeeCollection* _tmp10_; + GeeIterator* _tmp11_ = NULL; + GeeIterator* iter; + gboolean _tmp12_ = FALSE; + g_return_if_fail (self != NULL); + _data1_ = g_slice_new0 (Block1Data); + _data1_->_ref_count_ = 1; + _data1_->self = g_object_ref (self); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _data1_->count = 0; + _tmp6_ = self->test_collection; + gee_traversable_foreach ((GeeTraversable*) _tmp6_, ___lambda6__gee_forall_func, _data1_); + _vala_assert (_data1_->count == 3, "count == 3"); + _tmp7_ = self->test_collection; + _tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_); + _tmp9_ = _tmp8_; + gee_traversable_foreach ((GeeTraversable*) _tmp9_, ___lambda7__gee_forall_func, _data1_); + _g_object_unref0 (_tmp9_); + _vala_assert (_data1_->count == 6, "count == 6"); _tmp10_ = self->test_collection; - g_object_get_property ((GObject*) _tmp10_, "is-empty", &value); - _tmp11_ = g_value_get_boolean (&value); - _tmp12_ = self->test_collection; - _tmp13_ = gee_collection_get_is_empty (_tmp12_); - _tmp14_ = _tmp13_; - _vala_assert (_tmp11_ == _tmp14_, "value.get_boolean () == test_collection.is_empty"); - g_value_unset (&value); - g_value_init (&_tmp15_, G_TYPE_INT); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp15_; - _tmp16_ = value; - _tmp17_ = self->test_collection; - g_object_get_property ((GObject*) _tmp17_, "size", &value); - _tmp18_ = g_value_get_int (&value); - _tmp19_ = self->test_collection; - _tmp20_ = gee_collection_get_size (_tmp19_); - _tmp21_ = _tmp20_; - _vala_assert (_tmp18_ == _tmp21_, "value.get_int () == test_collection.size"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; + _tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_); + iter = _tmp11_; + _tmp12_ = gee_iterator_next (iter); + _vala_assert (_tmp12_, "iter.next ()"); + gee_traversable_foreach ((GeeTraversable*) iter, ___lambda8__gee_forall_func, _data1_); + _vala_assert (_data1_->count == 9, "count == 9"); + _g_object_unref0 (iter); + block1_data_unref (_data1_); + _data1_ = NULL; +} + + +static Block2Data* block2_data_ref (Block2Data* _data2_) { + g_atomic_int_inc (&_data2_->_ref_count_); + return _data2_; +} + + +static void block2_data_unref (void * _userdata_) { + Block2Data* _data2_; + _data2_ = (Block2Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) { + CollectionTests * self; + self = _data2_->self; + _g_object_unref0 (self); + g_slice_free (Block2Data, _data2_); + } +} + + +static gint __lambda9_ (Block2Data* _data2_, gchar* str) { + CollectionTests * self; + gint result = 0; + const gchar* _tmp0_; + gint _tmp6_; + self = _data2_->self; + g_return_val_if_fail (str != NULL, 0); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data2_->one; + _vala_assert (!_tmp1_, "!one"); + _data2_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data2_->two; + _vala_assert (!_tmp3_, "!two"); + _data2_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data2_->three; + _vala_assert (!_tmp5_, "!three"); + _data2_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = _data2_->i; + _data2_->i = _tmp6_ + 1; + result = _tmp6_; + _g_free0 (str); + return result; +} + + +static gpointer ___lambda9__gee_map_func (gpointer g, gpointer self) { + gpointer result; + result = __lambda9_ (self, g); + return result; +} + + +static gint __lambda10_ (Block2Data* _data2_, gchar* str) { + CollectionTests * self; + gint result = 0; + const gchar* _tmp0_; + gint _tmp6_; + self = _data2_->self; + g_return_val_if_fail (str != NULL, 0); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data2_->one; + _vala_assert (!_tmp1_, "!one"); + _data2_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data2_->two; + _vala_assert (!_tmp3_, "!two"); + _data2_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data2_->three; + _vala_assert (!_tmp5_, "!three"); + _data2_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = _data2_->i; + _data2_->i = _tmp6_ + 1; + result = _tmp6_; + _g_free0 (str); + return result; +} + + +static gpointer ___lambda10__gee_map_func (gpointer g, gpointer self) { + gpointer result; + result = __lambda10_ (self, g); + return result; +} + + +void collection_tests_test_map (CollectionTests* self) { + Block2Data* _data2_; + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeCollection* _tmp6_; + GeeIterator* _tmp7_ = NULL; + GeeIterator* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* _tmp10_; + GeeIterator* iter; + gint j; + gint _tmp24_; + gint _tmp25_; + gint _tmp26_; + GeeCollection* _tmp27_; + gint _tmp28_; + gint _tmp29_; + gboolean _tmp30_; + gboolean _tmp31_; + gboolean _tmp32_; + gboolean _tmp33_; + gboolean _tmp34_; + gint _tmp35_; + GeeCollection* _tmp36_; + GeeIterator* _tmp37_ = NULL; + gint _tmp51_; + gint _tmp52_; + gint _tmp53_; + GeeCollection* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gboolean _tmp57_; + gboolean _tmp58_; + gboolean _tmp59_; + g_return_if_fail (self != NULL); + _data2_ = g_slice_new0 (Block2Data); + _data2_->_ref_count_ = 1; + _data2_->self = g_object_ref (self); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _data2_->one = FALSE; + _data2_->two = FALSE; + _data2_->three = FALSE; + _data2_->i = 0; + _tmp6_ = self->test_collection; + _tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = gee_traversable_map ((GeeTraversable*) _tmp8_, G_TYPE_INT, NULL, NULL, ___lambda9__gee_map_func, _data2_); + _tmp10_ = _tmp9_; + _g_object_unref0 (_tmp8_); + iter = _tmp10_; + j = 0; + while (TRUE) { + GeeIterator* _tmp11_; + gboolean _tmp12_ = FALSE; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + GeeIterator* _tmp16_; + gpointer _tmp17_ = NULL; + gint _tmp18_; + GeeIterator* _tmp19_; + gpointer _tmp20_ = NULL; + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; + _tmp11_ = iter; + _tmp12_ = gee_iterator_next (_tmp11_); + if (!_tmp12_) { + break; + } + _tmp13_ = _data2_->i; + _tmp14_ = j; + _vala_assert (_tmp13_ == _tmp14_, "i == j"); + _tmp15_ = j; + _tmp16_ = iter; + _tmp17_ = gee_iterator_get (_tmp16_); + _vala_assert (_tmp15_ == ((gint) ((gintptr) _tmp17_)), "j == iter.get ()"); + _tmp18_ = j; + _tmp19_ = iter; + _tmp20_ = gee_iterator_get (_tmp19_); + _vala_assert (_tmp18_ == ((gint) ((gintptr) _tmp20_)), "j == iter.get ()"); + _tmp21_ = j; + j = _tmp21_ + 1; + _tmp22_ = _data2_->i; + _tmp23_ = j; + _vala_assert (_tmp22_ == _tmp23_, "i == j"); + } + _tmp24_ = _data2_->i; + _tmp25_ = j; + _vala_assert (_tmp24_ == _tmp25_, "i == j"); + _tmp26_ = _data2_->i; + _tmp27_ = self->test_collection; + _tmp28_ = gee_collection_get_size (_tmp27_); + _tmp29_ = _tmp28_; + _vala_assert (_tmp26_ == _tmp29_, "i == test_collection.size"); + _tmp30_ = _data2_->one; + _vala_assert (_tmp30_, "one"); + _tmp31_ = _data2_->two; + _vala_assert (_tmp31_, "two"); + _tmp32_ = _data2_->three; + _vala_assert (_tmp32_, "three"); + _data2_->three = FALSE; + _tmp33_ = _data2_->three; + _data2_->two = _tmp33_; + _tmp34_ = _data2_->two; + _data2_->one = _tmp34_; + j = 0; + _tmp35_ = j; + _data2_->i = _tmp35_; + _tmp36_ = self->test_collection; + _tmp37_ = gee_traversable_map ((GeeTraversable*) _tmp36_, G_TYPE_INT, NULL, NULL, ___lambda10__gee_map_func, _data2_); + _g_object_unref0 (iter); + iter = _tmp37_; + while (TRUE) { + GeeIterator* _tmp38_; + gboolean _tmp39_ = FALSE; + gint _tmp40_; + gint _tmp41_; + gint _tmp42_; + GeeIterator* _tmp43_; + gpointer _tmp44_ = NULL; + gint _tmp45_; + GeeIterator* _tmp46_; + gpointer _tmp47_ = NULL; + gint _tmp48_; + gint _tmp49_; + gint _tmp50_; + _tmp38_ = iter; + _tmp39_ = gee_iterator_next (_tmp38_); + if (!_tmp39_) { + break; + } + _tmp40_ = _data2_->i; + _tmp41_ = j; + _vala_assert (_tmp40_ == _tmp41_, "i == j"); + _tmp42_ = j; + _tmp43_ = iter; + _tmp44_ = gee_iterator_get (_tmp43_); + _vala_assert (_tmp42_ == ((gint) ((gintptr) _tmp44_)), "j == iter.get ()"); + _tmp45_ = j; + _tmp46_ = iter; + _tmp47_ = gee_iterator_get (_tmp46_); + _vala_assert (_tmp45_ == ((gint) ((gintptr) _tmp47_)), "j == iter.get ()"); + _tmp48_ = j; + j = _tmp48_ + 1; + _tmp49_ = _data2_->i; + _tmp50_ = j; + _vala_assert (_tmp49_ == _tmp50_, "i == j"); + } + _tmp51_ = _data2_->i; + _tmp52_ = j; + _vala_assert (_tmp51_ == _tmp52_, "i == j"); + _tmp53_ = _data2_->i; + _tmp54_ = self->test_collection; + _tmp55_ = gee_collection_get_size (_tmp54_); + _tmp56_ = _tmp55_; + _vala_assert (_tmp53_ == _tmp56_, "i == test_collection.size"); + _tmp57_ = _data2_->one; + _vala_assert (_tmp57_, "one"); + _tmp58_ = _data2_->two; + _vala_assert (_tmp58_, "two"); + _tmp59_ = _data2_->three; + _vala_assert (_tmp59_, "three"); + _g_object_unref0 (iter); + block2_data_unref (_data2_); + _data2_ = NULL; +} + + +static Block3Data* block3_data_ref (Block3Data* _data3_) { + g_atomic_int_inc (&_data3_->_ref_count_); + return _data3_; +} + + +static void block3_data_unref (void * _userdata_) { + Block3Data* _data3_; + _data3_ = (Block3Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) { + CollectionTests * self; + self = _data3_->self; + _g_object_unref0 (self); + g_slice_free (Block3Data, _data3_); + } +} + + +static gint __lambda11_ (Block3Data* _data3_, gchar* str, gint cur) { + CollectionTests * self; + gint result = 0; + const gchar* _tmp0_; + gint _tmp6_; + self = _data3_->self; + g_return_val_if_fail (str != NULL, 0); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data3_->one; + _vala_assert (!_tmp1_, "!one"); + _data3_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data3_->two; + _vala_assert (!_tmp3_, "!two"); + _data3_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data3_->three; + _vala_assert (!_tmp5_, "!three"); + _data3_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = cur; + result = _tmp6_ + 1; + _g_free0 (str); + return result; +} + + +static gpointer ___lambda11__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda11_ (self, g, a); + return result; +} + + +static gint __lambda12_ (Block3Data* _data3_, gchar* str, gint cur) { + CollectionTests * self; + gint result = 0; + const gchar* _tmp0_; + gint _tmp6_; + self = _data3_->self; + g_return_val_if_fail (str != NULL, 0); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data3_->one; + _vala_assert (!_tmp1_, "!one"); + _data3_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data3_->two; + _vala_assert (!_tmp3_, "!two"); + _data3_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data3_->three; + _vala_assert (!_tmp5_, "!three"); + _data3_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = cur; + result = _tmp6_ + 1; + _g_free0 (str); + return result; +} + + +static gpointer ___lambda12__gee_fold_func (gpointer g, gpointer a, gpointer self) { + gpointer result; + result = __lambda12_ (self, g, a); + return result; +} + + +void collection_tests_test_scan (CollectionTests* self) { + Block3Data* _data3_; + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeCollection* _tmp6_; + GeeIterator* _tmp7_ = NULL; + GeeIterator* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* _tmp10_; + GeeIterator* iter; + gint j; + gint _tmp22_; + GeeCollection* _tmp23_; + gint _tmp24_; + gint _tmp25_; + gboolean _tmp26_; + gboolean _tmp27_; + gboolean _tmp28_; + gboolean _tmp29_; + gboolean _tmp30_; + GeeCollection* _tmp31_; + GeeIterator* _tmp32_ = NULL; + gint _tmp44_; + GeeCollection* _tmp45_; + gint _tmp46_; + gint _tmp47_; + gboolean _tmp48_; + gboolean _tmp49_; + gboolean _tmp50_; + g_return_if_fail (self != NULL); + _data3_ = g_slice_new0 (Block3Data); + _data3_->_ref_count_ = 1; + _data3_->self = g_object_ref (self); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _data3_->one = FALSE; + _data3_->two = FALSE; + _data3_->three = FALSE; + _tmp6_ = self->test_collection; + _tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = gee_traversable_scan ((GeeTraversable*) _tmp8_, G_TYPE_INT, NULL, NULL, ___lambda11__gee_fold_func, _data3_, (gpointer) ((gintptr) 0)); + _tmp10_ = _tmp9_; + _g_object_unref0 (_tmp8_); + iter = _tmp10_; + j = 0; + { + gboolean _tmp11_; + _tmp11_ = TRUE; + while (TRUE) { + gboolean _tmp12_; + gint _tmp15_; + GeeIterator* _tmp16_; + gpointer _tmp17_ = NULL; + gint _tmp18_; + GeeIterator* _tmp19_; + gpointer _tmp20_ = NULL; + gint _tmp21_; + _tmp12_ = _tmp11_; + if (!_tmp12_) { + GeeIterator* _tmp13_; + gboolean _tmp14_ = FALSE; + _tmp13_ = iter; + _tmp14_ = gee_iterator_next (_tmp13_); + if (!_tmp14_) { + break; + } + } + _tmp11_ = FALSE; + _tmp15_ = j; + _tmp16_ = iter; + _tmp17_ = gee_iterator_get (_tmp16_); + _vala_assert (_tmp15_ == ((gint) ((gintptr) _tmp17_)), "j == iter.get ()"); + _tmp18_ = j; + _tmp19_ = iter; + _tmp20_ = gee_iterator_get (_tmp19_); + _vala_assert (_tmp18_ == ((gint) ((gintptr) _tmp20_)), "j == iter.get ()"); + _tmp21_ = j; + j = _tmp21_ + 1; + } + } + _tmp22_ = j; + _tmp23_ = self->test_collection; + _tmp24_ = gee_collection_get_size (_tmp23_); + _tmp25_ = _tmp24_; + _vala_assert (_tmp22_ == (_tmp25_ + 1), "j == test_collection.size + 1"); + _tmp26_ = _data3_->one; + _vala_assert (_tmp26_, "one"); + _tmp27_ = _data3_->two; + _vala_assert (_tmp27_, "two"); + _tmp28_ = _data3_->three; + _vala_assert (_tmp28_, "three"); + _data3_->three = FALSE; + _tmp29_ = _data3_->three; + _data3_->two = _tmp29_; + _tmp30_ = _data3_->two; + _data3_->one = _tmp30_; + j = 0; + _tmp31_ = self->test_collection; + _tmp32_ = gee_traversable_scan ((GeeTraversable*) _tmp31_, G_TYPE_INT, NULL, NULL, ___lambda12__gee_fold_func, _data3_, (gpointer) ((gintptr) 0)); + _g_object_unref0 (iter); + iter = _tmp32_; + { + gboolean _tmp33_; + _tmp33_ = TRUE; + while (TRUE) { + gboolean _tmp34_; + gint _tmp37_; + GeeIterator* _tmp38_; + gpointer _tmp39_ = NULL; + gint _tmp40_; + GeeIterator* _tmp41_; + gpointer _tmp42_ = NULL; + gint _tmp43_; + _tmp34_ = _tmp33_; + if (!_tmp34_) { + GeeIterator* _tmp35_; + gboolean _tmp36_ = FALSE; + _tmp35_ = iter; + _tmp36_ = gee_iterator_next (_tmp35_); + if (!_tmp36_) { + break; + } + } + _tmp33_ = FALSE; + _tmp37_ = j; + _tmp38_ = iter; + _tmp39_ = gee_iterator_get (_tmp38_); + _vala_assert (_tmp37_ == ((gint) ((gintptr) _tmp39_)), "j == iter.get ()"); + _tmp40_ = j; + _tmp41_ = iter; + _tmp42_ = gee_iterator_get (_tmp41_); + _vala_assert (_tmp40_ == ((gint) ((gintptr) _tmp42_)), "j == iter.get ()"); + _tmp43_ = j; + j = _tmp43_ + 1; + } + } + _tmp44_ = j; + _tmp45_ = self->test_collection; + _tmp46_ = gee_collection_get_size (_tmp45_); + _tmp47_ = _tmp46_; + _vala_assert (_tmp44_ == (_tmp47_ + 1), "j == test_collection.size + 1"); + _tmp48_ = _data3_->one; + _vala_assert (_tmp48_, "one"); + _tmp49_ = _data3_->two; + _vala_assert (_tmp49_, "two"); + _tmp50_ = _data3_->three; + _vala_assert (_tmp50_, "three"); + _g_object_unref0 (iter); + block3_data_unref (_data3_); + _data3_ = NULL; +} + + +static Block4Data* block4_data_ref (Block4Data* _data4_) { + g_atomic_int_inc (&_data4_->_ref_count_); + return _data4_; +} + + +static void block4_data_unref (void * _userdata_) { + Block4Data* _data4_; + _data4_ = (Block4Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) { + CollectionTests * self; + self = _data4_->self; + _g_object_unref0 (self); + g_slice_free (Block4Data, _data4_); + } +} + + +static gboolean __lambda13_ (Block4Data* _data4_, const gchar* str) { + CollectionTests * self; + gboolean result = FALSE; + const gchar* _tmp0_; + const gchar* _tmp6_; + self = _data4_->self; + g_return_val_if_fail (str != NULL, FALSE); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data4_->one; + _vala_assert (!_tmp1_, "!one"); + _data4_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data4_->two; + _vala_assert (!_tmp3_, "!two"); + _data4_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data4_->three; + _vala_assert (!_tmp5_, "!three"); + _data4_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = str; + result = g_strcmp0 (_tmp6_, "two") != 0; + return result; +} + + +static gboolean ___lambda13__gee_predicate (gconstpointer g, gpointer self) { + gboolean result; + result = __lambda13_ (self, g); + return result; +} + + +static gboolean __lambda14_ (Block4Data* _data4_, const gchar* str) { + CollectionTests * self; + gboolean result = FALSE; + const gchar* _tmp0_; + const gchar* _tmp6_; + self = _data4_->self; + g_return_val_if_fail (str != NULL, FALSE); + _tmp0_ = str; + if (g_strcmp0 (_tmp0_, "one") == 0) { + gboolean _tmp1_; + _tmp1_ = _data4_->one; + _vala_assert (!_tmp1_, "!one"); + _data4_->one = TRUE; + } else { + const gchar* _tmp2_; + _tmp2_ = str; + if (g_strcmp0 (_tmp2_, "two") == 0) { + gboolean _tmp3_; + _tmp3_ = _data4_->two; + _vala_assert (!_tmp3_, "!two"); + _data4_->two = TRUE; + } else { + const gchar* _tmp4_; + _tmp4_ = str; + if (g_strcmp0 (_tmp4_, "three") == 0) { + gboolean _tmp5_; + _tmp5_ = _data4_->three; + _vala_assert (!_tmp5_, "!three"); + _data4_->three = TRUE; + } else { + g_assert_not_reached (); + } + } + } + _tmp6_ = str; + result = g_strcmp0 (_tmp6_, "two") != 0; + return result; +} + + +static gboolean ___lambda14__gee_predicate (gconstpointer g, gpointer self) { + gboolean result; + result = __lambda14_ (self, g); + return result; +} + + +void collection_tests_test_filter (CollectionTests* self) { + Block4Data* _data4_; + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeCollection* _tmp6_; + GeeIterator* _tmp7_ = NULL; + GeeIterator* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* _tmp10_; + GeeIterator* iter; + GeeIterator* _tmp11_; + gboolean _tmp12_; + gboolean _tmp13_; + gint j; + gint _tmp20_; + gboolean _tmp21_; + gboolean _tmp22_; + gboolean _tmp23_; + gboolean _tmp24_; + gboolean _tmp25_; + GeeCollection* _tmp26_; + GeeIterator* _tmp27_ = NULL; + GeeIterator* _tmp28_; + gboolean _tmp29_; + gboolean _tmp30_; + gint _tmp37_; + gboolean _tmp38_; + gboolean _tmp39_; + gboolean _tmp40_; + g_return_if_fail (self != NULL); + _data4_ = g_slice_new0 (Block4Data); + _data4_->_ref_count_ = 1; + _data4_->self = g_object_ref (self); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _data4_->one = FALSE; + _data4_->two = FALSE; + _data4_->three = FALSE; + _tmp6_ = self->test_collection; + _tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = gee_traversable_filter ((GeeTraversable*) _tmp8_, ___lambda13__gee_predicate, block4_data_ref (_data4_), block4_data_unref); + _tmp10_ = _tmp9_; + _g_object_unref0 (_tmp8_); + iter = _tmp10_; + _tmp11_ = iter; + _tmp12_ = gee_iterator_get_valid (_tmp11_); + _tmp13_ = _tmp12_; + _vala_assert (!_tmp13_, "!iter.valid"); + j = 0; + while (TRUE) { + GeeIterator* _tmp14_; + gboolean _tmp15_ = FALSE; + GeeIterator* _tmp16_; + gpointer _tmp17_ = NULL; + gchar* _tmp18_; + gint _tmp19_; + _tmp14_ = iter; + _tmp15_ = gee_iterator_next (_tmp14_); + if (!_tmp15_) { + break; + } + _tmp16_ = iter; + _tmp17_ = gee_iterator_get (_tmp16_); + _tmp18_ = (gchar*) _tmp17_; + _vala_assert (g_strcmp0 (_tmp18_, "two") != 0, "iter.get () != \"two\""); + _g_free0 (_tmp18_); + _tmp19_ = j; + j = _tmp19_ + 1; + } + _tmp20_ = j; + _vala_assert (_tmp20_ == 2, "j == 2"); + _tmp21_ = _data4_->one; + _vala_assert (_tmp21_, "one"); + _tmp22_ = _data4_->two; + _vala_assert (_tmp22_, "two"); + _tmp23_ = _data4_->three; + _vala_assert (_tmp23_, "three"); + _data4_->three = FALSE; + _tmp24_ = _data4_->three; + _data4_->two = _tmp24_; + _tmp25_ = _data4_->two; + _data4_->one = _tmp25_; + j = 0; + _tmp26_ = self->test_collection; + _tmp27_ = gee_traversable_filter ((GeeTraversable*) _tmp26_, ___lambda14__gee_predicate, block4_data_ref (_data4_), block4_data_unref); + _g_object_unref0 (iter); + iter = _tmp27_; + _tmp28_ = iter; + _tmp29_ = gee_iterator_get_valid (_tmp28_); + _tmp30_ = _tmp29_; + _vala_assert (!_tmp30_, "!iter.valid"); + while (TRUE) { + GeeIterator* _tmp31_; + gboolean _tmp32_ = FALSE; + GeeIterator* _tmp33_; + gpointer _tmp34_ = NULL; + gchar* _tmp35_; + gint _tmp36_; + _tmp31_ = iter; + _tmp32_ = gee_iterator_next (_tmp31_); + if (!_tmp32_) { + break; + } + _tmp33_ = iter; + _tmp34_ = gee_iterator_get (_tmp33_); + _tmp35_ = (gchar*) _tmp34_; + _vala_assert (g_strcmp0 (_tmp35_, "two") != 0, "iter.get () != \"two\""); + _g_free0 (_tmp35_); + _tmp36_ = j; + j = _tmp36_ + 1; + } + _tmp37_ = j; + _vala_assert (_tmp37_ == 2, "j == 2"); + _tmp38_ = _data4_->one; + _vala_assert (_tmp38_, "one"); + _tmp39_ = _data4_->two; + _vala_assert (_tmp39_, "two"); + _tmp40_ = _data4_->three; + _vala_assert (_tmp40_, "three"); + _g_object_unref0 (iter); + block4_data_unref (_data4_); + _data4_ = NULL; +} + + +void collection_tests_test_chop (CollectionTests* self) { + GeeCollection* _tmp0_; + gboolean _tmp1_ = FALSE; + GeeCollection* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeCollection* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeCollection* _tmp6_; + GeeIterator* _tmp7_ = NULL; + GeeIterator* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* _tmp10_; + GeeIterator* iter; + GeeIterator* _tmp11_; + gboolean _tmp12_; + gboolean _tmp13_; + GeeCollection* _tmp14_; + GeeIterator* _tmp15_ = NULL; + GeeIterator* iter2; + GeeIterator* _tmp16_; + gboolean _tmp17_ = FALSE; + GeeIterator* _tmp18_; + gboolean _tmp19_ = FALSE; + GeeIterator* _tmp20_; + gboolean _tmp21_ = FALSE; + GeeIterator* _tmp22_; + gpointer _tmp23_ = NULL; + gchar* _tmp24_; + GeeIterator* _tmp25_; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + GeeIterator* _tmp28_; + gboolean _tmp29_ = FALSE; + GeeIterator* _tmp30_; + gboolean _tmp31_ = FALSE; + GeeCollection* _tmp32_; + GeeIterator* _tmp33_ = NULL; + GeeIterator* _tmp34_; + gboolean _tmp35_; + gboolean _tmp36_; + GeeCollection* _tmp37_; + GeeIterator* _tmp38_ = NULL; + GeeIterator* _tmp39_; + gboolean _tmp40_ = FALSE; + GeeIterator* _tmp41_; + gboolean _tmp42_ = FALSE; + GeeIterator* _tmp43_; + gboolean _tmp44_ = FALSE; + GeeIterator* _tmp45_; + gpointer _tmp46_ = NULL; + gchar* _tmp47_; + GeeIterator* _tmp48_; + gpointer _tmp49_ = NULL; + gchar* _tmp50_; + GeeIterator* _tmp51_; + gboolean _tmp52_ = FALSE; + GeeIterator* _tmp53_; + gboolean _tmp54_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = self->test_collection; + _tmp1_ = gee_collection_add (_tmp0_, "one"); + _vala_assert (_tmp1_, "test_collection.add (\"one\")"); + _tmp2_ = self->test_collection; + _tmp3_ = gee_collection_add (_tmp2_, "two"); + _vala_assert (_tmp3_, "test_collection.add (\"two\")"); + _tmp4_ = self->test_collection; + _tmp5_ = gee_collection_add (_tmp4_, "three"); + _vala_assert (_tmp5_, "test_collection.add (\"three\")"); + _tmp6_ = self->test_collection; + _tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = gee_traversable_chop ((GeeTraversable*) _tmp8_, 1, 1); + _tmp10_ = _tmp9_; + _g_object_unref0 (_tmp8_); + iter = _tmp10_; + _tmp11_ = iter; + _tmp12_ = gee_iterator_get_valid (_tmp11_); + _tmp13_ = _tmp12_; + _vala_assert (!_tmp13_, "!iter.valid"); + _tmp14_ = self->test_collection; + _tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_); + iter2 = _tmp15_; + _tmp16_ = iter2; + _tmp17_ = gee_iterator_next (_tmp16_); + _vala_assert (_tmp17_, "iter2.next ()"); + _tmp18_ = iter2; + _tmp19_ = gee_iterator_next (_tmp18_); + _vala_assert (_tmp19_, "iter2.next ()"); + _tmp20_ = iter; + _tmp21_ = gee_iterator_next (_tmp20_); + _vala_assert (_tmp21_, "iter.next ()"); + _tmp22_ = iter2; + _tmp23_ = gee_iterator_get (_tmp22_); + _tmp24_ = (gchar*) _tmp23_; + _tmp25_ = iter; + _tmp26_ = gee_iterator_get (_tmp25_); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp24_, _tmp27_) == 0, "iter2.get () == iter.get ()"); + _g_free0 (_tmp27_); + _g_free0 (_tmp24_); + _tmp28_ = iter; + _tmp29_ = gee_iterator_next (_tmp28_); + _vala_assert (!_tmp29_, "!iter.next ()"); + _tmp30_ = iter2; + _tmp31_ = gee_iterator_next (_tmp30_); + _vala_assert (_tmp31_, "iter2.next ()"); + _tmp32_ = self->test_collection; + _tmp33_ = gee_traversable_chop ((GeeTraversable*) _tmp32_, 1, 1); + _g_object_unref0 (iter); + iter = _tmp33_; + _tmp34_ = iter; + _tmp35_ = gee_iterator_get_valid (_tmp34_); + _tmp36_ = _tmp35_; + _vala_assert (!_tmp36_, "!iter.valid"); + _tmp37_ = self->test_collection; + _tmp38_ = gee_iterable_iterator ((GeeIterable*) _tmp37_); + _g_object_unref0 (iter2); + iter2 = _tmp38_; + _tmp39_ = iter2; + _tmp40_ = gee_iterator_next (_tmp39_); + _vala_assert (_tmp40_, "iter2.next ()"); + _tmp41_ = iter2; + _tmp42_ = gee_iterator_next (_tmp41_); + _vala_assert (_tmp42_, "iter2.next ()"); + _tmp43_ = iter; + _tmp44_ = gee_iterator_next (_tmp43_); + _vala_assert (_tmp44_, "iter.next ()"); + _tmp45_ = iter2; + _tmp46_ = gee_iterator_get (_tmp45_); + _tmp47_ = (gchar*) _tmp46_; + _tmp48_ = iter; + _tmp49_ = gee_iterator_get (_tmp48_); + _tmp50_ = (gchar*) _tmp49_; + _vala_assert (g_strcmp0 (_tmp47_, _tmp50_) == 0, "iter2.get () == iter.get ()"); + _g_free0 (_tmp50_); + _g_free0 (_tmp47_); + _tmp51_ = iter; + _tmp52_ = gee_iterator_next (_tmp51_); + _vala_assert (!_tmp52_, "!iter.next ()"); + _tmp53_ = iter2; + _tmp54_ = gee_iterator_next (_tmp53_); + _vala_assert (_tmp54_, "iter2.next ()"); + _g_object_unref0 (iter2); + _g_object_unref0 (iter); } diff --git a/tests/testcollection.vala b/tests/testcollection.vala index 6155f9e..ddb9308 100644 --- a/tests/testcollection.vala +++ b/tests/testcollection.vala @@ -2,6 +2,7 @@ * * Copyright (C) 2008 Jürg Billeter * Copyright (C) 2009 Didier Villevalois, Julien Peeters + * Copyright (C) 2011-2012 Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,6 +22,7 @@ * Jürg Billeter * Didier 'Ptitjes' Villevalois * Julien Peeters + * Maciej Piechotka */ using Gee; @@ -43,6 +45,12 @@ public abstract class CollectionTests : Gee.TestCase { add_test ("[Collection] retain_all", test_retain_all); add_test ("[Collection] to_array", test_to_array); add_test ("[Collection] GObject properties", test_gobject_properties); + add_test ("[Collection] fold", test_fold); + add_test ("[Collection] foreach", test_foreach); + add_test ("[Collection] map", test_map); + add_test ("[Collection] scan", test_scan); + add_test ("[Collection] filter", test_filter); + add_test ("[Collection] chop", test_chop); } protected Collection test_collection; @@ -64,98 +72,50 @@ public abstract class CollectionTests : Gee.TestCase { Iterator iterator = test_collection.iterator (); assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (! iterator.first ()); - // Check for some elements in the collection - assert (test_collection.add ("one")); - assert (test_collection.add ("two")); - assert (test_collection.add ("three")); + unowned string[] data = TestData.get_data (); - bool one_found = false; - bool two_found = false; - bool three_found = false; - bool one_found_once = true; - bool two_found_once = true; - bool three_found_once = true; - iterator = test_collection.iterator (); - while (true) { - has_next = iterator.has_next (); - assert (has_next == iterator.next ()); - if (! has_next) { - break; - } + // Check for some elements in the collection + foreach (unowned string el in data) { + assert (test_collection.add (el)); + } - string element = iterator.get (); - if (element == "one") { - if (one_found) { - one_found_once = false; - } - one_found = true; - } else if (element == "two") { - if (two_found) { - two_found_once = false; - } - two_found = true; - } else if (element == "three") { - if (three_found) { - three_found_once = false; - } - three_found = true; + uint[] found_times = new uint[data.length]; + for (uint i = 0; i < 2; i++) { + for (uint j = 0; j < found_times.length; j++) { + found_times[j] = 0; } - } - has_next = iterator.has_next (); - assert (! has_next); - assert (has_next == iterator.next ()); - assert (one_found); - assert (one_found_once); - assert (two_found); - assert (two_found_once); - assert (three_found); - assert (three_found_once); - - // Do it twice to check first () - assert (iterator.first ()); - - one_found = false; - two_found = false; - three_found = false; - one_found_once = true; - two_found_once = true; - three_found_once = true; - while (true) { - string element = iterator.get (); - if (element == "one") { - if (one_found) { - one_found_once = false; - } - one_found = true; - } else if (element == "two") { - if (two_found) { - two_found_once = false; + iterator = test_collection.iterator (); + bool valid = iterator.valid; + assert (! valid); + while (true) { + has_next = iterator.has_next (); + assert (valid == iterator.valid); + assert (has_next == iterator.next ()); + assert (valid = iterator.valid); + if (! has_next) { + break; } - two_found = true; - } else if (element == "three") { - if (three_found) { - three_found_once = false; + + string element = iterator.get (); + assert (iterator.valid); + for (uint element_idx = 0;; element_idx++) { + assert (element_idx < data.length); + if (data[element_idx] == element) { + found_times[element_idx]++; + break; + } } - three_found = true; } - has_next = iterator.has_next (); + assert (! has_next); + assert (iterator.valid); assert (has_next == iterator.next ()); - if (! has_next) { - break; + assert (iterator.valid); + foreach (var ft in found_times) { + assert (ft == 1); } } - has_next = iterator.has_next (); - assert (! has_next); - assert (has_next == iterator.next ()); - assert (one_found); - assert (one_found_once); - assert (two_found); - assert (two_found_once); - assert (three_found); - assert (three_found_once); } public void test_mutable_iterator () { @@ -167,167 +127,143 @@ public abstract class CollectionTests : Gee.TestCase { Iterator iterator = test_collection.iterator (); // ... - // Check for some elements in the collection and remove one - assert (test_collection.add ("one")); - assert (test_collection.add ("two")); - assert (test_collection.add ("three")); + unowned string[] data = TestData.get_data (); + unowned uint[] idx = TestData.get_drawn_numbers (); + + // Check for some elements in the collection and remove few + foreach (unowned string el in data) { + assert (test_collection.add (el)); + } - bool one_found = false; - bool two_found = false; - bool three_found = false; - bool one_found_once = true; - bool two_found_once = true; - bool three_found_once = true; iterator = test_collection.iterator (); - while (true) { - has_next = iterator.has_next (); - assert (has_next == iterator.next ()); - if (! has_next) { - break; + uint[] found_times = new uint[data.length]; + for (uint i = 0; i <= idx.length; i++) { + for (uint j = 0; j < found_times.length; j++) { + found_times[j] = 0; } - - string element = iterator.get (); - if (element == "one") { - if (one_found) { - one_found_once = false; + iterator = test_collection.iterator (); + assert (! iterator.valid); + bool last_removed = false; + while (true) { + has_next = iterator.has_next (); + assert (has_next == iterator.next ()); + if (! has_next) { + break; } - one_found = true; - } else if (element == "two") { - if (two_found) { - two_found_once = false; - } - two_found = true; - // Remove this element - iterator.remove (); - } else if (element == "three") { - if (three_found) { - three_found_once = false; - } - three_found = true; - } - } - has_next = iterator.has_next (); - assert (! has_next); - assert (has_next == iterator.next ()); - assert (one_found); - assert (one_found_once); - assert (two_found); - assert (two_found_once); - assert (three_found); - assert (three_found_once); - - // Check after removal - assert (iterator.first ()); - - one_found = false; - two_found = false; - three_found = false; - one_found_once = true; - two_found_once = true; - three_found_once = true; - while (true) { - string element = iterator.get (); - if (element == "one") { - if (one_found) { - one_found_once = false; + string element = iterator.get (); + assert (iterator.valid); + for (uint element_idx = 0;; element_idx++) { + assert (element_idx < data.length); + if (data[element_idx] == element) { + if (i != idx.length && data[element_idx] == data[idx[i]]) { + iterator.remove (); + assert (! iterator.valid); + last_removed = true; + } else { + last_removed = false; + } + found_times[element_idx]++; + break; + } } - one_found = true; - } else if (element == "two") { - two_found = true; - } else if (element == "three") { - if (three_found) { - three_found_once = false; - } - three_found = true; } - has_next = iterator.has_next (); + assert (! has_next); + assert (iterator.valid == !last_removed); assert (has_next == iterator.next ()); - if (! has_next) { - break; + assert (iterator.valid == !last_removed); + for (uint j = 0; j < found_times.length; j++) { + bool removed = false; + for (int k = 0; k < i; k++) { + if (idx[k] == j) { + removed = true; + break; + } + } + assert (found_times[j] == (removed ? 0 : 1)); } } - has_next = iterator.has_next (); - assert (! has_next); - assert (has_next == iterator.next ()); - assert (one_found); - assert (one_found_once); - assert (!two_found); - assert (three_found); - assert (three_found_once); } public void test_contains_size_and_is_empty () { // Check the collection exists assert (test_collection != null); + unowned string[] data = TestData.get_data (); + unowned uint[] idx = TestData.get_drawn_numbers (); + // Check the collection is initially empty - assert (! test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (! test_collection.contains ("three")); + foreach (unowned string s in data) { + assert (! test_collection.contains (s)); + } assert (test_collection.size == 0); assert (test_collection.is_empty); // Add an element - assert (test_collection.add ("one")); - assert (test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (! test_collection.contains ("three")); + assert (test_collection.add (data[0])); + assert (test_collection.contains (data[0])); + for (uint i = 1; i < data.length; i++) { + assert (! test_collection.contains (data[i])); + } assert (test_collection.size == 1); assert (! test_collection.is_empty); // Remove the added element assert (test_collection.remove ("one")); - assert (! test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (! test_collection.contains ("three")); + foreach (unowned string s in data) { + assert (! test_collection.contains (s)); + } assert (test_collection.size == 0); assert (test_collection.is_empty); // Add more elements - assert (test_collection.add ("one")); - assert (test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (! test_collection.contains ("three")); - assert (test_collection.size == 1); - assert (! test_collection.is_empty); - - assert (test_collection.add ("two")); - assert (test_collection.contains ("one")); - assert (test_collection.contains ("two")); - assert (! test_collection.contains ("three")); - assert (test_collection.size == 2); - assert (! test_collection.is_empty); - - assert (test_collection.add ("three")); - assert (test_collection.contains ("one")); - assert (test_collection.contains ("two")); - assert (test_collection.contains ("three")); - assert (test_collection.size == 3); - assert (! test_collection.is_empty); - - // Remove one element - assert (test_collection.remove ("two")); - assert (test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (test_collection.contains ("three")); - assert (test_collection.size == 2); - assert (! test_collection.is_empty); - - // Remove the same element again - assert (! test_collection.remove ("two")); - assert (test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (test_collection.contains ("three")); - assert (test_collection.size == 2); - assert (! test_collection.is_empty); + for (uint i = 0; i < data.length; i++) { + assert (test_collection.add (data[i])); + for (uint j = 0; j <= i; j++) { + assert (test_collection.contains (data[j])); + } + for (uint j = i + 1; j < data.length; j++) { + assert (! test_collection.contains (data[j])); + } + assert (test_collection.size == i + 1); + assert (! test_collection.is_empty); + } + for (uint i = 0; i < idx.length; i++) { + // Remove one element + assert (test_collection.remove (data[idx[i]])); + for (uint j = 0; j < data.length; j++) { + bool removed = false; + for (uint k = 0; k <= i; k++) { + if (idx[k] == j) { + removed = true; + break; + } + } + assert (test_collection.contains (data[j]) == !removed); + } + assert (test_collection.size == data.length - (i + 1)); + + // Remove the same element again + assert (! test_collection.remove (data[idx[i]])); + for (uint j = 0; j < data.length; j++) { + bool removed = false; + for (uint k = 0; k <= i; k++) { + if (idx[k] == j) { + removed = true; + break; + } + } + assert (test_collection.contains (data[j]) == !removed); + } + assert (test_collection.size == data.length - (i + 1)); + } // Remove all elements test_collection.clear (); - assert (! test_collection.contains ("one")); - assert (! test_collection.contains ("two")); - assert (! test_collection.contains ("three")); + foreach (unowned string el in data) { + assert (! test_collection.contains (el)); + } assert (test_collection.size == 0); assert (test_collection.is_empty); } @@ -336,16 +272,7 @@ public abstract class CollectionTests : Gee.TestCase { // Check the collection exists assert (test_collection != null); - string[] to_add = { - "one", "two", "three", "four", "five", "six", "seven", "eight", - "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", - "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", - "twenty one", "twenty two", "twenty three", "twenty four", - "twenty five", "twenty six", "twenty seven", "twenty eight", - "twenty nine", "thirty", "thirty one", "thirty two", "thirty four", - "thirty five", "thirty six", "thirty seven", "thirty eight", - "thirty nine", "fourty" - }; + unowned string[] to_add = TestData.get_data (); var expected_size = 0; foreach (var a in to_add) { @@ -373,16 +300,7 @@ public abstract class CollectionTests : Gee.TestCase { // Check the collection exists assert (test_collection != null); - string[] to_add = { - "one", "two", "three", "four", "five", "six", "seven", "eight", - "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", - "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", - "twenty one", "twenty two", "twenty three", "twenty four", - "twenty five", "twenty six", "twenty seven", "twenty eight", - "twenty nine", "thirty", "thirty one", "thirty two", "thirty four", - "thirty five", "thirty six", "thirty seven", "thirty eight", - "thirty nine", "fourty" - }; + unowned string[] to_add = TestData.get_data (); var expected_size = 0; foreach (var a in to_add) { @@ -718,19 +636,285 @@ public abstract class CollectionTests : Gee.TestCase { assert (test_collection != null); Value value; - value = Value (typeof (Type)); - test_collection.get_property ("element-type", ref value); - assert (value.get_gtype () == test_collection.element_type); - value.unset (); - - value = Value (typeof (bool)); - test_collection.get_property ("is-empty", ref value); - assert (value.get_boolean () == test_collection.is_empty); - value.unset (); - value = Value (typeof (int)); test_collection.get_property ("size", ref value); assert (value.get_int () == test_collection.size); value.unset (); } + + public void test_fold () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + int count; + + count = test_collection.fold ((x, y) => {return y + 1;}, 0); + assert (count == 3); + + count = test_collection.iterator ().fold ((x, y) => {return y + 1;}, 0); + assert (count == 3); + + Iterator iter = test_collection.iterator (); + assert (iter.next ()); + count = iter.fold ((x, y) => {return y + 1;}, 0); + assert (count == 3); + } + + public void test_foreach () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + int count = 0; + + test_collection.foreach ((x) => {count++; return true;}); + assert (count == 3); + + test_collection.iterator ().foreach ((x) => {count++; return true;}); + assert (count == 6); + + Iterator iter = test_collection.iterator (); + assert (iter.next ()); + iter.foreach ((x) => {count++; return true;}); + assert (count == 9); + } + + public void test_map () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + bool one = false; + bool two = false; + bool three = false; + + int i = 0; + var iter = test_collection.iterator().map ((str) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return i++; + }); + int j = 0; + while (iter.next ()) { + assert (i == j); + assert (j == iter.get ()); + assert (j == iter.get ()); + j++; + assert (i == j); + } + + assert (i == j); + assert (i == test_collection.size); + assert (one); + assert (two); + assert (three); + + one = two = three = false; + i = j = 0; + + iter = test_collection.map ((str) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return i++; + }); + while (iter.next ()) { + assert (i == j); + assert (j == iter.get ()); + assert (j == iter.get ()); + j++; + assert (i == j); + } + + assert (i == j); + assert (i == test_collection.size); + assert (one); + assert (two); + assert (three); + } + + public void test_scan () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + bool one = false; + bool two = false; + bool three = false; + + var iter = test_collection.iterator().scan ((str, cur) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return cur + 1; + }, 0); + + int j = 0; + do { + assert (j == iter.get ()); + assert (j == iter.get ()); + j++; + } while (iter.next ()); + + assert (j == test_collection.size + 1); + assert (one); + assert (two); + assert (three); + + one = two = three = false; + j = 0; + + iter = test_collection.scan ((str, cur) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return cur + 1; + }, 0); + + do { + assert (j == iter.get ()); + assert (j == iter.get ()); + j++; + } while (iter.next ()); + + assert (j == test_collection.size + 1); + assert (one); + assert (two); + assert (three); + } + + public void test_filter () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + bool one = false; + bool two = false; + bool three = false; + + var iter = test_collection.iterator().filter ((str) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return str != "two"; + }); + + assert (!iter.valid); + + int j = 0; + while (iter.next ()) { + assert(iter.get () != "two"); + j++; + } + assert (j == 2); + assert (one); + assert (two); + assert (three); + + one = two = three = false; + j = 0; + + iter = test_collection.filter ((str) => { + if (str == "one") { + assert (!one); + one = true; + } else if (str == "two") { + assert (!two); + two = true; + } else if (str == "three") { + assert (!three); + three = true; + } else { + assert_not_reached (); + } + return str != "two"; + }); + + assert (!iter.valid); + + while (iter.next ()) { + assert(iter.get () != "two"); + j++; + } + assert (j == 2); + assert (one); + assert (two); + assert (three); + } + + public void test_chop () { + assert (test_collection.add ("one")); + assert (test_collection.add ("two")); + assert (test_collection.add ("three")); + + var iter = test_collection.iterator().chop (1, 1); + assert (!iter.valid); + var iter2 = test_collection.iterator(); + + assert (iter2.next ()); + assert (iter2.next ()); + assert (iter.next ()); + assert (iter2.get () == iter.get ()); + assert (!iter.next ()); + assert (iter2.next ()); + + iter = test_collection.chop (1, 1); + assert (!iter.valid); + iter2 = test_collection.iterator(); + + assert (iter2.next ()); + assert (iter2.next ()); + assert (iter.next ()); + assert (iter2.get () == iter.get ()); + assert (!iter.next ()); + assert (iter2.next ()); + } } + diff --git a/tests/testcomparable.c b/tests/testcomparable.c deleted file mode 100644 index 2241ca0..0000000 --- a/tests/testcomparable.c +++ /dev/null @@ -1,258 +0,0 @@ -/* testcomparable.c generated by valac 0.18.0, the Vala compiler - * generated from testcomparable.vala, do not modify */ - -/* testcomparable.vala - * - * Copyright (C) 2009 Didier Villevalois - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Didier 'Ptitjes' Villevalois - */ - -#include -#include -#include -#include -#include - - -#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) -#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) -#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) -#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) -#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) -#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) - -typedef struct _GeeTestCase GeeTestCase; -typedef struct _GeeTestCaseClass GeeTestCaseClass; -typedef struct _GeeTestCasePrivate GeeTestCasePrivate; - -#define TYPE_COMPARABLE_TESTS (comparable_tests_get_type ()) -#define COMPARABLE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMPARABLE_TESTS, ComparableTests)) -#define COMPARABLE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMPARABLE_TESTS, ComparableTestsClass)) -#define IS_COMPARABLE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMPARABLE_TESTS)) -#define IS_COMPARABLE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMPARABLE_TESTS)) -#define COMPARABLE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMPARABLE_TESTS, ComparableTestsClass)) - -typedef struct _ComparableTests ComparableTests; -typedef struct _ComparableTestsClass ComparableTestsClass; -typedef struct _ComparableTestsPrivate ComparableTestsPrivate; - -#define COMPARABLE_TESTS_TYPE_TEST_COMPARABLE (comparable_tests_test_comparable_get_type ()) -#define COMPARABLE_TESTS_TEST_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMPARABLE_TESTS_TYPE_TEST_COMPARABLE, ComparableTestsTestComparable)) -#define COMPARABLE_TESTS_TEST_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COMPARABLE_TESTS_TYPE_TEST_COMPARABLE, ComparableTestsTestComparableClass)) -#define COMPARABLE_TESTS_IS_TEST_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMPARABLE_TESTS_TYPE_TEST_COMPARABLE)) -#define COMPARABLE_TESTS_IS_TEST_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMPARABLE_TESTS_TYPE_TEST_COMPARABLE)) -#define COMPARABLE_TESTS_TEST_COMPARABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COMPARABLE_TESTS_TYPE_TEST_COMPARABLE, ComparableTestsTestComparableClass)) - -typedef struct _ComparableTestsTestComparable ComparableTestsTestComparable; -typedef struct _ComparableTestsTestComparableClass ComparableTestsTestComparableClass; -typedef struct _ComparableTestsTestComparablePrivate ComparableTestsTestComparablePrivate; -#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); - -struct _GeeTestCase { - GObject parent_instance; - GeeTestCasePrivate * priv; -}; - -struct _GeeTestCaseClass { - GObjectClass parent_class; - void (*set_up) (GeeTestCase* self); - void (*tear_down) (GeeTestCase* self); -}; - -struct _ComparableTests { - GeeTestCase parent_instance; - ComparableTestsPrivate * priv; -}; - -struct _ComparableTestsClass { - GeeTestCaseClass parent_class; -}; - -typedef void (*GeeTestCaseTestMethod) (void* user_data); -struct _ComparableTestsTestComparable { - GObject parent_instance; - ComparableTestsTestComparablePrivate * priv; - gint _a; -}; - -struct _ComparableTestsTestComparableClass { - GObjectClass parent_class; -}; - - -static gpointer comparable_tests_parent_class = NULL; -static gpointer comparable_tests_test_comparable_parent_class = NULL; -static GeeComparableIface* comparable_tests_test_comparable_gee_comparable_parent_iface = NULL; - -GType gee_test_case_get_type (void) G_GNUC_CONST; -GType comparable_tests_get_type (void) G_GNUC_CONST; -enum { - COMPARABLE_TESTS_DUMMY_PROPERTY -}; -ComparableTests* comparable_tests_new (void); -ComparableTests* comparable_tests_construct (GType object_type); -GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -void comparable_tests_test_selected_functions (ComparableTests* self); -static void _comparable_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -static ComparableTestsTestComparable* comparable_tests_test_comparable_new (gint a); -static ComparableTestsTestComparable* comparable_tests_test_comparable_construct (GType object_type, gint a); -static GType comparable_tests_test_comparable_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; -enum { - COMPARABLE_TESTS_TEST_COMPARABLE_DUMMY_PROPERTY -}; -static gint comparable_tests_test_comparable_real_compare_to (GeeComparable* base, ComparableTestsTestComparable* object); -static void comparable_tests_test_comparable_finalize (GObject* obj); - - -static void _comparable_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - comparable_tests_test_selected_functions (self); -} - - -ComparableTests* comparable_tests_construct (GType object_type) { - ComparableTests * self = NULL; - self = (ComparableTests*) gee_test_case_construct (object_type, "Comparable"); - gee_test_case_add_test ((GeeTestCase*) self, "[Comparable] selected functions", _comparable_tests_test_selected_functions_gee_test_case_test_method, self); - return self; -} - - -ComparableTests* comparable_tests_new (void) { - return comparable_tests_construct (TYPE_COMPARABLE_TESTS); -} - - -void comparable_tests_test_selected_functions (ComparableTests* self) { - ComparableTestsTestComparable* _tmp0_; - ComparableTestsTestComparable* o1; - ComparableTestsTestComparable* _tmp1_; - ComparableTestsTestComparable* o2; - GCompareFunc _tmp2_ = NULL; - GCompareFunc compare; - gint _tmp3_ = 0; - gint _tmp4_ = 0; - g_return_if_fail (self != NULL); - _tmp0_ = comparable_tests_test_comparable_new (10); - o1 = _tmp0_; - _tmp1_ = comparable_tests_test_comparable_new (20); - o2 = _tmp1_; - _tmp2_ = gee_functions_get_compare_func_for (COMPARABLE_TESTS_TYPE_TEST_COMPARABLE); - compare = _tmp2_; - _tmp3_ = compare (o1, o2); - _vala_assert (_tmp3_ < 0, "compare (o1, o2) < 0"); - o1->_a = 42; - _tmp4_ = compare (o1, o2); - _vala_assert (_tmp4_ > 0, "compare (o1, o2) > 0"); - _g_object_unref0 (o2); - _g_object_unref0 (o1); -} - - -static ComparableTestsTestComparable* comparable_tests_test_comparable_construct (GType object_type, gint a) { - ComparableTestsTestComparable * self = NULL; - gint _tmp0_; - self = (ComparableTestsTestComparable*) g_object_new (object_type, NULL); - _tmp0_ = a; - self->_a = _tmp0_; - return self; -} - - -static ComparableTestsTestComparable* comparable_tests_test_comparable_new (gint a) { - return comparable_tests_test_comparable_construct (COMPARABLE_TESTS_TYPE_TEST_COMPARABLE, a); -} - - -static gint comparable_tests_test_comparable_real_compare_to (GeeComparable* base, ComparableTestsTestComparable* object) { - ComparableTestsTestComparable * self; - gint result = 0; - gint _tmp0_; - ComparableTestsTestComparable* _tmp1_; - gint _tmp2_; - self = (ComparableTestsTestComparable*) base; - g_return_val_if_fail (object != NULL, 0); - _tmp0_ = self->_a; - _tmp1_ = object; - _tmp2_ = _tmp1_->_a; - result = _tmp0_ - _tmp2_; - return result; -} - - -static void comparable_tests_test_comparable_class_init (ComparableTestsTestComparableClass * klass) { - comparable_tests_test_comparable_parent_class = g_type_class_peek_parent (klass); - G_OBJECT_CLASS (klass)->finalize = comparable_tests_test_comparable_finalize; -} - - -static void comparable_tests_test_comparable_gee_comparable_interface_init (GeeComparableIface * iface) { - comparable_tests_test_comparable_gee_comparable_parent_iface = g_type_interface_peek_parent (iface); - iface->compare_to = (gint (*)(GeeComparable*, gconstpointer)) comparable_tests_test_comparable_real_compare_to; -} - - -static void comparable_tests_test_comparable_instance_init (ComparableTestsTestComparable * self) { -} - - -static void comparable_tests_test_comparable_finalize (GObject* obj) { - ComparableTestsTestComparable * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, COMPARABLE_TESTS_TYPE_TEST_COMPARABLE, ComparableTestsTestComparable); - G_OBJECT_CLASS (comparable_tests_test_comparable_parent_class)->finalize (obj); -} - - -static GType comparable_tests_test_comparable_get_type (void) { - static volatile gsize comparable_tests_test_comparable_type_id__volatile = 0; - if (g_once_init_enter (&comparable_tests_test_comparable_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (ComparableTestsTestComparableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) comparable_tests_test_comparable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComparableTestsTestComparable), 0, (GInstanceInitFunc) comparable_tests_test_comparable_instance_init, NULL }; - static const GInterfaceInfo gee_comparable_info = { (GInterfaceInitFunc) comparable_tests_test_comparable_gee_comparable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; - GType comparable_tests_test_comparable_type_id; - comparable_tests_test_comparable_type_id = g_type_register_static (G_TYPE_OBJECT, "ComparableTestsTestComparable", &g_define_type_info, 0); - g_type_add_interface_static (comparable_tests_test_comparable_type_id, GEE_TYPE_COMPARABLE, &gee_comparable_info); - g_once_init_leave (&comparable_tests_test_comparable_type_id__volatile, comparable_tests_test_comparable_type_id); - } - return comparable_tests_test_comparable_type_id__volatile; -} - - -static void comparable_tests_class_init (ComparableTestsClass * klass) { - comparable_tests_parent_class = g_type_class_peek_parent (klass); -} - - -static void comparable_tests_instance_init (ComparableTests * self) { -} - - -GType comparable_tests_get_type (void) { - static volatile gsize comparable_tests_type_id__volatile = 0; - if (g_once_init_enter (&comparable_tests_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (ComparableTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) comparable_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ComparableTests), 0, (GInstanceInitFunc) comparable_tests_instance_init, NULL }; - GType comparable_tests_type_id; - comparable_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "ComparableTests", &g_define_type_info, 0); - g_once_init_leave (&comparable_tests_type_id__volatile, comparable_tests_type_id); - } - return comparable_tests_type_id__volatile; -} - - - diff --git a/tests/testcomparable.vala b/tests/testcomparable.vala deleted file mode 100644 index de5c2ef..0000000 --- a/tests/testcomparable.vala +++ /dev/null @@ -1,54 +0,0 @@ -/* testcomparable.vala - * - * Copyright (C) 2009 Didier Villevalois - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Didier 'Ptitjes' Villevalois - */ - -using Gee; - -public class ComparableTests : Gee.TestCase { - - public ComparableTests () { - base ("Comparable"); - add_test ("[Comparable] selected functions", test_selected_functions); - } - - private class TestComparable : Object, Comparable { - public int _a; - - public TestComparable (int a) { - _a = a; - } - - public int compare_to (TestComparable object) { - return _a - object._a; - } - } - - public void test_selected_functions () { - TestComparable o1 = new TestComparable (10); - TestComparable o2 = new TestComparable (20); - - CompareFunc compare = Functions.get_compare_func_for (typeof (TestComparable)); - assert (compare (o1, o2) < 0); - - o1._a = 42; - assert (compare (o1, o2) > 0); - } -} diff --git a/tests/testconcurrentlist.c b/tests/testconcurrentlist.c new file mode 100644 index 0000000..9ec4537 --- /dev/null +++ b/tests/testconcurrentlist.c @@ -0,0 +1,188 @@ +/* testconcurrentlist.c generated by valac 0.18.0, the Vala compiler + * generated from testconcurrentlist.vala, do not modify */ + +/* testconcurrentlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_COLLECTION_TESTS (collection_tests_get_type ()) +#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests)) +#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass)) +#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS)) +#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS)) +#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass)) + +typedef struct _CollectionTests CollectionTests; +typedef struct _CollectionTestsClass CollectionTestsClass; +typedef struct _CollectionTestsPrivate CollectionTestsPrivate; + +#define TYPE_LIST_TESTS (list_tests_get_type ()) +#define LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIST_TESTS, ListTests)) +#define LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIST_TESTS, ListTestsClass)) +#define IS_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIST_TESTS)) +#define IS_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIST_TESTS)) +#define LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIST_TESTS, ListTestsClass)) + +typedef struct _ListTests ListTests; +typedef struct _ListTestsClass ListTestsClass; +typedef struct _ListTestsPrivate ListTestsPrivate; + +#define TYPE_CONCURRENT_LIST_TESTS (concurrent_list_tests_get_type ()) +#define CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTests)) +#define CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass)) +#define IS_CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_LIST_TESTS)) +#define IS_CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_LIST_TESTS)) +#define CONCURRENT_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass)) + +typedef struct _ConcurrentListTests ConcurrentListTests; +typedef struct _ConcurrentListTestsClass ConcurrentListTestsClass; +typedef struct _ConcurrentListTestsPrivate ConcurrentListTestsPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _CollectionTests { + GeeTestCase parent_instance; + CollectionTestsPrivate * priv; + GeeCollection* test_collection; +}; + +struct _CollectionTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _ListTests { + CollectionTests parent_instance; + ListTestsPrivate * priv; +}; + +struct _ListTestsClass { + CollectionTestsClass parent_class; + void (*test_duplicates_are_retained) (ListTests* self); +}; + +struct _ConcurrentListTests { + ListTests parent_instance; + ConcurrentListTestsPrivate * priv; +}; + +struct _ConcurrentListTestsClass { + ListTestsClass parent_class; +}; + + +static gpointer concurrent_list_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType collection_tests_get_type (void) G_GNUC_CONST; +GType list_tests_get_type (void) G_GNUC_CONST; +GType concurrent_list_tests_get_type (void) G_GNUC_CONST; +enum { + CONCURRENT_LIST_TESTS_DUMMY_PROPERTY +}; +ConcurrentListTests* concurrent_list_tests_new (void); +ConcurrentListTests* concurrent_list_tests_construct (GType object_type); +ListTests* list_tests_construct (GType object_type, const gchar* name); +static void concurrent_list_tests_real_set_up (GeeTestCase* base); +static void concurrent_list_tests_real_tear_down (GeeTestCase* base); + + +ConcurrentListTests* concurrent_list_tests_construct (GType object_type) { + ConcurrentListTests * self = NULL; + self = (ConcurrentListTests*) list_tests_construct (object_type, "ConcurrentList"); + return self; +} + + +ConcurrentListTests* concurrent_list_tests_new (void) { + return concurrent_list_tests_construct (TYPE_CONCURRENT_LIST_TESTS); +} + + +static void concurrent_list_tests_real_set_up (GeeTestCase* base) { + ConcurrentListTests * self; + GeeConcurrentList* _tmp0_; + self = (ConcurrentListTests*) base; + _tmp0_ = gee_concurrent_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; +} + + +static void concurrent_list_tests_real_tear_down (GeeTestCase* base) { + ConcurrentListTests * self; + self = (ConcurrentListTests*) base; + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = NULL; +} + + +static void concurrent_list_tests_class_init (ConcurrentListTestsClass * klass) { + concurrent_list_tests_parent_class = g_type_class_peek_parent (klass); + GEE_TEST_CASE_CLASS (klass)->set_up = concurrent_list_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = concurrent_list_tests_real_tear_down; +} + + +static void concurrent_list_tests_instance_init (ConcurrentListTests * self) { +} + + +GType concurrent_list_tests_get_type (void) { + static volatile gsize concurrent_list_tests_type_id__volatile = 0; + if (g_once_init_enter (&concurrent_list_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (ConcurrentListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) concurrent_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConcurrentListTests), 0, (GInstanceInitFunc) concurrent_list_tests_instance_init, NULL }; + GType concurrent_list_tests_type_id; + concurrent_list_tests_type_id = g_type_register_static (TYPE_LIST_TESTS, "ConcurrentListTests", &g_define_type_info, 0); + g_once_init_leave (&concurrent_list_tests_type_id__volatile, concurrent_list_tests_type_id); + } + return concurrent_list_tests_type_id__volatile; +} + + + diff --git a/tests/testconcurrentlist.vala b/tests/testconcurrentlist.vala new file mode 100644 index 0000000..3bc5039 --- /dev/null +++ b/tests/testconcurrentlist.vala @@ -0,0 +1,38 @@ +/* testconcurrentlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using Gee; + +public class ConcurrentListTests : ListTests { + public ConcurrentListTests () { + base ("ConcurrentList"); + } + + public override void set_up () { + test_collection = new Gee.ConcurrentList (); + } + + public override void tear_down () { + test_collection = null; + } +} + diff --git a/tests/testconcurrentset.c b/tests/testconcurrentset.c new file mode 100644 index 0000000..7c1a67f --- /dev/null +++ b/tests/testconcurrentset.c @@ -0,0 +1,209 @@ +/* testconcurrentset.c generated by valac 0.18.0, the Vala compiler + * generated from testconcurrentset.vala, do not modify */ + +/* testconcurrentset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_COLLECTION_TESTS (collection_tests_get_type ()) +#define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests)) +#define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass)) +#define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS)) +#define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS)) +#define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass)) + +typedef struct _CollectionTests CollectionTests; +typedef struct _CollectionTestsClass CollectionTestsClass; +typedef struct _CollectionTestsPrivate CollectionTestsPrivate; + +#define TYPE_SET_TESTS (set_tests_get_type ()) +#define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests)) +#define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass)) +#define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS)) +#define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS)) +#define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass)) + +typedef struct _SetTests SetTests; +typedef struct _SetTestsClass SetTestsClass; +typedef struct _SetTestsPrivate SetTestsPrivate; + +#define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ()) +#define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests)) +#define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) +#define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS)) +#define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS)) +#define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) + +typedef struct _SortedSetTests SortedSetTests; +typedef struct _SortedSetTestsClass SortedSetTestsClass; +typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate; + +#define TYPE_CONCURRENT_SET_TESTS (concurrent_set_tests_get_type ()) +#define CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTests)) +#define CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass)) +#define IS_CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_SET_TESTS)) +#define IS_CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_SET_TESTS)) +#define CONCURRENT_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass)) + +typedef struct _ConcurrentSetTests ConcurrentSetTests; +typedef struct _ConcurrentSetTestsClass ConcurrentSetTestsClass; +typedef struct _ConcurrentSetTestsPrivate ConcurrentSetTestsPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _CollectionTests { + GeeTestCase parent_instance; + CollectionTestsPrivate * priv; + GeeCollection* test_collection; +}; + +struct _CollectionTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _SetTests { + CollectionTests parent_instance; + SetTestsPrivate * priv; +}; + +struct _SetTestsClass { + CollectionTestsClass parent_class; + void (*test_duplicates_are_ignored) (SetTests* self); +}; + +struct _SortedSetTests { + SetTests parent_instance; + SortedSetTestsPrivate * priv; +}; + +struct _SortedSetTestsClass { + SetTestsClass parent_class; +}; + +struct _ConcurrentSetTests { + SortedSetTests parent_instance; + ConcurrentSetTestsPrivate * priv; +}; + +struct _ConcurrentSetTestsClass { + SortedSetTestsClass parent_class; +}; + + +static gpointer concurrent_set_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType collection_tests_get_type (void) G_GNUC_CONST; +GType set_tests_get_type (void) G_GNUC_CONST; +GType sorted_set_tests_get_type (void) G_GNUC_CONST; +GType concurrent_set_tests_get_type (void) G_GNUC_CONST; +enum { + CONCURRENT_SET_TESTS_DUMMY_PROPERTY +}; +ConcurrentSetTests* concurrent_set_tests_new (void); +ConcurrentSetTests* concurrent_set_tests_construct (GType object_type); +SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict); +static void concurrent_set_tests_real_set_up (GeeTestCase* base); +static void concurrent_set_tests_real_tear_down (GeeTestCase* base); + + +ConcurrentSetTests* concurrent_set_tests_construct (GType object_type) { + ConcurrentSetTests * self = NULL; + self = (ConcurrentSetTests*) sorted_set_tests_construct (object_type, "ConcurrentSet", FALSE); + return self; +} + + +ConcurrentSetTests* concurrent_set_tests_new (void) { + return concurrent_set_tests_construct (TYPE_CONCURRENT_SET_TESTS); +} + + +static void concurrent_set_tests_real_set_up (GeeTestCase* base) { + ConcurrentSetTests * self; + GeeConcurrentSet* _tmp0_; + self = (ConcurrentSetTests*) base; + _tmp0_ = gee_concurrent_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; +} + + +static void concurrent_set_tests_real_tear_down (GeeTestCase* base) { + ConcurrentSetTests * self; + self = (ConcurrentSetTests*) base; + _g_object_unref0 (((CollectionTests*) self)->test_collection); + ((CollectionTests*) self)->test_collection = NULL; +} + + +static void concurrent_set_tests_class_init (ConcurrentSetTestsClass * klass) { + concurrent_set_tests_parent_class = g_type_class_peek_parent (klass); + GEE_TEST_CASE_CLASS (klass)->set_up = concurrent_set_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = concurrent_set_tests_real_tear_down; +} + + +static void concurrent_set_tests_instance_init (ConcurrentSetTests * self) { +} + + +GType concurrent_set_tests_get_type (void) { + static volatile gsize concurrent_set_tests_type_id__volatile = 0; + if (g_once_init_enter (&concurrent_set_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (ConcurrentSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) concurrent_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConcurrentSetTests), 0, (GInstanceInitFunc) concurrent_set_tests_instance_init, NULL }; + GType concurrent_set_tests_type_id; + concurrent_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "ConcurrentSetTests", &g_define_type_info, 0); + g_once_init_leave (&concurrent_set_tests_type_id__volatile, concurrent_set_tests_type_id); + } + return concurrent_set_tests_type_id__volatile; +} + + + diff --git a/tests/testconcurrentset.vala b/tests/testconcurrentset.vala new file mode 100644 index 0000000..0b23c4e --- /dev/null +++ b/tests/testconcurrentset.vala @@ -0,0 +1,38 @@ +/* testconcurrentset.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using Gee; + +public class ConcurrentSetTests : SortedSetTests { + public ConcurrentSetTests () { + base ("ConcurrentSet", false); + } + + public override void set_up () { + test_collection = new Gee.ConcurrentSet (); + } + + public override void tear_down () { + test_collection = null; + } +} + diff --git a/tests/testdata.c b/tests/testdata.c new file mode 100644 index 0000000..acf8331 --- /dev/null +++ b/tests/testdata.c @@ -0,0 +1,1103 @@ +/* testdata.c generated by valac 0.18.0, the Vala compiler + * generated from testdata.vala, do not modify */ + +/* testcollection.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define TYPE_TEST_DATA (test_data_get_type ()) +#define TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_DATA, TestData)) +#define TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_DATA, TestDataClass)) +#define IS_TEST_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_DATA)) +#define IS_TEST_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_DATA)) +#define TEST_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_DATA, TestDataClass)) + +typedef struct _TestData TestData; +typedef struct _TestDataClass TestDataClass; +typedef struct _TestDataPrivate TestDataPrivate; +#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _ParamSpecTestData ParamSpecTestData; + +struct _TestData { + GTypeInstance parent_instance; + volatile int ref_count; + TestDataPrivate * priv; +}; + +struct _TestDataClass { + GTypeClass parent_class; + void (*finalize) (TestData *self); +}; + +struct _ParamSpecTestData { + GParamSpec parent_instance; +}; + + +static gpointer test_data_parent_class = NULL; +static gchar** test_data_ones; +static gint test_data_ones_length1; +static gchar** test_data_ones = NULL; +static gint test_data_ones_length1 = 0; +static gint _test_data_ones_size_ = 0; +static gchar** test_data_tens; +static gint test_data_tens_length1; +static gchar** test_data_tens = NULL; +static gint test_data_tens_length1 = 0; +static gint _test_data_tens_size_ = 0; +static gchar* test_data_hundred; +static gchar* test_data_hundred = NULL; +static gchar** test_data_thousands; +static gint test_data_thousands_length1; +static gchar** test_data_thousands = NULL; +static gint test_data_thousands_length1 = 0; +static gint _test_data_thousands_size_ = 0; +static guint test_data_DATA_SIZE; +static guint test_data_DATA_SIZE = 0U; +static gchar** test_data_data; +static gint test_data_data_length1; +static gchar** test_data_data = NULL; +static gint test_data_data_length1 = 0; +static gint _test_data_data_size_ = 0; +static gchar** test_data_sorted_data; +static gint test_data_sorted_data_length1; +static gchar** test_data_sorted_data = NULL; +static gint test_data_sorted_data_length1 = 0; +static gint _test_data_sorted_data_size_ = 0; +static guint* test_data_random_idx; +static gint test_data_random_idx_length1; +static guint* test_data_random_idx = NULL; +static gint test_data_random_idx_length1 = 0; +static gint _test_data_random_idx_size_ = 0; + +gpointer test_data_ref (gpointer instance); +void test_data_unref (gpointer instance); +GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_test_data (GValue* value, gpointer v_object); +void value_take_test_data (GValue* value, gpointer v_object); +gpointer value_get_test_data (const GValue* value); +GType test_data_get_type (void) G_GNUC_CONST; +enum { + TEST_DATA_DUMMY_PROPERTY +}; +static guint test_data_data_size (void); +static gchar** test_data_create_data (guint count, int* result_length1); +static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1); +static gchar** _vala_array_dup1 (gchar** self, int length); +static guint* test_data_draw_numbers (guint n, guint k, int* result_length1); +#define TEST_DATA_RND_IDX_SIZE ((guint) 8) +gchar** test_data_get_data (int* result_length1); +gchar** test_data_get_sorted_data (int* result_length1); +guint* test_data_get_drawn_numbers (int* result_length1); +static gchar* test_data_print3digit (guint n); +static gint __lambda2_ (const gchar* a, const gchar* b); +static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self); +TestData* test_data_new (void); +TestData* test_data_construct (GType object_type); +static void test_data_finalize (TestData* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +static gchar** _vala_array_dup1 (gchar** self, int length) { + gchar** result; + int i; + result = g_new0 (gchar*, length + 1); + for (i = 0; i < length; i++) { + gchar* _tmp0_; + _tmp0_ = g_strdup (self[i]); + result[i] = _tmp0_; + } + return result; +} + + +static guint test_data_data_size (void) { + guint result = 0U; + gint _tmp0_ = 0; + gboolean _tmp1_ = FALSE; + gint _tmp2_; + _tmp1_ = g_test_quick (); + if (_tmp1_) { + _tmp0_ = 128; + } else { + _tmp0_ = 1024; + } + _tmp2_ = _tmp0_; + result = (guint) _tmp2_; + return result; +} + + +gchar** test_data_get_data (int* result_length1) { + gchar** result = NULL; + GTypeClass* _tmp0_ = NULL; + GTypeClass* klass; + gchar** _tmp1_; + gint _tmp1__length1; + gchar** _tmp2_; + gint _tmp2__length1; + _tmp0_ = g_type_class_ref (TYPE_TEST_DATA); + klass = _tmp0_; + G_TYPE_FROM_CLASS (klass); + _tmp1_ = test_data_data; + _tmp1__length1 = test_data_data_length1; + _tmp2_ = _tmp1_; + _tmp2__length1 = _tmp1__length1; + if (result_length1) { + *result_length1 = _tmp2__length1; + } + result = _tmp2_; + _g_type_class_unref0 (klass); + return result; +} + + +gchar** test_data_get_sorted_data (int* result_length1) { + gchar** result = NULL; + GTypeClass* _tmp0_ = NULL; + GTypeClass* klass; + gchar** _tmp1_; + gint _tmp1__length1; + gchar** _tmp2_; + gint _tmp2__length1; + _tmp0_ = g_type_class_ref (TYPE_TEST_DATA); + klass = _tmp0_; + G_TYPE_FROM_CLASS (klass); + _tmp1_ = test_data_sorted_data; + _tmp1__length1 = test_data_sorted_data_length1; + _tmp2_ = _tmp1_; + _tmp2__length1 = _tmp1__length1; + if (result_length1) { + *result_length1 = _tmp2__length1; + } + result = _tmp2_; + _g_type_class_unref0 (klass); + return result; +} + + +guint* test_data_get_drawn_numbers (int* result_length1) { + guint* result = NULL; + GTypeClass* _tmp0_ = NULL; + GTypeClass* klass; + guint* _tmp1_; + gint _tmp1__length1; + guint* _tmp2_; + gint _tmp2__length1; + _tmp0_ = g_type_class_ref (TYPE_TEST_DATA); + klass = _tmp0_; + G_TYPE_FROM_CLASS (klass); + _tmp1_ = test_data_random_idx; + _tmp1__length1 = test_data_random_idx_length1; + _tmp2_ = _tmp1_; + _tmp2__length1 = _tmp1__length1; + if (result_length1) { + *result_length1 = _tmp2__length1; + } + result = _tmp2_; + _g_type_class_unref0 (klass); + return result; +} + + +static guint* test_data_draw_numbers (guint n, guint k, int* result_length1) { + guint* result = NULL; + guint _tmp0_; + guint* _tmp1_ = NULL; + guint* _result_; + gint _result__length1; + gint __result__size_; + guint _tmp31_; + gint _tmp32_ = 0; + guint* _tmp33_; + gint _tmp33__length1; + guint* _tmp34_; + gint _tmp34__length1; + _tmp0_ = n; + _tmp1_ = g_new0 (guint, _tmp0_); + _result_ = _tmp1_; + _result__length1 = _tmp0_; + __result__size_ = _result__length1; + { + guint i; + i = (guint) 0; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + guint _tmp5_; + guint _tmp6_; + guint* _tmp7_; + gint _tmp7__length1; + guint _tmp8_; + guint _tmp9_; + guint _tmp10_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + guint _tmp4_; + _tmp4_ = i; + i = _tmp4_ + 1; + } + _tmp2_ = FALSE; + _tmp5_ = i; + _tmp6_ = n; + if (!(_tmp5_ < _tmp6_)) { + break; + } + _tmp7_ = _result_; + _tmp7__length1 = _result__length1; + _tmp8_ = i; + _tmp9_ = i; + _tmp7_[_tmp8_] = _tmp9_; + _tmp10_ = _tmp7_[_tmp8_]; + } + } + } + { + guint _tmp11_; + guint i; + _tmp11_ = n; + i = _tmp11_ - 1; + { + gboolean _tmp12_; + _tmp12_ = TRUE; + while (TRUE) { + gboolean _tmp13_; + guint _tmp15_; + guint _tmp16_; + gint32 _tmp17_ = 0; + gint j; + guint* _tmp18_; + gint _tmp18__length1; + guint _tmp19_; + guint _tmp20_; + guint tmp; + guint* _tmp21_; + gint _tmp21__length1; + guint _tmp22_; + guint* _tmp23_; + gint _tmp23__length1; + gint _tmp24_; + guint _tmp25_; + guint _tmp26_; + guint* _tmp27_; + gint _tmp27__length1; + gint _tmp28_; + guint _tmp29_; + guint _tmp30_; + _tmp13_ = _tmp12_; + if (!_tmp13_) { + guint _tmp14_; + _tmp14_ = i; + i = _tmp14_ - 1; + } + _tmp12_ = FALSE; + _tmp15_ = i; + if (!(_tmp15_ >= ((guint) 1))) { + break; + } + _tmp16_ = i; + _tmp17_ = g_test_rand_int_range ((gint32) 0, (gint32) (_tmp16_ + 1)); + j = (gint) _tmp17_; + _tmp18_ = _result_; + _tmp18__length1 = _result__length1; + _tmp19_ = i; + _tmp20_ = _tmp18_[_tmp19_]; + tmp = _tmp20_; + _tmp21_ = _result_; + _tmp21__length1 = _result__length1; + _tmp22_ = i; + _tmp23_ = _result_; + _tmp23__length1 = _result__length1; + _tmp24_ = j; + _tmp25_ = _tmp23_[_tmp24_]; + _tmp21_[_tmp22_] = _tmp25_; + _tmp26_ = _tmp21_[_tmp22_]; + _tmp27_ = _result_; + _tmp27__length1 = _result__length1; + _tmp28_ = j; + _tmp29_ = tmp; + _tmp27_[_tmp28_] = _tmp29_; + _tmp30_ = _tmp27_[_tmp28_]; + } + } + } + _tmp31_ = k; + _tmp32_ = (gint) _tmp31_; + _result_ = g_renew (guint, _result_, (gint) _tmp31_); + (_tmp32_ > _result__length1) ? memset (_result_ + _result__length1, 0, sizeof (guint) * (_tmp32_ - _result__length1)) : NULL; + _result__length1 = _tmp32_; + __result__size_ = _tmp32_; + _tmp33_ = _result_; + _tmp33__length1 = _result__length1; + _result_ = NULL; + _tmp34_ = _tmp33_; + _tmp34__length1 = _tmp33__length1; + if (result_length1) { + *result_length1 = _tmp34__length1; + } + result = _tmp34_; + _result_ = (g_free (_result_), NULL); + return result; +} + + +static gchar* test_data_print3digit (guint n) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + guint _tmp1_; + const gchar* _tmp12_; + gchar* _tmp13_; + gchar* h; + guint _tmp14_; + gchar** _tmp15_; + gint _tmp15__length1; + guint _tmp16_; + const gchar* _tmp17_; + const gchar* t; + guint _tmp18_ = 0U; + guint _tmp19_; + gchar** _tmp20_; + gint _tmp20__length1; + guint _tmp23_; + gchar** _tmp24_; + gint _tmp24__length1; + guint _tmp25_; + const gchar* _tmp26_; + const gchar* o; + const gchar* _tmp27_ = NULL; + const gchar* _tmp28_; + const gchar* _tmp30_ = NULL; + gboolean _tmp31_ = FALSE; + const gchar* _tmp32_; + gboolean _tmp37_; + const gchar* _tmp38_ = NULL; + const gchar* _tmp39_; + const gchar* _tmp41_ = NULL; + gboolean _tmp42_ = FALSE; + const gchar* _tmp43_; + gboolean _tmp45_; + const gchar* _tmp46_ = NULL; + const gchar* _tmp47_; + const gchar* _tmp49_; + const gchar* _tmp50_; + const gchar* _tmp51_; + const gchar* _tmp52_; + const gchar* _tmp53_; + gchar* _tmp54_ = NULL; + _tmp1_ = n; + if (_tmp1_ >= ((guint) 200)) { + gchar** _tmp2_; + gint _tmp2__length1; + guint _tmp3_; + const gchar* _tmp4_; + const gchar* _tmp5_; + gchar* _tmp6_ = NULL; + _tmp2_ = test_data_ones; + _tmp2__length1 = test_data_ones_length1; + _tmp3_ = n; + _tmp4_ = _tmp2_[_tmp3_ / 100]; + _tmp5_ = test_data_hundred; + _tmp6_ = g_strdup_printf ("%s %s", _tmp4_, _tmp5_); + _g_free0 (_tmp0_); + _tmp0_ = _tmp6_; + } else { + const gchar* _tmp7_ = NULL; + guint _tmp8_; + const gchar* _tmp10_; + gchar* _tmp11_; + _tmp8_ = n; + if (_tmp8_ >= ((guint) 100)) { + const gchar* _tmp9_; + _tmp9_ = test_data_hundred; + _tmp7_ = _tmp9_; + } else { + _tmp7_ = NULL; + } + _tmp10_ = _tmp7_; + _tmp11_ = g_strdup (_tmp10_); + _g_free0 (_tmp0_); + _tmp0_ = _tmp11_; + } + _tmp12_ = _tmp0_; + _tmp13_ = g_strdup (_tmp12_); + h = _tmp13_; + _tmp14_ = n; + n = _tmp14_ % 100; + _tmp15_ = test_data_tens; + _tmp15__length1 = test_data_tens_length1; + _tmp16_ = n; + _tmp17_ = _tmp15_[_tmp16_ / 10]; + t = _tmp17_; + _tmp19_ = n; + _tmp20_ = test_data_ones; + _tmp20__length1 = test_data_ones_length1; + if (_tmp19_ >= ((guint) _tmp20__length1)) { + guint _tmp21_; + _tmp21_ = n; + _tmp18_ = _tmp21_ % 10; + } else { + guint _tmp22_; + _tmp22_ = n; + _tmp18_ = _tmp22_; + } + _tmp23_ = _tmp18_; + n = _tmp23_; + _tmp24_ = test_data_ones; + _tmp24__length1 = test_data_ones_length1; + _tmp25_ = n; + _tmp26_ = _tmp24_[_tmp25_]; + o = _tmp26_; + _tmp28_ = h; + if (_tmp28_ != NULL) { + const gchar* _tmp29_; + _tmp29_ = h; + _tmp27_ = _tmp29_; + } else { + _tmp27_ = ""; + } + _tmp32_ = h; + if (_tmp32_ != NULL) { + gboolean _tmp33_ = FALSE; + const gchar* _tmp34_; + gboolean _tmp36_; + _tmp34_ = t; + if (_tmp34_ != NULL) { + _tmp33_ = TRUE; + } else { + const gchar* _tmp35_; + _tmp35_ = o; + _tmp33_ = _tmp35_ != NULL; + } + _tmp36_ = _tmp33_; + _tmp31_ = _tmp36_; + } else { + _tmp31_ = FALSE; + } + _tmp37_ = _tmp31_; + if (_tmp37_) { + _tmp30_ = " "; + } else { + _tmp30_ = ""; + } + _tmp39_ = t; + if (_tmp39_ != NULL) { + const gchar* _tmp40_; + _tmp40_ = t; + _tmp38_ = _tmp40_; + } else { + _tmp38_ = ""; + } + _tmp43_ = t; + if (_tmp43_ != NULL) { + const gchar* _tmp44_; + _tmp44_ = o; + _tmp42_ = _tmp44_ != NULL; + } else { + _tmp42_ = FALSE; + } + _tmp45_ = _tmp42_; + if (_tmp45_) { + _tmp41_ = "-"; + } else { + _tmp41_ = ""; + } + _tmp47_ = o; + if (_tmp47_ != NULL) { + const gchar* _tmp48_; + _tmp48_ = o; + _tmp46_ = _tmp48_; + } else { + _tmp46_ = ""; + } + _tmp49_ = _tmp27_; + _tmp50_ = _tmp30_; + _tmp51_ = _tmp38_; + _tmp52_ = _tmp41_; + _tmp53_ = _tmp46_; + _tmp54_ = g_strdup_printf ("%s%s%s%s%s", _tmp49_, _tmp50_, _tmp51_, _tmp52_, _tmp53_); + result = _tmp54_; + _g_free0 (h); + _g_free0 (_tmp0_); + return result; +} + + +static gchar** test_data_create_data (guint count, int* result_length1) { + gchar** result = NULL; + guint _tmp0_; + gchar** _tmp1_ = NULL; + gchar** numbers; + gint numbers_length1; + gint _numbers_size_; + gchar** _tmp40_; + gint _tmp40__length1; + gchar** _tmp41_; + gint _tmp41__length1; + _tmp0_ = count; + _tmp1_ = g_new0 (gchar*, _tmp0_ + 1); + numbers = _tmp1_; + numbers_length1 = _tmp0_; + _numbers_size_ = numbers_length1; + { + guint idx; + idx = (guint) 0; + { + gboolean _tmp2_; + _tmp2_ = TRUE; + while (TRUE) { + gboolean _tmp3_; + guint _tmp5_; + guint _tmp6_; + guint _tmp7_; + guint n; + gchar* num; + guint th; + const gchar* _tmp34_; + gchar** _tmp36_; + gint _tmp36__length1; + guint _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + guint _tmp4_; + _tmp4_ = idx; + idx = _tmp4_ + 1; + } + _tmp2_ = FALSE; + _tmp5_ = idx; + _tmp6_ = count; + if (!(_tmp5_ < _tmp6_)) { + break; + } + _tmp7_ = idx; + n = _tmp7_ + 1; + num = NULL; + th = (guint) 0; + while (TRUE) { + guint _tmp8_; + guint _tmp9_; + guint _tmp32_; + guint _tmp33_; + _tmp8_ = n; + if (!(_tmp8_ != ((guint) 0))) { + break; + } + _tmp9_ = n; + if ((_tmp9_ % 1000) != ((guint) 0)) { + gchar** _tmp10_; + gint _tmp10__length1; + guint _tmp11_; + const gchar* _tmp12_; + gchar* _tmp13_; + gchar* t; + guint _tmp14_; + gchar* _tmp15_ = NULL; + gchar* c; + const gchar* _tmp16_ = NULL; + const gchar* _tmp17_; + const gchar* _tmp18_ = NULL; + const gchar* _tmp19_; + const gchar* _tmp21_ = NULL; + const gchar* _tmp22_; + const gchar* _tmp23_ = NULL; + const gchar* _tmp24_; + const gchar* _tmp26_; + const gchar* _tmp27_; + const gchar* _tmp28_; + const gchar* _tmp29_; + const gchar* _tmp30_; + gchar* _tmp31_ = NULL; + _tmp10_ = test_data_thousands; + _tmp10__length1 = test_data_thousands_length1; + _tmp11_ = th; + _tmp12_ = _tmp10_[_tmp11_]; + _tmp13_ = g_strdup (_tmp12_); + t = _tmp13_; + _tmp14_ = n; + _tmp15_ = test_data_print3digit (_tmp14_ % 1000); + c = _tmp15_; + _tmp17_ = t; + if (_tmp17_ != NULL) { + _tmp16_ = " "; + } else { + _tmp16_ = ""; + } + _tmp19_ = t; + if (_tmp19_ != NULL) { + const gchar* _tmp20_; + _tmp20_ = t; + _tmp18_ = _tmp20_; + } else { + _tmp18_ = ""; + } + _tmp22_ = num; + if (_tmp22_ != NULL) { + _tmp21_ = " "; + } else { + _tmp21_ = ""; + } + _tmp24_ = num; + if (_tmp24_ != NULL) { + const gchar* _tmp25_; + _tmp25_ = num; + _tmp23_ = _tmp25_; + } else { + _tmp23_ = ""; + } + _tmp26_ = c; + _tmp27_ = _tmp16_; + _tmp28_ = _tmp18_; + _tmp29_ = _tmp21_; + _tmp30_ = _tmp23_; + _tmp31_ = g_strdup_printf ("%s%s%s%s%s", _tmp26_, _tmp27_, _tmp28_, _tmp29_, _tmp30_); + _g_free0 (num); + num = _tmp31_; + _g_free0 (c); + _g_free0 (t); + } + _tmp32_ = n; + n = _tmp32_ / 1000; + _tmp33_ = th; + th = _tmp33_ + 1; + } + _tmp34_ = num; + if (_tmp34_ == NULL) { + gchar* _tmp35_; + _tmp35_ = g_strdup ("zero"); + _g_free0 (num); + num = _tmp35_; + } + _tmp36_ = numbers; + _tmp36__length1 = numbers_length1; + _tmp37_ = idx; + _tmp38_ = num; + num = NULL; + _g_free0 (_tmp36_[_tmp37_]); + _tmp36_[_tmp37_] = _tmp38_; + _tmp39_ = _tmp36_[_tmp37_]; + _g_free0 (num); + } + } + } + _tmp40_ = numbers; + _tmp40__length1 = numbers_length1; + numbers = NULL; + _tmp41_ = _tmp40_; + _tmp41__length1 = _tmp40__length1; + if (result_length1) { + *result_length1 = _tmp41__length1; + } + result = _tmp41_; + numbers = (_vala_array_free (numbers, numbers_length1, (GDestroyNotify) g_free), NULL); + return result; +} + + +static gint __lambda2_ (const gchar* a, const gchar* b) { + gint result = 0; + GCompareFunc _tmp0_; + const gchar* _tmp1_; + const gchar* _tmp2_; + gint _tmp3_ = 0; + g_return_val_if_fail (a != NULL, 0); + g_return_val_if_fail (b != NULL, 0); + _tmp0_ = g_strcmp0; + _tmp1_ = a; + _tmp2_ = b; + _tmp3_ = _tmp0_ (*((const gchar**) _tmp1_), *((const gchar**) _tmp2_)); + result = _tmp3_; + return result; +} + + +static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) { + gint result; + result = __lambda2_ (a, b); + return result; +} + + +static gchar** test_data_sort_array (gchar** array, int array_length1, int* result_length1) { + gchar** result = NULL; + gchar** _tmp0_; + gint _tmp0__length1; + gchar** _tmp1_; + gint _tmp1__length1; + gchar** _tmp2_; + gint _tmp2__length1; + _tmp0_ = array; + _tmp0__length1 = array_length1; + g_qsort_with_data (_tmp0_, _tmp0__length1, (gsize) sizeof (gchar*), (GCompareDataFunc) ___lambda2__gcompare_data_func, NULL); + _tmp1_ = array; + _tmp1__length1 = array_length1; + array = NULL; + _tmp2_ = _tmp1_; + _tmp2__length1 = _tmp1__length1; + if (result_length1) { + *result_length1 = _tmp2__length1; + } + result = _tmp2_; + array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL); + return result; +} + + +TestData* test_data_construct (GType object_type) { + TestData* self = NULL; + self = (TestData*) g_type_create_instance (object_type); + return self; +} + + +TestData* test_data_new (void) { + return test_data_construct (TYPE_TEST_DATA); +} + + +static void value_test_data_init (GValue* value) { + value->data[0].v_pointer = NULL; +} + + +static void value_test_data_free_value (GValue* value) { + if (value->data[0].v_pointer) { + test_data_unref (value->data[0].v_pointer); + } +} + + +static void value_test_data_copy_value (const GValue* src_value, GValue* dest_value) { + if (src_value->data[0].v_pointer) { + dest_value->data[0].v_pointer = test_data_ref (src_value->data[0].v_pointer); + } else { + dest_value->data[0].v_pointer = NULL; + } +} + + +static gpointer value_test_data_peek_pointer (const GValue* value) { + return value->data[0].v_pointer; +} + + +static gchar* value_test_data_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + if (collect_values[0].v_pointer) { + TestData* object; + object = collect_values[0].v_pointer; + if (object->parent_instance.g_class == NULL) { + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); + } + value->data[0].v_pointer = test_data_ref (object); + } else { + value->data[0].v_pointer = NULL; + } + return NULL; +} + + +static gchar* value_test_data_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + TestData** object_p; + object_p = collect_values[0].v_pointer; + if (!object_p) { + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); + } + if (!value->data[0].v_pointer) { + *object_p = NULL; + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { + *object_p = value->data[0].v_pointer; + } else { + *object_p = test_data_ref (value->data[0].v_pointer); + } + return NULL; +} + + +GParamSpec* param_spec_test_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + ParamSpecTestData* spec; + g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST_DATA), NULL); + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); + G_PARAM_SPEC (spec)->value_type = object_type; + return G_PARAM_SPEC (spec); +} + + +gpointer value_get_test_data (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA), NULL); + return value->data[0].v_pointer; +} + + +void value_set_test_data (GValue* value, gpointer v_object) { + TestData* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + test_data_ref (value->data[0].v_pointer); + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + test_data_unref (old); + } +} + + +void value_take_test_data (GValue* value, gpointer v_object) { + TestData* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_DATA)); + old = value->data[0].v_pointer; + if (v_object) { + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_DATA)); + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); + value->data[0].v_pointer = v_object; + } else { + value->data[0].v_pointer = NULL; + } + if (old) { + test_data_unref (old); + } +} + + +static void test_data_class_init (TestDataClass * klass) { + gchar* _tmp0_; + gchar* _tmp1_; + gchar* _tmp2_; + gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; + gchar* _tmp16_; + gchar* _tmp17_; + gchar* _tmp18_; + gchar** _tmp19_ = NULL; + gchar* _tmp20_; + gchar* _tmp21_; + gchar* _tmp22_; + gchar* _tmp23_; + gchar* _tmp24_; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; + gchar** _tmp28_ = NULL; + gchar* _tmp29_; + gchar* _tmp30_; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; + gchar** _tmp34_ = NULL; + guint _tmp35_ = 0U; + guint _tmp36_; + gint _tmp37_ = 0; + gchar** _tmp38_ = NULL; + gchar** _tmp39_; + gint _tmp39__length1; + gchar** _tmp40_; + gint _tmp40__length1; + gint _tmp41_ = 0; + gchar** _tmp42_ = NULL; + guint _tmp43_; + gint _tmp44_ = 0; + guint* _tmp45_ = NULL; + test_data_parent_class = g_type_class_peek_parent (klass); + TEST_DATA_CLASS (klass)->finalize = test_data_finalize; + _tmp0_ = g_strdup ("one"); + _tmp1_ = g_strdup ("two"); + _tmp2_ = g_strdup ("three"); + _tmp3_ = g_strdup ("four"); + _tmp4_ = g_strdup ("five"); + _tmp5_ = g_strdup ("six"); + _tmp6_ = g_strdup ("seven"); + _tmp7_ = g_strdup ("eight"); + _tmp8_ = g_strdup ("nine"); + _tmp9_ = g_strdup ("ten"); + _tmp10_ = g_strdup ("eleven"); + _tmp11_ = g_strdup ("twelve"); + _tmp12_ = g_strdup ("thirteen"); + _tmp13_ = g_strdup ("fourteen"); + _tmp14_ = g_strdup ("fifteen"); + _tmp15_ = g_strdup ("sixteen"); + _tmp16_ = g_strdup ("seventeen"); + _tmp17_ = g_strdup ("eighteen"); + _tmp18_ = g_strdup ("nineteen"); + _tmp19_ = g_new0 (gchar*, 20 + 1); + _tmp19_[0] = NULL; + _tmp19_[1] = _tmp0_; + _tmp19_[2] = _tmp1_; + _tmp19_[3] = _tmp2_; + _tmp19_[4] = _tmp3_; + _tmp19_[5] = _tmp4_; + _tmp19_[6] = _tmp5_; + _tmp19_[7] = _tmp6_; + _tmp19_[8] = _tmp7_; + _tmp19_[9] = _tmp8_; + _tmp19_[10] = _tmp9_; + _tmp19_[11] = _tmp10_; + _tmp19_[12] = _tmp11_; + _tmp19_[13] = _tmp12_; + _tmp19_[14] = _tmp13_; + _tmp19_[15] = _tmp14_; + _tmp19_[16] = _tmp15_; + _tmp19_[17] = _tmp16_; + _tmp19_[18] = _tmp17_; + _tmp19_[19] = _tmp18_; + test_data_ones = _tmp19_; + test_data_ones_length1 = 20; + _tmp20_ = g_strdup ("twenty"); + _tmp21_ = g_strdup ("thirty"); + _tmp22_ = g_strdup ("forty"); + _tmp23_ = g_strdup ("fifty"); + _tmp24_ = g_strdup ("sixty"); + _tmp25_ = g_strdup ("seventy"); + _tmp26_ = g_strdup ("eighty"); + _tmp27_ = g_strdup ("ninety"); + _tmp28_ = g_new0 (gchar*, 10 + 1); + _tmp28_[0] = NULL; + _tmp28_[1] = NULL; + _tmp28_[2] = _tmp20_; + _tmp28_[3] = _tmp21_; + _tmp28_[4] = _tmp22_; + _tmp28_[5] = _tmp23_; + _tmp28_[6] = _tmp24_; + _tmp28_[7] = _tmp25_; + _tmp28_[8] = _tmp26_; + _tmp28_[9] = _tmp27_; + test_data_tens = _tmp28_; + test_data_tens_length1 = 10; + _tmp29_ = g_strdup ("hundred"); + test_data_hundred = _tmp29_; + _tmp30_ = g_strdup ("thousand"); + _tmp31_ = g_strdup ("million"); + _tmp32_ = g_strdup ("billion"); + _tmp33_ = g_strdup ("trillion"); + _tmp34_ = g_new0 (gchar*, 5 + 1); + _tmp34_[0] = NULL; + _tmp34_[1] = _tmp30_; + _tmp34_[2] = _tmp31_; + _tmp34_[3] = _tmp32_; + _tmp34_[4] = _tmp33_; + test_data_thousands = _tmp34_; + test_data_thousands_length1 = 5; + _tmp35_ = test_data_data_size (); + test_data_DATA_SIZE = _tmp35_; + _tmp36_ = test_data_DATA_SIZE; + _tmp38_ = test_data_create_data (_tmp36_, &_tmp37_); + test_data_data = _tmp38_; + _tmp39_ = test_data_data; + _tmp39__length1 = test_data_data_length1; + _tmp40_ = (_tmp39_ != NULL) ? _vala_array_dup1 (_tmp39_, _tmp39__length1) : ((gpointer) _tmp39_); + _tmp40__length1 = _tmp39__length1; + _tmp42_ = test_data_sort_array (_tmp40_, _tmp40__length1, &_tmp41_); + test_data_sorted_data = _tmp42_; + _tmp43_ = test_data_DATA_SIZE; + _tmp45_ = test_data_draw_numbers (_tmp43_, TEST_DATA_RND_IDX_SIZE, &_tmp44_); + test_data_random_idx = _tmp45_; +} + + +static void test_data_instance_init (TestData * self) { + self->ref_count = 1; +} + + +static void test_data_finalize (TestData* obj) { + TestData * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST_DATA, TestData); +} + + +GType test_data_get_type (void) { + static volatile gsize test_data_type_id__volatile = 0; + if (g_once_init_enter (&test_data_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { value_test_data_init, value_test_data_free_value, value_test_data_copy_value, value_test_data_peek_pointer, "p", value_test_data_collect_value, "p", value_test_data_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (TestDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestData), 0, (GInstanceInitFunc) test_data_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType test_data_type_id; + test_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TestData", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&test_data_type_id__volatile, test_data_type_id); + } + return test_data_type_id__volatile; +} + + +gpointer test_data_ref (gpointer instance) { + TestData* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +void test_data_unref (gpointer instance) { + TestData* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + TEST_DATA_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/tests/testdata.vala b/tests/testdata.vala new file mode 100644 index 0000000..5f00c97 --- /dev/null +++ b/tests/testdata.vala @@ -0,0 +1,111 @@ +/* testcollection.vala + * + * Copyright (C) 2012 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ +public class TestData { + private static string?[] ones = {null, "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"}; + private static string[] tens = {null, null, "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}; + private static string hundred = "hundred"; + private static string?[] thousands = {null, "thousand", "million", "billion", "trillion"}; + + private static uint data_size () { + return Test.quick() ? 128 : 1024; + } + + private static uint DATA_SIZE = data_size (); + private static const uint RND_IDX_SIZE = 8; + + private static string[] data = create_data (DATA_SIZE); + private static string[] sorted_data = sort_array (data); + private static uint[] random_idx = draw_numbers(DATA_SIZE, RND_IDX_SIZE); + + public static unowned string[] get_data () { + TypeClass klass = typeof (TestData).class_ref (); + klass.get_type (); + return data; + } + + public static unowned string[] get_sorted_data () { + TypeClass klass = typeof (TestData).class_ref (); + klass.get_type (); + return sorted_data; + } + + public static unowned uint[] get_drawn_numbers () { + TypeClass klass = typeof (TestData).class_ref (); + klass.get_type (); + return random_idx; + } + + private static uint[] draw_numbers (uint n, uint k) { + uint[] result = new uint[n]; + // Initialize array + for (uint i = 0; i < n; i++) { + result[i] = i; + } + // Fisher-Yates shuffle algorithm. Possibly not the most efficient implementation but oh well + for (uint i = n - 1; i >= 1; i--) { + int j = Test.rand_int_range (0, (int32)(i + 1)); + uint tmp = result[i]; + result[i] = result[j]; + result[j] = tmp; + } + result.resize ((int)k); + return (owned)result; + } + + private static string print3digit (uint n) { + string? h = (n >= 200) ? "%s %s".printf(ones[n / 100], hundred) : ((n >= 100) ? hundred : null); + n = n % 100; + unowned string? t = tens[n / 10]; + n = (n >= ones.length) ? n % 10 : n; + unowned string? o = ones[n]; + return "%s%s%s%s%s".printf(h != null ? h : "", h != null && (t != null || o != null) ? " " : "", t != null ? t : "", t != null && o != null ? "-" : "", o != null ? o : ""); + } + + private static string[] create_data (uint count) { + string[] numbers = new string[count]; + for (uint idx = 0; idx < count; idx++) { + uint n = idx + 1; + string? num = null; + uint th = 0; + while (n != 0) { + if (n % 1000 != 0) { + string? t = thousands[th]; + string c = print3digit (n % 1000); + num = "%s%s%s%s%s".printf(c, t != null ? " " : "", t != null ? t : "", num != null ? " " : "", num != null ? num : ""); + } + n /= 1000; + th++; + } + if (num == null) { + num = "zero"; + } + numbers[idx] = (owned)num; + } + return (owned)numbers; + } + + private static string[] sort_array (owned string[] array) { + qsort_with_data (array, sizeof(string), (a, b) => {return strcmp(*(string **)a, *(string **)b);}); + return (owned)array; + } +} + diff --git a/tests/testdeque.c b/tests/testdeque.c index 4af05df..8cea5a5 100644 --- a/tests/testdeque.c +++ b/tests/testdeque.c @@ -129,13 +129,15 @@ enum { }; DequeTests* deque_tests_construct (GType object_type, const gchar* name); QueueTests* queue_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void deque_tests_test_queue_use (DequeTests* self); static void _deque_tests_test_queue_use_gee_test_case_test_method (gpointer self); void deque_tests_test_stack_use (DequeTests* self); static void _deque_tests_test_stack_use_gee_test_case_test_method (gpointer self); void deque_tests_test_reversed_stack_use (DequeTests* self); static void _deque_tests_test_reversed_stack_use_gee_test_case_test_method (gpointer self); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _deque_tests_test_queue_use_gee_test_case_test_method (gpointer self) { @@ -159,9 +161,9 @@ DequeTests* deque_tests_construct (GType object_type, const gchar* name) { g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (DequeTests*) queue_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] queue use", _deque_tests_test_queue_use_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] stack use", _deque_tests_test_stack_use_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] reversed stack use", _deque_tests_test_reversed_stack_use_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] queue use", _deque_tests_test_queue_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] stack use", _deque_tests_test_stack_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] reversed stack use", _deque_tests_test_reversed_stack_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -177,221 +179,493 @@ void deque_tests_test_queue_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + GeeDeque* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; + gchar* _tmp41_; gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar** _tmp43_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp80_; + gpointer _tmp81_ = NULL; + gchar* _tmp82_; + GeeDeque* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeArrayList* _tmp86_; + GeeDeque* _tmp97_; + gint _tmp98_; + gint _tmp99_; + gchar** _tmp100_; + gint _tmp100__length1; + GeeDeque* _tmp101_; + GeeArrayList* _tmp102_; + gint _tmp103_ = 0; + GeeDeque* _tmp104_; + gint _tmp105_; + gint _tmp106_; + gchar** _tmp107_; + gint _tmp107__length1; + GeeArrayList* _tmp108_; + gint _tmp109_; + gint _tmp110_; + GeeArrayList* _tmp111_; + gpointer _tmp112_ = NULL; + gchar* _tmp113_; + gchar** _tmp114_; + gint _tmp114__length1; + const gchar* _tmp115_; + GeeDeque* _tmp116_; + GeeArrayList* _tmp117_; + gint _tmp118_ = 0; + gchar** _tmp119_; + gint _tmp119__length1; + GeeDeque* _tmp120_; + gint _tmp121_; + gint _tmp122_; + GeeArrayList* _tmp123_; + gint _tmp124_; + gint _tmp125_; + gchar** _tmp126_; + gint _tmp126__length1; + GeeArrayList* _tmp139_; + GeeDeque* _tmp140_; + GeeArrayList* _tmp141_; + gint _tmp142_ = 0; + GeeDeque* _tmp143_; + gint _tmp144_; + gint _tmp145_; + GeeArrayList* _tmp146_; + gint _tmp147_; + gint _tmp148_; + GeeArrayList* _tmp149_; + GeeDeque* _tmp150_; + GeeArrayList* _tmp151_; + gint _tmp152_ = 0; + GeeDeque* _tmp153_; + gint _tmp154_; + gint _tmp155_; + GeeArrayList* _tmp156_; + gint _tmp157_; + gint _tmp158_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_tail (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_tail (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_tail (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_tail (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_head (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "one") == 0, "test_deque.peek_head () == \"one\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_head (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "one") == 0, "test_deque.poll_head () == \"one\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_head (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "two") == 0, "test_deque.peek_head () == \"two\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_head (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "two") == 0, "test_deque.poll_head () == \"two\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_head (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "three") == 0, "test_deque.peek_head () == \"three\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_head (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "three") == 0, "test_deque.poll_head () == \"three\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_head (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "four") == 0, "test_deque.peek_head () == \"four\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_head (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "four") == 0, "test_deque.poll_head () == \"four\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_head (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_head () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_head (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_head () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_tail (\"one\")"); - _tmp44_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_tail (\"two\")"); - _tmp45_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_tail (\"three\")"); - _tmp46_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_tail (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_head (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "one") == 0, "recipient.get (0) == \"one\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_head (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "two") == 0, "recipient.get (1) == \"two\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "three") == 0, "recipient.get (2) == \"three\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "four") == 0, "recipient.get (3) == \"four\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_head (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_head (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = test_deque; + _vala_assert (_tmp3_ != NULL, "test_deque != null"); + _tmp4_ = g_strdup ("one"); + _tmp5_ = g_strdup ("two"); + _tmp6_ = g_strdup ("three"); + _tmp7_ = g_strdup ("four"); + _tmp8_ = g_strdup ("five"); + _tmp9_ = g_strdup ("six"); + _tmp10_ = g_strdup ("seven"); + _tmp11_ = g_strdup ("\neight"); + _tmp12_ = g_strdup ("nine"); + _tmp13_ = g_strdup ("ten"); + _tmp14_ = g_strdup ("eleven"); + _tmp15_ = g_strdup ("twelve"); + _tmp16_ = g_strdup ("thirteen"); + _tmp17_ = g_strdup ("fourteen\n"); + _tmp18_ = g_strdup ("fifteen"); + _tmp19_ = g_strdup ("sixteen"); + _tmp20_ = g_strdup ("seventeen"); + _tmp21_ = g_strdup ("eighteen"); + _tmp22_ = g_strdup ("nineteen\n"); + _tmp23_ = g_strdup ("twenty"); + _tmp24_ = g_strdup ("twenty one"); + _tmp25_ = g_strdup ("twenty two"); + _tmp26_ = g_strdup ("twenty three"); + _tmp27_ = g_strdup ("twenty four"); + _tmp28_ = g_strdup ("twenty five"); + _tmp29_ = g_strdup ("twenty six"); + _tmp30_ = g_strdup ("twenty seven"); + _tmp31_ = g_strdup ("twenty eight"); + _tmp32_ = g_strdup ("twenty nine"); + _tmp33_ = g_strdup ("thirty"); + _tmp34_ = g_strdup ("thirty one"); + _tmp35_ = g_strdup ("thirty two"); + _tmp36_ = g_strdup ("thirty four"); + _tmp37_ = g_strdup ("thirty five"); + _tmp38_ = g_strdup ("thirty six"); + _tmp39_ = g_strdup ("thirty seven"); + _tmp40_ = g_strdup ("thirty eight"); + _tmp41_ = g_strdup ("thirty nine"); + _tmp42_ = g_strdup ("fourty"); + _tmp43_ = g_new0 (gchar*, 39 + 1); + _tmp43_[0] = _tmp4_; + _tmp43_[1] = _tmp5_; + _tmp43_[2] = _tmp6_; + _tmp43_[3] = _tmp7_; + _tmp43_[4] = _tmp8_; + _tmp43_[5] = _tmp9_; + _tmp43_[6] = _tmp10_; + _tmp43_[7] = _tmp11_; + _tmp43_[8] = _tmp12_; + _tmp43_[9] = _tmp13_; + _tmp43_[10] = _tmp14_; + _tmp43_[11] = _tmp15_; + _tmp43_[12] = _tmp16_; + _tmp43_[13] = _tmp17_; + _tmp43_[14] = _tmp18_; + _tmp43_[15] = _tmp19_; + _tmp43_[16] = _tmp20_; + _tmp43_[17] = _tmp21_; + _tmp43_[18] = _tmp22_; + _tmp43_[19] = _tmp23_; + _tmp43_[20] = _tmp24_; + _tmp43_[21] = _tmp25_; + _tmp43_[22] = _tmp26_; + _tmp43_[23] = _tmp27_; + _tmp43_[24] = _tmp28_; + _tmp43_[25] = _tmp29_; + _tmp43_[26] = _tmp30_; + _tmp43_[27] = _tmp31_; + _tmp43_[28] = _tmp32_; + _tmp43_[29] = _tmp33_; + _tmp43_[30] = _tmp34_; + _tmp43_[31] = _tmp35_; + _tmp43_[32] = _tmp36_; + _tmp43_[33] = _tmp37_; + _tmp43_[34] = _tmp38_; + _tmp43_[35] = _tmp39_; + _tmp43_[36] = _tmp40_; + _tmp43_[37] = _tmp41_; + _tmp43_[38] = _tmp42_; + to_offer = _tmp43_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_tail (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_tail (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp58_; + _tmp58_ = TRUE; + while (TRUE) { + gboolean _tmp59_; + gint _tmp61_; + gchar** _tmp62_; + gint _tmp62__length1; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gint _tmp67_; + const gchar* _tmp68_; + GeeDeque* _tmp69_; + gpointer _tmp70_ = NULL; + gchar* _tmp71_; + gchar** _tmp72_; + gint _tmp72__length1; + gint _tmp73_; + const gchar* _tmp74_; + GeeDeque* _tmp75_; + gint _tmp76_; + gint _tmp77_; + gchar** _tmp78_; + gint _tmp78__length1; + gint _tmp79_; + _tmp59_ = _tmp58_; + if (!_tmp59_) { + gint _tmp60_; + _tmp60_ = i; + i = _tmp60_ + 1; + } + _tmp58_ = FALSE; + _tmp61_ = i; + _tmp62_ = to_offer; + _tmp62__length1 = to_offer_length1; + if (!(_tmp61_ < _tmp62__length1)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_head (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = i; + _tmp68_ = _tmp66_[_tmp67_]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp68_) == 0, "test_deque.peek_head () == to_offer[i]"); + _g_free0 (_tmp65_); + _tmp69_ = test_deque; + _tmp70_ = gee_deque_poll_head (_tmp69_); + _tmp71_ = (gchar*) _tmp70_; + _tmp72_ = to_offer; + _tmp72__length1 = to_offer_length1; + _tmp73_ = i; + _tmp74_ = _tmp72_[_tmp73_]; + _vala_assert (g_strcmp0 (_tmp71_, _tmp74_) == 0, "test_deque.poll_head () == to_offer[i]"); + _g_free0 (_tmp71_); + _tmp75_ = test_deque; + _tmp76_ = gee_collection_get_size ((GeeCollection*) _tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = to_offer; + _tmp78__length1 = to_offer_length1; + _tmp79_ = i; + _vala_assert (_tmp77_ == ((_tmp78__length1 - _tmp79_) - 1), "test_deque.size == to_offer.length - i - 1"); + } + } + } + _tmp80_ = test_deque; + _tmp81_ = gee_deque_peek_head (_tmp80_); + _tmp82_ = (gchar*) _tmp81_; + _vala_assert (_tmp82_ == NULL, "test_deque.peek_head () == null"); + _g_free0 (_tmp82_); + _tmp83_ = test_deque; + _tmp84_ = gee_deque_poll_head (_tmp83_); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (_tmp85_ == NULL, "test_deque.poll_head () == null"); + _g_free0 (_tmp85_); + _tmp86_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp86_); + { + gint i; + i = 0; + { + gboolean _tmp87_; + _tmp87_ = TRUE; + while (TRUE) { + gboolean _tmp88_; + gint _tmp90_; + gchar** _tmp91_; + gint _tmp91__length1; + GeeDeque* _tmp92_; + gchar** _tmp93_; + gint _tmp93__length1; + gint _tmp94_; + const gchar* _tmp95_; + gboolean _tmp96_ = FALSE; + _tmp88_ = _tmp87_; + if (!_tmp88_) { + gint _tmp89_; + _tmp89_ = i; + i = _tmp89_ + 1; + } + _tmp87_ = FALSE; + _tmp90_ = i; + _tmp91_ = to_offer; + _tmp91__length1 = to_offer_length1; + if (!(_tmp90_ < _tmp91__length1)) { + break; + } + _tmp92_ = test_deque; + _tmp93_ = to_offer; + _tmp93__length1 = to_offer_length1; + _tmp94_ = i; + _tmp95_ = _tmp93_[_tmp94_]; + _tmp96_ = gee_deque_offer_tail (_tmp92_, _tmp95_); + _vala_assert (_tmp96_, "test_deque.offer_tail (to_offer[i])"); + } + } + } + _tmp97_ = test_deque; + _tmp98_ = gee_collection_get_size ((GeeCollection*) _tmp97_); + _tmp99_ = _tmp98_; + _tmp100_ = to_offer; + _tmp100__length1 = to_offer_length1; + _vala_assert (_tmp99_ == _tmp100__length1, "test_deque.size == to_offer.length"); + _tmp101_ = test_deque; + _tmp102_ = recipient; + _tmp103_ = gee_deque_drain_head (_tmp101_, (GeeCollection*) _tmp102_, 1); + _vala_assert (_tmp103_ == 1, "test_deque.drain_head (recipient, 1) == 1"); + _tmp104_ = test_deque; + _tmp105_ = gee_collection_get_size ((GeeCollection*) _tmp104_); + _tmp106_ = _tmp105_; + _tmp107_ = to_offer; + _tmp107__length1 = to_offer_length1; + _vala_assert (_tmp106_ == (_tmp107__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp108_ = recipient; + _tmp109_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp108_); + _tmp110_ = _tmp109_; + _vala_assert (_tmp110_ == 1, "recipient.size == 1"); + _tmp111_ = recipient; + _tmp112_ = gee_abstract_list_get ((GeeAbstractList*) _tmp111_, 0); + _tmp113_ = (gchar*) _tmp112_; + _tmp114_ = to_offer; + _tmp114__length1 = to_offer_length1; + _tmp115_ = _tmp114_[0]; + _vala_assert (g_strcmp0 (_tmp113_, _tmp115_) == 0, "recipient.get (0) == to_offer[0]"); + _g_free0 (_tmp113_); + _tmp116_ = test_deque; + _tmp117_ = recipient; + _tmp118_ = gee_deque_drain_head (_tmp116_, (GeeCollection*) _tmp117_, -1); + _tmp119_ = to_offer; + _tmp119__length1 = to_offer_length1; + _vala_assert (_tmp118_ == (_tmp119__length1 - 1), "test_deque.drain_head (recipient) == to_offer.length - 1"); + _tmp120_ = test_deque; + _tmp121_ = gee_collection_get_size ((GeeCollection*) _tmp120_); + _tmp122_ = _tmp121_; + _vala_assert (_tmp122_ == 0, "test_deque.size == 0"); + _tmp123_ = recipient; + _tmp124_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _tmp126_ = to_offer; + _tmp126__length1 = to_offer_length1; + _vala_assert (_tmp125_ == _tmp126__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp127_; + _tmp127_ = TRUE; + while (TRUE) { + gboolean _tmp128_; + gint _tmp130_; + gchar** _tmp131_; + gint _tmp131__length1; + GeeArrayList* _tmp132_; + gint _tmp133_; + gpointer _tmp134_ = NULL; + gchar* _tmp135_; + gchar** _tmp136_; + gint _tmp136__length1; + gint _tmp137_; + const gchar* _tmp138_; + _tmp128_ = _tmp127_; + if (!_tmp128_) { + gint _tmp129_; + _tmp129_ = i; + i = _tmp129_ + 1; + } + _tmp127_ = FALSE; + _tmp130_ = i; + _tmp131_ = to_offer; + _tmp131__length1 = to_offer_length1; + if (!(_tmp130_ < _tmp131__length1)) { + break; + } + _tmp132_ = recipient; + _tmp133_ = i; + _tmp134_ = gee_abstract_list_get ((GeeAbstractList*) _tmp132_, _tmp133_); + _tmp135_ = (gchar*) _tmp134_; + _tmp136_ = to_offer; + _tmp136__length1 = to_offer_length1; + _tmp137_ = i; + _tmp138_ = _tmp136_[_tmp137_]; + _vala_assert (g_strcmp0 (_tmp135_, _tmp138_) == 0, "recipient.get (i) == to_offer[i]"); + _g_free0 (_tmp135_); + } + } + } + _tmp139_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp139_); + _tmp140_ = test_deque; + _tmp141_ = recipient; + _tmp142_ = gee_deque_drain_head (_tmp140_, (GeeCollection*) _tmp141_, 1); + _vala_assert (_tmp142_ == 0, "test_deque.drain_head (recipient, 1) == 0"); + _tmp143_ = test_deque; + _tmp144_ = gee_collection_get_size ((GeeCollection*) _tmp143_); + _tmp145_ = _tmp144_; + _vala_assert (_tmp145_ == 0, "test_deque.size == 0"); + _tmp146_ = recipient; + _tmp147_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp146_); + _tmp148_ = _tmp147_; + _vala_assert (_tmp148_ == 0, "recipient.size == 0"); + _tmp149_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp149_); + _tmp150_ = test_deque; + _tmp151_ = recipient; + _tmp152_ = gee_deque_drain_head (_tmp150_, (GeeCollection*) _tmp151_, -1); + _vala_assert (_tmp152_ == 0, "test_deque.drain_head (recipient) == 0"); + _tmp153_ = test_deque; + _tmp154_ = gee_collection_get_size ((GeeCollection*) _tmp153_); + _tmp155_ = _tmp154_; + _vala_assert (_tmp155_ == 0, "test_deque.size == 0"); + _tmp156_ = recipient; + _tmp157_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp156_); + _tmp158_ = _tmp157_; + _vala_assert (_tmp158_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -403,221 +677,497 @@ void deque_tests_test_stack_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; - gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar* _tmp41_; + gchar** _tmp42_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp43_; + GeeDeque* _tmp79_; + gpointer _tmp80_ = NULL; + gchar* _tmp81_; + GeeDeque* _tmp82_; + gpointer _tmp83_ = NULL; + gchar* _tmp84_; + GeeArrayList* _tmp85_; + GeeDeque* _tmp96_; + gint _tmp97_; + gint _tmp98_; + gchar** _tmp99_; + gint _tmp99__length1; + GeeDeque* _tmp100_; + GeeArrayList* _tmp101_; + gint _tmp102_ = 0; + GeeDeque* _tmp103_; + gint _tmp104_; + gint _tmp105_; + gchar** _tmp106_; + gint _tmp106__length1; + GeeArrayList* _tmp107_; + gint _tmp108_; + gint _tmp109_; + GeeArrayList* _tmp110_; + gpointer _tmp111_ = NULL; + gchar* _tmp112_; + gchar** _tmp113_; + gint _tmp113__length1; + gchar** _tmp114_; + gint _tmp114__length1; + const gchar* _tmp115_; + GeeDeque* _tmp116_; + GeeArrayList* _tmp117_; + gint _tmp118_ = 0; + gchar** _tmp119_; + gint _tmp119__length1; + GeeDeque* _tmp120_; + gint _tmp121_; + gint _tmp122_; + GeeArrayList* _tmp123_; + gint _tmp124_; + gint _tmp125_; + gchar** _tmp126_; + gint _tmp126__length1; + GeeArrayList* _tmp140_; + GeeDeque* _tmp141_; + GeeArrayList* _tmp142_; + gint _tmp143_ = 0; + GeeDeque* _tmp144_; + gint _tmp145_; + gint _tmp146_; + GeeArrayList* _tmp147_; + gint _tmp148_; + gint _tmp149_; + GeeArrayList* _tmp150_; + GeeDeque* _tmp151_; + GeeArrayList* _tmp152_; + gint _tmp153_ = 0; + GeeDeque* _tmp154_; + gint _tmp155_; + gint _tmp156_; + GeeArrayList* _tmp157_; + gint _tmp158_; + gint _tmp159_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_head (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_head (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_head (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_head (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_head (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_head (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_head (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_head (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_head (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "four") == 0, "test_deque.peek_head () == \"four\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_head (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "test_deque.poll_head () == \"four\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_head (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "three") == 0, "test_deque.peek_head () == \"three\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_head (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "three") == 0, "test_deque.poll_head () == \"three\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_head (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "test_deque.peek_head () == \"two\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_head (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "two") == 0, "test_deque.poll_head () == \"two\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_head (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "one") == 0, "test_deque.peek_head () == \"one\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_head (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "one") == 0, "test_deque.poll_head () == \"one\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_head (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_head () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_head (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_head () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_head (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_head (\"one\")"); - _tmp44_ = gee_deque_offer_head (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_head (\"two\")"); - _tmp45_ = gee_deque_offer_head (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_head (\"three\")"); - _tmp46_ = gee_deque_offer_head (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_head (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_head (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "four") == 0, "recipient.get (0) == \"four\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_head (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "three") == 0, "recipient.get (1) == \"three\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "two") == 0, "recipient.get (2) == \"two\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "one") == 0, "recipient.get (3) == \"one\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_head (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_head (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = g_strdup ("one"); + _tmp4_ = g_strdup ("two"); + _tmp5_ = g_strdup ("three"); + _tmp6_ = g_strdup ("four"); + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("six"); + _tmp9_ = g_strdup ("seven"); + _tmp10_ = g_strdup ("\neight"); + _tmp11_ = g_strdup ("nine"); + _tmp12_ = g_strdup ("ten"); + _tmp13_ = g_strdup ("eleven"); + _tmp14_ = g_strdup ("twelve"); + _tmp15_ = g_strdup ("thirteen"); + _tmp16_ = g_strdup ("fourteen\n"); + _tmp17_ = g_strdup ("fifteen"); + _tmp18_ = g_strdup ("sixteen"); + _tmp19_ = g_strdup ("seventeen"); + _tmp20_ = g_strdup ("eighteen"); + _tmp21_ = g_strdup ("nineteen\n"); + _tmp22_ = g_strdup ("twenty"); + _tmp23_ = g_strdup ("twenty one"); + _tmp24_ = g_strdup ("twenty two"); + _tmp25_ = g_strdup ("twenty three"); + _tmp26_ = g_strdup ("twenty four"); + _tmp27_ = g_strdup ("twenty five"); + _tmp28_ = g_strdup ("twenty six"); + _tmp29_ = g_strdup ("twenty seven"); + _tmp30_ = g_strdup ("twenty eight"); + _tmp31_ = g_strdup ("twenty nine"); + _tmp32_ = g_strdup ("thirty"); + _tmp33_ = g_strdup ("thirty one"); + _tmp34_ = g_strdup ("thirty two"); + _tmp35_ = g_strdup ("thirty four"); + _tmp36_ = g_strdup ("thirty five"); + _tmp37_ = g_strdup ("thirty six"); + _tmp38_ = g_strdup ("thirty seven"); + _tmp39_ = g_strdup ("thirty eight"); + _tmp40_ = g_strdup ("thirty nine"); + _tmp41_ = g_strdup ("fourty"); + _tmp42_ = g_new0 (gchar*, 39 + 1); + _tmp42_[0] = _tmp3_; + _tmp42_[1] = _tmp4_; + _tmp42_[2] = _tmp5_; + _tmp42_[3] = _tmp6_; + _tmp42_[4] = _tmp7_; + _tmp42_[5] = _tmp8_; + _tmp42_[6] = _tmp9_; + _tmp42_[7] = _tmp10_; + _tmp42_[8] = _tmp11_; + _tmp42_[9] = _tmp12_; + _tmp42_[10] = _tmp13_; + _tmp42_[11] = _tmp14_; + _tmp42_[12] = _tmp15_; + _tmp42_[13] = _tmp16_; + _tmp42_[14] = _tmp17_; + _tmp42_[15] = _tmp18_; + _tmp42_[16] = _tmp19_; + _tmp42_[17] = _tmp20_; + _tmp42_[18] = _tmp21_; + _tmp42_[19] = _tmp22_; + _tmp42_[20] = _tmp23_; + _tmp42_[21] = _tmp24_; + _tmp42_[22] = _tmp25_; + _tmp42_[23] = _tmp26_; + _tmp42_[24] = _tmp27_; + _tmp42_[25] = _tmp28_; + _tmp42_[26] = _tmp29_; + _tmp42_[27] = _tmp30_; + _tmp42_[28] = _tmp31_; + _tmp42_[29] = _tmp32_; + _tmp42_[30] = _tmp33_; + _tmp42_[31] = _tmp34_; + _tmp42_[32] = _tmp35_; + _tmp42_[33] = _tmp36_; + _tmp42_[34] = _tmp37_; + _tmp42_[35] = _tmp38_; + _tmp42_[36] = _tmp39_; + _tmp42_[37] = _tmp40_; + _tmp42_[38] = _tmp41_; + to_offer = _tmp42_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + _tmp43_ = test_deque; + _vala_assert (_tmp43_ != NULL, "test_deque != null"); + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_head (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_head (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gchar** _tmp58_; + gint _tmp58__length1; + gint i; + _tmp58_ = to_offer; + _tmp58__length1 = to_offer_length1; + i = _tmp58__length1 - 1; + { + gboolean _tmp59_; + _tmp59_ = TRUE; + while (TRUE) { + gboolean _tmp60_; + gint _tmp62_; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gint _tmp67_; + const gchar* _tmp68_; + GeeDeque* _tmp69_; + gpointer _tmp70_ = NULL; + gchar* _tmp71_; + gchar** _tmp72_; + gint _tmp72__length1; + gint _tmp73_; + const gchar* _tmp74_; + GeeDeque* _tmp75_; + gint _tmp76_; + gint _tmp77_; + gint _tmp78_; + _tmp60_ = _tmp59_; + if (!_tmp60_) { + gint _tmp61_; + _tmp61_ = i; + i = _tmp61_ - 1; + } + _tmp59_ = FALSE; + _tmp62_ = i; + if (!(_tmp62_ >= 0)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_head (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = i; + _tmp68_ = _tmp66_[_tmp67_]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp68_) == 0, "test_deque.peek_head () == to_offer[i]"); + _g_free0 (_tmp65_); + _tmp69_ = test_deque; + _tmp70_ = gee_deque_poll_head (_tmp69_); + _tmp71_ = (gchar*) _tmp70_; + _tmp72_ = to_offer; + _tmp72__length1 = to_offer_length1; + _tmp73_ = i; + _tmp74_ = _tmp72_[_tmp73_]; + _vala_assert (g_strcmp0 (_tmp71_, _tmp74_) == 0, "test_deque.poll_head () == to_offer[i]"); + _g_free0 (_tmp71_); + _tmp75_ = test_deque; + _tmp76_ = gee_collection_get_size ((GeeCollection*) _tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = i; + _vala_assert (_tmp77_ == _tmp78_, "test_deque.size == i"); + } + } + } + _tmp79_ = test_deque; + _tmp80_ = gee_deque_peek_head (_tmp79_); + _tmp81_ = (gchar*) _tmp80_; + _vala_assert (_tmp81_ == NULL, "test_deque.peek_head () == null"); + _g_free0 (_tmp81_); + _tmp82_ = test_deque; + _tmp83_ = gee_deque_poll_head (_tmp82_); + _tmp84_ = (gchar*) _tmp83_; + _vala_assert (_tmp84_ == NULL, "test_deque.poll_head () == null"); + _g_free0 (_tmp84_); + _tmp85_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp85_); + { + gint i; + i = 0; + { + gboolean _tmp86_; + _tmp86_ = TRUE; + while (TRUE) { + gboolean _tmp87_; + gint _tmp89_; + gchar** _tmp90_; + gint _tmp90__length1; + GeeDeque* _tmp91_; + gchar** _tmp92_; + gint _tmp92__length1; + gint _tmp93_; + const gchar* _tmp94_; + gboolean _tmp95_ = FALSE; + _tmp87_ = _tmp86_; + if (!_tmp87_) { + gint _tmp88_; + _tmp88_ = i; + i = _tmp88_ + 1; + } + _tmp86_ = FALSE; + _tmp89_ = i; + _tmp90_ = to_offer; + _tmp90__length1 = to_offer_length1; + if (!(_tmp89_ < _tmp90__length1)) { + break; + } + _tmp91_ = test_deque; + _tmp92_ = to_offer; + _tmp92__length1 = to_offer_length1; + _tmp93_ = i; + _tmp94_ = _tmp92_[_tmp93_]; + _tmp95_ = gee_deque_offer_head (_tmp91_, _tmp94_); + _vala_assert (_tmp95_, "test_deque.offer_head (to_offer[i])"); + } + } + } + _tmp96_ = test_deque; + _tmp97_ = gee_collection_get_size ((GeeCollection*) _tmp96_); + _tmp98_ = _tmp97_; + _tmp99_ = to_offer; + _tmp99__length1 = to_offer_length1; + _vala_assert (_tmp98_ == _tmp99__length1, "test_deque.size == to_offer.length"); + _tmp100_ = test_deque; + _tmp101_ = recipient; + _tmp102_ = gee_deque_drain_head (_tmp100_, (GeeCollection*) _tmp101_, 1); + _vala_assert (_tmp102_ == 1, "test_deque.drain_head (recipient, 1) == 1"); + _tmp103_ = test_deque; + _tmp104_ = gee_collection_get_size ((GeeCollection*) _tmp103_); + _tmp105_ = _tmp104_; + _tmp106_ = to_offer; + _tmp106__length1 = to_offer_length1; + _vala_assert (_tmp105_ == (_tmp106__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp107_ = recipient; + _tmp108_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp107_); + _tmp109_ = _tmp108_; + _vala_assert (_tmp109_ == 1, "recipient.size == 1"); + _tmp110_ = recipient; + _tmp111_ = gee_abstract_list_get ((GeeAbstractList*) _tmp110_, 0); + _tmp112_ = (gchar*) _tmp111_; + _tmp113_ = to_offer; + _tmp113__length1 = to_offer_length1; + _tmp114_ = to_offer; + _tmp114__length1 = to_offer_length1; + _tmp115_ = _tmp113_[_tmp114__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp112_, _tmp115_) == 0, "recipient.get (0) == to_offer[to_offer.length - 1]"); + _g_free0 (_tmp112_); + _tmp116_ = test_deque; + _tmp117_ = recipient; + _tmp118_ = gee_deque_drain_head (_tmp116_, (GeeCollection*) _tmp117_, -1); + _tmp119_ = to_offer; + _tmp119__length1 = to_offer_length1; + _vala_assert (_tmp118_ == (_tmp119__length1 - 1), "test_deque.drain_head (recipient) == to_offer.length - 1"); + _tmp120_ = test_deque; + _tmp121_ = gee_collection_get_size ((GeeCollection*) _tmp120_); + _tmp122_ = _tmp121_; + _vala_assert (_tmp122_ == 0, "test_deque.size == 0"); + _tmp123_ = recipient; + _tmp124_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _tmp126_ = to_offer; + _tmp126__length1 = to_offer_length1; + _vala_assert (_tmp125_ == _tmp126__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp127_; + _tmp127_ = TRUE; + while (TRUE) { + gboolean _tmp128_; + gint _tmp130_; + gchar** _tmp131_; + gint _tmp131__length1; + GeeArrayList* _tmp132_; + gint _tmp133_; + gpointer _tmp134_ = NULL; + gchar* _tmp135_; + gchar** _tmp136_; + gint _tmp136__length1; + gchar** _tmp137_; + gint _tmp137__length1; + gint _tmp138_; + const gchar* _tmp139_; + _tmp128_ = _tmp127_; + if (!_tmp128_) { + gint _tmp129_; + _tmp129_ = i; + i = _tmp129_ + 1; + } + _tmp127_ = FALSE; + _tmp130_ = i; + _tmp131_ = to_offer; + _tmp131__length1 = to_offer_length1; + if (!(_tmp130_ < _tmp131__length1)) { + break; + } + _tmp132_ = recipient; + _tmp133_ = i; + _tmp134_ = gee_abstract_list_get ((GeeAbstractList*) _tmp132_, _tmp133_); + _tmp135_ = (gchar*) _tmp134_; + _tmp136_ = to_offer; + _tmp136__length1 = to_offer_length1; + _tmp137_ = to_offer; + _tmp137__length1 = to_offer_length1; + _tmp138_ = i; + _tmp139_ = _tmp136_[(_tmp137__length1 - _tmp138_) - 1]; + _vala_assert (g_strcmp0 (_tmp135_, _tmp139_) == 0, "recipient.get (i) == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp135_); + } + } + } + _tmp140_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp140_); + _tmp141_ = test_deque; + _tmp142_ = recipient; + _tmp143_ = gee_deque_drain_head (_tmp141_, (GeeCollection*) _tmp142_, 1); + _vala_assert (_tmp143_ == 0, "test_deque.drain_head (recipient, 1) == 0"); + _tmp144_ = test_deque; + _tmp145_ = gee_collection_get_size ((GeeCollection*) _tmp144_); + _tmp146_ = _tmp145_; + _vala_assert (_tmp146_ == 0, "test_deque.size == 0"); + _tmp147_ = recipient; + _tmp148_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp147_); + _tmp149_ = _tmp148_; + _vala_assert (_tmp149_ == 0, "recipient.size == 0"); + _tmp150_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp150_); + _tmp151_ = test_deque; + _tmp152_ = recipient; + _tmp153_ = gee_deque_drain_head (_tmp151_, (GeeCollection*) _tmp152_, -1); + _vala_assert (_tmp153_ == 0, "test_deque.drain_head (recipient) == 0"); + _tmp154_ = test_deque; + _tmp155_ = gee_collection_get_size ((GeeCollection*) _tmp154_); + _tmp156_ = _tmp155_; + _vala_assert (_tmp156_ == 0, "test_deque.size == 0"); + _tmp157_ = recipient; + _tmp158_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp157_); + _tmp159_ = _tmp158_; + _vala_assert (_tmp159_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -629,221 +1179,509 @@ void deque_tests_test_reversed_stack_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; - gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar* _tmp41_; + gchar** _tmp42_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp43_; + GeeDeque* _tmp82_; + gpointer _tmp83_ = NULL; + gchar* _tmp84_; + GeeDeque* _tmp85_; + gpointer _tmp86_ = NULL; + gchar* _tmp87_; + GeeArrayList* _tmp88_; + GeeDeque* _tmp99_; + gint _tmp100_; + gint _tmp101_; + gchar** _tmp102_; + gint _tmp102__length1; + GeeDeque* _tmp103_; + GeeArrayList* _tmp104_; + gint _tmp105_ = 0; + GeeDeque* _tmp106_; + gint _tmp107_; + gint _tmp108_; + gchar** _tmp109_; + gint _tmp109__length1; + GeeArrayList* _tmp110_; + gint _tmp111_; + gint _tmp112_; + GeeArrayList* _tmp113_; + gpointer _tmp114_ = NULL; + gchar* _tmp115_; + gchar** _tmp116_; + gint _tmp116__length1; + gchar** _tmp117_; + gint _tmp117__length1; + const gchar* _tmp118_; + GeeDeque* _tmp119_; + GeeArrayList* _tmp120_; + gint _tmp121_ = 0; + gchar** _tmp122_; + gint _tmp122__length1; + GeeDeque* _tmp123_; + gint _tmp124_; + gint _tmp125_; + GeeArrayList* _tmp126_; + gint _tmp127_; + gint _tmp128_; + gchar** _tmp129_; + gint _tmp129__length1; + GeeArrayList* _tmp143_; + GeeDeque* _tmp144_; + GeeArrayList* _tmp145_; + gint _tmp146_ = 0; + GeeDeque* _tmp147_; + gint _tmp148_; + gint _tmp149_; + GeeArrayList* _tmp150_; + gint _tmp151_; + gint _tmp152_; + GeeArrayList* _tmp153_; + GeeDeque* _tmp154_; + GeeArrayList* _tmp155_; + gint _tmp156_ = 0; + GeeDeque* _tmp157_; + gint _tmp158_; + gint _tmp159_; + GeeArrayList* _tmp160_; + gint _tmp161_; + gint _tmp162_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_tail (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_tail (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_tail (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_tail (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_tail (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "four") == 0, "test_deque.peek_tail () == \"four\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_tail (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "test_deque.poll_tail () == \"four\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_tail (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "three") == 0, "test_deque.peek_tail () == \"three\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_tail (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "three") == 0, "test_deque.poll_tail () == \"three\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_tail (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "test_deque.peek_tail () == \"two\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_tail (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "two") == 0, "test_deque.poll_tail () == \"two\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_tail (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "one") == 0, "test_deque.peek_tail () == \"one\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_tail (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "one") == 0, "test_deque.poll_tail () == \"one\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_tail (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_tail () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_tail (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_tail () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_tail (\"one\")"); - _tmp44_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_tail (\"two\")"); - _tmp45_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_tail (\"three\")"); - _tmp46_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_tail (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_tail (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "four") == 0, "recipient.get (0) == \"four\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_tail (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "three") == 0, "recipient.get (1) == \"three\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "two") == 0, "recipient.get (2) == \"two\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "one") == 0, "recipient.get (3) == \"one\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_tail (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_tail (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = g_strdup ("one"); + _tmp4_ = g_strdup ("two"); + _tmp5_ = g_strdup ("three"); + _tmp6_ = g_strdup ("four"); + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("six"); + _tmp9_ = g_strdup ("seven"); + _tmp10_ = g_strdup ("\neight"); + _tmp11_ = g_strdup ("nine"); + _tmp12_ = g_strdup ("ten"); + _tmp13_ = g_strdup ("eleven"); + _tmp14_ = g_strdup ("twelve"); + _tmp15_ = g_strdup ("thirteen"); + _tmp16_ = g_strdup ("fourteen\n"); + _tmp17_ = g_strdup ("fifteen"); + _tmp18_ = g_strdup ("sixteen"); + _tmp19_ = g_strdup ("seventeen"); + _tmp20_ = g_strdup ("eighteen"); + _tmp21_ = g_strdup ("nineteen\n"); + _tmp22_ = g_strdup ("twenty"); + _tmp23_ = g_strdup ("twenty one"); + _tmp24_ = g_strdup ("twenty two"); + _tmp25_ = g_strdup ("twenty three"); + _tmp26_ = g_strdup ("twenty four"); + _tmp27_ = g_strdup ("twenty five"); + _tmp28_ = g_strdup ("twenty six"); + _tmp29_ = g_strdup ("twenty seven"); + _tmp30_ = g_strdup ("twenty eight"); + _tmp31_ = g_strdup ("twenty nine"); + _tmp32_ = g_strdup ("thirty"); + _tmp33_ = g_strdup ("thirty one"); + _tmp34_ = g_strdup ("thirty two"); + _tmp35_ = g_strdup ("thirty four"); + _tmp36_ = g_strdup ("thirty five"); + _tmp37_ = g_strdup ("thirty six"); + _tmp38_ = g_strdup ("thirty seven"); + _tmp39_ = g_strdup ("thirty eight"); + _tmp40_ = g_strdup ("thirty nine"); + _tmp41_ = g_strdup ("fourty"); + _tmp42_ = g_new0 (gchar*, 39 + 1); + _tmp42_[0] = _tmp3_; + _tmp42_[1] = _tmp4_; + _tmp42_[2] = _tmp5_; + _tmp42_[3] = _tmp6_; + _tmp42_[4] = _tmp7_; + _tmp42_[5] = _tmp8_; + _tmp42_[6] = _tmp9_; + _tmp42_[7] = _tmp10_; + _tmp42_[8] = _tmp11_; + _tmp42_[9] = _tmp12_; + _tmp42_[10] = _tmp13_; + _tmp42_[11] = _tmp14_; + _tmp42_[12] = _tmp15_; + _tmp42_[13] = _tmp16_; + _tmp42_[14] = _tmp17_; + _tmp42_[15] = _tmp18_; + _tmp42_[16] = _tmp19_; + _tmp42_[17] = _tmp20_; + _tmp42_[18] = _tmp21_; + _tmp42_[19] = _tmp22_; + _tmp42_[20] = _tmp23_; + _tmp42_[21] = _tmp24_; + _tmp42_[22] = _tmp25_; + _tmp42_[23] = _tmp26_; + _tmp42_[24] = _tmp27_; + _tmp42_[25] = _tmp28_; + _tmp42_[26] = _tmp29_; + _tmp42_[27] = _tmp30_; + _tmp42_[28] = _tmp31_; + _tmp42_[29] = _tmp32_; + _tmp42_[30] = _tmp33_; + _tmp42_[31] = _tmp34_; + _tmp42_[32] = _tmp35_; + _tmp42_[33] = _tmp36_; + _tmp42_[34] = _tmp37_; + _tmp42_[35] = _tmp38_; + _tmp42_[36] = _tmp39_; + _tmp42_[37] = _tmp40_; + _tmp42_[38] = _tmp41_; + to_offer = _tmp42_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + _tmp43_ = test_deque; + _vala_assert (_tmp43_ != NULL, "test_deque != null"); + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_tail (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_tail (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp58_; + _tmp58_ = TRUE; + while (TRUE) { + gboolean _tmp59_; + gint _tmp61_; + gchar** _tmp62_; + gint _tmp62__length1; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gchar** _tmp67_; + gint _tmp67__length1; + gint _tmp68_; + const gchar* _tmp69_; + GeeDeque* _tmp70_; + gpointer _tmp71_ = NULL; + gchar* _tmp72_; + gchar** _tmp73_; + gint _tmp73__length1; + gchar** _tmp74_; + gint _tmp74__length1; + gint _tmp75_; + const gchar* _tmp76_; + GeeDeque* _tmp77_; + gint _tmp78_; + gint _tmp79_; + gchar** _tmp80_; + gint _tmp80__length1; + gint _tmp81_; + _tmp59_ = _tmp58_; + if (!_tmp59_) { + gint _tmp60_; + _tmp60_ = i; + i = _tmp60_ + 1; + } + _tmp58_ = FALSE; + _tmp61_ = i; + _tmp62_ = to_offer; + _tmp62__length1 = to_offer_length1; + if (!(_tmp61_ < _tmp62__length1)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_tail (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = to_offer; + _tmp67__length1 = to_offer_length1; + _tmp68_ = i; + _tmp69_ = _tmp66_[(_tmp67__length1 - _tmp68_) - 1]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp69_) == 0, "test_deque.peek_tail () == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp65_); + _tmp70_ = test_deque; + _tmp71_ = gee_deque_poll_tail (_tmp70_); + _tmp72_ = (gchar*) _tmp71_; + _tmp73_ = to_offer; + _tmp73__length1 = to_offer_length1; + _tmp74_ = to_offer; + _tmp74__length1 = to_offer_length1; + _tmp75_ = i; + _tmp76_ = _tmp73_[(_tmp74__length1 - _tmp75_) - 1]; + _vala_assert (g_strcmp0 (_tmp72_, _tmp76_) == 0, "test_deque.poll_tail () == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp72_); + _tmp77_ = test_deque; + _tmp78_ = gee_collection_get_size ((GeeCollection*) _tmp77_); + _tmp79_ = _tmp78_; + _tmp80_ = to_offer; + _tmp80__length1 = to_offer_length1; + _tmp81_ = i; + _vala_assert (_tmp79_ == ((_tmp80__length1 - _tmp81_) - 1), "test_deque.size == to_offer.length - i - 1"); + } + } + } + _tmp82_ = test_deque; + _tmp83_ = gee_deque_peek_tail (_tmp82_); + _tmp84_ = (gchar*) _tmp83_; + _vala_assert (_tmp84_ == NULL, "test_deque.peek_tail () == null"); + _g_free0 (_tmp84_); + _tmp85_ = test_deque; + _tmp86_ = gee_deque_poll_tail (_tmp85_); + _tmp87_ = (gchar*) _tmp86_; + _vala_assert (_tmp87_ == NULL, "test_deque.poll_tail () == null"); + _g_free0 (_tmp87_); + _tmp88_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp88_); + { + gint i; + i = 0; + { + gboolean _tmp89_; + _tmp89_ = TRUE; + while (TRUE) { + gboolean _tmp90_; + gint _tmp92_; + gchar** _tmp93_; + gint _tmp93__length1; + GeeDeque* _tmp94_; + gchar** _tmp95_; + gint _tmp95__length1; + gint _tmp96_; + const gchar* _tmp97_; + gboolean _tmp98_ = FALSE; + _tmp90_ = _tmp89_; + if (!_tmp90_) { + gint _tmp91_; + _tmp91_ = i; + i = _tmp91_ + 1; + } + _tmp89_ = FALSE; + _tmp92_ = i; + _tmp93_ = to_offer; + _tmp93__length1 = to_offer_length1; + if (!(_tmp92_ < _tmp93__length1)) { + break; + } + _tmp94_ = test_deque; + _tmp95_ = to_offer; + _tmp95__length1 = to_offer_length1; + _tmp96_ = i; + _tmp97_ = _tmp95_[_tmp96_]; + _tmp98_ = gee_deque_offer_tail (_tmp94_, _tmp97_); + _vala_assert (_tmp98_, "test_deque.offer_tail (to_offer[i])"); + } + } + } + _tmp99_ = test_deque; + _tmp100_ = gee_collection_get_size ((GeeCollection*) _tmp99_); + _tmp101_ = _tmp100_; + _tmp102_ = to_offer; + _tmp102__length1 = to_offer_length1; + _vala_assert (_tmp101_ == _tmp102__length1, "test_deque.size == to_offer.length"); + _tmp103_ = test_deque; + _tmp104_ = recipient; + _tmp105_ = gee_deque_drain_tail (_tmp103_, (GeeCollection*) _tmp104_, 1); + _vala_assert (_tmp105_ == 1, "test_deque.drain_tail (recipient, 1) == 1"); + _tmp106_ = test_deque; + _tmp107_ = gee_collection_get_size ((GeeCollection*) _tmp106_); + _tmp108_ = _tmp107_; + _tmp109_ = to_offer; + _tmp109__length1 = to_offer_length1; + _vala_assert (_tmp108_ == (_tmp109__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp110_ = recipient; + _tmp111_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp110_); + _tmp112_ = _tmp111_; + _vala_assert (_tmp112_ == 1, "recipient.size == 1"); + _tmp113_ = recipient; + _tmp114_ = gee_abstract_list_get ((GeeAbstractList*) _tmp113_, 0); + _tmp115_ = (gchar*) _tmp114_; + _tmp116_ = to_offer; + _tmp116__length1 = to_offer_length1; + _tmp117_ = to_offer; + _tmp117__length1 = to_offer_length1; + _tmp118_ = _tmp116_[_tmp117__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp115_, _tmp118_) == 0, "recipient.get (0) == to_offer[to_offer.length - 1]"); + _g_free0 (_tmp115_); + _tmp119_ = test_deque; + _tmp120_ = recipient; + _tmp121_ = gee_deque_drain_tail (_tmp119_, (GeeCollection*) _tmp120_, -1); + _tmp122_ = to_offer; + _tmp122__length1 = to_offer_length1; + _vala_assert (_tmp121_ == (_tmp122__length1 - 1), "test_deque.drain_tail (recipient) == to_offer.length - 1"); + _tmp123_ = test_deque; + _tmp124_ = gee_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _vala_assert (_tmp125_ == 0, "test_deque.size == 0"); + _tmp126_ = recipient; + _tmp127_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp126_); + _tmp128_ = _tmp127_; + _tmp129_ = to_offer; + _tmp129__length1 = to_offer_length1; + _vala_assert (_tmp128_ == _tmp129__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp130_; + _tmp130_ = TRUE; + while (TRUE) { + gboolean _tmp131_; + gint _tmp133_; + gchar** _tmp134_; + gint _tmp134__length1; + GeeArrayList* _tmp135_; + gint _tmp136_; + gpointer _tmp137_ = NULL; + gchar* _tmp138_; + gchar** _tmp139_; + gint _tmp139__length1; + gchar** _tmp140_; + gint _tmp140__length1; + gint _tmp141_; + const gchar* _tmp142_; + _tmp131_ = _tmp130_; + if (!_tmp131_) { + gint _tmp132_; + _tmp132_ = i; + i = _tmp132_ + 1; + } + _tmp130_ = FALSE; + _tmp133_ = i; + _tmp134_ = to_offer; + _tmp134__length1 = to_offer_length1; + if (!(_tmp133_ < _tmp134__length1)) { + break; + } + _tmp135_ = recipient; + _tmp136_ = i; + _tmp137_ = gee_abstract_list_get ((GeeAbstractList*) _tmp135_, _tmp136_); + _tmp138_ = (gchar*) _tmp137_; + _tmp139_ = to_offer; + _tmp139__length1 = to_offer_length1; + _tmp140_ = to_offer; + _tmp140__length1 = to_offer_length1; + _tmp141_ = i; + _tmp142_ = _tmp139_[(_tmp140__length1 - _tmp141_) - 1]; + _vala_assert (g_strcmp0 (_tmp138_, _tmp142_) == 0, "recipient.get (i) == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp138_); + } + } + } + _tmp143_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp143_); + _tmp144_ = test_deque; + _tmp145_ = recipient; + _tmp146_ = gee_deque_drain_tail (_tmp144_, (GeeCollection*) _tmp145_, 1); + _vala_assert (_tmp146_ == 0, "test_deque.drain_tail (recipient, 1) == 0"); + _tmp147_ = test_deque; + _tmp148_ = gee_collection_get_size ((GeeCollection*) _tmp147_); + _tmp149_ = _tmp148_; + _vala_assert (_tmp149_ == 0, "test_deque.size == 0"); + _tmp150_ = recipient; + _tmp151_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp150_); + _tmp152_ = _tmp151_; + _vala_assert (_tmp152_ == 0, "recipient.size == 0"); + _tmp153_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp153_); + _tmp154_ = test_deque; + _tmp155_ = recipient; + _tmp156_ = gee_deque_drain_tail (_tmp154_, (GeeCollection*) _tmp155_, -1); + _vala_assert (_tmp156_ == 0, "test_deque.drain_tail (recipient) == 0"); + _tmp157_ = test_deque; + _tmp158_ = gee_collection_get_size ((GeeCollection*) _tmp157_); + _tmp159_ = _tmp158_; + _vala_assert (_tmp159_ == 0, "test_deque.size == 0"); + _tmp160_ = recipient; + _tmp161_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp160_); + _tmp162_ = _tmp161_; + _vala_assert (_tmp162_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -870,4 +1708,22 @@ GType deque_tests_get_type (void) { } +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + diff --git a/tests/testdeque.vala b/tests/testdeque.vala index d100ce0..ff2d320 100644 --- a/tests/testdeque.vala +++ b/tests/testdeque.vala @@ -37,28 +37,30 @@ public abstract class DequeTests : QueueTests { // Check the test deque is not null assert (test_deque != null); + string[] to_offer = { + "one", "two", "three", "four", "five", "six", "seven", " +eight", + "nine", "ten", "eleven", "twelve", "thirteen", "fourteen +", + "fifteen", "sixteen", "seventeen", "eighteen", "nineteen +", "twenty", + "twenty one", "twenty two", "twenty three", "twenty four", + "twenty five", "twenty six", "twenty seven", "twenty eight", + "twenty nine", "thirty", "thirty one", "thirty two", "thirty four", + "thirty five", "thirty six", "thirty seven", "thirty eight", + "thirty nine", "fourty" + }; // Check normal FIFO behavior - assert (test_deque.offer_tail ("one")); - assert (test_deque.size == 1); - assert (test_deque.offer_tail ("two")); - assert (test_deque.size == 2); - assert (test_deque.offer_tail ("three")); - assert (test_deque.size == 3); - assert (test_deque.offer_tail ("four")); - assert (test_deque.size == 4); - assert (test_deque.peek_head () == "one"); - assert (test_deque.poll_head () == "one"); - assert (test_deque.size == 3); - assert (test_deque.peek_head () == "two"); - assert (test_deque.poll_head () == "two"); - assert (test_deque.size == 2); - assert (test_deque.peek_head () == "three"); - assert (test_deque.poll_head () == "three"); - assert (test_deque.size == 1); - assert (test_deque.peek_head () == "four"); - assert (test_deque.poll_head () == "four"); - assert (test_deque.size == 0); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_tail (to_offer[i])); + assert (test_deque.size == i + 1); + } + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.peek_head () == to_offer[i]); + assert (test_deque.poll_head () == to_offer[i]); + assert (test_deque.size == to_offer.length - i - 1); + } // Check normal behavior when no element assert (test_deque.peek_head () == null); @@ -66,21 +68,20 @@ public abstract class DequeTests : QueueTests { // Check drain with FIFO behavior recipient.clear (); - assert (test_deque.offer_tail ("one")); - assert (test_deque.offer_tail ("two")); - assert (test_deque.offer_tail ("three")); - assert (test_deque.offer_tail ("four")); - assert (test_deque.size == 4); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_tail (to_offer[i])); + } + assert (test_deque.size == to_offer.length); assert (test_deque.drain_head (recipient, 1) == 1); - assert (test_deque.size == 3); + assert (test_deque.size == to_offer.length - 1); assert (recipient.size == 1); - assert (recipient.get (0) == "one"); - assert (test_deque.drain_head (recipient) == 3); + assert (recipient.get (0) == to_offer[0]); + assert (test_deque.drain_head (recipient) == to_offer.length - 1); assert (test_deque.size == 0); - assert (recipient.size == 4); - assert (recipient.get (1) == "two"); - assert (recipient.get (2) == "three"); - assert (recipient.get (3) == "four"); + assert (recipient.size == to_offer.length); + for (int i = 1; i < to_offer.length; i++) { + assert (recipient.get (i) == to_offer[i]); + } // Check drain one when no element recipient.clear (); @@ -98,31 +99,33 @@ public abstract class DequeTests : QueueTests { public void test_stack_use () { var test_deque = test_collection as Gee.Deque; ArrayList recipient = new ArrayList (); + string[] to_offer = { + "one", "two", "three", "four", "five", "six", "seven", " +eight", + "nine", "ten", "eleven", "twelve", "thirteen", "fourteen +", + "fifteen", "sixteen", "seventeen", "eighteen", "nineteen +", "twenty", + "twenty one", "twenty two", "twenty three", "twenty four", + "twenty five", "twenty six", "twenty seven", "twenty eight", + "twenty nine", "thirty", "thirty one", "thirty two", "thirty four", + "thirty five", "thirty six", "thirty seven", "thirty eight", + "thirty nine", "fourty" + }; // Check the test deque is not null assert (test_deque != null); // Check normal LIFO behavior - assert (test_deque.offer_head ("one")); - assert (test_deque.size == 1); - assert (test_deque.offer_head ("two")); - assert (test_deque.size == 2); - assert (test_deque.offer_head ("three")); - assert (test_deque.size == 3); - assert (test_deque.offer_head ("four")); - assert (test_deque.size == 4); - assert (test_deque.peek_head () == "four"); - assert (test_deque.poll_head () == "four"); - assert (test_deque.size == 3); - assert (test_deque.peek_head () == "three"); - assert (test_deque.poll_head () == "three"); - assert (test_deque.size == 2); - assert (test_deque.peek_head () == "two"); - assert (test_deque.poll_head () == "two"); - assert (test_deque.size == 1); - assert (test_deque.peek_head () == "one"); - assert (test_deque.poll_head () == "one"); - assert (test_deque.size == 0); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_head (to_offer[i])); + assert (test_deque.size == i + 1); + } + for (int i = to_offer.length - 1; i >= 0; i--) { + assert (test_deque.peek_head () == to_offer[i]); + assert (test_deque.poll_head () == to_offer[i]); + assert (test_deque.size == i); + } // Check normal behavior when no element assert (test_deque.peek_head () == null); @@ -130,21 +133,20 @@ public abstract class DequeTests : QueueTests { // Check drain with LIFO behavior recipient.clear (); - assert (test_deque.offer_head ("one")); - assert (test_deque.offer_head ("two")); - assert (test_deque.offer_head ("three")); - assert (test_deque.offer_head ("four")); - assert (test_deque.size == 4); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_head (to_offer[i])); + } + assert (test_deque.size == to_offer.length); assert (test_deque.drain_head (recipient, 1) == 1); - assert (test_deque.size == 3); + assert (test_deque.size == to_offer.length - 1); assert (recipient.size == 1); - assert (recipient.get (0) == "four"); - assert (test_deque.drain_head (recipient) == 3); + assert (recipient.get (0) == to_offer[to_offer.length - 1]); + assert (test_deque.drain_head (recipient) == to_offer.length - 1); assert (test_deque.size == 0); - assert (recipient.size == 4); - assert (recipient.get (1) == "three"); - assert (recipient.get (2) == "two"); - assert (recipient.get (3) == "one"); + assert (recipient.size == to_offer.length); + for (int i = 1; i < to_offer.length; i++) { + assert (recipient.get (i) == to_offer[to_offer.length - i - 1]); + } // Check drain one when no element recipient.clear (); @@ -162,31 +164,33 @@ public abstract class DequeTests : QueueTests { public void test_reversed_stack_use () { var test_deque = test_collection as Gee.Deque; ArrayList recipient = new ArrayList (); + string[] to_offer = { + "one", "two", "three", "four", "five", "six", "seven", " +eight", + "nine", "ten", "eleven", "twelve", "thirteen", "fourteen +", + "fifteen", "sixteen", "seventeen", "eighteen", "nineteen +", "twenty", + "twenty one", "twenty two", "twenty three", "twenty four", + "twenty five", "twenty six", "twenty seven", "twenty eight", + "twenty nine", "thirty", "thirty one", "thirty two", "thirty four", + "thirty five", "thirty six", "thirty seven", "thirty eight", + "thirty nine", "fourty" + }; // Check the test deque is not null assert (test_deque != null); // Check normal LIFO behavior - assert (test_deque.offer_tail ("one")); - assert (test_deque.size == 1); - assert (test_deque.offer_tail ("two")); - assert (test_deque.size == 2); - assert (test_deque.offer_tail ("three")); - assert (test_deque.size == 3); - assert (test_deque.offer_tail ("four")); - assert (test_deque.size == 4); - assert (test_deque.peek_tail () == "four"); - assert (test_deque.poll_tail () == "four"); - assert (test_deque.size == 3); - assert (test_deque.peek_tail () == "three"); - assert (test_deque.poll_tail () == "three"); - assert (test_deque.size == 2); - assert (test_deque.peek_tail () == "two"); - assert (test_deque.poll_tail () == "two"); - assert (test_deque.size == 1); - assert (test_deque.peek_tail () == "one"); - assert (test_deque.poll_tail () == "one"); - assert (test_deque.size == 0); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_tail (to_offer[i])); + assert (test_deque.size == i + 1); + } + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.peek_tail () == to_offer[to_offer.length - i - 1]); + assert (test_deque.poll_tail () == to_offer[to_offer.length - i - 1]); + assert (test_deque.size == to_offer.length - i - 1); + } // Check normal behavior when no element assert (test_deque.peek_tail () == null); @@ -194,21 +198,20 @@ public abstract class DequeTests : QueueTests { // Check drain with LIFO behavior recipient.clear (); - assert (test_deque.offer_tail ("one")); - assert (test_deque.offer_tail ("two")); - assert (test_deque.offer_tail ("three")); - assert (test_deque.offer_tail ("four")); - assert (test_deque.size == 4); + for (int i = 0; i < to_offer.length; i++) { + assert (test_deque.offer_tail (to_offer[i])); + } + assert (test_deque.size == to_offer.length); assert (test_deque.drain_tail (recipient, 1) == 1); - assert (test_deque.size == 3); + assert (test_deque.size == to_offer.length - 1); assert (recipient.size == 1); - assert (recipient.get (0) == "four"); - assert (test_deque.drain_tail (recipient) == 3); + assert (recipient.get (0) == to_offer[to_offer.length - 1]); + assert (test_deque.drain_tail (recipient) == to_offer.length - 1); assert (test_deque.size == 0); - assert (recipient.size == 4); - assert (recipient.get (1) == "three"); - assert (recipient.get (2) == "two"); - assert (recipient.get (3) == "one"); + assert (recipient.size == to_offer.length); + for (int i = 1; i < to_offer.length; i++) { + assert (recipient.get (i) == to_offer[to_offer.length - i - 1]); + } // Check drain one when no element recipient.clear (); @@ -223,3 +226,4 @@ public abstract class DequeTests : QueueTests { assert (recipient.size == 0); } } + diff --git a/tests/testfunctions.c b/tests/testfunctions.c new file mode 100644 index 0000000..21a5ed2 --- /dev/null +++ b/tests/testfunctions.c @@ -0,0 +1,1203 @@ +/* testfunctions.c generated by valac 0.18.0, the Vala compiler + * generated from testfunctions.vala, do not modify */ + +/* testfunctions.vala + * + * Copyright (C) 2010 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_FUNCTIONS_TESTS (functions_tests_get_type ()) +#define FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTests)) +#define FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass)) +#define IS_FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTIONS_TESTS)) +#define IS_FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTIONS_TESTS)) +#define FUNCTIONS_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass)) + +typedef struct _FunctionsTests FunctionsTests; +typedef struct _FunctionsTestsClass FunctionsTestsClass; +typedef struct _FunctionsTestsPrivate FunctionsTestsPrivate; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define FUNCTIONS_TESTS_TYPE_MY_COMPARABLE (functions_tests_my_comparable_get_type ()) +#define FUNCTIONS_TESTS_MY_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparable)) +#define FUNCTIONS_TESTS_MY_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparableClass)) +#define FUNCTIONS_TESTS_IS_MY_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE)) +#define FUNCTIONS_TESTS_IS_MY_COMPARABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE)) +#define FUNCTIONS_TESTS_MY_COMPARABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparableClass)) + +typedef struct _FunctionsTestsMyComparable FunctionsTestsMyComparable; +typedef struct _FunctionsTestsMyComparableClass FunctionsTestsMyComparableClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define FUNCTIONS_TESTS_TYPE_MY_HASHABLE (functions_tests_my_hashable_get_type ()) +#define FUNCTIONS_TESTS_MY_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashable)) +#define FUNCTIONS_TESTS_MY_HASHABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashableClass)) +#define FUNCTIONS_TESTS_IS_MY_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE)) +#define FUNCTIONS_TESTS_IS_MY_HASHABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FUNCTIONS_TESTS_TYPE_MY_HASHABLE)) +#define FUNCTIONS_TESTS_MY_HASHABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashableClass)) + +typedef struct _FunctionsTestsMyHashable FunctionsTestsMyHashable; +typedef struct _FunctionsTestsMyHashableClass FunctionsTestsMyHashableClass; +typedef struct _Block5Data Block5Data; +typedef struct _Block6Data Block6Data; +typedef struct _Block7Data Block7Data; +typedef struct _Block8Data Block8Data; +typedef struct _FunctionsTestsMyComparablePrivate FunctionsTestsMyComparablePrivate; +typedef struct _FunctionsTestsMyHashablePrivate FunctionsTestsMyHashablePrivate; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _FunctionsTests { + GeeTestCase parent_instance; + FunctionsTestsPrivate * priv; +}; + +struct _FunctionsTestsClass { + GeeTestCaseClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); +struct _Block5Data { + int _ref_count_; + FunctionsTests * self; + gint i; + gint j; +}; + +struct _Block6Data { + int _ref_count_; + Block5Data * _data5_; + gint k; +}; + +struct _Block7Data { + int _ref_count_; + FunctionsTests * self; + gint i; +}; + +struct _Block8Data { + int _ref_count_; + Block7Data * _data7_; + gint j; + gint start; +}; + +struct _FunctionsTestsMyComparable { + GObject parent_instance; + FunctionsTestsMyComparablePrivate * priv; +}; + +struct _FunctionsTestsMyComparableClass { + GObjectClass parent_class; +}; + +struct _FunctionsTestsMyComparablePrivate { + gint i; +}; + +struct _FunctionsTestsMyHashable { + GObject parent_instance; + FunctionsTestsMyHashablePrivate * priv; +}; + +struct _FunctionsTestsMyHashableClass { + GObjectClass parent_class; +}; + +struct _FunctionsTestsMyHashablePrivate { + gint i; +}; + + +static gpointer functions_tests_parent_class = NULL; +static gpointer functions_tests_my_comparable_parent_class = NULL; +static GeeComparableIface* functions_tests_my_comparable_gee_comparable_parent_iface = NULL; +static gpointer functions_tests_my_hashable_parent_class = NULL; +static GeeComparableIface* functions_tests_my_hashable_gee_comparable_parent_iface = NULL; +static GeeHashableIface* functions_tests_my_hashable_gee_hashable_parent_iface = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType functions_tests_get_type (void) G_GNUC_CONST; +enum { + FUNCTIONS_TESTS_DUMMY_PROPERTY +}; +FunctionsTests* functions_tests_new (void); +FunctionsTests* functions_tests_construct (GType object_type); +GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void functions_tests_test_string_func (FunctionsTests* self); +static void _functions_tests_test_string_func_gee_test_case_test_method (gpointer self); +void functions_tests_test_int_func (FunctionsTests* self); +static void _functions_tests_test_int_func_gee_test_case_test_method (gpointer self); +void functions_tests_test_compare_func (FunctionsTests* self); +static void _functions_tests_test_compare_func_gee_test_case_test_method (gpointer self); +void functions_tests_test_hash_func (FunctionsTests* self); +static void _functions_tests_test_hash_func_gee_test_case_test_method (gpointer self); +void functions_tests_test_unfold (FunctionsTests* self); +static void _functions_tests_test_unfold_gee_test_case_test_method (gpointer self); +void functions_tests_test_concat (FunctionsTests* self); +static void _functions_tests_test_concat_gee_test_case_test_method (gpointer self); +static FunctionsTestsMyComparable* functions_tests_my_comparable_new (gint i); +static FunctionsTestsMyComparable* functions_tests_my_comparable_construct (GType object_type, gint i); +static GType functions_tests_my_comparable_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static FunctionsTestsMyHashable* functions_tests_my_hashable_new (gint i); +static FunctionsTestsMyHashable* functions_tests_my_hashable_construct (GType object_type, gint i); +static GType functions_tests_my_hashable_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static Block5Data* block5_data_ref (Block5Data* _data5_); +static void block5_data_unref (void * _userdata_); +static GeeLazy* __lambda19_ (Block5Data* _data5_); +static Block6Data* block6_data_ref (Block6Data* _data6_); +static void block6_data_unref (void * _userdata_); +static gint __lambda20_ (Block6Data* _data6_); +static gpointer ___lambda20__gee_lazy_func (gpointer self); +static GeeLazy* ___lambda19__gee_unfold_func (gpointer self); +static Block7Data* block7_data_ref (Block7Data* _data7_); +static void block7_data_unref (void * _userdata_); +static GeeLazy* __lambda21_ (Block7Data* _data7_); +static Block8Data* block8_data_ref (Block8Data* _data8_); +static void block8_data_unref (void * _userdata_); +static GeeLazy* __lambda22_ (Block8Data* _data8_); +static GeeLazy* ___lambda22__gee_unfold_func (gpointer self); +static GeeLazy* ___lambda21__gee_unfold_func (gpointer self); +#define FUNCTIONS_TESTS_MY_COMPARABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparablePrivate)) +enum { + FUNCTIONS_TESTS_MY_COMPARABLE_DUMMY_PROPERTY +}; +static gint functions_tests_my_comparable_real_compare_to (GeeComparable* base, FunctionsTestsMyComparable* cmp); +static void functions_tests_my_comparable_finalize (GObject* obj); +#define FUNCTIONS_TESTS_MY_HASHABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashablePrivate)) +enum { + FUNCTIONS_TESTS_MY_HASHABLE_DUMMY_PROPERTY +}; +static gint functions_tests_my_hashable_real_compare_to (GeeComparable* base, FunctionsTestsMyHashable* cmp); +static guint functions_tests_my_hashable_real_hash (GeeHashable* base); +static gboolean functions_tests_my_hashable_real_equal_to (GeeHashable* base, FunctionsTestsMyHashable* hash); +static void functions_tests_my_hashable_finalize (GObject* obj); + + +static void _functions_tests_test_string_func_gee_test_case_test_method (gpointer self) { + functions_tests_test_string_func (self); +} + + +static void _functions_tests_test_int_func_gee_test_case_test_method (gpointer self) { + functions_tests_test_int_func (self); +} + + +static void _functions_tests_test_compare_func_gee_test_case_test_method (gpointer self) { + functions_tests_test_compare_func (self); +} + + +static void _functions_tests_test_hash_func_gee_test_case_test_method (gpointer self) { + functions_tests_test_hash_func (self); +} + + +static void _functions_tests_test_unfold_gee_test_case_test_method (gpointer self) { + functions_tests_test_unfold (self); +} + + +static void _functions_tests_test_concat_gee_test_case_test_method (gpointer self) { + functions_tests_test_concat (self); +} + + +FunctionsTests* functions_tests_construct (GType object_type) { + FunctionsTests * self = NULL; + self = (FunctionsTests*) gee_test_case_construct (object_type, "Functions"); + gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing strings", _functions_tests_test_string_func_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing int", _functions_tests_test_int_func_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing instances of Comparable", _functions_tests_test_compare_func_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Functions] comparing and hashing instances of Hashable", _functions_tests_test_hash_func_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Iterator] unfold", _functions_tests_test_unfold_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Iterator] concat", _functions_tests_test_concat_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +FunctionsTests* functions_tests_new (void) { + return functions_tests_construct (TYPE_FUNCTIONS_TESTS); +} + + +void functions_tests_test_string_func (FunctionsTests* self) { + gchar* _tmp0_; + gchar* one; + gchar* _tmp1_; + gchar* two; + gchar* _tmp2_ = NULL; + gchar* two_copy; + void* _tmp3_ = NULL; + GDestroyNotify _tmp4_ = NULL; + GeeEqualDataFunc _tmp5_ = NULL; + GeeEqualDataFunc eq; + void* eq_target; + GDestroyNotify eq_target_destroy_notify; + void* _tmp6_ = NULL; + GDestroyNotify _tmp7_ = NULL; + GCompareDataFunc _tmp8_ = NULL; + GCompareDataFunc cmp; + void* cmp_target; + GDestroyNotify cmp_target_destroy_notify; + void* _tmp9_ = NULL; + GDestroyNotify _tmp10_ = NULL; + GeeHashDataFunc _tmp11_ = NULL; + GeeHashDataFunc hash; + void* hash_target; + GDestroyNotify hash_target_destroy_notify; + gboolean _tmp12_ = FALSE; + gint _tmp13_ = 0; + guint _tmp14_ = 0U; + guint _tmp15_ = 0U; + gboolean _tmp16_ = FALSE; + gint _tmp17_ = 0; + guint _tmp18_ = 0U; + guint _tmp19_ = 0U; + gboolean _tmp20_ = FALSE; + gint _tmp21_ = 0; + gboolean _tmp22_ = FALSE; + gint _tmp23_ = 0; + g_return_if_fail (self != NULL); + _tmp0_ = g_strdup ("one"); + one = _tmp0_; + _tmp1_ = g_strdup ("two"); + two = _tmp1_; + _tmp2_ = g_strdup (two); + two_copy = _tmp2_; + _tmp5_ = gee_functions_get_equal_func_for (G_TYPE_STRING, &_tmp3_, &_tmp4_); + eq = _tmp5_; + eq_target = _tmp3_; + eq_target_destroy_notify = _tmp4_; + _tmp8_ = gee_functions_get_compare_func_for (G_TYPE_STRING, &_tmp6_, &_tmp7_); + cmp = _tmp8_; + cmp_target = _tmp6_; + cmp_target_destroy_notify = _tmp7_; + _tmp11_ = gee_functions_get_hash_func_for (G_TYPE_STRING, &_tmp9_, &_tmp10_); + hash = _tmp11_; + hash_target = _tmp9_; + hash_target_destroy_notify = _tmp10_; + _vala_assert (eq != NULL, "eq != null"); + _vala_assert (cmp != NULL, "cmp != null"); + _vala_assert (hash != NULL, "hash != null"); + _tmp12_ = eq (two, two, eq_target); + _vala_assert (_tmp12_, "eq (two, two)"); + _tmp13_ = cmp (two, two, cmp_target); + _vala_assert (_tmp13_ == 0, "cmp (two, two) == 0"); + _tmp14_ = hash (two, hash_target); + _tmp15_ = hash (two, hash_target); + _vala_assert (_tmp14_ == _tmp15_, "hash (two) == hash (two)"); + _tmp16_ = eq (two, two_copy, eq_target); + _vala_assert (_tmp16_, "eq (two, two_copy)"); + _tmp17_ = cmp (two, two_copy, cmp_target); + _vala_assert (_tmp17_ == 0, "cmp (two, two_copy) == 0"); + _tmp18_ = hash (two, hash_target); + _tmp19_ = hash (two_copy, hash_target); + _vala_assert (_tmp18_ == _tmp19_, "hash (two) == hash (two_copy)"); + _tmp20_ = eq (one, two, eq_target); + _vala_assert (!_tmp20_, "!eq (one, two)"); + _tmp21_ = cmp (one, two, cmp_target); + _vala_assert (_tmp21_ < 0, "cmp (one, two) < 0"); + _tmp22_ = eq (two, one, eq_target); + _vala_assert (!_tmp22_, "!eq (two, one)"); + _tmp23_ = cmp (two, one, cmp_target); + _vala_assert (_tmp23_ > 0, "cmp (two, one) > 0"); + (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL); + hash = NULL; + hash_target = NULL; + hash_target_destroy_notify = NULL; + (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL); + cmp = NULL; + cmp_target = NULL; + cmp_target_destroy_notify = NULL; + (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL); + eq = NULL; + eq_target = NULL; + eq_target_destroy_notify = NULL; + _g_free0 (two_copy); + _g_free0 (two); + _g_free0 (one); +} + + +void functions_tests_test_int_func (FunctionsTests* self) { + void* one; + void* two; + void* _tmp0_ = NULL; + GDestroyNotify _tmp1_ = NULL; + GeeEqualDataFunc _tmp2_ = NULL; + GeeEqualDataFunc eq; + void* eq_target; + GDestroyNotify eq_target_destroy_notify; + void* _tmp3_ = NULL; + GDestroyNotify _tmp4_ = NULL; + GCompareDataFunc _tmp5_ = NULL; + GCompareDataFunc cmp; + void* cmp_target; + GDestroyNotify cmp_target_destroy_notify; + void* _tmp6_ = NULL; + GDestroyNotify _tmp7_ = NULL; + GeeHashDataFunc _tmp8_ = NULL; + GeeHashDataFunc hash; + void* hash_target; + GDestroyNotify hash_target_destroy_notify; + gboolean _tmp9_ = FALSE; + gint _tmp10_ = 0; + guint _tmp11_ = 0U; + guint _tmp12_ = 0U; + gboolean _tmp13_ = FALSE; + gint _tmp14_ = 0; + gboolean _tmp15_ = FALSE; + gint _tmp16_ = 0; + g_return_if_fail (self != NULL); + one = (void*) 1; + two = (void*) 2; + _tmp2_ = gee_functions_get_equal_func_for (G_TYPE_INT, &_tmp0_, &_tmp1_); + eq = _tmp2_; + eq_target = _tmp0_; + eq_target_destroy_notify = _tmp1_; + _tmp5_ = gee_functions_get_compare_func_for (G_TYPE_INT, &_tmp3_, &_tmp4_); + cmp = _tmp5_; + cmp_target = _tmp3_; + cmp_target_destroy_notify = _tmp4_; + _tmp8_ = gee_functions_get_hash_func_for (G_TYPE_INT, &_tmp6_, &_tmp7_); + hash = _tmp8_; + hash_target = _tmp6_; + hash_target_destroy_notify = _tmp7_; + _vala_assert (eq != NULL, "eq != null"); + _vala_assert (cmp != NULL, "cmp != null"); + _vala_assert (hash != NULL, "hash != null"); + _tmp9_ = eq (two, two, eq_target); + _vala_assert (_tmp9_, "eq (two, two)"); + _tmp10_ = cmp (two, two, cmp_target); + _vala_assert (_tmp10_ == 0, "cmp (two, two) == 0"); + _tmp11_ = hash (two, hash_target); + _tmp12_ = hash (two, hash_target); + _vala_assert (_tmp11_ == _tmp12_, "hash (two) == hash (two)"); + _tmp13_ = eq (one, two, eq_target); + _vala_assert (!_tmp13_, "!eq (one, two)"); + _tmp14_ = cmp (one, two, cmp_target); + _vala_assert (_tmp14_ < 0, "cmp (one, two) < 0"); + _tmp15_ = eq (two, one, eq_target); + _vala_assert (!_tmp15_, "!eq (two, one)"); + _tmp16_ = cmp (two, one, cmp_target); + _vala_assert (_tmp16_ > 0, "cmp (two, one) > 0"); + (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL); + hash = NULL; + hash_target = NULL; + hash_target_destroy_notify = NULL; + (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL); + cmp = NULL; + cmp_target = NULL; + cmp_target_destroy_notify = NULL; + (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL); + eq = NULL; + eq_target = NULL; + eq_target_destroy_notify = NULL; +} + + +void functions_tests_test_compare_func (FunctionsTests* self) { + FunctionsTestsMyComparable* _tmp0_; + FunctionsTestsMyComparable* two; + FunctionsTestsMyComparable* _tmp1_; + FunctionsTestsMyComparable* one; + FunctionsTestsMyComparable* _tmp2_; + FunctionsTestsMyComparable* two_copy; + void* _tmp3_ = NULL; + GDestroyNotify _tmp4_ = NULL; + GeeEqualDataFunc _tmp5_ = NULL; + GeeEqualDataFunc eq; + void* eq_target; + GDestroyNotify eq_target_destroy_notify; + void* _tmp6_ = NULL; + GDestroyNotify _tmp7_ = NULL; + GCompareDataFunc _tmp8_ = NULL; + GCompareDataFunc cmp; + void* cmp_target; + GDestroyNotify cmp_target_destroy_notify; + gboolean _tmp9_ = FALSE; + gint _tmp10_ = 0; + gboolean _tmp11_ = FALSE; + gint _tmp12_ = 0; + gboolean _tmp13_ = FALSE; + gint _tmp14_ = 0; + gboolean _tmp15_ = FALSE; + gint _tmp16_ = 0; + g_return_if_fail (self != NULL); + _tmp0_ = functions_tests_my_comparable_new (2); + two = _tmp0_; + _tmp1_ = functions_tests_my_comparable_new (1); + one = _tmp1_; + _tmp2_ = functions_tests_my_comparable_new (2); + two_copy = _tmp2_; + _tmp5_ = gee_functions_get_equal_func_for (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, &_tmp3_, &_tmp4_); + eq = _tmp5_; + eq_target = _tmp3_; + eq_target_destroy_notify = _tmp4_; + _tmp8_ = gee_functions_get_compare_func_for (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, &_tmp6_, &_tmp7_); + cmp = _tmp8_; + cmp_target = _tmp6_; + cmp_target_destroy_notify = _tmp7_; + _vala_assert (eq != NULL, "eq != null"); + _vala_assert (cmp != NULL, "cmp != null"); + _tmp9_ = eq (two, two, eq_target); + _vala_assert (_tmp9_, "eq (two, two)"); + _tmp10_ = cmp (two, two, cmp_target); + _vala_assert (_tmp10_ == 0, "cmp (two, two) == 0"); + _tmp11_ = eq (two, two_copy, eq_target); + _vala_assert (_tmp11_, "eq (two, two_copy)"); + _tmp12_ = cmp (two, two_copy, cmp_target); + _vala_assert (_tmp12_ == 0, "cmp (two, two_copy) == 0"); + _tmp13_ = eq (one, two, eq_target); + _vala_assert (!_tmp13_, "!eq (one, two)"); + _tmp14_ = cmp (one, two, cmp_target); + _vala_assert (_tmp14_ < 0, "cmp (one, two) < 0"); + _tmp15_ = eq (two, one, eq_target); + _vala_assert (!_tmp15_, "!eq (two, one)"); + _tmp16_ = cmp (two, one, cmp_target); + _vala_assert (_tmp16_ > 0, "cmp (two, one) > 0"); + (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL); + cmp = NULL; + cmp_target = NULL; + cmp_target_destroy_notify = NULL; + (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL); + eq = NULL; + eq_target = NULL; + eq_target_destroy_notify = NULL; + _g_object_unref0 (two_copy); + _g_object_unref0 (one); + _g_object_unref0 (two); +} + + +void functions_tests_test_hash_func (FunctionsTests* self) { + FunctionsTestsMyHashable* _tmp0_; + FunctionsTestsMyHashable* two; + FunctionsTestsMyHashable* _tmp1_; + FunctionsTestsMyHashable* one; + FunctionsTestsMyHashable* _tmp2_; + FunctionsTestsMyHashable* two_copy; + FunctionsTestsMyHashable* _tmp3_; + FunctionsTestsMyHashable* minus_one; + FunctionsTestsMyHashable* _tmp4_; + FunctionsTestsMyHashable* minus_one2; + void* _tmp5_ = NULL; + GDestroyNotify _tmp6_ = NULL; + GeeEqualDataFunc _tmp7_ = NULL; + GeeEqualDataFunc eq; + void* eq_target; + GDestroyNotify eq_target_destroy_notify; + void* _tmp8_ = NULL; + GDestroyNotify _tmp9_ = NULL; + GCompareDataFunc _tmp10_ = NULL; + GCompareDataFunc cmp; + void* cmp_target; + GDestroyNotify cmp_target_destroy_notify; + void* _tmp11_ = NULL; + GDestroyNotify _tmp12_ = NULL; + GeeHashDataFunc _tmp13_ = NULL; + GeeHashDataFunc hash; + void* hash_target; + GDestroyNotify hash_target_destroy_notify; + gboolean _tmp14_ = FALSE; + gint _tmp15_ = 0; + guint _tmp16_ = 0U; + guint _tmp17_ = 0U; + gboolean _tmp18_ = FALSE; + gint _tmp19_ = 0; + guint _tmp20_ = 0U; + guint _tmp21_ = 0U; + gboolean _tmp22_ = FALSE; + gint _tmp23_ = 0; + gboolean _tmp24_ = FALSE; + gint _tmp25_ = 0; + guint _tmp26_ = 0U; + gboolean _tmp27_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = functions_tests_my_hashable_new (2); + two = _tmp0_; + _tmp1_ = functions_tests_my_hashable_new (1); + one = _tmp1_; + _tmp2_ = functions_tests_my_hashable_new (2); + two_copy = _tmp2_; + _tmp3_ = functions_tests_my_hashable_new (-1); + minus_one = _tmp3_; + _tmp4_ = functions_tests_my_hashable_new (-1); + minus_one2 = _tmp4_; + _tmp7_ = gee_functions_get_equal_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp5_, &_tmp6_); + eq = _tmp7_; + eq_target = _tmp5_; + eq_target_destroy_notify = _tmp6_; + _tmp10_ = gee_functions_get_compare_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp8_, &_tmp9_); + cmp = _tmp10_; + cmp_target = _tmp8_; + cmp_target_destroy_notify = _tmp9_; + _tmp13_ = gee_functions_get_hash_func_for (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, &_tmp11_, &_tmp12_); + hash = _tmp13_; + hash_target = _tmp11_; + hash_target_destroy_notify = _tmp12_; + _vala_assert (eq != NULL, "eq != null"); + _vala_assert (cmp != NULL, "cmp != null"); + _vala_assert (hash != NULL, "hash != null"); + _tmp14_ = eq (two, two, eq_target); + _vala_assert (_tmp14_, "eq (two, two)"); + _tmp15_ = cmp (two, two, cmp_target); + _vala_assert (_tmp15_ == 0, "cmp (two, two) == 0"); + _tmp16_ = hash (two, hash_target); + _tmp17_ = hash (two, hash_target); + _vala_assert (_tmp16_ == _tmp17_, "hash (two) == hash (two)"); + _tmp18_ = eq (two, two_copy, eq_target); + _vala_assert (_tmp18_, "eq (two, two_copy)"); + _tmp19_ = cmp (two, two_copy, cmp_target); + _vala_assert (_tmp19_ == 0, "cmp (two, two_copy) == 0"); + _tmp20_ = hash (two, hash_target); + _tmp21_ = hash (two_copy, hash_target); + _vala_assert (_tmp20_ == _tmp21_, "hash (two) == hash (two_copy)"); + _tmp22_ = eq (one, two, eq_target); + _vala_assert (!_tmp22_, "!eq (one, two)"); + _tmp23_ = cmp (one, two, cmp_target); + _vala_assert (_tmp23_ < 0, "cmp (one, two) < 0"); + _tmp24_ = eq (two, one, eq_target); + _vala_assert (!_tmp24_, "!eq (two, one)"); + _tmp25_ = cmp (two, one, cmp_target); + _vala_assert (_tmp25_ > 0, "cmp (two, one) > 0"); + _tmp26_ = hash (one, hash_target); + _vala_assert (_tmp26_ == ((guint) 1), "hash (one) == 1"); + _tmp27_ = eq (minus_one, minus_one2, eq_target); + _vala_assert (!_tmp27_, "!eq (minus_one, minus_one2)"); + (hash_target_destroy_notify == NULL) ? NULL : (hash_target_destroy_notify (hash_target), NULL); + hash = NULL; + hash_target = NULL; + hash_target_destroy_notify = NULL; + (cmp_target_destroy_notify == NULL) ? NULL : (cmp_target_destroy_notify (cmp_target), NULL); + cmp = NULL; + cmp_target = NULL; + cmp_target_destroy_notify = NULL; + (eq_target_destroy_notify == NULL) ? NULL : (eq_target_destroy_notify (eq_target), NULL); + eq = NULL; + eq_target = NULL; + eq_target_destroy_notify = NULL; + _g_object_unref0 (minus_one2); + _g_object_unref0 (minus_one); + _g_object_unref0 (two_copy); + _g_object_unref0 (one); + _g_object_unref0 (two); +} + + +static Block5Data* block5_data_ref (Block5Data* _data5_) { + g_atomic_int_inc (&_data5_->_ref_count_); + return _data5_; +} + + +static void block5_data_unref (void * _userdata_) { + Block5Data* _data5_; + _data5_ = (Block5Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) { + FunctionsTests * self; + self = _data5_->self; + _g_object_unref0 (self); + g_slice_free (Block5Data, _data5_); + } +} + + +static Block6Data* block6_data_ref (Block6Data* _data6_) { + g_atomic_int_inc (&_data6_->_ref_count_); + return _data6_; +} + + +static void block6_data_unref (void * _userdata_) { + Block6Data* _data6_; + _data6_ = (Block6Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) { + FunctionsTests * self; + self = _data6_->_data5_->self; + block5_data_unref (_data6_->_data5_); + _data6_->_data5_ = NULL; + g_slice_free (Block6Data, _data6_); + } +} + + +static gint __lambda20_ (Block6Data* _data6_) { + Block5Data* _data5_; + FunctionsTests * self; + gint result = 0; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + _data5_ = _data6_->_data5_; + self = _data5_->self; + _tmp0_ = _data6_->k; + _tmp1_ = _data5_->i; + _vala_assert ((_tmp0_ + 1) == _tmp1_, "k + 1 == i"); + _tmp2_ = _data6_->k; + _data5_->j = _tmp2_; + _tmp3_ = _data6_->k; + result = _tmp3_; + return result; +} + + +static gpointer ___lambda20__gee_lazy_func (gpointer self) { + gpointer result; + result = __lambda20_ (self); + return result; +} + + +static GeeLazy* __lambda19_ (Block5Data* _data5_) { + FunctionsTests * self; + GeeLazy* result = NULL; + Block6Data* _data6_; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + GeeLazy* _tmp4_; + self = _data5_->self; + _data6_ = g_slice_new0 (Block6Data); + _data6_->_ref_count_ = 1; + _data6_->_data5_ = block5_data_ref (_data5_); + _tmp0_ = _data5_->j; + _tmp1_ = _data5_->i; + _vala_assert ((_tmp0_ + 1) == _tmp1_, "j + 1 == i"); + _tmp2_ = _data5_->i; + if (_tmp2_ == 10) { + result = NULL; + block6_data_unref (_data6_); + _data6_ = NULL; + return result; + } + _tmp3_ = _data5_->i; + _data5_->i = _tmp3_ + 1; + _data6_->k = _tmp3_; + _tmp4_ = gee_lazy_new (G_TYPE_INT, NULL, NULL, ___lambda20__gee_lazy_func, block6_data_ref (_data6_), block6_data_unref); + result = _tmp4_; + block6_data_unref (_data6_); + _data6_ = NULL; + return result; +} + + +static GeeLazy* ___lambda19__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = __lambda19_ (self); + return result; +} + + +void functions_tests_test_unfold (FunctionsTests* self) { + Block5Data* _data5_; + GeeIterator* _tmp0_ = NULL; + GeeIterator* iter; + gint k; + gint _tmp10_; + g_return_if_fail (self != NULL); + _data5_ = g_slice_new0 (Block5Data); + _data5_->_ref_count_ = 1; + _data5_->self = g_object_ref (self); + _data5_->i = 0; + _data5_->j = -1; + _tmp0_ = gee_iterator_unfold (G_TYPE_INT, NULL, NULL, ___lambda19__gee_unfold_func, block5_data_ref (_data5_), block5_data_unref, NULL); + iter = _tmp0_; + k = 0; + while (TRUE) { + GeeIterator* _tmp1_; + gboolean _tmp2_ = FALSE; + GeeIterator* _tmp3_; + gpointer _tmp4_ = NULL; + gint _tmp5_; + GeeIterator* _tmp6_; + gpointer _tmp7_ = NULL; + gint _tmp8_; + gint _tmp9_; + _tmp1_ = iter; + _tmp2_ = gee_iterator_next (_tmp1_); + if (!_tmp2_) { + break; + } + _tmp3_ = iter; + _tmp4_ = gee_iterator_get (_tmp3_); + _tmp5_ = k; + _vala_assert (((gint) ((gintptr) _tmp4_)) == _tmp5_, "iter.get () == k"); + _tmp6_ = iter; + _tmp7_ = gee_iterator_get (_tmp6_); + _tmp8_ = k; + _vala_assert (((gint) ((gintptr) _tmp7_)) == _tmp8_, "iter.get () == k"); + _tmp9_ = k; + k = _tmp9_ + 1; + } + _tmp10_ = k; + _vala_assert (_tmp10_ == 10, "k == 10"); + _g_object_unref0 (iter); + block5_data_unref (_data5_); + _data5_ = NULL; +} + + +static Block7Data* block7_data_ref (Block7Data* _data7_) { + g_atomic_int_inc (&_data7_->_ref_count_); + return _data7_; +} + + +static void block7_data_unref (void * _userdata_) { + Block7Data* _data7_; + _data7_ = (Block7Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) { + FunctionsTests * self; + self = _data7_->self; + _g_object_unref0 (self); + g_slice_free (Block7Data, _data7_); + } +} + + +static Block8Data* block8_data_ref (Block8Data* _data8_) { + g_atomic_int_inc (&_data8_->_ref_count_); + return _data8_; +} + + +static void block8_data_unref (void * _userdata_) { + Block8Data* _data8_; + _data8_ = (Block8Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) { + FunctionsTests * self; + self = _data8_->_data7_->self; + block7_data_unref (_data8_->_data7_); + _data8_->_data7_ = NULL; + g_slice_free (Block8Data, _data8_); + } +} + + +static GeeLazy* __lambda22_ (Block8Data* _data8_) { + Block7Data* _data7_; + FunctionsTests * self; + GeeLazy* result = NULL; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeLazy* _tmp3_; + _data7_ = _data8_->_data7_; + self = _data7_->self; + _tmp0_ = _data8_->j; + _tmp1_ = _data8_->start; + if (_tmp0_ == (_tmp1_ + 3)) { + result = NULL; + return result; + } + _tmp2_ = _data8_->j; + _data8_->j = _tmp2_ + 1; + _tmp3_ = gee_lazy_new_from_value (G_TYPE_INT, NULL, NULL, (gpointer) ((gintptr) _tmp2_)); + result = _tmp3_; + return result; +} + + +static GeeLazy* ___lambda22__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = __lambda22_ (self); + return result; +} + + +static GeeLazy* __lambda21_ (Block7Data* _data7_) { + FunctionsTests * self; + GeeLazy* result = NULL; + Block8Data* _data8_; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + GeeIterator* _tmp3_ = NULL; + GeeIterator* iter; + GeeIterator* _tmp4_; + GeeLazy* _tmp5_; + self = _data7_->self; + _data8_ = g_slice_new0 (Block8Data); + _data8_->_ref_count_ = 1; + _data8_->_data7_ = block7_data_ref (_data7_); + _tmp0_ = _data7_->i; + if (_tmp0_ >= 3) { + result = NULL; + block8_data_unref (_data8_); + _data8_ = NULL; + return result; + } + _tmp1_ = _data7_->i; + _data7_->i = _tmp1_ + 1; + _data8_->j = _tmp1_ * 3; + _tmp2_ = _data8_->j; + _data8_->start = _tmp2_; + _tmp3_ = gee_iterator_unfold (G_TYPE_INT, NULL, NULL, ___lambda22__gee_unfold_func, block8_data_ref (_data8_), block8_data_unref, NULL); + iter = _tmp3_; + _tmp4_ = iter; + _tmp5_ = gee_lazy_new_from_value (GEE_TYPE_ITERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp4_); + result = _tmp5_; + _g_object_unref0 (iter); + block8_data_unref (_data8_); + _data8_ = NULL; + return result; +} + + +static GeeLazy* ___lambda21__gee_unfold_func (gpointer self) { + GeeLazy* result; + result = __lambda21_ (self); + return result; +} + + +void functions_tests_test_concat (FunctionsTests* self) { + Block7Data* _data7_; + GeeIterator* _tmp0_ = NULL; + GeeIterator* iter_; + gint j; + GeeIterator* _tmp1_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* iter; + gint _tmp12_; + gint _tmp13_; + g_return_if_fail (self != NULL); + _data7_ = g_slice_new0 (Block7Data); + _data7_->_ref_count_ = 1; + _data7_->self = g_object_ref (self); + _data7_->i = 0; + _tmp0_ = gee_iterator_unfold (GEE_TYPE_ITERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, ___lambda21__gee_unfold_func, block7_data_ref (_data7_), block7_data_unref, NULL); + iter_ = _tmp0_; + j = 0; + _tmp1_ = iter_; + _tmp2_ = gee_iterator_concat (G_TYPE_INT, NULL, NULL, _tmp1_); + iter = _tmp2_; + while (TRUE) { + GeeIterator* _tmp3_; + gboolean _tmp4_ = FALSE; + gint _tmp5_; + GeeIterator* _tmp6_; + gpointer _tmp7_ = NULL; + gint _tmp8_; + GeeIterator* _tmp9_; + gpointer _tmp10_ = NULL; + gint _tmp11_; + _tmp3_ = iter; + _tmp4_ = gee_iterator_next (_tmp3_); + if (!_tmp4_) { + break; + } + _tmp5_ = j; + _tmp6_ = iter; + _tmp7_ = gee_iterator_get (_tmp6_); + _vala_assert (_tmp5_ == ((gint) ((gintptr) _tmp7_)), "j == iter.get ()"); + _tmp8_ = j; + _tmp9_ = iter; + _tmp10_ = gee_iterator_get (_tmp9_); + _vala_assert (_tmp8_ == ((gint) ((gintptr) _tmp10_)), "j == iter.get ()"); + _tmp11_ = j; + j = _tmp11_ + 1; + } + _tmp12_ = _data7_->i; + _vala_assert (_tmp12_ == 3, "i == 3"); + _tmp13_ = j; + _vala_assert (_tmp13_ == 9, "j == 9"); + _g_object_unref0 (iter); + _g_object_unref0 (iter_); + block7_data_unref (_data7_); + _data7_ = NULL; +} + + +static FunctionsTestsMyComparable* functions_tests_my_comparable_construct (GType object_type, gint i) { + FunctionsTestsMyComparable * self = NULL; + gint _tmp0_; + self = (FunctionsTestsMyComparable*) g_object_new (object_type, NULL); + _tmp0_ = i; + self->priv->i = _tmp0_; + return self; +} + + +static FunctionsTestsMyComparable* functions_tests_my_comparable_new (gint i) { + return functions_tests_my_comparable_construct (FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, i); +} + + +static gint functions_tests_my_comparable_real_compare_to (GeeComparable* base, FunctionsTestsMyComparable* cmp) { + FunctionsTestsMyComparable * self; + gint result = 0; + gint _tmp0_; + FunctionsTestsMyComparable* _tmp1_; + gint _tmp2_; + self = (FunctionsTestsMyComparable*) base; + g_return_val_if_fail (cmp != NULL, 0); + _tmp0_ = self->priv->i; + _tmp1_ = cmp; + _tmp2_ = _tmp1_->priv->i; + if (_tmp0_ == _tmp2_) { + result = 0; + return result; + } else { + gint _tmp3_; + FunctionsTestsMyComparable* _tmp4_; + gint _tmp5_; + _tmp3_ = self->priv->i; + _tmp4_ = cmp; + _tmp5_ = _tmp4_->priv->i; + if (_tmp3_ >= _tmp5_) { + result = 1; + return result; + } else { + result = -1; + return result; + } + } +} + + +static void functions_tests_my_comparable_class_init (FunctionsTestsMyComparableClass * klass) { + functions_tests_my_comparable_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (FunctionsTestsMyComparablePrivate)); + G_OBJECT_CLASS (klass)->finalize = functions_tests_my_comparable_finalize; +} + + +static void functions_tests_my_comparable_gee_comparable_interface_init (GeeComparableIface * iface) { + functions_tests_my_comparable_gee_comparable_parent_iface = g_type_interface_peek_parent (iface); + iface->compare_to = (gint (*)(GeeComparable*, gconstpointer)) functions_tests_my_comparable_real_compare_to; +} + + +static void functions_tests_my_comparable_instance_init (FunctionsTestsMyComparable * self) { + self->priv = FUNCTIONS_TESTS_MY_COMPARABLE_GET_PRIVATE (self); +} + + +static void functions_tests_my_comparable_finalize (GObject* obj) { + FunctionsTestsMyComparable * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, FUNCTIONS_TESTS_TYPE_MY_COMPARABLE, FunctionsTestsMyComparable); + G_OBJECT_CLASS (functions_tests_my_comparable_parent_class)->finalize (obj); +} + + +static GType functions_tests_my_comparable_get_type (void) { + static volatile gsize functions_tests_my_comparable_type_id__volatile = 0; + if (g_once_init_enter (&functions_tests_my_comparable_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsMyComparableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_my_comparable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTestsMyComparable), 0, (GInstanceInitFunc) functions_tests_my_comparable_instance_init, NULL }; + static const GInterfaceInfo gee_comparable_info = { (GInterfaceInitFunc) functions_tests_my_comparable_gee_comparable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType functions_tests_my_comparable_type_id; + functions_tests_my_comparable_type_id = g_type_register_static (G_TYPE_OBJECT, "FunctionsTestsMyComparable", &g_define_type_info, 0); + g_type_add_interface_static (functions_tests_my_comparable_type_id, GEE_TYPE_COMPARABLE, &gee_comparable_info); + g_once_init_leave (&functions_tests_my_comparable_type_id__volatile, functions_tests_my_comparable_type_id); + } + return functions_tests_my_comparable_type_id__volatile; +} + + +static FunctionsTestsMyHashable* functions_tests_my_hashable_construct (GType object_type, gint i) { + FunctionsTestsMyHashable * self = NULL; + gint _tmp0_; + self = (FunctionsTestsMyHashable*) g_object_new (object_type, NULL); + _tmp0_ = i; + self->priv->i = _tmp0_; + return self; +} + + +static FunctionsTestsMyHashable* functions_tests_my_hashable_new (gint i) { + return functions_tests_my_hashable_construct (FUNCTIONS_TESTS_TYPE_MY_HASHABLE, i); +} + + +static gint functions_tests_my_hashable_real_compare_to (GeeComparable* base, FunctionsTestsMyHashable* cmp) { + FunctionsTestsMyHashable * self; + gint result = 0; + gint _tmp0_; + FunctionsTestsMyHashable* _tmp1_; + gint _tmp2_; + self = (FunctionsTestsMyHashable*) base; + g_return_val_if_fail (cmp != NULL, 0); + _tmp0_ = self->priv->i; + _tmp1_ = cmp; + _tmp2_ = _tmp1_->priv->i; + if (_tmp0_ == _tmp2_) { + result = 0; + return result; + } else { + gint _tmp3_; + FunctionsTestsMyHashable* _tmp4_; + gint _tmp5_; + _tmp3_ = self->priv->i; + _tmp4_ = cmp; + _tmp5_ = _tmp4_->priv->i; + if (_tmp3_ >= _tmp5_) { + result = 1; + return result; + } else { + result = -1; + return result; + } + } +} + + +static guint functions_tests_my_hashable_real_hash (GeeHashable* base) { + FunctionsTestsMyHashable * self; + guint result = 0U; + gint _tmp0_; + self = (FunctionsTestsMyHashable*) base; + _tmp0_ = self->priv->i; + result = (guint) _tmp0_; + return result; +} + + +static gboolean functions_tests_my_hashable_real_equal_to (GeeHashable* base, FunctionsTestsMyHashable* hash) { + FunctionsTestsMyHashable * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gint _tmp1_; + FunctionsTestsMyHashable* _tmp2_; + gint _tmp3_; + gboolean _tmp5_; + self = (FunctionsTestsMyHashable*) base; + g_return_val_if_fail (hash != NULL, FALSE); + _tmp1_ = self->priv->i; + _tmp2_ = hash; + _tmp3_ = _tmp2_->priv->i; + if (_tmp1_ == _tmp3_) { + gint _tmp4_; + _tmp4_ = self->priv->i; + _tmp0_ = _tmp4_ != (-1); + } else { + _tmp0_ = FALSE; + } + _tmp5_ = _tmp0_; + result = _tmp5_; + return result; +} + + +static void functions_tests_my_hashable_class_init (FunctionsTestsMyHashableClass * klass) { + functions_tests_my_hashable_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (FunctionsTestsMyHashablePrivate)); + G_OBJECT_CLASS (klass)->finalize = functions_tests_my_hashable_finalize; +} + + +static void functions_tests_my_hashable_gee_comparable_interface_init (GeeComparableIface * iface) { + functions_tests_my_hashable_gee_comparable_parent_iface = g_type_interface_peek_parent (iface); + iface->compare_to = (gint (*)(GeeComparable*, gconstpointer)) functions_tests_my_hashable_real_compare_to; +} + + +static void functions_tests_my_hashable_gee_hashable_interface_init (GeeHashableIface * iface) { + functions_tests_my_hashable_gee_hashable_parent_iface = g_type_interface_peek_parent (iface); + iface->hash = (guint (*)(GeeHashable*)) functions_tests_my_hashable_real_hash; + iface->equal_to = (gboolean (*)(GeeHashable*, gconstpointer)) functions_tests_my_hashable_real_equal_to; +} + + +static void functions_tests_my_hashable_instance_init (FunctionsTestsMyHashable * self) { + self->priv = FUNCTIONS_TESTS_MY_HASHABLE_GET_PRIVATE (self); +} + + +static void functions_tests_my_hashable_finalize (GObject* obj) { + FunctionsTestsMyHashable * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, FUNCTIONS_TESTS_TYPE_MY_HASHABLE, FunctionsTestsMyHashable); + G_OBJECT_CLASS (functions_tests_my_hashable_parent_class)->finalize (obj); +} + + +static GType functions_tests_my_hashable_get_type (void) { + static volatile gsize functions_tests_my_hashable_type_id__volatile = 0; + if (g_once_init_enter (&functions_tests_my_hashable_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsMyHashableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_my_hashable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTestsMyHashable), 0, (GInstanceInitFunc) functions_tests_my_hashable_instance_init, NULL }; + static const GInterfaceInfo gee_comparable_info = { (GInterfaceInitFunc) functions_tests_my_hashable_gee_comparable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + static const GInterfaceInfo gee_hashable_info = { (GInterfaceInitFunc) functions_tests_my_hashable_gee_hashable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType functions_tests_my_hashable_type_id; + functions_tests_my_hashable_type_id = g_type_register_static (G_TYPE_OBJECT, "FunctionsTestsMyHashable", &g_define_type_info, 0); + g_type_add_interface_static (functions_tests_my_hashable_type_id, GEE_TYPE_COMPARABLE, &gee_comparable_info); + g_type_add_interface_static (functions_tests_my_hashable_type_id, GEE_TYPE_HASHABLE, &gee_hashable_info); + g_once_init_leave (&functions_tests_my_hashable_type_id__volatile, functions_tests_my_hashable_type_id); + } + return functions_tests_my_hashable_type_id__volatile; +} + + +static void functions_tests_class_init (FunctionsTestsClass * klass) { + functions_tests_parent_class = g_type_class_peek_parent (klass); +} + + +static void functions_tests_instance_init (FunctionsTests * self) { +} + + +GType functions_tests_get_type (void) { + static volatile gsize functions_tests_type_id__volatile = 0; + if (g_once_init_enter (&functions_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (FunctionsTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) functions_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FunctionsTests), 0, (GInstanceInitFunc) functions_tests_instance_init, NULL }; + GType functions_tests_type_id; + functions_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "FunctionsTests", &g_define_type_info, 0); + g_once_init_leave (&functions_tests_type_id__volatile, functions_tests_type_id); + } + return functions_tests_type_id__volatile; +} + + + diff --git a/tests/testfunctions.vala b/tests/testfunctions.vala new file mode 100644 index 0000000..1fff514 --- /dev/null +++ b/tests/testfunctions.vala @@ -0,0 +1,238 @@ +/* testfunctions.vala + * + * Copyright (C) 2010 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +public class FunctionsTests : Gee.TestCase { + public FunctionsTests () { + base ("Functions"); + add_test ("[Functions] comparing and hashing strings", test_string_func); + add_test ("[Functions] comparing and hashing int", test_int_func); + add_test ("[Functions] comparing instances of Comparable", test_compare_func); + add_test ("[Functions] comparing and hashing instances of Hashable", test_hash_func); + add_test ("[Iterator] unfold", test_unfold); + add_test ("[Iterator] concat", test_concat); + } + + public void test_string_func () { + string one = "one"; + string two = "two"; + string two_copy = two.dup (); + + Gee.EqualDataFunc eq = Gee.Functions.get_equal_func_for (typeof (string)); + CompareDataFunc cmp = Gee.Functions.get_compare_func_for (typeof (string)); + Gee.HashDataFunc hash = Gee.Functions.get_hash_func_for (typeof (string)); + assert (eq != null); + assert (cmp != null); + assert (hash != null); + + assert (eq (two, two)); + assert (cmp (two, two) == 0); + assert (hash (two) == hash (two)); + + assert (eq (two, two_copy)); + assert (cmp (two, two_copy) == 0); + assert (hash (two) == hash (two_copy)); + + assert (!eq (one, two)); + assert (cmp (one, two) < 0); + + assert (!eq (two, one)); + assert (cmp (two, one) > 0); + } + + public void test_int_func () { + void *one = (void *)1; + void *two = (void *)2; + + Gee.EqualDataFunc eq = Gee.Functions.get_equal_func_for (typeof (int)); + CompareDataFunc cmp = Gee.Functions.get_compare_func_for (typeof (int)); + Gee.HashDataFunc hash = Gee.Functions.get_hash_func_for (typeof (int)); + + assert (eq != null); + assert (cmp != null); + assert (hash != null); + + assert (eq (two, two)); + assert (cmp (two, two) == 0); + assert (hash (two) == hash (two)); + + assert (!eq (one, two)); + assert (cmp (one, two) < 0); + + assert (!eq (two, one)); + assert (cmp (two, one) > 0); + } + + public void test_compare_func () { + MyComparable two = new MyComparable(2); + MyComparable one = new MyComparable(1); + MyComparable two_copy = new MyComparable(2); + + Gee.EqualDataFunc eq = Gee.Functions.get_equal_func_for (typeof (MyComparable)); + CompareDataFunc cmp = Gee.Functions.get_compare_func_for (typeof (MyComparable)); + //Gee.HashDataFunc hash = Gee.Functions.get_hash_func_for (typeof (MyComparable)); + + assert (eq != null); + assert (cmp != null); + //assert (hash != null); + + assert (eq (two, two)); + assert (cmp (two, two) == 0); + //assert (hash (two) == hash (two)); + + assert (eq (two, two_copy)); + assert (cmp (two, two_copy) == 0); + //assert (hash (two) == hash (two_copy)); + + assert (!eq (one, two)); + assert (cmp (one, two) < 0); + + assert (!eq (two, one)); + assert (cmp (two, one) > 0); + } + + public void test_hash_func () { + MyHashable two = new MyHashable(2); + MyHashable one = new MyHashable(1); + MyHashable two_copy = new MyHashable(2); + MyHashable minus_one = new MyHashable(-1); + MyHashable minus_one2 = new MyHashable(-1); + + Gee.EqualDataFunc eq = Gee.Functions.get_equal_func_for (typeof (MyHashable)); + CompareDataFunc cmp = Gee.Functions.get_compare_func_for (typeof (MyHashable)); + Gee.HashDataFunc hash = Gee.Functions.get_hash_func_for (typeof (MyHashable)); + + assert (eq != null); + assert (cmp != null); + assert (hash != null); + + assert (eq (two, two)); + assert (cmp (two, two) == 0); + assert (hash (two) == hash (two)); + + assert (eq (two, two_copy)); + assert (cmp (two, two_copy) == 0); + assert (hash (two) == hash (two_copy)); + + assert (!eq (one, two)); + assert (cmp (one, two) < 0); + + assert (!eq (two, one)); + assert (cmp (two, one) > 0); + + // Check if correct functions taken + assert (hash (one) == 1); + assert (!eq (minus_one, minus_one2)); + } + + public void test_unfold () { + int i = 0; + int j = -1; + var iter = Gee.Iterator.unfold (() => { + assert (j + 1 == i); + if (i == 10) + return null; + int k = i++; + return new Gee.Lazy (() => { + assert (k + 1 == i); + j = k; + return k; + }); + }); + int k = 0; + while (iter.next ()) { + assert (iter.get () == k); + assert (iter.get () == k); + k++; + } + assert (k == 10); + } + + public void test_concat () { + int i = 0; + var iter_ = Gee.Iterator.unfold> (() => { + if (i >= 3) + return null; + int j = i++*3; + int start = j; + var iter = Gee.Iterator.unfold (() => { + if (j == start + 3) + return null; + return new Gee.Lazy.from_value (j++); + }); + return new Gee.Lazy>.from_value (iter); + }); + + int j = 0; + var iter = Gee.Iterator.concat (iter_); + while (iter.next()) { + assert (j == iter.get ()); + assert (j == iter.get ()); + j++; + } + assert (i == 3); + assert (j == 9); + } + + private class MyComparable : GLib.Object, Gee.Comparable { + public MyComparable (int i) { + this.i = i; + } + + public int compare_to (MyComparable cmp) { + if (i == cmp.i) + return 0; + else if (i >= cmp.i) + return 1; + else + return -1; + } + + int i; + } + + private class MyHashable : GLib.Object, Gee.Comparable, Gee.Hashable { + public MyHashable (int i) { + this.i = i; + } + + public int compare_to (MyHashable cmp) { + if (i == cmp.i) + return 0; + else if (i >= cmp.i) + return 1; + else + return -1; + } + + public uint hash () { + return i; + } + + public bool equal_to (MyHashable hash) { + // -1 break API but it is used for checks + return i == hash.i && i != -1; + } + + int i; + } +} + diff --git a/tests/testhashmap.c b/tests/testhashmap.c index 9f826ed..8e7124e 100644 --- a/tests/testhashmap.c +++ b/tests/testhashmap.c @@ -64,7 +64,6 @@ typedef struct _HashMapTests HashMapTests; typedef struct _HashMapTestsClass HashMapTestsClass; typedef struct _HashMapTestsPrivate HashMapTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { GObject parent_instance; @@ -96,7 +95,6 @@ struct _HashMapTestsClass { MapTestsClass parent_class; }; -typedef void (*GeeTestCaseTestMethod) (void* user_data); static gpointer hash_map_tests_parent_class = NULL; @@ -109,30 +107,13 @@ enum { HashMapTests* hash_map_tests_new (void); HashMapTests* hash_map_tests_construct (GType object_type); MapTests* map_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -void hash_map_tests_test_selected_functions (HashMapTests* self); -static void _hash_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void hash_map_tests_test_gobject_properties (HashMapTests* self); -static void _hash_map_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); static void hash_map_tests_real_set_up (GeeTestCase* base); static void hash_map_tests_real_tear_down (GeeTestCase* base); -static void _hash_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - hash_map_tests_test_selected_functions (self); -} - - -static void _hash_map_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - hash_map_tests_test_gobject_properties (self); -} - - HashMapTests* hash_map_tests_construct (GType object_type) { HashMapTests * self = NULL; self = (HashMapTests*) map_tests_construct (object_type, "HashMap"); - gee_test_case_add_test ((GeeTestCase*) self, "[HashMap] selected functions", _hash_map_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[HashMap] GObject properties", _hash_map_tests_test_gobject_properties_gee_test_case_test_method, self); return self; } @@ -146,7 +127,7 @@ static void hash_map_tests_real_set_up (GeeTestCase* base) { HashMapTests * self; GeeHashMap* _tmp0_; self = (HashMapTests*) base; - _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((MapTests*) self)->test_map); ((MapTests*) self)->test_map = (GeeMap*) _tmp0_; } @@ -160,105 +141,6 @@ static void hash_map_tests_real_tear_down (GeeTestCase* base) { } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -void hash_map_tests_test_selected_functions (HashMapTests* self) { - GeeMap* _tmp0_; - GeeHashMap* _tmp1_; - GeeHashMap* test_hash_map; - GHashFunc _tmp2_; - GHashFunc _tmp3_; - GHashFunc _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; - GEqualFunc _tmp8_; - GEqualFunc _tmp9_; - GEqualFunc _tmp10_; - g_return_if_fail (self != NULL); - _tmp0_ = ((MapTests*) self)->test_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_MAP) ? ((GeeHashMap*) _tmp0_) : NULL); - test_hash_map = _tmp1_; - _vala_assert (test_hash_map != NULL, "test_hash_map != null"); - _tmp2_ = gee_hash_map_get_key_hash_func (test_hash_map); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_hash; - _vala_assert (_tmp3_ == _tmp4_, "test_hash_map.key_hash_func == str_hash"); - _tmp5_ = gee_hash_map_get_key_equal_func (test_hash_map); - _tmp6_ = _tmp5_; - _tmp7_ = g_str_equal; - _vala_assert (_tmp6_ == _tmp7_, "test_hash_map.key_equal_func == str_equal"); - _tmp8_ = gee_hash_map_get_value_equal_func (test_hash_map); - _tmp9_ = _tmp8_; - _tmp10_ = g_str_equal; - _vala_assert (_tmp9_ == _tmp10_, "test_hash_map.value_equal_func == str_equal"); - _g_object_unref0 (test_hash_map); -} - - -void hash_map_tests_test_gobject_properties (HashMapTests* self) { - GeeMap* _tmp0_; - GeeHashMap* _tmp1_; - GeeHashMap* test_hash_map; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GHashFunc _tmp5_; - GHashFunc _tmp6_; - GValue _tmp7_ = {0}; - GValue _tmp8_; - void* _tmp9_ = NULL; - GEqualFunc _tmp10_; - GEqualFunc _tmp11_; - GValue _tmp12_ = {0}; - GValue _tmp13_; - void* _tmp14_ = NULL; - GEqualFunc _tmp15_; - GEqualFunc _tmp16_; - g_return_if_fail (self != NULL); - _tmp0_ = ((MapTests*) self)->test_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_MAP) ? ((GeeHashMap*) _tmp0_) : NULL); - test_hash_map = _tmp1_; - _vala_assert (test_hash_map != NULL, "test_hash_map != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_hash_map, "key-hash-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_hash_map_get_key_hash_func (test_hash_map); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_hash_map.key_hash_func"); - g_value_unset (&value); - g_value_init (&_tmp7_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp7_; - _tmp8_ = value; - g_object_get_property ((GObject*) test_hash_map, "key-equal-func", &value); - _tmp9_ = g_value_get_pointer (&value); - _tmp10_ = gee_hash_map_get_key_equal_func (test_hash_map); - _tmp11_ = _tmp10_; - _vala_assert (_tmp9_ == ((void*) _tmp11_), "value.get_pointer () == (void*) test_hash_map.key_equal_func"); - g_value_unset (&value); - g_value_init (&_tmp12_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp12_; - _tmp13_ = value; - g_object_get_property ((GObject*) test_hash_map, "value-equal-func", &value); - _tmp14_ = g_value_get_pointer (&value); - _tmp15_ = gee_hash_map_get_value_equal_func (test_hash_map); - _tmp16_ = _tmp15_; - _vala_assert (_tmp14_ == ((void*) _tmp16_), "value.get_pointer () == (void*) test_hash_map.value_equal_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_hash_map); -} - - static void hash_map_tests_class_init (HashMapTestsClass * klass) { hash_map_tests_parent_class = g_type_class_peek_parent (klass); GEE_TEST_CASE_CLASS (klass)->set_up = hash_map_tests_real_set_up; diff --git a/tests/testhashmap.vala b/tests/testhashmap.vala index 6ea5582..ac4d989 100644 --- a/tests/testhashmap.vala +++ b/tests/testhashmap.vala @@ -27,8 +27,6 @@ public class HashMapTests : MapTests { public HashMapTests () { base ("HashMap"); - add_test ("[HashMap] selected functions", test_selected_functions); - add_test ("[HashMap] GObject properties", test_gobject_properties); } public override void set_up () { @@ -38,39 +36,4 @@ public class HashMapTests : MapTests { public override void tear_down () { test_map = null; } - - public void test_selected_functions () { - var test_hash_map = test_map as HashMap; - - // Check the map exists - assert (test_hash_map != null); - - // Check the selected hash and equal functions - assert (test_hash_map.key_hash_func == str_hash); - assert (test_hash_map.key_equal_func == str_equal); - assert (test_hash_map.value_equal_func == str_equal); - } - - public new void test_gobject_properties () { - var test_hash_map = test_map as HashMap; - - // Check the list exists - assert (test_hash_map != null); - Value value; - - value = Value (typeof (HashFunc)); - test_hash_map.get_property ("key-hash-func", ref value); - assert (value.get_pointer () == (void*) test_hash_map.key_hash_func); - value.unset (); - - value = Value (typeof (EqualFunc)); - test_hash_map.get_property ("key-equal-func", ref value); - assert (value.get_pointer () == (void*) test_hash_map.key_equal_func); - value.unset (); - - value = Value (typeof (EqualFunc)); - test_hash_map.get_property ("value-equal-func", ref value); - assert (value.get_pointer () == (void*) test_hash_map.value_equal_func); - value.unset (); - } } diff --git a/tests/testhashmultimap.c b/tests/testhashmultimap.c index 1e29589..8fd393c 100644 --- a/tests/testhashmultimap.c +++ b/tests/testhashmultimap.c @@ -111,7 +111,7 @@ enum { HashMultiMapTests* hash_multi_map_tests_new (void); HashMultiMapTests* hash_multi_map_tests_construct (GType object_type); MultiMapTests* multi_map_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void hash_multi_map_tests_test_selected_functions (HashMultiMapTests* self); static void _hash_multi_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self); static void hash_multi_map_tests_real_set_up (GeeTestCase* base); @@ -126,7 +126,7 @@ static void _hash_multi_map_tests_test_selected_functions_gee_test_case_test_met HashMultiMapTests* hash_multi_map_tests_construct (GType object_type) { HashMultiMapTests * self = NULL; self = (HashMultiMapTests*) multi_map_tests_construct (object_type, "HashMultiMap"); - gee_test_case_add_test ((GeeTestCase*) self, "[HashMultiMap] selected functions", _hash_multi_map_tests_test_selected_functions_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[HashMultiMap] selected functions", _hash_multi_map_tests_test_selected_functions_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -140,7 +140,7 @@ static void hash_multi_map_tests_real_set_up (GeeTestCase* base) { HashMultiMapTests * self; GeeHashMultiMap* _tmp0_; self = (HashMultiMapTests*) base; - _tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL); + _tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((MultiMapTests*) self)->test_multi_map); ((MultiMapTests*) self)->test_multi_map = (GeeMultiMap*) _tmp0_; } @@ -163,39 +163,11 @@ static void hash_multi_map_tests_test_selected_functions (HashMultiMapTests* sel GeeMultiMap* _tmp0_; GeeHashMultiMap* _tmp1_; GeeHashMultiMap* test_hash_multi_map; - GHashFunc _tmp2_; - GHashFunc _tmp3_; - GHashFunc _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; - GHashFunc _tmp8_; - GHashFunc _tmp9_; - GHashFunc _tmp10_; - GEqualFunc _tmp11_; - GEqualFunc _tmp12_; - GEqualFunc _tmp13_; g_return_if_fail (self != NULL); _tmp0_ = ((MultiMapTests*) self)->test_multi_map; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_MULTI_MAP) ? ((GeeHashMultiMap*) _tmp0_) : NULL); test_hash_multi_map = _tmp1_; _vala_assert (test_hash_multi_map != NULL, "test_hash_multi_map != null"); - _tmp2_ = gee_hash_multi_map_get_key_hash_func (test_hash_multi_map); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_hash; - _vala_assert (_tmp3_ == _tmp4_, "test_hash_multi_map.key_hash_func == str_hash"); - _tmp5_ = gee_hash_multi_map_get_key_equal_func (test_hash_multi_map); - _tmp6_ = _tmp5_; - _tmp7_ = g_str_equal; - _vala_assert (_tmp6_ == _tmp7_, "test_hash_multi_map.key_equal_func == str_equal"); - _tmp8_ = gee_hash_multi_map_get_value_hash_func (test_hash_multi_map); - _tmp9_ = _tmp8_; - _tmp10_ = g_str_hash; - _vala_assert (_tmp9_ == _tmp10_, "test_hash_multi_map.value_hash_func == str_hash"); - _tmp11_ = gee_hash_multi_map_get_value_equal_func (test_hash_multi_map); - _tmp12_ = _tmp11_; - _tmp13_ = g_str_equal; - _vala_assert (_tmp12_ == _tmp13_, "test_hash_multi_map.value_equal_func == str_equal"); _g_object_unref0 (test_hash_multi_map); } diff --git a/tests/testhashmultimap.vala b/tests/testhashmultimap.vala index 160985b..b334d28 100644 --- a/tests/testhashmultimap.vala +++ b/tests/testhashmultimap.vala @@ -45,11 +45,5 @@ public class HashMultiMapTests : MultiMapTests { // Check the map exists assert (test_hash_multi_map != null); - - // Check the selected hash and equal functions - assert (test_hash_multi_map.key_hash_func == str_hash); - assert (test_hash_multi_map.key_equal_func == str_equal); - assert (test_hash_multi_map.value_hash_func == str_hash); - assert (test_hash_multi_map.value_equal_func == str_equal); } } diff --git a/tests/testhashmultiset.c b/tests/testhashmultiset.c index 31adc39..48ccc3d 100644 --- a/tests/testhashmultiset.c +++ b/tests/testhashmultiset.c @@ -132,7 +132,7 @@ enum { HashMultiSetTests* hash_multi_set_tests_new (void); HashMultiSetTests* hash_multi_set_tests_construct (GType object_type); MultiSetTests* multi_set_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void hash_multi_set_tests_test_selected_functions (HashMultiSetTests* self); static void _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self); static void hash_multi_set_tests_real_set_up (GeeTestCase* base); @@ -147,7 +147,7 @@ static void _hash_multi_set_tests_test_selected_functions_gee_test_case_test_met HashMultiSetTests* hash_multi_set_tests_construct (GType object_type) { HashMultiSetTests * self = NULL; self = (HashMultiSetTests*) multi_set_tests_construct (object_type, "HashMultiSet"); - gee_test_case_add_test ((GeeTestCase*) self, "[HashMultiSet] selected functions", _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[HashMultiSet] selected functions", _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -161,7 +161,7 @@ static void hash_multi_set_tests_real_set_up (GeeTestCase* base) { HashMultiSetTests * self; GeeHashMultiSet* _tmp0_; self = (HashMultiSetTests*) base; - _tmp0_ = gee_hash_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_hash_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -184,25 +184,11 @@ static void hash_multi_set_tests_test_selected_functions (HashMultiSetTests* sel GeeCollection* _tmp0_; GeeHashMultiSet* _tmp1_; GeeHashMultiSet* test_multi_set; - GHashFunc _tmp2_; - GHashFunc _tmp3_; - GHashFunc _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_MULTI_SET) ? ((GeeHashMultiSet*) _tmp0_) : NULL); test_multi_set = _tmp1_; _vala_assert (test_multi_set != NULL, "test_multi_set != null"); - _tmp2_ = gee_hash_multi_set_get_hash_func (test_multi_set); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_hash; - _vala_assert (_tmp3_ == _tmp4_, "test_multi_set.hash_func == str_hash"); - _tmp5_ = gee_hash_multi_set_get_equal_func (test_multi_set); - _tmp6_ = _tmp5_; - _tmp7_ = g_str_equal; - _vala_assert (_tmp6_ == _tmp7_, "test_multi_set.equal_func == str_equal"); _g_object_unref0 (test_multi_set); } diff --git a/tests/testhashmultiset.vala b/tests/testhashmultiset.vala index 13b951c..da9f3f4 100644 --- a/tests/testhashmultiset.vala +++ b/tests/testhashmultiset.vala @@ -45,9 +45,5 @@ public class HashMultiSetTests : MultiSetTests { // Check the collection exists assert (test_multi_set != null); - - // Check the selected hash and equal functions - assert (test_multi_set.hash_func == str_hash); - assert (test_multi_set.equal_func == str_equal); } } diff --git a/tests/testhashset.c b/tests/testhashset.c index 59710db..94648f2 100644 --- a/tests/testhashset.c +++ b/tests/testhashset.c @@ -75,7 +75,6 @@ typedef struct _HashSetTests HashSetTests; typedef struct _HashSetTestsClass HashSetTestsClass; typedef struct _HashSetTestsPrivate HashSetTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { GObject parent_instance; @@ -117,7 +116,6 @@ struct _HashSetTestsClass { SetTestsClass parent_class; }; -typedef void (*GeeTestCaseTestMethod) (void* user_data); static gpointer hash_set_tests_parent_class = NULL; @@ -131,30 +129,13 @@ enum { HashSetTests* hash_set_tests_new (void); HashSetTests* hash_set_tests_construct (GType object_type); SetTests* set_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -void hash_set_tests_test_selected_functions (HashSetTests* self); -static void _hash_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void hash_set_tests_test_gobject_properties (HashSetTests* self); -static void _hash_set_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); static void hash_set_tests_real_set_up (GeeTestCase* base); static void hash_set_tests_real_tear_down (GeeTestCase* base); -static void _hash_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - hash_set_tests_test_selected_functions (self); -} - - -static void _hash_set_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - hash_set_tests_test_gobject_properties (self); -} - - HashSetTests* hash_set_tests_construct (GType object_type) { HashSetTests * self = NULL; self = (HashSetTests*) set_tests_construct (object_type, "HashSet"); - gee_test_case_add_test ((GeeTestCase*) self, "[HashSet] selected functions", _hash_set_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[HashSet] GObject properties", _hash_set_tests_test_gobject_properties_gee_test_case_test_method, self); return self; } @@ -168,7 +149,7 @@ static void hash_set_tests_real_set_up (GeeTestCase* base) { HashSetTests * self; GeeHashSet* _tmp0_; self = (HashSetTests*) base; - _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -182,83 +163,6 @@ static void hash_set_tests_real_tear_down (GeeTestCase* base) { } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -void hash_set_tests_test_selected_functions (HashSetTests* self) { - GeeCollection* _tmp0_; - GeeHashSet* _tmp1_; - GeeHashSet* test_set; - GHashFunc _tmp2_; - GHashFunc _tmp3_; - GHashFunc _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_SET) ? ((GeeHashSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _vala_assert (test_set != NULL, "test_set != null"); - _tmp2_ = gee_hash_set_get_hash_func (test_set); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_hash; - _vala_assert (_tmp3_ == _tmp4_, "test_set.hash_func == str_hash"); - _tmp5_ = gee_hash_set_get_equal_func (test_set); - _tmp6_ = _tmp5_; - _tmp7_ = g_str_equal; - _vala_assert (_tmp6_ == _tmp7_, "test_set.equal_func == str_equal"); - _g_object_unref0 (test_set); -} - - -void hash_set_tests_test_gobject_properties (HashSetTests* self) { - GeeCollection* _tmp0_; - GeeHashSet* _tmp1_; - GeeHashSet* test_set; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GHashFunc _tmp5_; - GHashFunc _tmp6_; - GValue _tmp7_ = {0}; - GValue _tmp8_; - void* _tmp9_ = NULL; - GEqualFunc _tmp10_; - GEqualFunc _tmp11_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_SET) ? ((GeeHashSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _vala_assert (test_set != NULL, "test_set != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_set, "hash-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_hash_set_get_hash_func (test_set); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_set.hash_func"); - g_value_unset (&value); - g_value_init (&_tmp7_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp7_; - _tmp8_ = value; - g_object_get_property ((GObject*) test_set, "equal-func", &value); - _tmp9_ = g_value_get_pointer (&value); - _tmp10_ = gee_hash_set_get_equal_func (test_set); - _tmp11_ = _tmp10_; - _vala_assert (_tmp9_ == ((void*) _tmp11_), "value.get_pointer () == (void*) test_set.equal_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_set); -} - - static void hash_set_tests_class_init (HashSetTestsClass * klass) { hash_set_tests_parent_class = g_type_class_peek_parent (klass); GEE_TEST_CASE_CLASS (klass)->set_up = hash_set_tests_real_set_up; diff --git a/tests/testhashset.vala b/tests/testhashset.vala index b252c19..1a6f8f1 100644 --- a/tests/testhashset.vala +++ b/tests/testhashset.vala @@ -27,8 +27,6 @@ public class HashSetTests : SetTests { public HashSetTests () { base ("HashSet"); - add_test ("[HashSet] selected functions", test_selected_functions); - add_test ("[HashSet] GObject properties", test_gobject_properties); } public override void set_up () { @@ -38,33 +36,4 @@ public class HashSetTests : SetTests { public override void tear_down () { test_collection = null; } - - public void test_selected_functions () { - var test_set = test_collection as HashSet; - - // Check the map exists - assert (test_set != null); - - // Check the selected hash and equal functions - assert (test_set.hash_func == str_hash); - assert (test_set.equal_func == str_equal); - } - - public new void test_gobject_properties () { - var test_set = test_collection as HashSet; - - // Check the list exists - assert (test_set != null); - Value value; - - value = Value (typeof (HashFunc)); - test_set.get_property ("hash-func", ref value); - assert (value.get_pointer () == (void*) test_set.hash_func); - value.unset (); - - value = Value (typeof (EqualFunc)); - test_set.get_property ("equal-func", ref value); - assert (value.get_pointer () == (void*) test_set.equal_func); - value.unset (); - } } diff --git a/tests/testlinkedlist.c b/tests/testlinkedlist.c index a4113f3..399055b 100644 --- a/tests/testlinkedlist.c +++ b/tests/testlinkedlist.c @@ -65,6 +65,17 @@ typedef struct _ListTests ListTests; typedef struct _ListTestsClass ListTestsClass; typedef struct _ListTestsPrivate ListTestsPrivate; +#define TYPE_BIDIR_LIST_TESTS (bidir_list_tests_get_type ()) +#define BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTests)) +#define BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) +#define IS_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_LIST_TESTS)) +#define IS_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_LIST_TESTS)) +#define BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) + +typedef struct _BidirListTests BidirListTests; +typedef struct _BidirListTestsClass BidirListTestsClass; +typedef struct _BidirListTestsPrivate BidirListTestsPrivate; + #define TYPE_LINKED_LIST_TESTS (linked_list_tests_get_type ()) #define LINKED_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINKED_LIST_TESTS, LinkedListTests)) #define LINKED_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINKED_LIST_TESTS, LinkedListTestsClass)) @@ -110,13 +121,22 @@ struct _ListTestsClass { void (*test_duplicates_are_retained) (ListTests* self); }; -struct _LinkedListTests { +struct _BidirListTests { ListTests parent_instance; + BidirListTestsPrivate * priv; +}; + +struct _BidirListTestsClass { + ListTestsClass parent_class; +}; + +struct _LinkedListTests { + BidirListTests parent_instance; LinkedListTestsPrivate * priv; }; struct _LinkedListTestsClass { - ListTestsClass parent_class; + BidirListTestsClass parent_class; }; typedef void (*GeeTestCaseTestMethod) (void* user_data); @@ -126,34 +146,21 @@ static gpointer linked_list_tests_parent_class = NULL; GType gee_test_case_get_type (void) G_GNUC_CONST; GType collection_tests_get_type (void) G_GNUC_CONST; GType list_tests_get_type (void) G_GNUC_CONST; +GType bidir_list_tests_get_type (void) G_GNUC_CONST; GType linked_list_tests_get_type (void) G_GNUC_CONST; enum { LINKED_LIST_TESTS_DUMMY_PROPERTY }; LinkedListTests* linked_list_tests_new (void); LinkedListTests* linked_list_tests_construct (GType object_type); -ListTests* list_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -static void linked_list_tests_test_selected_functions (LinkedListTests* self); -static void _linked_list_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void linked_list_tests_test_gobject_properties (LinkedListTests* self); -static void _linked_list_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); +BidirListTests* bidir_list_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void linked_list_tests_test_sort (LinkedListTests* self); static void _linked_list_tests_test_sort_gee_test_case_test_method (gpointer self); static void linked_list_tests_real_set_up (GeeTestCase* base); static void linked_list_tests_real_tear_down (GeeTestCase* base); -static void _linked_list_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - linked_list_tests_test_selected_functions (self); -} - - -static void _linked_list_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - linked_list_tests_test_gobject_properties (self); -} - - static void _linked_list_tests_test_sort_gee_test_case_test_method (gpointer self) { linked_list_tests_test_sort (self); } @@ -161,10 +168,8 @@ static void _linked_list_tests_test_sort_gee_test_case_test_method (gpointer sel LinkedListTests* linked_list_tests_construct (GType object_type) { LinkedListTests * self = NULL; - self = (LinkedListTests*) list_tests_construct (object_type, "LinkedList"); - gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] selected functions", _linked_list_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] GObject properties", _linked_list_tests_test_gobject_properties_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] sort", _linked_list_tests_test_sort_gee_test_case_test_method, self); + self = (LinkedListTests*) bidir_list_tests_construct (object_type, "LinkedList"); + gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] sort", _linked_list_tests_test_sort_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -178,7 +183,7 @@ static void linked_list_tests_real_set_up (GeeTestCase* base) { LinkedListTests * self; GeeLinkedList* _tmp0_; self = (LinkedListTests*) base; - _tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -197,56 +202,6 @@ static gpointer _g_object_ref0 (gpointer self) { } -static void linked_list_tests_test_selected_functions (LinkedListTests* self) { - GeeCollection* _tmp0_; - GeeLinkedList* _tmp1_; - GeeLinkedList* test_list; - GEqualFunc _tmp2_; - GEqualFunc _tmp3_; - GEqualFunc _tmp4_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LINKED_LIST) ? ((GeeLinkedList*) _tmp0_) : NULL); - test_list = _tmp1_; - _vala_assert (test_list != NULL, "test_list != null"); - _tmp2_ = gee_linked_list_get_equal_func (test_list); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_equal; - _vala_assert (_tmp3_ == _tmp4_, "test_list.equal_func == str_equal"); - _g_object_unref0 (test_list); -} - - -void linked_list_tests_test_gobject_properties (LinkedListTests* self) { - GeeCollection* _tmp0_; - GeeLinkedList* _tmp1_; - GeeLinkedList* test_list; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LINKED_LIST) ? ((GeeLinkedList*) _tmp0_) : NULL); - test_list = _tmp1_; - _vala_assert (test_list != NULL, "test_list != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_list, "equal-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_linked_list_get_equal_func (test_list); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_list.equal_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_list); -} - - static void linked_list_tests_test_sort (LinkedListTests* self) { GeeCollection* _tmp0_; GeeLinkedList* _tmp1_; @@ -292,7 +247,7 @@ static void linked_list_tests_test_sort (LinkedListTests* self) { gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "ten"); gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "eleven"); gee_abstract_collection_add ((GeeAbstractCollection*) test_list, "twelve"); - gee_list_sort ((GeeList*) test_list, NULL); + gee_list_sort ((GeeList*) test_list, NULL, NULL, NULL); _tmp2_ = gee_abstract_list_get ((GeeAbstractList*) test_list, 0); _tmp3_ = (gchar*) _tmp2_; _vala_assert (g_strcmp0 (_tmp3_, "eight") == 0, "test_list.get (0) == \"eight\""); @@ -361,7 +316,7 @@ GType linked_list_tests_get_type (void) { if (g_once_init_enter (&linked_list_tests_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (LinkedListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) linked_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LinkedListTests), 0, (GInstanceInitFunc) linked_list_tests_instance_init, NULL }; GType linked_list_tests_type_id; - linked_list_tests_type_id = g_type_register_static (TYPE_LIST_TESTS, "LinkedListTests", &g_define_type_info, 0); + linked_list_tests_type_id = g_type_register_static (TYPE_BIDIR_LIST_TESTS, "LinkedListTests", &g_define_type_info, 0); g_once_init_leave (&linked_list_tests_type_id__volatile, linked_list_tests_type_id); } return linked_list_tests_type_id__volatile; diff --git a/tests/testlinkedlist.vala b/tests/testlinkedlist.vala index 737b6e3..bff2c5c 100644 --- a/tests/testlinkedlist.vala +++ b/tests/testlinkedlist.vala @@ -24,12 +24,10 @@ using Gee; -public class LinkedListTests : ListTests { +public class LinkedListTests : BidirListTests { public LinkedListTests () { base ("LinkedList"); - add_test ("[LinkedList] selected functions", test_selected_functions); - add_test ("[LinkedList] GObject properties", test_gobject_properties); add_test ("[LinkedList] sort", test_sort); } @@ -41,29 +39,6 @@ public class LinkedListTests : ListTests { test_collection = null; } - private void test_selected_functions () { - var test_list = test_collection as LinkedList; - - // Check the collection exists - assert (test_list != null); - - // Check the selected equal function - assert (test_list.equal_func == str_equal); - } - - public new void test_gobject_properties () { - var test_list = test_collection as LinkedList; - - // Check the list exists - assert (test_list != null); - Value value; - - value = Value (typeof (EqualFunc)); - test_list.get_property ("equal-func", ref value); - assert (value.get_pointer () == (void*) test_list.equal_func); - value.unset (); - } - private void test_sort () { var test_list = test_collection as LinkedList; diff --git a/tests/testlinkedlistasdeque.c b/tests/testlinkedlistasdeque.c index 2bc8f68..2a8238f 100644 --- a/tests/testlinkedlistasdeque.c +++ b/tests/testlinkedlistasdeque.c @@ -150,7 +150,7 @@ enum { LinkedListAsDequeTests* linked_list_as_deque_tests_new (void); LinkedListAsDequeTests* linked_list_as_deque_tests_construct (GType object_type); DequeTests* deque_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void linked_list_as_deque_tests_test_selected_functions (LinkedListAsDequeTests* self); static void _linked_list_as_deque_tests_test_selected_functions_gee_test_case_test_method (gpointer self); static void linked_list_as_deque_tests_real_set_up (GeeTestCase* base); @@ -165,7 +165,7 @@ static void _linked_list_as_deque_tests_test_selected_functions_gee_test_case_te LinkedListAsDequeTests* linked_list_as_deque_tests_construct (GType object_type) { LinkedListAsDequeTests * self = NULL; self = (LinkedListAsDequeTests*) deque_tests_construct (object_type, "LinkedList as Deque"); - gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] selected functions", _linked_list_as_deque_tests_test_selected_functions_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[LinkedList] selected functions", _linked_list_as_deque_tests_test_selected_functions_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -179,7 +179,7 @@ static void linked_list_as_deque_tests_real_set_up (GeeTestCase* base) { LinkedListAsDequeTests * self; GeeLinkedList* _tmp0_; self = (LinkedListAsDequeTests*) base; - _tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -202,18 +202,11 @@ static void linked_list_as_deque_tests_test_selected_functions (LinkedListAsDequ GeeCollection* _tmp0_; GeeLinkedList* _tmp1_; GeeLinkedList* test_list; - GEqualFunc _tmp2_; - GEqualFunc _tmp3_; - GEqualFunc _tmp4_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LINKED_LIST) ? ((GeeLinkedList*) _tmp0_) : NULL); test_list = _tmp1_; _vala_assert (test_list != NULL, "test_list != null"); - _tmp2_ = gee_linked_list_get_equal_func (test_list); - _tmp3_ = _tmp2_; - _tmp4_ = g_str_equal; - _vala_assert (_tmp3_ == _tmp4_, "test_list.equal_func == str_equal"); _g_object_unref0 (test_list); } diff --git a/tests/testlinkedlistasdeque.vala b/tests/testlinkedlistasdeque.vala index 81b791f..2b9a791 100644 --- a/tests/testlinkedlistasdeque.vala +++ b/tests/testlinkedlistasdeque.vala @@ -42,8 +42,5 @@ public class LinkedListAsDequeTests : DequeTests { // Check the collection exists assert (test_list != null); - - // Check the selected equal function - assert (test_list.equal_func == str_equal); } } diff --git a/tests/testlist.c b/tests/testlist.c index 580d171..d793157 100644 --- a/tests/testlist.c +++ b/tests/testlist.c @@ -112,7 +112,7 @@ enum { }; ListTests* list_tests_construct (GType object_type, const gchar* name); CollectionTests* collection_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void list_tests_test_iterator_is_ordered (ListTests* self); static void _list_tests_test_iterator_is_ordered_gee_test_case_test_method (gpointer self); void list_tests_test_list_iterator (ListTests* self); @@ -206,18 +206,18 @@ ListTests* list_tests_construct (GType object_type, const gchar* name) { g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (ListTests*) collection_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[List] iterator is ordered", _list_tests_test_iterator_is_ordered_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] list iterator", _list_tests_test_list_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] duplicates are retained", _list_tests_test_duplicates_are_retained_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] get", _list_tests_test_get_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] set", _list_tests_test_set_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] insert", _list_tests_test_insert_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] remove_at", _list_tests_test_remove_at_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] index_of", _list_tests_test_index_of_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] first", _list_tests_test_first_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] last", _list_tests_test_last_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] insert_all", _list_tests_test_insert_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[List] slice", _list_tests_test_slice_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[List] iterator is ordered", _list_tests_test_iterator_is_ordered_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] list iterator", _list_tests_test_list_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] duplicates are retained", _list_tests_test_duplicates_are_retained_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] get", _list_tests_test_get_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] set", _list_tests_test_set_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] insert", _list_tests_test_insert_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] remove_at", _list_tests_test_remove_at_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] index_of", _list_tests_test_index_of_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] first", _list_tests_test_first_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] last", _list_tests_test_last_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] insert_all", _list_tests_test_insert_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[List] slice", _list_tests_test_slice_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -333,18 +333,18 @@ void list_tests_test_list_iterator (ListTests* self) { gboolean _tmp4_ = FALSE; GeeListIterator* _tmp5_; gboolean _tmp6_ = FALSE; - GeeListIterator* _tmp7_; + gboolean _tmp7_ = FALSE; gboolean _tmp8_ = FALSE; - GeeListIterator* _tmp9_; - gboolean _tmp10_ = FALSE; + gboolean _tmp9_ = FALSE; + GeeListIterator* _tmp10_ = NULL; GeeListIterator* _tmp11_; gboolean _tmp12_ = FALSE; GeeListIterator* _tmp13_; - gboolean _tmp14_ = FALSE; - gboolean _tmp15_ = FALSE; - gboolean _tmp16_ = FALSE; - gboolean _tmp17_ = FALSE; - GeeListIterator* _tmp18_ = NULL; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + GeeListIterator* _tmp16_; + gint _tmp17_ = 0; + GeeListIterator* _tmp18_; GeeListIterator* _tmp19_; gboolean _tmp20_ = FALSE; GeeListIterator* _tmp21_; @@ -353,28 +353,28 @@ void list_tests_test_list_iterator (ListTests* self) { GeeListIterator* _tmp24_; gint _tmp25_ = 0; GeeListIterator* _tmp26_; - GeeListIterator* _tmp27_; - gboolean _tmp28_ = FALSE; + gint _tmp27_; + gint _tmp28_; GeeListIterator* _tmp29_; - gpointer _tmp30_ = NULL; - gchar* _tmp31_; - GeeListIterator* _tmp32_; - gint _tmp33_ = 0; + gint _tmp30_ = 0; + GeeListIterator* _tmp31_; + gint _tmp32_; + gint _tmp33_; GeeListIterator* _tmp34_; - gint _tmp35_; - gint _tmp36_; - GeeListIterator* _tmp37_; - gint _tmp38_ = 0; - GeeListIterator* _tmp39_; - gint _tmp40_; - gint _tmp41_; - GeeListIterator* _tmp42_; - gint _tmp43_ = 0; + gint _tmp35_ = 0; + GeeListIterator* _tmp36_; + gboolean _tmp37_ = FALSE; + GeeListIterator* _tmp38_; + gpointer _tmp39_ = NULL; + gchar* _tmp40_; + GeeListIterator* _tmp41_; + gint _tmp42_ = 0; + GeeListIterator* _tmp43_; GeeListIterator* _tmp44_; - gint _tmp45_; - gint _tmp46_; - GeeListIterator* _tmp47_; - gint _tmp48_ = 0; + gboolean _tmp45_ = FALSE; + GeeListIterator* _tmp46_; + gboolean _tmp47_ = FALSE; + GeeListIterator* _tmp48_ = NULL; GeeListIterator* _tmp49_; gboolean _tmp50_ = FALSE; GeeListIterator* _tmp51_; @@ -382,69 +382,6 @@ void list_tests_test_list_iterator (ListTests* self) { gchar* _tmp53_; GeeListIterator* _tmp54_; gint _tmp55_ = 0; - GeeListIterator* _tmp56_; - GeeListIterator* _tmp57_; - gboolean _tmp58_ = FALSE; - GeeListIterator* _tmp59_; - gboolean _tmp60_ = FALSE; - GeeListIterator* _tmp61_; - gboolean _tmp62_ = FALSE; - GeeListIterator* _tmp63_; - gpointer _tmp64_ = NULL; - gchar* _tmp65_; - GeeListIterator* _tmp66_; - gint _tmp67_ = 0; - GeeListIterator* _tmp68_; - gboolean _tmp69_ = FALSE; - GeeListIterator* _tmp70_; - gboolean _tmp71_ = FALSE; - GeeListIterator* _tmp72_; - gboolean _tmp73_ = FALSE; - GeeListIterator* _tmp74_; - gpointer _tmp75_ = NULL; - gchar* _tmp76_; - GeeListIterator* _tmp77_; - gint _tmp78_ = 0; - GeeListIterator* _tmp79_; - gboolean _tmp80_ = FALSE; - GeeListIterator* _tmp81_; - gboolean _tmp82_ = FALSE; - GeeListIterator* _tmp83_; - gboolean _tmp84_ = FALSE; - GeeListIterator* _tmp85_; - gboolean _tmp86_ = FALSE; - GeeListIterator* _tmp87_; - gpointer _tmp88_ = NULL; - gchar* _tmp89_; - GeeListIterator* _tmp90_; - gint _tmp91_ = 0; - GeeListIterator* _tmp92_; - gboolean _tmp93_ = FALSE; - GeeListIterator* _tmp94_; - gboolean _tmp95_ = FALSE; - GeeListIterator* _tmp96_; - gpointer _tmp97_ = NULL; - gchar* _tmp98_; - GeeListIterator* _tmp99_; - gint _tmp100_ = 0; - GeeListIterator* _tmp101_; - gboolean _tmp102_ = FALSE; - GeeListIterator* _tmp103_; - gboolean _tmp104_ = FALSE; - GeeListIterator* _tmp105_; - gpointer _tmp106_ = NULL; - gchar* _tmp107_; - GeeListIterator* _tmp108_; - gint _tmp109_ = 0; - GeeListIterator* _tmp110_; - gboolean _tmp111_ = FALSE; - GeeListIterator* _tmp112_; - gboolean _tmp113_ = FALSE; - GeeListIterator* _tmp114_; - gpointer _tmp115_ = NULL; - gchar* _tmp116_; - GeeListIterator* _tmp117_; - gint _tmp118_ = 0; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LIST) ? ((GeeList*) _tmp0_) : NULL); @@ -458,184 +395,88 @@ void list_tests_test_list_iterator (ListTests* self) { _tmp5_ = iterator; _tmp6_ = gee_iterator_next ((GeeIterator*) _tmp5_); _vala_assert (!_tmp6_, "! iterator.next ()"); - _tmp7_ = iterator; - _tmp8_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp7_); - _vala_assert (!_tmp8_, "! iterator.has_previous ()"); - _tmp9_ = iterator; - _tmp10_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp9_); - _vala_assert (!_tmp10_, "! iterator.previous ()"); + _tmp7_ = gee_collection_add ((GeeCollection*) test_list, "one"); + _vala_assert (_tmp7_, "test_list.add (\"one\")"); + _tmp8_ = gee_collection_add ((GeeCollection*) test_list, "two"); + _vala_assert (_tmp8_, "test_list.add (\"two\")"); + _tmp9_ = gee_collection_add ((GeeCollection*) test_list, "three"); + _vala_assert (_tmp9_, "test_list.add (\"three\")"); + _tmp10_ = gee_list_list_iterator (test_list); + _g_object_unref0 (iterator); + iterator = _tmp10_; _tmp11_ = iterator; - _tmp12_ = gee_iterator_first ((GeeIterator*) _tmp11_); - _vala_assert (!_tmp12_, "! iterator.first ()"); + _tmp12_ = gee_iterator_next ((GeeIterator*) _tmp11_); + _vala_assert (_tmp12_, "iterator.next()"); _tmp13_ = iterator; - _tmp14_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp13_); - _vala_assert (!_tmp14_, "! iterator.last ()"); - _tmp15_ = gee_collection_add ((GeeCollection*) test_list, "one"); - _vala_assert (_tmp15_, "test_list.add (\"one\")"); - _tmp16_ = gee_collection_add ((GeeCollection*) test_list, "two"); - _vala_assert (_tmp16_, "test_list.add (\"two\")"); - _tmp17_ = gee_collection_add ((GeeCollection*) test_list, "three"); - _vala_assert (_tmp17_, "test_list.add (\"three\")"); - _tmp18_ = gee_list_list_iterator (test_list); - _g_object_unref0 (iterator); - iterator = _tmp18_; + _tmp14_ = gee_iterator_get ((GeeIterator*) _tmp13_); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp15_); + _tmp16_ = iterator; + _tmp17_ = gee_list_iterator_index (_tmp16_); + _vala_assert (_tmp17_ == 0, "iterator.index () == 0"); + _tmp18_ = iterator; + gee_list_iterator_set (_tmp18_, "new one"); _tmp19_ = iterator; _tmp20_ = gee_iterator_next ((GeeIterator*) _tmp19_); _vala_assert (_tmp20_, "iterator.next()"); _tmp21_ = iterator; _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_); _tmp23_ = (gchar*) _tmp22_; - _vala_assert (g_strcmp0 (_tmp23_, "one") == 0, "iterator.get () == \"one\""); + _vala_assert (g_strcmp0 (_tmp23_, "two") == 0, "iterator.get () == \"two\""); _g_free0 (_tmp23_); _tmp24_ = iterator; _tmp25_ = gee_list_iterator_index (_tmp24_); - _vala_assert (_tmp25_ == 0, "iterator.index () == 0"); + _vala_assert (_tmp25_ == 1, "iterator.index () == 1"); _tmp26_ = iterator; - gee_list_iterator_set (_tmp26_, "new one"); - _tmp27_ = iterator; - _tmp28_ = gee_iterator_next ((GeeIterator*) _tmp27_); - _vala_assert (_tmp28_, "iterator.next()"); + gee_list_iterator_set (_tmp26_, "new two"); + _tmp27_ = gee_collection_get_size ((GeeCollection*) test_list); + _tmp28_ = _tmp27_; + _vala_assert (_tmp28_ == 3, "test_list.size == 3"); _tmp29_ = iterator; - _tmp30_ = gee_iterator_get ((GeeIterator*) _tmp29_); - _tmp31_ = (gchar*) _tmp30_; - _vala_assert (g_strcmp0 (_tmp31_, "two") == 0, "iterator.get () == \"two\""); - _g_free0 (_tmp31_); - _tmp32_ = iterator; - _tmp33_ = gee_list_iterator_index (_tmp32_); - _vala_assert (_tmp33_ == 1, "iterator.index () == 1"); + _tmp30_ = gee_list_iterator_index (_tmp29_); + _vala_assert (_tmp30_ == 1, "iterator.index () == 1"); + _tmp31_ = iterator; + gee_list_iterator_add (_tmp31_, "after two"); + _tmp32_ = gee_collection_get_size ((GeeCollection*) test_list); + _tmp33_ = _tmp32_; + _vala_assert (_tmp33_ == 4, "test_list.size == 4"); _tmp34_ = iterator; - gee_list_iterator_set (_tmp34_, "new two"); - _tmp35_ = gee_collection_get_size ((GeeCollection*) test_list); - _tmp36_ = _tmp35_; - _vala_assert (_tmp36_ == 3, "test_list.size == 3"); - _tmp37_ = iterator; - _tmp38_ = gee_list_iterator_index (_tmp37_); - _vala_assert (_tmp38_ == 1, "iterator.index () == 1"); - _tmp39_ = iterator; - gee_list_iterator_insert (_tmp39_, "before two"); - _tmp40_ = gee_collection_get_size ((GeeCollection*) test_list); - _tmp41_ = _tmp40_; - _vala_assert (_tmp41_ == 4, "test_list.size == 4"); - _tmp42_ = iterator; - _tmp43_ = gee_list_iterator_index (_tmp42_); - _vala_assert (_tmp43_ == 2, "iterator.index () == 2"); + _tmp35_ = gee_list_iterator_index (_tmp34_); + _vala_assert (_tmp35_ == 2, "iterator.index () == 2"); + _tmp36_ = iterator; + _tmp37_ = gee_iterator_next ((GeeIterator*) _tmp36_); + _vala_assert (_tmp37_, "iterator.next()"); + _tmp38_ = iterator; + _tmp39_ = gee_iterator_get ((GeeIterator*) _tmp38_); + _tmp40_ = (gchar*) _tmp39_; + _vala_assert (g_strcmp0 (_tmp40_, "three") == 0, "iterator.get () == \"three\""); + _g_free0 (_tmp40_); + _tmp41_ = iterator; + _tmp42_ = gee_list_iterator_index (_tmp41_); + _vala_assert (_tmp42_ == 3, "iterator.index () == 3"); + _tmp43_ = iterator; + gee_list_iterator_set (_tmp43_, "new three"); _tmp44_ = iterator; - gee_list_iterator_add (_tmp44_, "after two"); - _tmp45_ = gee_collection_get_size ((GeeCollection*) test_list); - _tmp46_ = _tmp45_; - _vala_assert (_tmp46_ == 5, "test_list.size == 5"); - _tmp47_ = iterator; - _tmp48_ = gee_list_iterator_index (_tmp47_); - _vala_assert (_tmp48_ == 3, "iterator.index () == 3"); + _tmp45_ = gee_iterator_has_next ((GeeIterator*) _tmp44_); + _vala_assert (!_tmp45_, "! iterator.has_next ()"); + _tmp46_ = iterator; + _tmp47_ = gee_iterator_next ((GeeIterator*) _tmp46_); + _vala_assert (!_tmp47_, "! iterator.next ()"); + _tmp48_ = gee_list_list_iterator (test_list); + _g_object_unref0 (iterator); + iterator = _tmp48_; _tmp49_ = iterator; _tmp50_ = gee_iterator_next ((GeeIterator*) _tmp49_); - _vala_assert (_tmp50_, "iterator.next()"); + _vala_assert (_tmp50_, "iterator.next ()"); _tmp51_ = iterator; _tmp52_ = gee_iterator_get ((GeeIterator*) _tmp51_); _tmp53_ = (gchar*) _tmp52_; - _vala_assert (g_strcmp0 (_tmp53_, "three") == 0, "iterator.get () == \"three\""); + _vala_assert (g_strcmp0 (_tmp53_, "new one") == 0, "iterator.get () == \"new one\""); _g_free0 (_tmp53_); _tmp54_ = iterator; _tmp55_ = gee_list_iterator_index (_tmp54_); - _vala_assert (_tmp55_ == 4, "iterator.index () == 4"); - _tmp56_ = iterator; - gee_list_iterator_set (_tmp56_, "new three"); - _tmp57_ = iterator; - _tmp58_ = gee_iterator_has_next ((GeeIterator*) _tmp57_); - _vala_assert (!_tmp58_, "! iterator.has_next ()"); - _tmp59_ = iterator; - _tmp60_ = gee_iterator_next ((GeeIterator*) _tmp59_); - _vala_assert (!_tmp60_, "! iterator.next ()"); - _tmp61_ = iterator; - _tmp62_ = gee_iterator_first ((GeeIterator*) _tmp61_); - _vala_assert (_tmp62_, "iterator.first ()"); - _tmp63_ = iterator; - _tmp64_ = gee_iterator_get ((GeeIterator*) _tmp63_); - _tmp65_ = (gchar*) _tmp64_; - _vala_assert (g_strcmp0 (_tmp65_, "new one") == 0, "iterator.get () == \"new one\""); - _g_free0 (_tmp65_); - _tmp66_ = iterator; - _tmp67_ = gee_list_iterator_index (_tmp66_); - _vala_assert (_tmp67_ == 0, "iterator.index () == 0"); - _tmp68_ = iterator; - _tmp69_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp68_); - _vala_assert (!_tmp69_, "! iterator.has_previous ()"); - _tmp70_ = iterator; - _tmp71_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp70_); - _vala_assert (!_tmp71_, "! iterator.previous ()"); - _tmp72_ = iterator; - _tmp73_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp72_); - _vala_assert (_tmp73_, "iterator.last ()"); - _tmp74_ = iterator; - _tmp75_ = gee_iterator_get ((GeeIterator*) _tmp74_); - _tmp76_ = (gchar*) _tmp75_; - _vala_assert (g_strcmp0 (_tmp76_, "new three") == 0, "iterator.get () == \"new three\""); - _g_free0 (_tmp76_); - _tmp77_ = iterator; - _tmp78_ = gee_list_iterator_index (_tmp77_); - _vala_assert (_tmp78_ == 4, "iterator.index () == 4"); - _tmp79_ = iterator; - _tmp80_ = gee_iterator_has_next ((GeeIterator*) _tmp79_); - _vala_assert (!_tmp80_, "! iterator.has_next ()"); - _tmp81_ = iterator; - _tmp82_ = gee_iterator_next ((GeeIterator*) _tmp81_); - _vala_assert (!_tmp82_, "! iterator.next ()"); - _tmp83_ = iterator; - _tmp84_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp83_); - _vala_assert (_tmp84_, "iterator.has_previous ()"); - _tmp85_ = iterator; - _tmp86_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp85_); - _vala_assert (_tmp86_, "iterator.previous ()"); - _tmp87_ = iterator; - _tmp88_ = gee_iterator_get ((GeeIterator*) _tmp87_); - _tmp89_ = (gchar*) _tmp88_; - _vala_assert (g_strcmp0 (_tmp89_, "after two") == 0, "iterator.get () == \"after two\""); - _g_free0 (_tmp89_); - _tmp90_ = iterator; - _tmp91_ = gee_list_iterator_index (_tmp90_); - _vala_assert (_tmp91_ == 3, "iterator.index () == 3"); - _tmp92_ = iterator; - _tmp93_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp92_); - _vala_assert (_tmp93_, "iterator.has_previous ()"); - _tmp94_ = iterator; - _tmp95_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp94_); - _vala_assert (_tmp95_, "iterator.previous ()"); - _tmp96_ = iterator; - _tmp97_ = gee_iterator_get ((GeeIterator*) _tmp96_); - _tmp98_ = (gchar*) _tmp97_; - _vala_assert (g_strcmp0 (_tmp98_, "new two") == 0, "iterator.get () == \"new two\""); - _g_free0 (_tmp98_); - _tmp99_ = iterator; - _tmp100_ = gee_list_iterator_index (_tmp99_); - _vala_assert (_tmp100_ == 2, "iterator.index () == 2"); - _tmp101_ = iterator; - _tmp102_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp101_); - _vala_assert (_tmp102_, "iterator.has_previous ()"); - _tmp103_ = iterator; - _tmp104_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp103_); - _vala_assert (_tmp104_, "iterator.previous ()"); - _tmp105_ = iterator; - _tmp106_ = gee_iterator_get ((GeeIterator*) _tmp105_); - _tmp107_ = (gchar*) _tmp106_; - _vala_assert (g_strcmp0 (_tmp107_, "before two") == 0, "iterator.get () == \"before two\""); - _g_free0 (_tmp107_); - _tmp108_ = iterator; - _tmp109_ = gee_list_iterator_index (_tmp108_); - _vala_assert (_tmp109_ == 1, "iterator.index () == 1"); - _tmp110_ = iterator; - _tmp111_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp110_); - _vala_assert (_tmp111_, "iterator.has_previous ()"); - _tmp112_ = iterator; - _tmp113_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp112_); - _vala_assert (_tmp113_, "iterator.previous ()"); - _tmp114_ = iterator; - _tmp115_ = gee_iterator_get ((GeeIterator*) _tmp114_); - _tmp116_ = (gchar*) _tmp115_; - _vala_assert (g_strcmp0 (_tmp116_, "new one") == 0, "iterator.get () == \"new one\""); - _g_free0 (_tmp116_); - _tmp117_ = iterator; - _tmp118_ = gee_list_iterator_index (_tmp117_); - _vala_assert (_tmp118_ == 0, "iterator.index () == 0"); + _vala_assert (_tmp55_ == 0, "iterator.index () == 0"); _g_object_unref0 (iterator); _g_object_unref0 (test_list); } @@ -1786,7 +1627,7 @@ void list_tests_test_insert_all (ListTests* self) { test_list = _tmp1_; _tmp2_ = test_list; _vala_assert (_tmp2_ != NULL, "test_list != null"); - _tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = _tmp3_; _tmp4_ = test_list; _tmp5_ = gee_collection_add ((GeeCollection*) _tmp4_, "zero"); @@ -1802,7 +1643,7 @@ void list_tests_test_insert_all (ListTests* self) { _tmp12_ = _tmp11_; _vala_assert (_tmp12_ == 3, "test_list.size == 3"); _tmp13_ = dummy; - _tmp14_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) _tmp13_); + _tmp14_ = gee_collection_get_is_empty ((GeeCollection*) _tmp13_); _tmp15_ = _tmp14_; _vala_assert (_tmp15_, "dummy.is_empty"); _tmp16_ = test_list; @@ -1813,7 +1654,7 @@ void list_tests_test_insert_all (ListTests* self) { _tmp20_ = _tmp19_; _vala_assert (_tmp20_ == 3, "test_list.size == 3"); _tmp21_ = dummy; - _tmp22_ = gee_abstract_collection_get_is_empty ((GeeAbstractCollection*) _tmp21_); + _tmp22_ = gee_collection_get_is_empty ((GeeCollection*) _tmp21_); _tmp23_ = _tmp22_; _vala_assert (_tmp23_, "dummy.is_empty"); _tmp24_ = test_list; diff --git a/tests/testlist.vala b/tests/testlist.vala index 48ca387..5b83b49 100644 --- a/tests/testlist.vala +++ b/tests/testlist.vala @@ -83,10 +83,6 @@ public abstract class ListTests : CollectionTests { var iterator = test_list.list_iterator (); assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (! iterator.has_previous ()); - assert (! iterator.previous ()); - assert (! iterator.first ()); - assert (! iterator.last ()); // Check iterate list assert (test_list.add ("one")); @@ -104,45 +100,18 @@ public abstract class ListTests : CollectionTests { iterator.set ("new two"); assert (test_list.size == 3); assert (iterator.index () == 1); - iterator.insert ("before two"); + iterator.add ("after two"); assert (test_list.size == 4); assert (iterator.index () == 2); - iterator.add ("after two"); - assert (test_list.size == 5); - assert (iterator.index () == 3); assert (iterator.next()); assert (iterator.get () == "three"); - assert (iterator.index () == 4); + assert (iterator.index () == 3); iterator.set ("new three"); assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (iterator.first ()); - assert (iterator.get () == "new one"); - assert (iterator.index () == 0); - assert (! iterator.has_previous ()); - assert (! iterator.previous ()); - - assert (iterator.last ()); - assert (iterator.get () == "new three"); - assert (iterator.index () == 4); - assert (! iterator.has_next ()); - assert (! iterator.next ()); - - assert (iterator.has_previous ()); - assert (iterator.previous ()); - assert (iterator.get () == "after two"); - assert (iterator.index () == 3); - assert (iterator.has_previous ()); - assert (iterator.previous ()); - assert (iterator.get () == "new two"); - assert (iterator.index () == 2); - assert (iterator.has_previous ()); - assert (iterator.previous ()); - assert (iterator.get () == "before two"); - assert (iterator.index () == 1); - assert (iterator.has_previous ()); - assert (iterator.previous ()); + iterator = test_list.list_iterator (); + assert (iterator.next ()); assert (iterator.get () == "new one"); assert (iterator.index () == 0); } diff --git a/tests/testmain.c b/tests/testmain.c index 2b62033..8a15ec4 100644 --- a/tests/testmain.c +++ b/tests/testmain.c @@ -28,6 +28,7 @@ #include #include #include +#include #define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) @@ -60,6 +61,16 @@ typedef struct _CollectionTestsClass CollectionTestsClass; typedef struct _ListTests ListTests; typedef struct _ListTestsClass ListTestsClass; +#define TYPE_BIDIR_LIST_TESTS (bidir_list_tests_get_type ()) +#define BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTests)) +#define BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) +#define IS_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_LIST_TESTS)) +#define IS_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_LIST_TESTS)) +#define BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_LIST_TESTS, BidirListTestsClass)) + +typedef struct _BidirListTests BidirListTests; +typedef struct _BidirListTestsClass BidirListTestsClass; + #define TYPE_ARRAY_LIST_TESTS (array_list_tests_get_type ()) #define ARRAY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ARRAY_LIST_TESTS, ArrayListTests)) #define ARRAY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ARRAY_LIST_TESTS, ArrayListTestsClass)) @@ -71,15 +82,85 @@ typedef struct _ArrayListTests ArrayListTests; typedef struct _ArrayListTestsClass ArrayListTestsClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define TYPE_COMPARABLE_TESTS (comparable_tests_get_type ()) -#define COMPARABLE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMPARABLE_TESTS, ComparableTests)) -#define COMPARABLE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMPARABLE_TESTS, ComparableTestsClass)) -#define IS_COMPARABLE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMPARABLE_TESTS)) -#define IS_COMPARABLE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMPARABLE_TESTS)) -#define COMPARABLE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMPARABLE_TESTS, ComparableTestsClass)) +#define TYPE_QUEUE_TESTS (queue_tests_get_type ()) +#define QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_QUEUE_TESTS, QueueTests)) +#define QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_QUEUE_TESTS, QueueTestsClass)) +#define IS_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_QUEUE_TESTS)) +#define IS_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_QUEUE_TESTS)) +#define QUEUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_QUEUE_TESTS, QueueTestsClass)) + +typedef struct _QueueTests QueueTests; +typedef struct _QueueTestsClass QueueTestsClass; + +#define TYPE_DEQUE_TESTS (deque_tests_get_type ()) +#define DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEQUE_TESTS, DequeTests)) +#define DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEQUE_TESTS, DequeTestsClass)) +#define IS_DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEQUE_TESTS)) +#define IS_DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEQUE_TESTS)) +#define DEQUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEQUE_TESTS, DequeTestsClass)) + +typedef struct _DequeTests DequeTests; +typedef struct _DequeTestsClass DequeTestsClass; + +#define TYPE_ARRAY_QUEUE_TESTS (array_queue_tests_get_type ()) +#define ARRAY_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTests)) +#define ARRAY_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTestsClass)) +#define IS_ARRAY_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ARRAY_QUEUE_TESTS)) +#define IS_ARRAY_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ARRAY_QUEUE_TESTS)) +#define ARRAY_QUEUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ARRAY_QUEUE_TESTS, ArrayQueueTestsClass)) + +typedef struct _ArrayQueueTests ArrayQueueTests; +typedef struct _ArrayQueueTestsClass ArrayQueueTestsClass; + +#define TYPE_CONCURRENT_LIST_TESTS (concurrent_list_tests_get_type ()) +#define CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTests)) +#define CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass)) +#define IS_CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_LIST_TESTS)) +#define IS_CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_LIST_TESTS)) +#define CONCURRENT_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass)) + +typedef struct _ConcurrentListTests ConcurrentListTests; +typedef struct _ConcurrentListTestsClass ConcurrentListTestsClass; + +#define TYPE_SET_TESTS (set_tests_get_type ()) +#define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests)) +#define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass)) +#define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS)) +#define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS)) +#define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass)) + +typedef struct _SetTests SetTests; +typedef struct _SetTestsClass SetTestsClass; + +#define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ()) +#define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests)) +#define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) +#define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS)) +#define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS)) +#define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) + +typedef struct _SortedSetTests SortedSetTests; +typedef struct _SortedSetTestsClass SortedSetTestsClass; + +#define TYPE_CONCURRENT_SET_TESTS (concurrent_set_tests_get_type ()) +#define CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTests)) +#define CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass)) +#define IS_CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_SET_TESTS)) +#define IS_CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_SET_TESTS)) +#define CONCURRENT_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass)) -typedef struct _ComparableTests ComparableTests; -typedef struct _ComparableTestsClass ComparableTestsClass; +typedef struct _ConcurrentSetTests ConcurrentSetTests; +typedef struct _ConcurrentSetTestsClass ConcurrentSetTestsClass; + +#define TYPE_FUNCTIONS_TESTS (functions_tests_get_type ()) +#define FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTests)) +#define FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass)) +#define IS_FUNCTIONS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTIONS_TESTS)) +#define IS_FUNCTIONS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTIONS_TESTS)) +#define FUNCTIONS_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTIONS_TESTS, FunctionsTestsClass)) + +typedef struct _FunctionsTests FunctionsTests; +typedef struct _FunctionsTestsClass FunctionsTestsClass; #define TYPE_MAP_TESTS (map_tests_get_type ()) #define MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_TESTS, MapTests)) @@ -141,16 +222,6 @@ typedef struct _MultiSetTestsClass MultiSetTestsClass; typedef struct _HashMultiSetTests HashMultiSetTests; typedef struct _HashMultiSetTestsClass HashMultiSetTestsClass; -#define TYPE_SET_TESTS (set_tests_get_type ()) -#define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests)) -#define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass)) -#define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS)) -#define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS)) -#define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass)) - -typedef struct _SetTests SetTests; -typedef struct _SetTestsClass SetTestsClass; - #define TYPE_HASH_SET_TESTS (hash_set_tests_get_type ()) #define HASH_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HASH_SET_TESTS, HashSetTests)) #define HASH_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HASH_SET_TESTS, HashSetTestsClass)) @@ -171,26 +242,6 @@ typedef struct _HashSetTestsClass HashSetTestsClass; typedef struct _LinkedListTests LinkedListTests; typedef struct _LinkedListTestsClass LinkedListTestsClass; -#define TYPE_QUEUE_TESTS (queue_tests_get_type ()) -#define QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_QUEUE_TESTS, QueueTests)) -#define QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_QUEUE_TESTS, QueueTestsClass)) -#define IS_QUEUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_QUEUE_TESTS)) -#define IS_QUEUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_QUEUE_TESTS)) -#define QUEUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_QUEUE_TESTS, QueueTestsClass)) - -typedef struct _QueueTests QueueTests; -typedef struct _QueueTestsClass QueueTestsClass; - -#define TYPE_DEQUE_TESTS (deque_tests_get_type ()) -#define DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEQUE_TESTS, DequeTests)) -#define DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEQUE_TESTS, DequeTestsClass)) -#define IS_DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEQUE_TESTS)) -#define IS_DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEQUE_TESTS)) -#define DEQUE_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEQUE_TESTS, DequeTestsClass)) - -typedef struct _DequeTests DequeTests; -typedef struct _DequeTestsClass DequeTestsClass; - #define TYPE_LINKED_LIST_AS_DEQUE_TESTS (linked_list_as_deque_tests_get_type ()) #define LINKED_LIST_AS_DEQUE_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINKED_LIST_AS_DEQUE_TESTS, LinkedListAsDequeTests)) #define LINKED_LIST_AS_DEQUE_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINKED_LIST_AS_DEQUE_TESTS, LinkedListAsDequeTestsClass)) @@ -231,6 +282,16 @@ typedef struct _ReadOnlyCollectionTestsClass ReadOnlyCollectionTestsClass; typedef struct _ReadOnlyListTests ReadOnlyListTests; typedef struct _ReadOnlyListTestsClass ReadOnlyListTestsClass; +#define TYPE_READ_ONLY_BIDIR_LIST_TESTS (read_only_bidir_list_tests_get_type ()) +#define READ_ONLY_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTests)) +#define READ_ONLY_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTestsClass)) +#define IS_READ_ONLY_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS)) +#define IS_READ_ONLY_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_BIDIR_LIST_TESTS)) +#define READ_ONLY_BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTestsClass)) + +typedef struct _ReadOnlyBidirListTests ReadOnlyBidirListTests; +typedef struct _ReadOnlyBidirListTestsClass ReadOnlyBidirListTestsClass; + #define TYPE_READ_ONLY_MAP_TESTS (read_only_map_tests_get_type ()) #define READ_ONLY_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_MAP_TESTS, ReadOnlyMapTests)) #define READ_ONLY_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_MAP_TESTS, ReadOnlyMapTestsClass)) @@ -251,6 +312,26 @@ typedef struct _ReadOnlyMapTestsClass ReadOnlyMapTestsClass; typedef struct _ReadOnlySetTests ReadOnlySetTests; typedef struct _ReadOnlySetTestsClass ReadOnlySetTestsClass; +#define GEE_TYPE_SORTED_MAP_TESTS (gee_sorted_map_tests_get_type ()) +#define GEE_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTests)) +#define GEE_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) +#define GEE_IS_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_IS_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) + +typedef struct _GeeSortedMapTests GeeSortedMapTests; +typedef struct _GeeSortedMapTestsClass GeeSortedMapTestsClass; + +#define TYPE_BIDIR_SORTED_MAP_TESTS (bidir_sorted_map_tests_get_type ()) +#define BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTests)) +#define BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) +#define IS_BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define IS_BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define BIDIR_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) + +typedef struct _BidirSortedMapTests BidirSortedMapTests; +typedef struct _BidirSortedMapTestsClass BidirSortedMapTestsClass; + #define TYPE_TREE_MAP_TESTS (tree_map_tests_get_type ()) #define TREE_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TREE_MAP_TESTS, TreeMapTests)) #define TREE_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TREE_MAP_TESTS, TreeMapTestsClass)) @@ -281,15 +362,15 @@ typedef struct _TreeMultiMapTestsClass TreeMultiMapTestsClass; typedef struct _TreeMultiSetTests TreeMultiSetTests; typedef struct _TreeMultiSetTestsClass TreeMultiSetTestsClass; -#define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ()) -#define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests)) -#define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) -#define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS)) -#define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS)) -#define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass)) +#define TYPE_BIDIR_SORTED_SET_TESTS (bidir_sorted_set_tests_get_type ()) +#define BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests)) +#define BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) +#define IS_BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_SET_TESTS)) +#define IS_BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_SET_TESTS)) +#define BIDIR_SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) -typedef struct _SortedSetTests SortedSetTests; -typedef struct _SortedSetTestsClass SortedSetTestsClass; +typedef struct _BidirSortedSetTests BidirSortedSetTests; +typedef struct _BidirSortedSetTestsClass BidirSortedSetTestsClass; #define TYPE_TREE_SET_TESTS (tree_set_tests_get_type ()) #define TREE_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TREE_SET_TESTS, TreeSetTests)) @@ -309,11 +390,25 @@ ArrayListTests* array_list_tests_construct (GType object_type); GType gee_test_case_get_type (void) G_GNUC_CONST; GType collection_tests_get_type (void) G_GNUC_CONST; GType list_tests_get_type (void) G_GNUC_CONST; +GType bidir_list_tests_get_type (void) G_GNUC_CONST; GType array_list_tests_get_type (void) G_GNUC_CONST; GTestSuite* gee_test_case_get_suite (GeeTestCase* self); -ComparableTests* comparable_tests_new (void); -ComparableTests* comparable_tests_construct (GType object_type); -GType comparable_tests_get_type (void) G_GNUC_CONST; +ArrayQueueTests* array_queue_tests_new (void); +ArrayQueueTests* array_queue_tests_construct (GType object_type); +GType queue_tests_get_type (void) G_GNUC_CONST; +GType deque_tests_get_type (void) G_GNUC_CONST; +GType array_queue_tests_get_type (void) G_GNUC_CONST; +ConcurrentListTests* concurrent_list_tests_new (void); +ConcurrentListTests* concurrent_list_tests_construct (GType object_type); +GType concurrent_list_tests_get_type (void) G_GNUC_CONST; +ConcurrentSetTests* concurrent_set_tests_new (void); +ConcurrentSetTests* concurrent_set_tests_construct (GType object_type); +GType set_tests_get_type (void) G_GNUC_CONST; +GType sorted_set_tests_get_type (void) G_GNUC_CONST; +GType concurrent_set_tests_get_type (void) G_GNUC_CONST; +FunctionsTests* functions_tests_new (void); +FunctionsTests* functions_tests_construct (GType object_type); +GType functions_tests_get_type (void) G_GNUC_CONST; HashMapTests* hash_map_tests_new (void); HashMapTests* hash_map_tests_construct (GType object_type); GType map_tests_get_type (void) G_GNUC_CONST; @@ -328,25 +423,25 @@ GType multi_set_tests_get_type (void) G_GNUC_CONST; GType hash_multi_set_tests_get_type (void) G_GNUC_CONST; HashSetTests* hash_set_tests_new (void); HashSetTests* hash_set_tests_construct (GType object_type); -GType set_tests_get_type (void) G_GNUC_CONST; GType hash_set_tests_get_type (void) G_GNUC_CONST; LinkedListTests* linked_list_tests_new (void); LinkedListTests* linked_list_tests_construct (GType object_type); GType linked_list_tests_get_type (void) G_GNUC_CONST; LinkedListAsDequeTests* linked_list_as_deque_tests_new (void); LinkedListAsDequeTests* linked_list_as_deque_tests_construct (GType object_type); -GType queue_tests_get_type (void) G_GNUC_CONST; -GType deque_tests_get_type (void) G_GNUC_CONST; GType linked_list_as_deque_tests_get_type (void) G_GNUC_CONST; PriorityQueueTests* priority_queue_tests_new (void); PriorityQueueTests* priority_queue_tests_construct (GType object_type); GType priority_queue_tests_get_type (void) G_GNUC_CONST; +ReadOnlyBidirListTests* read_only_bidir_list_tests_new (void); +ReadOnlyBidirListTests* read_only_bidir_list_tests_construct (GType object_type); +GType read_only_collection_tests_get_type (void) G_GNUC_CONST; +GType read_only_list_tests_get_type (void) G_GNUC_CONST; +GType read_only_bidir_list_tests_get_type (void) G_GNUC_CONST; ReadOnlyCollectionTests* read_only_collection_tests_new (void); ReadOnlyCollectionTests* read_only_collection_tests_construct (GType object_type); -GType read_only_collection_tests_get_type (void) G_GNUC_CONST; ReadOnlyListTests* read_only_list_tests_new (void); ReadOnlyListTests* read_only_list_tests_construct (GType object_type); -GType read_only_list_tests_get_type (void) G_GNUC_CONST; ReadOnlyMapTests* read_only_map_tests_new (void); ReadOnlyMapTests* read_only_map_tests_construct (GType object_type); GType read_only_map_tests_get_type (void) G_GNUC_CONST; @@ -355,6 +450,8 @@ ReadOnlySetTests* read_only_set_tests_construct (GType object_type); GType read_only_set_tests_get_type (void) G_GNUC_CONST; TreeMapTests* tree_map_tests_new (void); TreeMapTests* tree_map_tests_construct (GType object_type); +GType gee_sorted_map_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_map_tests_get_type (void) G_GNUC_CONST; GType tree_map_tests_get_type (void) G_GNUC_CONST; TreeMultiMapTests* tree_multi_map_tests_new (void); TreeMultiMapTests* tree_multi_map_tests_construct (GType object_type); @@ -364,7 +461,7 @@ TreeMultiSetTests* tree_multi_set_tests_construct (GType object_type); GType tree_multi_set_tests_get_type (void) G_GNUC_CONST; TreeSetTests* tree_set_tests_new (void); TreeSetTests* tree_set_tests_construct (GType object_type); -GType sorted_set_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_set_tests_get_type (void) G_GNUC_CONST; GType tree_set_tests_get_type (void) G_GNUC_CONST; @@ -374,70 +471,87 @@ void _vala_main (gchar** args, int args_length1) { ArrayListTests* _tmp2_; GTestSuite* _tmp3_ = NULL; GTestSuite* _tmp4_ = NULL; - ComparableTests* _tmp5_; - ComparableTests* _tmp6_; + ArrayQueueTests* _tmp5_; + ArrayQueueTests* _tmp6_; GTestSuite* _tmp7_ = NULL; GTestSuite* _tmp8_ = NULL; - HashMapTests* _tmp9_; - HashMapTests* _tmp10_; + ConcurrentListTests* _tmp9_; + ConcurrentListTests* _tmp10_; GTestSuite* _tmp11_ = NULL; GTestSuite* _tmp12_ = NULL; - HashMultiMapTests* _tmp13_; - HashMultiMapTests* _tmp14_; + ConcurrentSetTests* _tmp13_; + ConcurrentSetTests* _tmp14_; GTestSuite* _tmp15_ = NULL; GTestSuite* _tmp16_ = NULL; - HashMultiSetTests* _tmp17_; - HashMultiSetTests* _tmp18_; + FunctionsTests* _tmp17_; + FunctionsTests* _tmp18_; GTestSuite* _tmp19_ = NULL; GTestSuite* _tmp20_ = NULL; - HashSetTests* _tmp21_; - HashSetTests* _tmp22_; + HashMapTests* _tmp21_; + HashMapTests* _tmp22_; GTestSuite* _tmp23_ = NULL; GTestSuite* _tmp24_ = NULL; - LinkedListTests* _tmp25_; - LinkedListTests* _tmp26_; + HashMultiMapTests* _tmp25_; + HashMultiMapTests* _tmp26_; GTestSuite* _tmp27_ = NULL; GTestSuite* _tmp28_ = NULL; - LinkedListAsDequeTests* _tmp29_; - LinkedListAsDequeTests* _tmp30_; + HashMultiSetTests* _tmp29_; + HashMultiSetTests* _tmp30_; GTestSuite* _tmp31_ = NULL; GTestSuite* _tmp32_ = NULL; - PriorityQueueTests* _tmp33_; - PriorityQueueTests* _tmp34_; + HashSetTests* _tmp33_; + HashSetTests* _tmp34_; GTestSuite* _tmp35_ = NULL; GTestSuite* _tmp36_ = NULL; - ReadOnlyCollectionTests* _tmp37_; - ReadOnlyCollectionTests* _tmp38_; + LinkedListTests* _tmp37_; + LinkedListTests* _tmp38_; GTestSuite* _tmp39_ = NULL; GTestSuite* _tmp40_ = NULL; - ReadOnlyListTests* _tmp41_; - ReadOnlyListTests* _tmp42_; + LinkedListAsDequeTests* _tmp41_; + LinkedListAsDequeTests* _tmp42_; GTestSuite* _tmp43_ = NULL; GTestSuite* _tmp44_ = NULL; - ReadOnlyMapTests* _tmp45_; - ReadOnlyMapTests* _tmp46_; + PriorityQueueTests* _tmp45_; + PriorityQueueTests* _tmp46_; GTestSuite* _tmp47_ = NULL; GTestSuite* _tmp48_ = NULL; - ReadOnlySetTests* _tmp49_; - ReadOnlySetTests* _tmp50_; + ReadOnlyBidirListTests* _tmp49_; + ReadOnlyBidirListTests* _tmp50_; GTestSuite* _tmp51_ = NULL; GTestSuite* _tmp52_ = NULL; - TreeMapTests* _tmp53_; - TreeMapTests* _tmp54_; + ReadOnlyCollectionTests* _tmp53_; + ReadOnlyCollectionTests* _tmp54_; GTestSuite* _tmp55_ = NULL; GTestSuite* _tmp56_ = NULL; - TreeMultiMapTests* _tmp57_; - TreeMultiMapTests* _tmp58_; + ReadOnlyListTests* _tmp57_; + ReadOnlyListTests* _tmp58_; GTestSuite* _tmp59_ = NULL; GTestSuite* _tmp60_ = NULL; - TreeMultiSetTests* _tmp61_; - TreeMultiSetTests* _tmp62_; + ReadOnlyMapTests* _tmp61_; + ReadOnlyMapTests* _tmp62_; GTestSuite* _tmp63_ = NULL; GTestSuite* _tmp64_ = NULL; - TreeSetTests* _tmp65_; - TreeSetTests* _tmp66_; + ReadOnlySetTests* _tmp65_; + ReadOnlySetTests* _tmp66_; GTestSuite* _tmp67_ = NULL; + GTestSuite* _tmp68_ = NULL; + TreeMapTests* _tmp69_; + TreeMapTests* _tmp70_; + GTestSuite* _tmp71_ = NULL; + GTestSuite* _tmp72_ = NULL; + TreeMultiMapTests* _tmp73_; + TreeMultiMapTests* _tmp74_; + GTestSuite* _tmp75_ = NULL; + GTestSuite* _tmp76_ = NULL; + TreeMultiSetTests* _tmp77_; + TreeMultiSetTests* _tmp78_; + GTestSuite* _tmp79_ = NULL; + GTestSuite* _tmp80_ = NULL; + TreeSetTests* _tmp81_; + TreeSetTests* _tmp82_; + GTestSuite* _tmp83_ = NULL; g_test_init (&args_length1, &args, NULL); + gee_hazard_pointer_set_release_policy (GEE_HAZARD_POINTER_RELEASE_POLICY_MAIN_LOOP); _tmp0_ = g_test_get_root (); _tmp1_ = array_list_tests_new (); _tmp2_ = _tmp1_; @@ -445,101 +559,125 @@ void _vala_main (gchar** args, int args_length1) { g_test_suite_add_suite (_tmp0_, _tmp3_); _g_object_unref0 (_tmp2_); _tmp4_ = g_test_get_root (); - _tmp5_ = comparable_tests_new (); + _tmp5_ = array_queue_tests_new (); _tmp6_ = _tmp5_; _tmp7_ = gee_test_case_get_suite ((GeeTestCase*) _tmp6_); g_test_suite_add_suite (_tmp4_, _tmp7_); _g_object_unref0 (_tmp6_); _tmp8_ = g_test_get_root (); - _tmp9_ = hash_map_tests_new (); + _tmp9_ = concurrent_list_tests_new (); _tmp10_ = _tmp9_; _tmp11_ = gee_test_case_get_suite ((GeeTestCase*) _tmp10_); g_test_suite_add_suite (_tmp8_, _tmp11_); _g_object_unref0 (_tmp10_); _tmp12_ = g_test_get_root (); - _tmp13_ = hash_multi_map_tests_new (); + _tmp13_ = concurrent_set_tests_new (); _tmp14_ = _tmp13_; _tmp15_ = gee_test_case_get_suite ((GeeTestCase*) _tmp14_); g_test_suite_add_suite (_tmp12_, _tmp15_); _g_object_unref0 (_tmp14_); _tmp16_ = g_test_get_root (); - _tmp17_ = hash_multi_set_tests_new (); + _tmp17_ = functions_tests_new (); _tmp18_ = _tmp17_; _tmp19_ = gee_test_case_get_suite ((GeeTestCase*) _tmp18_); g_test_suite_add_suite (_tmp16_, _tmp19_); _g_object_unref0 (_tmp18_); _tmp20_ = g_test_get_root (); - _tmp21_ = hash_set_tests_new (); + _tmp21_ = hash_map_tests_new (); _tmp22_ = _tmp21_; _tmp23_ = gee_test_case_get_suite ((GeeTestCase*) _tmp22_); g_test_suite_add_suite (_tmp20_, _tmp23_); _g_object_unref0 (_tmp22_); _tmp24_ = g_test_get_root (); - _tmp25_ = linked_list_tests_new (); + _tmp25_ = hash_multi_map_tests_new (); _tmp26_ = _tmp25_; _tmp27_ = gee_test_case_get_suite ((GeeTestCase*) _tmp26_); g_test_suite_add_suite (_tmp24_, _tmp27_); _g_object_unref0 (_tmp26_); _tmp28_ = g_test_get_root (); - _tmp29_ = linked_list_as_deque_tests_new (); + _tmp29_ = hash_multi_set_tests_new (); _tmp30_ = _tmp29_; _tmp31_ = gee_test_case_get_suite ((GeeTestCase*) _tmp30_); g_test_suite_add_suite (_tmp28_, _tmp31_); _g_object_unref0 (_tmp30_); _tmp32_ = g_test_get_root (); - _tmp33_ = priority_queue_tests_new (); + _tmp33_ = hash_set_tests_new (); _tmp34_ = _tmp33_; _tmp35_ = gee_test_case_get_suite ((GeeTestCase*) _tmp34_); g_test_suite_add_suite (_tmp32_, _tmp35_); _g_object_unref0 (_tmp34_); _tmp36_ = g_test_get_root (); - _tmp37_ = read_only_collection_tests_new (); + _tmp37_ = linked_list_tests_new (); _tmp38_ = _tmp37_; _tmp39_ = gee_test_case_get_suite ((GeeTestCase*) _tmp38_); g_test_suite_add_suite (_tmp36_, _tmp39_); _g_object_unref0 (_tmp38_); _tmp40_ = g_test_get_root (); - _tmp41_ = read_only_list_tests_new (); + _tmp41_ = linked_list_as_deque_tests_new (); _tmp42_ = _tmp41_; _tmp43_ = gee_test_case_get_suite ((GeeTestCase*) _tmp42_); g_test_suite_add_suite (_tmp40_, _tmp43_); _g_object_unref0 (_tmp42_); _tmp44_ = g_test_get_root (); - _tmp45_ = read_only_map_tests_new (); + _tmp45_ = priority_queue_tests_new (); _tmp46_ = _tmp45_; _tmp47_ = gee_test_case_get_suite ((GeeTestCase*) _tmp46_); g_test_suite_add_suite (_tmp44_, _tmp47_); _g_object_unref0 (_tmp46_); _tmp48_ = g_test_get_root (); - _tmp49_ = read_only_set_tests_new (); + _tmp49_ = read_only_bidir_list_tests_new (); _tmp50_ = _tmp49_; _tmp51_ = gee_test_case_get_suite ((GeeTestCase*) _tmp50_); g_test_suite_add_suite (_tmp48_, _tmp51_); _g_object_unref0 (_tmp50_); _tmp52_ = g_test_get_root (); - _tmp53_ = tree_map_tests_new (); + _tmp53_ = read_only_collection_tests_new (); _tmp54_ = _tmp53_; _tmp55_ = gee_test_case_get_suite ((GeeTestCase*) _tmp54_); g_test_suite_add_suite (_tmp52_, _tmp55_); _g_object_unref0 (_tmp54_); _tmp56_ = g_test_get_root (); - _tmp57_ = tree_multi_map_tests_new (); + _tmp57_ = read_only_list_tests_new (); _tmp58_ = _tmp57_; _tmp59_ = gee_test_case_get_suite ((GeeTestCase*) _tmp58_); g_test_suite_add_suite (_tmp56_, _tmp59_); _g_object_unref0 (_tmp58_); _tmp60_ = g_test_get_root (); - _tmp61_ = tree_multi_set_tests_new (); + _tmp61_ = read_only_map_tests_new (); _tmp62_ = _tmp61_; _tmp63_ = gee_test_case_get_suite ((GeeTestCase*) _tmp62_); g_test_suite_add_suite (_tmp60_, _tmp63_); _g_object_unref0 (_tmp62_); _tmp64_ = g_test_get_root (); - _tmp65_ = tree_set_tests_new (); + _tmp65_ = read_only_set_tests_new (); _tmp66_ = _tmp65_; _tmp67_ = gee_test_case_get_suite ((GeeTestCase*) _tmp66_); g_test_suite_add_suite (_tmp64_, _tmp67_); _g_object_unref0 (_tmp66_); + _tmp68_ = g_test_get_root (); + _tmp69_ = tree_map_tests_new (); + _tmp70_ = _tmp69_; + _tmp71_ = gee_test_case_get_suite ((GeeTestCase*) _tmp70_); + g_test_suite_add_suite (_tmp68_, _tmp71_); + _g_object_unref0 (_tmp70_); + _tmp72_ = g_test_get_root (); + _tmp73_ = tree_multi_map_tests_new (); + _tmp74_ = _tmp73_; + _tmp75_ = gee_test_case_get_suite ((GeeTestCase*) _tmp74_); + g_test_suite_add_suite (_tmp72_, _tmp75_); + _g_object_unref0 (_tmp74_); + _tmp76_ = g_test_get_root (); + _tmp77_ = tree_multi_set_tests_new (); + _tmp78_ = _tmp77_; + _tmp79_ = gee_test_case_get_suite ((GeeTestCase*) _tmp78_); + g_test_suite_add_suite (_tmp76_, _tmp79_); + _g_object_unref0 (_tmp78_); + _tmp80_ = g_test_get_root (); + _tmp81_ = tree_set_tests_new (); + _tmp82_ = _tmp81_; + _tmp83_ = gee_test_case_get_suite ((GeeTestCase*) _tmp82_); + g_test_suite_add_suite (_tmp80_, _tmp83_); + _g_object_unref0 (_tmp82_); g_test_run (); } diff --git a/tests/testmain.vala b/tests/testmain.vala index ad6e992..312c6ba 100644 --- a/tests/testmain.vala +++ b/tests/testmain.vala @@ -24,8 +24,13 @@ void main (string[] args) { Test.init (ref args); + Gee.HazardPointer.set_release_policy(Gee.HazardPointer.ReleasePolicy.MAIN_LOOP); + TestSuite.get_root ().add_suite (new ArrayListTests ().get_suite ()); - TestSuite.get_root ().add_suite (new ComparableTests ().get_suite ()); + TestSuite.get_root ().add_suite (new ArrayQueueTests ().get_suite ()); + TestSuite.get_root ().add_suite (new ConcurrentListTests ().get_suite ()); + TestSuite.get_root ().add_suite (new ConcurrentSetTests ().get_suite ()); + TestSuite.get_root ().add_suite (new FunctionsTests ().get_suite ()); TestSuite.get_root ().add_suite (new HashMapTests ().get_suite ()); TestSuite.get_root ().add_suite (new HashMultiMapTests ().get_suite ()); TestSuite.get_root ().add_suite (new HashMultiSetTests ().get_suite ()); @@ -33,6 +38,7 @@ void main (string[] args) { TestSuite.get_root ().add_suite (new LinkedListTests ().get_suite ()); TestSuite.get_root ().add_suite (new LinkedListAsDequeTests ().get_suite ()); TestSuite.get_root ().add_suite (new PriorityQueueTests ().get_suite ()); + TestSuite.get_root ().add_suite (new ReadOnlyBidirListTests ().get_suite ()); TestSuite.get_root ().add_suite (new ReadOnlyCollectionTests ().get_suite ()); TestSuite.get_root ().add_suite (new ReadOnlyListTests ().get_suite ()); TestSuite.get_root ().add_suite (new ReadOnlyMapTests ().get_suite ()); diff --git a/tests/testmap.c b/tests/testmap.c index e49ca88..aeded81 100644 --- a/tests/testmap.c +++ b/tests/testmap.c @@ -3,8 +3,8 @@ /* testmap.vala * - * Copyright (C) 2008 Jürg Billeter, Maciej Piechotka - * Copyright (C) 2009 Didier Villevalois, Julien Peeters + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2009 Didier Villevalois, Julien Peeters, Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -66,6 +66,7 @@ typedef struct _MapTestsPrivate MapTestsPrivate; typedef struct _MapTestsTestEntry MapTestsTestEntry; typedef struct _MapTestsTestEntryClass MapTestsTestEntryClass; +typedef struct _Block9Data Block9Data; typedef struct _MapTestsTestEntryPrivate MapTestsTestEntryPrivate; #define _k_destroy_func0(var) (((var == NULL) || (k_destroy_func == NULL)) ? NULL : (var = (k_destroy_func (var), NULL))) #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); @@ -92,6 +93,12 @@ struct _MapTestsClass { }; typedef void (*GeeTestCaseTestMethod) (void* user_data); +struct _Block9Data { + int _ref_count_; + MapTests * self; + gint count; +}; + struct _MapTestsTestEntry { GeeMapEntry parent_instance; MapTestsTestEntryPrivate * priv; @@ -123,7 +130,7 @@ enum { }; MapTests* map_tests_construct (GType object_type, const gchar* name); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void map_tests_test_type_correctness (MapTests* self); static void _map_tests_test_type_correctness_gee_test_case_test_method (gpointer self); void map_tests_test_has_key_size_is_empty (MapTests* self); @@ -142,10 +149,27 @@ void map_tests_test_has_all (MapTests* self); static void _map_tests_test_has_all_gee_test_case_test_method (gpointer self); void map_tests_test_gobject_properties (MapTests* self); static void _map_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); -MapTestsTestEntry* map_tests_test_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value); -MapTestsTestEntry* map_tests_test_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value); -GType map_tests_test_entry_get_type (void) G_GNUC_CONST; +void map_tests_test_fold (MapTests* self); +static void _map_tests_test_fold_gee_test_case_test_method (gpointer self); +void map_tests_test_foreach (MapTests* self); +static void _map_tests_test_foreach_gee_test_case_test_method (gpointer self); +static MapTestsTestEntry* map_tests_test_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value); +static MapTestsTestEntry* map_tests_test_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value); +static GType map_tests_test_entry_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; void map_tests_test_clear (MapTests* self); +static gint __lambda15_ (MapTests* self, const gchar* x, const gchar* y, gint z); +static gpointer ___lambda15__gee_fold_map_func (gconstpointer k, gconstpointer v, gpointer a, gpointer self); +static gint __lambda16_ (MapTests* self, const gchar* x, const gchar* y, gint z); +static gpointer ___lambda16__gee_fold_map_func (gconstpointer k, gconstpointer v, gpointer a, gpointer self); +static Block9Data* block9_data_ref (Block9Data* _data9_); +static void block9_data_unref (void * _userdata_); +static gboolean __lambda17_ (Block9Data* _data9_, const gchar* x, const gchar* y); +static gboolean ___lambda17__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self); +static gboolean __lambda18_ (Block9Data* _data9_, const gchar* x, const gchar* y); +static gboolean ___lambda18__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self); +GeeMapEntry* map_tests_entry_for (const gchar* key, const gchar* value); +gboolean map_tests_check_entry (GeeMapEntry* e, const gchar* key, const gchar* value); +void map_tests_assert_entry (GeeMapEntry* e, const gchar* key, const gchar* value); #define MAP_TESTS_TEST_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MAP_TESTS_TYPE_TEST_ENTRY, MapTestsTestEntryPrivate)) enum { MAP_TESTS_TEST_ENTRY_DUMMY_PROPERTY, @@ -156,7 +180,8 @@ enum { MAP_TESTS_TEST_ENTRY_V_DUP_FUNC, MAP_TESTS_TEST_ENTRY_V_DESTROY_FUNC, MAP_TESTS_TEST_ENTRY_KEY, - MAP_TESTS_TEST_ENTRY_VALUE + MAP_TESTS_TEST_ENTRY_VALUE, + MAP_TESTS_TEST_ENTRY_READ_ONLY }; static void map_tests_test_entry_finalize (GObject* obj); static void _vala_map_tests_test_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); @@ -209,21 +234,33 @@ static void _map_tests_test_gobject_properties_gee_test_case_test_method (gpoint } +static void _map_tests_test_fold_gee_test_case_test_method (gpointer self) { + map_tests_test_fold (self); +} + + +static void _map_tests_test_foreach_gee_test_case_test_method (gpointer self) { + map_tests_test_foreach (self); +} + + MapTests* map_tests_construct (GType object_type, const gchar* name) { MapTests * self = NULL; const gchar* _tmp0_; g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (MapTests*) gee_test_case_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] type correctness", _map_tests_test_type_correctness_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] has_key, size and is_empty", _map_tests_test_has_key_size_is_empty_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] keys", _map_tests_test_keys_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] values", _map_tests_test_values_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] entries", _map_tests_test_entries_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] set all", _map_tests_test_set_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] unset all", _map_tests_test_unset_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] has all", _map_tests_test_has_all_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Map] GObject properties", _map_tests_test_gobject_properties_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] type correctness", _map_tests_test_type_correctness_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] has_key, size and is_empty", _map_tests_test_has_key_size_is_empty_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] keys", _map_tests_test_keys_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] values", _map_tests_test_values_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] entries", _map_tests_test_entries_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] set all", _map_tests_test_set_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] unset all", _map_tests_test_unset_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] has all", _map_tests_test_has_all_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] GObject properties", _map_tests_test_gobject_properties_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] fold", _map_tests_test_fold_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] foreach", _map_tests_test_foreach_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -1349,30 +1386,30 @@ void map_tests_test_clear (MapTests* self) { void map_tests_test_set_all (MapTests* self) { - GHashFunc _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; - GeeHashMap* _tmp3_; + GeeHashMap* _tmp0_; GeeHashMap* another_map; + GeeMap* _tmp1_; + GeeMap* _tmp2_; + GeeMap* _tmp3_; GeeMap* _tmp4_; GeeMap* _tmp5_; - GeeMap* _tmp6_; - GeeMap* _tmp7_; + gint _tmp6_; + gint _tmp7_; GeeMap* _tmp8_; - gint _tmp9_; - gint _tmp10_; - GeeMap* _tmp11_; - gboolean _tmp12_ = FALSE; - GeeMap* _tmp13_; - gboolean _tmp14_ = FALSE; - GeeMap* _tmp15_; - gboolean _tmp16_ = FALSE; - GeeMap* _tmp17_; - gboolean _tmp18_ = FALSE; - GeeMap* _tmp19_; - gboolean _tmp20_ = FALSE; - GeeMap* _tmp21_; - gboolean _tmp22_ = FALSE; + gboolean _tmp9_ = FALSE; + GeeMap* _tmp10_; + gboolean _tmp11_ = FALSE; + GeeMap* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeMap* _tmp14_; + gboolean _tmp15_ = FALSE; + GeeMap* _tmp16_; + gboolean _tmp17_ = FALSE; + GeeMap* _tmp18_; + gboolean _tmp19_ = FALSE; + GeeMap* _tmp20_; + gpointer _tmp21_ = NULL; + gchar* _tmp22_; GeeMap* _tmp23_; gpointer _tmp24_ = NULL; gchar* _tmp25_; @@ -1388,299 +1425,287 @@ void map_tests_test_set_all (MapTests* self) { GeeMap* _tmp35_; gpointer _tmp36_ = NULL; gchar* _tmp37_; - GeeMap* _tmp38_; - gpointer _tmp39_ = NULL; - gchar* _tmp40_; g_return_if_fail (self != NULL); - _tmp0_ = g_str_hash; - _tmp1_ = g_str_equal; - _tmp2_ = g_str_equal; - _tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_, _tmp2_); - another_map = _tmp3_; - _tmp4_ = self->test_map; - gee_map_set (_tmp4_, "one", "value_of_one"); - _tmp5_ = self->test_map; - gee_map_set (_tmp5_, "two", "value_of_two"); - _tmp6_ = self->test_map; - gee_map_set (_tmp6_, "three", "value_of_three"); + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + another_map = _tmp0_; + _tmp1_ = self->test_map; + gee_map_set (_tmp1_, "one", "value_of_one"); + _tmp2_ = self->test_map; + gee_map_set (_tmp2_, "two", "value_of_two"); + _tmp3_ = self->test_map; + gee_map_set (_tmp3_, "three", "value_of_three"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "four", "value_of_four"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "five", "value_of_five"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "six", "value_of_six"); - _tmp7_ = self->test_map; - gee_map_set_all (_tmp7_, (GeeMap*) another_map); + _tmp4_ = self->test_map; + gee_map_set_all (_tmp4_, (GeeMap*) another_map); + _tmp5_ = self->test_map; + _tmp6_ = gee_map_get_size (_tmp5_); + _tmp7_ = _tmp6_; + _vala_assert (_tmp7_ == 6, "test_map.size == 6"); _tmp8_ = self->test_map; - _tmp9_ = gee_map_get_size (_tmp8_); - _tmp10_ = _tmp9_; - _vala_assert (_tmp10_ == 6, "test_map.size == 6"); - _tmp11_ = self->test_map; - _tmp12_ = gee_map_has_key (_tmp11_, "one"); - _vala_assert (_tmp12_, "test_map.has_key (\"one\")"); - _tmp13_ = self->test_map; - _tmp14_ = gee_map_has_key (_tmp13_, "two"); - _vala_assert (_tmp14_, "test_map.has_key (\"two\")"); - _tmp15_ = self->test_map; - _tmp16_ = gee_map_has_key (_tmp15_, "three"); - _vala_assert (_tmp16_, "test_map.has_key (\"three\")"); - _tmp17_ = self->test_map; - _tmp18_ = gee_map_has_key (_tmp17_, "four"); - _vala_assert (_tmp18_, "test_map.has_key (\"four\")"); - _tmp19_ = self->test_map; - _tmp20_ = gee_map_has_key (_tmp19_, "five"); - _vala_assert (_tmp20_, "test_map.has_key (\"five\")"); - _tmp21_ = self->test_map; - _tmp22_ = gee_map_has_key (_tmp21_, "six"); - _vala_assert (_tmp22_, "test_map.has_key (\"six\")"); + _tmp9_ = gee_map_has_key (_tmp8_, "one"); + _vala_assert (_tmp9_, "test_map.has_key (\"one\")"); + _tmp10_ = self->test_map; + _tmp11_ = gee_map_has_key (_tmp10_, "two"); + _vala_assert (_tmp11_, "test_map.has_key (\"two\")"); + _tmp12_ = self->test_map; + _tmp13_ = gee_map_has_key (_tmp12_, "three"); + _vala_assert (_tmp13_, "test_map.has_key (\"three\")"); + _tmp14_ = self->test_map; + _tmp15_ = gee_map_has_key (_tmp14_, "four"); + _vala_assert (_tmp15_, "test_map.has_key (\"four\")"); + _tmp16_ = self->test_map; + _tmp17_ = gee_map_has_key (_tmp16_, "five"); + _vala_assert (_tmp17_, "test_map.has_key (\"five\")"); + _tmp18_ = self->test_map; + _tmp19_ = gee_map_has_key (_tmp18_, "six"); + _vala_assert (_tmp19_, "test_map.has_key (\"six\")"); + _tmp20_ = self->test_map; + _tmp21_ = gee_map_get (_tmp20_, "one"); + _tmp22_ = (gchar*) _tmp21_; + _vala_assert (g_strcmp0 (_tmp22_, "value_of_one") == 0, "test_map.get (\"one\") == \"value_of_one\""); + _g_free0 (_tmp22_); _tmp23_ = self->test_map; - _tmp24_ = gee_map_get (_tmp23_, "one"); + _tmp24_ = gee_map_get (_tmp23_, "two"); _tmp25_ = (gchar*) _tmp24_; - _vala_assert (g_strcmp0 (_tmp25_, "value_of_one") == 0, "test_map.get (\"one\") == \"value_of_one\""); + _vala_assert (g_strcmp0 (_tmp25_, "value_of_two") == 0, "test_map.get (\"two\") == \"value_of_two\""); _g_free0 (_tmp25_); _tmp26_ = self->test_map; - _tmp27_ = gee_map_get (_tmp26_, "two"); + _tmp27_ = gee_map_get (_tmp26_, "three"); _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "value_of_two") == 0, "test_map.get (\"two\") == \"value_of_two\""); + _vala_assert (g_strcmp0 (_tmp28_, "value_of_three") == 0, "test_map.get (\"three\") == \"value_of_three\""); _g_free0 (_tmp28_); _tmp29_ = self->test_map; - _tmp30_ = gee_map_get (_tmp29_, "three"); + _tmp30_ = gee_map_get (_tmp29_, "four"); _tmp31_ = (gchar*) _tmp30_; - _vala_assert (g_strcmp0 (_tmp31_, "value_of_three") == 0, "test_map.get (\"three\") == \"value_of_three\""); + _vala_assert (g_strcmp0 (_tmp31_, "value_of_four") == 0, "test_map.get (\"four\") == \"value_of_four\""); _g_free0 (_tmp31_); _tmp32_ = self->test_map; - _tmp33_ = gee_map_get (_tmp32_, "four"); + _tmp33_ = gee_map_get (_tmp32_, "five"); _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "value_of_four") == 0, "test_map.get (\"four\") == \"value_of_four\""); + _vala_assert (g_strcmp0 (_tmp34_, "value_of_five") == 0, "test_map.get (\"five\") == \"value_of_five\""); _g_free0 (_tmp34_); _tmp35_ = self->test_map; - _tmp36_ = gee_map_get (_tmp35_, "five"); + _tmp36_ = gee_map_get (_tmp35_, "six"); _tmp37_ = (gchar*) _tmp36_; - _vala_assert (g_strcmp0 (_tmp37_, "value_of_five") == 0, "test_map.get (\"five\") == \"value_of_five\""); + _vala_assert (g_strcmp0 (_tmp37_, "value_of_six") == 0, "test_map.get (\"six\") == \"value_of_six\""); _g_free0 (_tmp37_); - _tmp38_ = self->test_map; - _tmp39_ = gee_map_get (_tmp38_, "six"); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (g_strcmp0 (_tmp40_, "value_of_six") == 0, "test_map.get (\"six\") == \"value_of_six\""); - _g_free0 (_tmp40_); _g_object_unref0 (another_map); } void map_tests_test_unset_all (MapTests* self) { - GHashFunc _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; - GeeHashMap* _tmp3_; + GeeHashMap* _tmp0_; GeeHashMap* another_map; - GeeMap* _tmp4_; + GeeMap* _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_; + gboolean _tmp4_; gboolean _tmp5_; - gboolean _tmp6_; - gboolean _tmp7_; - gboolean _tmp8_; - GeeMap* _tmp9_; - gboolean _tmp10_ = FALSE; - GeeMap* _tmp11_; + GeeMap* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeMap* _tmp8_; + gboolean _tmp9_; + gboolean _tmp10_; + gboolean _tmp11_; gboolean _tmp12_; - gboolean _tmp13_; - gboolean _tmp14_; + GeeMap* _tmp13_; + GeeMap* _tmp14_; gboolean _tmp15_; - GeeMap* _tmp16_; - GeeMap* _tmp17_; - gboolean _tmp18_; - gboolean _tmp19_; - gint _tmp20_; - gint _tmp21_; - GeeMap* _tmp22_; - gboolean _tmp23_ = FALSE; - GeeMap* _tmp24_; - gboolean _tmp25_; - gboolean _tmp26_; - gint _tmp27_; - gint _tmp28_; + gboolean _tmp16_; + gint _tmp17_; + gint _tmp18_; + GeeMap* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeMap* _tmp21_; + gboolean _tmp22_; + gboolean _tmp23_; + gint _tmp24_; + gint _tmp25_; + GeeMap* _tmp26_; + GeeMap* _tmp27_; + GeeMap* _tmp28_; GeeMap* _tmp29_; - GeeMap* _tmp30_; - GeeMap* _tmp31_; - GeeMap* _tmp32_; - gint _tmp33_; - gint _tmp34_; - gboolean _tmp35_; - gboolean _tmp36_; - GeeMap* _tmp37_; - gboolean _tmp38_ = FALSE; - GeeMap* _tmp39_; - gint _tmp40_; - gint _tmp41_; - gboolean _tmp42_; - gboolean _tmp43_; + gint _tmp30_; + gint _tmp31_; + gboolean _tmp32_; + gboolean _tmp33_; + GeeMap* _tmp34_; + gboolean _tmp35_ = FALSE; + GeeMap* _tmp36_; + gint _tmp37_; + gint _tmp38_; + gboolean _tmp39_; + gboolean _tmp40_; + GeeMap* _tmp41_; + GeeMap* _tmp42_; + GeeMap* _tmp43_; GeeMap* _tmp44_; - GeeMap* _tmp45_; - GeeMap* _tmp46_; - GeeMap* _tmp47_; + gint _tmp45_; + gint _tmp46_; + gint _tmp47_; gint _tmp48_; - gint _tmp49_; - gint _tmp50_; - gint _tmp51_; - GeeMap* _tmp52_; - gboolean _tmp53_ = FALSE; - GeeMap* _tmp54_; - gboolean _tmp55_; - gboolean _tmp56_; - gint _tmp57_; - gint _tmp58_; + GeeMap* _tmp49_; + gboolean _tmp50_ = FALSE; + GeeMap* _tmp51_; + gboolean _tmp52_; + gboolean _tmp53_; + gint _tmp54_; + gint _tmp55_; + GeeMap* _tmp56_; + GeeMap* _tmp57_; + GeeMap* _tmp58_; GeeMap* _tmp59_; GeeMap* _tmp60_; - GeeMap* _tmp61_; - GeeMap* _tmp62_; - GeeMap* _tmp63_; + gint _tmp61_; + gint _tmp62_; + gint _tmp63_; gint _tmp64_; - gint _tmp65_; - gint _tmp66_; - gint _tmp67_; - GeeMap* _tmp68_; - gboolean _tmp69_ = FALSE; - GeeMap* _tmp70_; + GeeMap* _tmp65_; + gboolean _tmp66_ = FALSE; + GeeMap* _tmp67_; + gint _tmp68_; + gint _tmp69_; + gint _tmp70_; gint _tmp71_; - gint _tmp72_; - gint _tmp73_; - gint _tmp74_; - GeeMap* _tmp75_; - gboolean _tmp76_ = FALSE; + GeeMap* _tmp72_; + gboolean _tmp73_ = FALSE; g_return_if_fail (self != NULL); - _tmp0_ = g_str_hash; - _tmp1_ = g_str_equal; - _tmp2_ = g_str_equal; - _tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_, _tmp2_); - another_map = _tmp3_; - _tmp4_ = self->test_map; - _tmp5_ = gee_map_get_is_empty (_tmp4_); - _tmp6_ = _tmp5_; - _vala_assert (_tmp6_, "test_map.is_empty"); - _tmp7_ = gee_abstract_map_get_is_empty ((GeeAbstractMap*) another_map); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_, "another_map.is_empty"); - _tmp9_ = self->test_map; - _tmp10_ = gee_map_unset_all (_tmp9_, (GeeMap*) another_map); - _vala_assert (!_tmp10_, "! test_map.unset_all (another_map)"); - _tmp11_ = self->test_map; - _tmp12_ = gee_map_get_is_empty (_tmp11_); - _tmp13_ = _tmp12_; - _vala_assert (_tmp13_, "test_map.is_empty"); - _tmp14_ = gee_abstract_map_get_is_empty ((GeeAbstractMap*) another_map); - _tmp15_ = _tmp14_; - _vala_assert (_tmp15_, "another_map.is_empty"); - _tmp16_ = self->test_map; - gee_map_clear (_tmp16_); + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + another_map = _tmp0_; + _tmp1_ = self->test_map; + _tmp2_ = gee_map_get_is_empty (_tmp1_); + _tmp3_ = _tmp2_; + _vala_assert (_tmp3_, "test_map.is_empty"); + _tmp4_ = gee_map_get_is_empty ((GeeMap*) another_map); + _tmp5_ = _tmp4_; + _vala_assert (_tmp5_, "another_map.is_empty"); + _tmp6_ = self->test_map; + _tmp7_ = gee_map_unset_all (_tmp6_, (GeeMap*) another_map); + _vala_assert (!_tmp7_, "! test_map.unset_all (another_map)"); + _tmp8_ = self->test_map; + _tmp9_ = gee_map_get_is_empty (_tmp8_); + _tmp10_ = _tmp9_; + _vala_assert (_tmp10_, "test_map.is_empty"); + _tmp11_ = gee_map_get_is_empty ((GeeMap*) another_map); + _tmp12_ = _tmp11_; + _vala_assert (_tmp12_, "another_map.is_empty"); + _tmp13_ = self->test_map; + gee_map_clear (_tmp13_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "value_of_one"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); - _tmp17_ = self->test_map; - _tmp18_ = gee_map_get_is_empty (_tmp17_); - _tmp19_ = _tmp18_; - _vala_assert (_tmp19_, "test_map.is_empty"); - _tmp20_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp21_ = _tmp20_; - _vala_assert (_tmp21_ == 2, "another_map.size == 2"); - _tmp22_ = self->test_map; - _tmp23_ = gee_map_unset_all (_tmp22_, (GeeMap*) another_map); - _vala_assert (!_tmp23_, "! test_map.unset_all (another_map)"); - _tmp24_ = self->test_map; - _tmp25_ = gee_map_get_is_empty (_tmp24_); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_, "test_map.is_empty"); - _tmp27_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp28_ = _tmp27_; - _vala_assert (_tmp28_ == 2, "another_map.size == 2"); - _tmp29_ = self->test_map; - gee_map_clear (_tmp29_); + _tmp14_ = self->test_map; + _tmp15_ = gee_map_get_is_empty (_tmp14_); + _tmp16_ = _tmp15_; + _vala_assert (_tmp16_, "test_map.is_empty"); + _tmp17_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp18_ = _tmp17_; + _vala_assert (_tmp18_ == 2, "another_map.size == 2"); + _tmp19_ = self->test_map; + _tmp20_ = gee_map_unset_all (_tmp19_, (GeeMap*) another_map); + _vala_assert (!_tmp20_, "! test_map.unset_all (another_map)"); + _tmp21_ = self->test_map; + _tmp22_ = gee_map_get_is_empty (_tmp21_); + _tmp23_ = _tmp22_; + _vala_assert (_tmp23_, "test_map.is_empty"); + _tmp24_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp25_ = _tmp24_; + _vala_assert (_tmp25_ == 2, "another_map.size == 2"); + _tmp26_ = self->test_map; + gee_map_clear (_tmp26_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp30_ = self->test_map; - gee_map_set (_tmp30_, "one", "value_of_one"); - _tmp31_ = self->test_map; - gee_map_set (_tmp31_, "two", "value_of_two"); - _tmp32_ = self->test_map; - _tmp33_ = gee_map_get_size (_tmp32_); - _tmp34_ = _tmp33_; - _vala_assert (_tmp34_ == 2, "test_map.size == 2"); - _tmp35_ = gee_abstract_map_get_is_empty ((GeeAbstractMap*) another_map); - _tmp36_ = _tmp35_; - _vala_assert (_tmp36_, "another_map.is_empty"); - _tmp37_ = self->test_map; - _tmp38_ = gee_map_unset_all (_tmp37_, (GeeMap*) another_map); - _vala_assert (!_tmp38_, "! test_map.unset_all (another_map)"); - _tmp39_ = self->test_map; - _tmp40_ = gee_map_get_size (_tmp39_); - _tmp41_ = _tmp40_; - _vala_assert (_tmp41_ == 2, "test_map.size == 2"); - _tmp42_ = gee_abstract_map_get_is_empty ((GeeAbstractMap*) another_map); - _tmp43_ = _tmp42_; - _vala_assert (_tmp43_, "another_map.is_empty"); - _tmp44_ = self->test_map; - gee_map_clear (_tmp44_); + _tmp27_ = self->test_map; + gee_map_set (_tmp27_, "one", "value_of_one"); + _tmp28_ = self->test_map; + gee_map_set (_tmp28_, "two", "value_of_two"); + _tmp29_ = self->test_map; + _tmp30_ = gee_map_get_size (_tmp29_); + _tmp31_ = _tmp30_; + _vala_assert (_tmp31_ == 2, "test_map.size == 2"); + _tmp32_ = gee_map_get_is_empty ((GeeMap*) another_map); + _tmp33_ = _tmp32_; + _vala_assert (_tmp33_, "another_map.is_empty"); + _tmp34_ = self->test_map; + _tmp35_ = gee_map_unset_all (_tmp34_, (GeeMap*) another_map); + _vala_assert (!_tmp35_, "! test_map.unset_all (another_map)"); + _tmp36_ = self->test_map; + _tmp37_ = gee_map_get_size (_tmp36_); + _tmp38_ = _tmp37_; + _vala_assert (_tmp38_ == 2, "test_map.size == 2"); + _tmp39_ = gee_map_get_is_empty ((GeeMap*) another_map); + _tmp40_ = _tmp39_; + _vala_assert (_tmp40_, "another_map.is_empty"); + _tmp41_ = self->test_map; + gee_map_clear (_tmp41_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp45_ = self->test_map; - gee_map_set (_tmp45_, "one", "value_of_one"); - _tmp46_ = self->test_map; - gee_map_set (_tmp46_, "two", "value_of_two"); + _tmp42_ = self->test_map; + gee_map_set (_tmp42_, "one", "value_of_one"); + _tmp43_ = self->test_map; + gee_map_set (_tmp43_, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "value_of_one"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); - _tmp47_ = self->test_map; - _tmp48_ = gee_map_get_size (_tmp47_); - _tmp49_ = _tmp48_; - _vala_assert (_tmp49_ == 2, "test_map.size == 2"); - _tmp50_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 2, "another_map.size == 2"); - _tmp52_ = self->test_map; - _tmp53_ = gee_map_unset_all (_tmp52_, (GeeMap*) another_map); - _vala_assert (_tmp53_, "test_map.unset_all (another_map)"); - _tmp54_ = self->test_map; - _tmp55_ = gee_map_get_is_empty (_tmp54_); - _tmp56_ = _tmp55_; - _vala_assert (_tmp56_, "test_map.is_empty"); - _tmp57_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 2, "another_map.size == 2"); - _tmp59_ = self->test_map; - gee_map_clear (_tmp59_); + _tmp44_ = self->test_map; + _tmp45_ = gee_map_get_size (_tmp44_); + _tmp46_ = _tmp45_; + _vala_assert (_tmp46_ == 2, "test_map.size == 2"); + _tmp47_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp48_ = _tmp47_; + _vala_assert (_tmp48_ == 2, "another_map.size == 2"); + _tmp49_ = self->test_map; + _tmp50_ = gee_map_unset_all (_tmp49_, (GeeMap*) another_map); + _vala_assert (_tmp50_, "test_map.unset_all (another_map)"); + _tmp51_ = self->test_map; + _tmp52_ = gee_map_get_is_empty (_tmp51_); + _tmp53_ = _tmp52_; + _vala_assert (_tmp53_, "test_map.is_empty"); + _tmp54_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp55_ = _tmp54_; + _vala_assert (_tmp55_ == 2, "another_map.size == 2"); + _tmp56_ = self->test_map; + gee_map_clear (_tmp56_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp60_ = self->test_map; - gee_map_set (_tmp60_, "one", "value_of_one"); - _tmp61_ = self->test_map; - gee_map_set (_tmp61_, "two", "value_of_two"); - _tmp62_ = self->test_map; - gee_map_set (_tmp62_, "three", "value_of_three"); + _tmp57_ = self->test_map; + gee_map_set (_tmp57_, "one", "value_of_one"); + _tmp58_ = self->test_map; + gee_map_set (_tmp58_, "two", "value_of_two"); + _tmp59_ = self->test_map; + gee_map_set (_tmp59_, "three", "value_of_three"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "three", "value_of_three"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "four", "value_of_four"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "five", "value_of_five"); - _tmp63_ = self->test_map; - _tmp64_ = gee_map_get_size (_tmp63_); - _tmp65_ = _tmp64_; - _vala_assert (_tmp65_ == 3, "test_map.size == 3"); - _tmp66_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp67_ = _tmp66_; - _vala_assert (_tmp67_ == 4, "another_map.size == 4"); - _tmp68_ = self->test_map; - _tmp69_ = gee_map_unset_all (_tmp68_, (GeeMap*) another_map); - _vala_assert (_tmp69_, "test_map.unset_all (another_map)"); - _tmp70_ = self->test_map; - _tmp71_ = gee_map_get_size (_tmp70_); - _tmp72_ = _tmp71_; - _vala_assert (_tmp72_ == 1, "test_map.size == 1"); - _tmp73_ = gee_abstract_map_get_size ((GeeMap*) another_map); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 4, "another_map.size == 4"); - _tmp75_ = self->test_map; - _tmp76_ = gee_map_has_key (_tmp75_, "one"); - _vala_assert (_tmp76_, "test_map.has_key (\"one\")"); + _tmp60_ = self->test_map; + _tmp61_ = gee_map_get_size (_tmp60_); + _tmp62_ = _tmp61_; + _vala_assert (_tmp62_ == 3, "test_map.size == 3"); + _tmp63_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp64_ = _tmp63_; + _vala_assert (_tmp64_ == 4, "another_map.size == 4"); + _tmp65_ = self->test_map; + _tmp66_ = gee_map_unset_all (_tmp65_, (GeeMap*) another_map); + _vala_assert (_tmp66_, "test_map.unset_all (another_map)"); + _tmp67_ = self->test_map; + _tmp68_ = gee_map_get_size (_tmp67_); + _tmp69_ = _tmp68_; + _vala_assert (_tmp69_ == 1, "test_map.size == 1"); + _tmp70_ = gee_abstract_map_get_size ((GeeMap*) another_map); + _tmp71_ = _tmp70_; + _vala_assert (_tmp71_ == 4, "another_map.size == 4"); + _tmp72_ = self->test_map; + _tmp73_ = gee_map_has_key (_tmp72_, "one"); + _vala_assert (_tmp73_, "test_map.has_key (\"one\")"); _g_object_unref0 (another_map); } void map_tests_test_has_all (MapTests* self) { - GHashFunc _tmp0_; - GEqualFunc _tmp1_; - GEqualFunc _tmp2_; - GeeHashMap* _tmp3_; + GeeHashMap* _tmp0_; GeeHashMap* another_map; + GeeMap* _tmp1_; + gboolean _tmp2_ = FALSE; + GeeMap* _tmp3_; GeeMap* _tmp4_; gboolean _tmp5_ = FALSE; GeeMap* _tmp6_; @@ -1688,136 +1713,130 @@ void map_tests_test_has_all (MapTests* self) { gboolean _tmp8_ = FALSE; GeeMap* _tmp9_; GeeMap* _tmp10_; - gboolean _tmp11_ = FALSE; + GeeMap* _tmp11_; GeeMap* _tmp12_; - GeeMap* _tmp13_; + gboolean _tmp13_ = FALSE; GeeMap* _tmp14_; GeeMap* _tmp15_; - gboolean _tmp16_ = FALSE; + GeeMap* _tmp16_; GeeMap* _tmp17_; - GeeMap* _tmp18_; + gboolean _tmp18_ = FALSE; GeeMap* _tmp19_; GeeMap* _tmp20_; - gboolean _tmp21_ = FALSE; - GeeMap* _tmp22_; + GeeMap* _tmp21_; + gboolean _tmp22_ = FALSE; GeeMap* _tmp23_; GeeMap* _tmp24_; - gboolean _tmp25_ = FALSE; + GeeMap* _tmp25_; GeeMap* _tmp26_; GeeMap* _tmp27_; GeeMap* _tmp28_; GeeMap* _tmp29_; GeeMap* _tmp30_; - GeeMap* _tmp31_; + gboolean _tmp31_ = FALSE; GeeMap* _tmp32_; GeeMap* _tmp33_; - gboolean _tmp34_ = FALSE; + GeeMap* _tmp34_; GeeMap* _tmp35_; GeeMap* _tmp36_; GeeMap* _tmp37_; GeeMap* _tmp38_; GeeMap* _tmp39_; - GeeMap* _tmp40_; - GeeMap* _tmp41_; - GeeMap* _tmp42_; - gboolean _tmp43_ = FALSE; + gboolean _tmp40_ = FALSE; g_return_if_fail (self != NULL); - _tmp0_ = g_str_hash; - _tmp1_ = g_str_equal; - _tmp2_ = g_str_equal; - _tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_, _tmp2_); - another_map = _tmp3_; + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + another_map = _tmp0_; + _tmp1_ = self->test_map; + _tmp2_ = gee_map_has_all (_tmp1_, (GeeMap*) another_map); + _vala_assert (_tmp2_, "test_map.has_all (another_map)"); + _tmp3_ = self->test_map; + gee_map_set (_tmp3_, "one", "value_of_one"); _tmp4_ = self->test_map; _tmp5_ = gee_map_has_all (_tmp4_, (GeeMap*) another_map); _vala_assert (_tmp5_, "test_map.has_all (another_map)"); _tmp6_ = self->test_map; - gee_map_set (_tmp6_, "one", "value_of_one"); + gee_map_clear (_tmp6_); + gee_abstract_map_clear ((GeeAbstractMap*) another_map); + gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "value_of_one"); _tmp7_ = self->test_map; _tmp8_ = gee_map_has_all (_tmp7_, (GeeMap*) another_map); - _vala_assert (_tmp8_, "test_map.has_all (another_map)"); + _vala_assert (!_tmp8_, "! test_map.has_all (another_map)"); _tmp9_ = self->test_map; gee_map_clear (_tmp9_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "value_of_one"); _tmp10_ = self->test_map; - _tmp11_ = gee_map_has_all (_tmp10_, (GeeMap*) another_map); - _vala_assert (!_tmp11_, "! test_map.has_all (another_map)"); - _tmp12_ = self->test_map; - gee_map_clear (_tmp12_); - gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp13_ = self->test_map; - gee_map_set (_tmp13_, "one", "value_of_one"); - _tmp14_ = self->test_map; - gee_map_set (_tmp14_, "two", "value_of_two"); + gee_map_set (_tmp10_, "one", "value_of_one"); + _tmp11_ = self->test_map; + gee_map_set (_tmp11_, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "value_of_one"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); - _tmp15_ = self->test_map; - _tmp16_ = gee_map_has_all (_tmp15_, (GeeMap*) another_map); - _vala_assert (_tmp16_, "test_map.has_all (another_map)"); - _tmp17_ = self->test_map; - gee_map_clear (_tmp17_); + _tmp12_ = self->test_map; + _tmp13_ = gee_map_has_all (_tmp12_, (GeeMap*) another_map); + _vala_assert (_tmp13_, "test_map.has_all (another_map)"); + _tmp14_ = self->test_map; + gee_map_clear (_tmp14_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp18_ = self->test_map; - gee_map_set (_tmp18_, "one", "value_of_one"); - _tmp19_ = self->test_map; - gee_map_set (_tmp19_, "two", "value_of_two"); + _tmp15_ = self->test_map; + gee_map_set (_tmp15_, "one", "value_of_one"); + _tmp16_ = self->test_map; + gee_map_set (_tmp16_, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "one", "another_value_of_one"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "another_value_of_two"); - _tmp20_ = self->test_map; - _tmp21_ = gee_map_has_all (_tmp20_, (GeeMap*) another_map); - _vala_assert (!_tmp21_, "! test_map.has_all (another_map)"); - _tmp22_ = self->test_map; - gee_map_clear (_tmp22_); + _tmp17_ = self->test_map; + _tmp18_ = gee_map_has_all (_tmp17_, (GeeMap*) another_map); + _vala_assert (!_tmp18_, "! test_map.has_all (another_map)"); + _tmp19_ = self->test_map; + gee_map_clear (_tmp19_); gee_abstract_map_clear ((GeeAbstractMap*) another_map); - _tmp23_ = self->test_map; - gee_map_set (_tmp23_, "one", "value_of_one"); + _tmp20_ = self->test_map; + gee_map_set (_tmp20_, "one", "value_of_one"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); + _tmp21_ = self->test_map; + _tmp22_ = gee_map_has_all (_tmp21_, (GeeMap*) another_map); + _vala_assert (!_tmp22_, "! test_map.has_all (another_map)"); + _tmp23_ = self->test_map; + gee_map_clear (_tmp23_); + gee_abstract_map_clear ((GeeAbstractMap*) another_map); _tmp24_ = self->test_map; - _tmp25_ = gee_map_has_all (_tmp24_, (GeeMap*) another_map); - _vala_assert (!_tmp25_, "! test_map.has_all (another_map)"); + gee_map_set (_tmp24_, "one", "value_of_one"); + _tmp25_ = self->test_map; + gee_map_set (_tmp25_, "two", "value_of_two"); _tmp26_ = self->test_map; - gee_map_clear (_tmp26_); - gee_abstract_map_clear ((GeeAbstractMap*) another_map); + gee_map_set (_tmp26_, "three", "value_of_three"); _tmp27_ = self->test_map; - gee_map_set (_tmp27_, "one", "value_of_one"); + gee_map_set (_tmp27_, "four", "value_of_four"); _tmp28_ = self->test_map; - gee_map_set (_tmp28_, "two", "value_of_two"); + gee_map_set (_tmp28_, "five", "value_of_five"); _tmp29_ = self->test_map; - gee_map_set (_tmp29_, "three", "value_of_three"); - _tmp30_ = self->test_map; - gee_map_set (_tmp30_, "four", "value_of_four"); - _tmp31_ = self->test_map; - gee_map_set (_tmp31_, "five", "value_of_five"); - _tmp32_ = self->test_map; - gee_map_set (_tmp32_, "six", "value_of_six"); + gee_map_set (_tmp29_, "six", "value_of_six"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "three", "value_of_three"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "four", "value_of_four"); + _tmp30_ = self->test_map; + _tmp31_ = gee_map_has_all (_tmp30_, (GeeMap*) another_map); + _vala_assert (_tmp31_, "test_map.has_all (another_map)"); + _tmp32_ = self->test_map; + gee_map_clear (_tmp32_); + gee_abstract_map_clear ((GeeAbstractMap*) another_map); _tmp33_ = self->test_map; - _tmp34_ = gee_map_has_all (_tmp33_, (GeeMap*) another_map); - _vala_assert (_tmp34_, "test_map.has_all (another_map)"); + gee_map_set (_tmp33_, "one", "value_of_one"); + _tmp34_ = self->test_map; + gee_map_set (_tmp34_, "two", "value_of_two"); _tmp35_ = self->test_map; - gee_map_clear (_tmp35_); - gee_abstract_map_clear ((GeeAbstractMap*) another_map); + gee_map_set (_tmp35_, "three", "value_of_three"); _tmp36_ = self->test_map; - gee_map_set (_tmp36_, "one", "value_of_one"); + gee_map_set (_tmp36_, "four", "value_of_four"); _tmp37_ = self->test_map; - gee_map_set (_tmp37_, "two", "value_of_two"); + gee_map_set (_tmp37_, "five", "value_of_five"); _tmp38_ = self->test_map; - gee_map_set (_tmp38_, "three", "value_of_three"); - _tmp39_ = self->test_map; - gee_map_set (_tmp39_, "four", "value_of_four"); - _tmp40_ = self->test_map; - gee_map_set (_tmp40_, "five", "value_of_five"); - _tmp41_ = self->test_map; - gee_map_set (_tmp41_, "six", "value_of_six"); + gee_map_set (_tmp38_, "six", "value_of_six"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "two", "value_of_two"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "three", "value_of_three"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "four", "value_of_four"); gee_abstract_map_set ((GeeAbstractMap*) another_map, "height", "value_of_height"); - _tmp42_ = self->test_map; - _tmp43_ = gee_map_has_all (_tmp42_, (GeeMap*) another_map); - _vala_assert (!_tmp43_, "! test_map.has_all (another_map)"); + _tmp39_ = self->test_map; + _tmp40_ = gee_map_has_all (_tmp39_, (GeeMap*) another_map); + _vala_assert (!_tmp40_, "! test_map.has_all (another_map)"); _g_object_unref0 (another_map); } @@ -1828,49 +1847,287 @@ void map_tests_test_gobject_properties (MapTests* self) { GValue _tmp1_ = {0}; GValue _tmp2_; GeeMap* _tmp3_; - gboolean _tmp4_ = FALSE; + gint _tmp4_ = 0; GeeMap* _tmp5_; - gboolean _tmp6_; - gboolean _tmp7_; - GValue _tmp8_ = {0}; - GValue _tmp9_; - GeeMap* _tmp10_; - gint _tmp11_ = 0; - GeeMap* _tmp12_; - gint _tmp13_; - gint _tmp14_; + gint _tmp6_; + gint _tmp7_; g_return_if_fail (self != NULL); _tmp0_ = self->test_map; _vala_assert (_tmp0_ != NULL, "test_map != null"); - g_value_init (&_tmp1_, G_TYPE_BOOLEAN); + g_value_init (&_tmp1_, G_TYPE_INT); G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; value = _tmp1_; _tmp2_ = value; _tmp3_ = self->test_map; - g_object_get_property ((GObject*) _tmp3_, "is-empty", &value); - _tmp4_ = g_value_get_boolean (&value); + g_object_get_property ((GObject*) _tmp3_, "size", &value); + _tmp4_ = g_value_get_int (&value); _tmp5_ = self->test_map; - _tmp6_ = gee_map_get_is_empty (_tmp5_); + _tmp6_ = gee_map_get_size (_tmp5_); _tmp7_ = _tmp6_; - _vala_assert (_tmp4_ == _tmp7_, "value.get_boolean () == test_map.is_empty"); - g_value_unset (&value); - g_value_init (&_tmp8_, G_TYPE_INT); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp8_; - _tmp9_ = value; - _tmp10_ = self->test_map; - g_object_get_property ((GObject*) _tmp10_, "size", &value); - _tmp11_ = g_value_get_int (&value); - _tmp12_ = self->test_map; - _tmp13_ = gee_map_get_size (_tmp12_); - _tmp14_ = _tmp13_; - _vala_assert (_tmp11_ == _tmp14_, "value.get_int () == test_map.size"); + _vala_assert (_tmp4_ == _tmp7_, "value.get_int () == test_map.size"); g_value_unset (&value); G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; } -MapTestsTestEntry* map_tests_test_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value) { +static gint __lambda15_ (MapTests* self, const gchar* x, const gchar* y, gint z) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (x != NULL, 0); + g_return_val_if_fail (y != NULL, 0); + _tmp0_ = z; + result = _tmp0_ + 1; + return result; +} + + +static gpointer ___lambda15__gee_fold_map_func (gconstpointer k, gconstpointer v, gpointer a, gpointer self) { + gpointer result; + result = __lambda15_ (self, k, v, a); + return result; +} + + +static gint __lambda16_ (MapTests* self, const gchar* x, const gchar* y, gint z) { + gint result = 0; + gint _tmp0_; + g_return_val_if_fail (x != NULL, 0); + g_return_val_if_fail (y != NULL, 0); + _tmp0_ = z; + result = _tmp0_ + 1; + return result; +} + + +static gpointer ___lambda16__gee_fold_map_func (gconstpointer k, gconstpointer v, gpointer a, gpointer self) { + gpointer result; + result = __lambda16_ (self, k, v, a); + return result; +} + + +void map_tests_test_fold (MapTests* self) { + GeeMap* _tmp0_; + GeeMap* _tmp1_; + GeeMap* _tmp2_; + gint count = 0; + GeeMap* _tmp3_; + GeeMapIterator* _tmp4_ = NULL; + GeeMapIterator* _tmp5_; + gpointer _tmp6_ = NULL; + gint _tmp7_; + GeeMap* _tmp8_; + GeeMapIterator* _tmp9_ = NULL; + GeeMapIterator* iter; + gboolean _tmp10_ = FALSE; + gpointer _tmp11_ = NULL; + gint _tmp12_; + g_return_if_fail (self != NULL); + _tmp0_ = self->test_map; + gee_map_set (_tmp0_, "one", "one"); + _tmp1_ = self->test_map; + gee_map_set (_tmp1_, "two", "two"); + _tmp2_ = self->test_map; + gee_map_set (_tmp2_, "three", "three"); + _tmp3_ = self->test_map; + _tmp4_ = gee_map_map_iterator (_tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_map_iterator_fold (_tmp5_, G_TYPE_INT, NULL, NULL, ___lambda15__gee_fold_map_func, self, (gpointer) ((gintptr) 0)); + count = (gint) ((gintptr) _tmp6_); + _g_object_unref0 (_tmp5_); + _tmp7_ = count; + _vala_assert (_tmp7_ == 3, "count == 3"); + _tmp8_ = self->test_map; + _tmp9_ = gee_map_map_iterator (_tmp8_); + iter = _tmp9_; + _tmp10_ = gee_map_iterator_next (iter); + _vala_assert (_tmp10_, "iter.next ()"); + _tmp11_ = gee_map_iterator_fold (iter, G_TYPE_INT, NULL, NULL, ___lambda16__gee_fold_map_func, self, (gpointer) ((gintptr) 0)); + count = (gint) ((gintptr) _tmp11_); + _tmp12_ = count; + _vala_assert (_tmp12_ == 3, "count == 3"); + _g_object_unref0 (iter); +} + + +static Block9Data* block9_data_ref (Block9Data* _data9_) { + g_atomic_int_inc (&_data9_->_ref_count_); + return _data9_; +} + + +static void block9_data_unref (void * _userdata_) { + Block9Data* _data9_; + _data9_ = (Block9Data*) _userdata_; + if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) { + MapTests * self; + self = _data9_->self; + _g_object_unref0 (self); + g_slice_free (Block9Data, _data9_); + } +} + + +static gboolean __lambda17_ (Block9Data* _data9_, const gchar* x, const gchar* y) { + MapTests * self; + gboolean result = FALSE; + gint _tmp0_; + self = _data9_->self; + g_return_val_if_fail (x != NULL, FALSE); + g_return_val_if_fail (y != NULL, FALSE); + _tmp0_ = _data9_->count; + _data9_->count = _tmp0_ + 1; + result = TRUE; + return result; +} + + +static gboolean ___lambda17__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self) { + gboolean result; + result = __lambda17_ (self, k, v); + return result; +} + + +static gboolean __lambda18_ (Block9Data* _data9_, const gchar* x, const gchar* y) { + MapTests * self; + gboolean result = FALSE; + gint _tmp0_; + self = _data9_->self; + g_return_val_if_fail (x != NULL, FALSE); + g_return_val_if_fail (y != NULL, FALSE); + _tmp0_ = _data9_->count; + _data9_->count = _tmp0_ + 1; + result = TRUE; + return result; +} + + +static gboolean ___lambda18__gee_forall_map_func (gconstpointer k, gconstpointer v, gpointer self) { + gboolean result; + result = __lambda18_ (self, k, v); + return result; +} + + +void map_tests_test_foreach (MapTests* self) { + Block9Data* _data9_; + GeeMap* _tmp0_; + GeeMap* _tmp1_; + GeeMap* _tmp2_; + GeeMap* _tmp3_; + GeeMapIterator* _tmp4_ = NULL; + GeeMapIterator* _tmp5_; + GeeMap* _tmp6_; + GeeMapIterator* _tmp7_ = NULL; + GeeMapIterator* iter; + gboolean _tmp8_ = FALSE; + g_return_if_fail (self != NULL); + _data9_ = g_slice_new0 (Block9Data); + _data9_->_ref_count_ = 1; + _data9_->self = g_object_ref (self); + _tmp0_ = self->test_map; + gee_map_set (_tmp0_, "one", "one"); + _tmp1_ = self->test_map; + gee_map_set (_tmp1_, "two", "two"); + _tmp2_ = self->test_map; + gee_map_set (_tmp2_, "three", "three"); + _data9_->count = 0; + _tmp3_ = self->test_map; + _tmp4_ = gee_map_map_iterator (_tmp3_); + _tmp5_ = _tmp4_; + gee_map_iterator_foreach (_tmp5_, ___lambda17__gee_forall_map_func, _data9_); + _g_object_unref0 (_tmp5_); + _vala_assert (_data9_->count == 3, "count == 3"); + _tmp6_ = self->test_map; + _tmp7_ = gee_map_map_iterator (_tmp6_); + iter = _tmp7_; + _tmp8_ = gee_map_iterator_next (iter); + _vala_assert (_tmp8_, "iter.next ()"); + gee_map_iterator_foreach (iter, ___lambda18__gee_forall_map_func, _data9_); + _vala_assert (_data9_->count == 6, "count == 6"); + _g_object_unref0 (iter); + block9_data_unref (_data9_); + _data9_ = NULL; +} + + +GeeMapEntry* map_tests_entry_for (const gchar* key, const gchar* value) { + GeeMapEntry* result = NULL; + const gchar* _tmp0_; + const gchar* _tmp1_; + MapTestsTestEntry* _tmp2_; + g_return_val_if_fail (key != NULL, NULL); + g_return_val_if_fail (value != NULL, NULL); + _tmp0_ = key; + _tmp1_ = value; + _tmp2_ = map_tests_test_entry_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_); + result = (GeeMapEntry*) _tmp2_; + return result; +} + + +gboolean map_tests_check_entry (GeeMapEntry* e, const gchar* key, const gchar* value) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + GeeMapEntry* _tmp1_; + gconstpointer _tmp2_; + const gchar* _tmp3_; + const gchar* _tmp4_; + gboolean _tmp9_; + g_return_val_if_fail (e != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + _tmp1_ = e; + _tmp2_ = gee_map_entry_get_key (_tmp1_); + _tmp3_ = _tmp2_; + _tmp4_ = key; + if (g_strcmp0 ((const gchar*) _tmp3_, _tmp4_) == 0) { + GeeMapEntry* _tmp5_; + gconstpointer _tmp6_; + const gchar* _tmp7_; + const gchar* _tmp8_; + _tmp5_ = e; + _tmp6_ = gee_map_entry_get_value (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = value; + _tmp0_ = g_strcmp0 ((const gchar*) _tmp7_, _tmp8_) == 0; + } else { + _tmp0_ = FALSE; + } + _tmp9_ = _tmp0_; + result = _tmp9_; + _g_object_unref0 (e); + return result; +} + + +void map_tests_assert_entry (GeeMapEntry* e, const gchar* key, const gchar* value) { + GeeMapEntry* _tmp0_; + gconstpointer _tmp1_; + const gchar* _tmp2_; + const gchar* _tmp3_; + GeeMapEntry* _tmp4_; + gconstpointer _tmp5_; + const gchar* _tmp6_; + const gchar* _tmp7_; + g_return_if_fail (e != NULL); + g_return_if_fail (key != NULL); + g_return_if_fail (value != NULL); + _tmp0_ = e; + _tmp1_ = gee_map_entry_get_key (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = key; + _vala_assert (g_strcmp0 ((const gchar*) _tmp2_, _tmp3_) == 0, "e.key == key"); + _tmp4_ = e; + _tmp5_ = gee_map_entry_get_value (_tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = value; + _vala_assert (g_strcmp0 ((const gchar*) _tmp6_, _tmp7_) == 0, "e.value == value"); +} + + +static MapTestsTestEntry* map_tests_test_entry_construct (GType object_type, GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value) { MapTestsTestEntry * self = NULL; gconstpointer _tmp0_; gpointer _tmp1_; @@ -1892,7 +2149,7 @@ MapTestsTestEntry* map_tests_test_entry_construct (GType object_type, GType k_ty } -MapTestsTestEntry* map_tests_test_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value) { +static MapTestsTestEntry* map_tests_test_entry_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, gconstpointer key, gconstpointer value) { return map_tests_test_entry_construct (MAP_TESTS_TYPE_TEST_ENTRY, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, key, value); } @@ -1932,12 +2189,22 @@ static void map_tests_test_entry_real_set_value (GeeMapEntry* base, gconstpointe } +static gboolean map_tests_test_entry_real_get_read_only (GeeMapEntry* base) { + gboolean result; + MapTestsTestEntry* self; + self = (MapTestsTestEntry*) base; + result = FALSE; + return result; +} + + static void map_tests_test_entry_class_init (MapTestsTestEntryClass * klass) { map_tests_test_entry_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (MapTestsTestEntryPrivate)); GEE_MAP_ENTRY_CLASS (klass)->get_key = map_tests_test_entry_real_get_key; GEE_MAP_ENTRY_CLASS (klass)->get_value = map_tests_test_entry_real_get_value; GEE_MAP_ENTRY_CLASS (klass)->set_value = map_tests_test_entry_real_set_value; + GEE_MAP_ENTRY_CLASS (klass)->get_read_only = map_tests_test_entry_real_get_read_only; G_OBJECT_CLASS (klass)->get_property = _vala_map_tests_test_entry_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_map_tests_test_entry_set_property; G_OBJECT_CLASS (klass)->finalize = map_tests_test_entry_finalize; @@ -1949,6 +2216,7 @@ static void map_tests_test_entry_class_init (MapTestsTestEntryClass * klass) { g_object_class_install_property (G_OBJECT_CLASS (klass), MAP_TESTS_TEST_ENTRY_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (G_OBJECT_CLASS (klass), MAP_TESTS_TEST_ENTRY_KEY, g_param_spec_pointer ("key", "key", "key", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), MAP_TESTS_TEST_ENTRY_VALUE, g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), MAP_TESTS_TEST_ENTRY_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } @@ -1966,7 +2234,7 @@ static void map_tests_test_entry_finalize (GObject* obj) { } -GType map_tests_test_entry_get_type (void) { +static GType map_tests_test_entry_get_type (void) { static volatile gsize map_tests_test_entry_type_id__volatile = 0; if (g_once_init_enter (&map_tests_test_entry_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (MapTestsTestEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) map_tests_test_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MapTestsTestEntry), 0, (GInstanceInitFunc) map_tests_test_entry_instance_init, NULL }; @@ -1988,6 +2256,9 @@ static void _vala_map_tests_test_entry_get_property (GObject * object, guint pro case MAP_TESTS_TEST_ENTRY_VALUE: g_value_set_pointer (value, gee_map_entry_get_value ((GeeMapEntry*) self)); break; + case MAP_TESTS_TEST_ENTRY_READ_ONLY: + g_value_set_boolean (value, gee_map_entry_get_read_only ((GeeMapEntry*) self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; diff --git a/tests/testmap.vala b/tests/testmap.vala index 19fc091..5a63cf8 100644 --- a/tests/testmap.vala +++ b/tests/testmap.vala @@ -1,7 +1,7 @@ /* testmap.vala * - * Copyright (C) 2008 Jürg Billeter, Maciej Piechotka - * Copyright (C) 2009 Didier Villevalois, Julien Peeters + * Copyright (C) 2008 Jürg Billeter + * Copyright (C) 2009 Didier Villevalois, Julien Peeters, Maciej Piechotka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,6 +39,8 @@ public abstract class MapTests : Gee.TestCase { add_test ("[Map] unset all", test_unset_all); add_test ("[Map] has all", test_has_all); add_test ("[Map] GObject properties", test_gobject_properties); + add_test ("[Map] fold", test_fold); + add_test ("[Map] foreach", test_foreach); } protected Map test_map; @@ -314,9 +316,7 @@ public abstract class MapTests : Gee.TestCase { } public void test_set_all () { - var another_map = new HashMap (str_hash, - str_equal, - str_equal); + var another_map = new HashMap (); test_map.set ("one", "value_of_one"); test_map.set ("two", "value_of_two"); @@ -344,9 +344,7 @@ public abstract class MapTests : Gee.TestCase { } public void test_unset_all () { - var another_map = new HashMap (str_hash, - str_equal, - str_equal); + var another_map = new HashMap (); // Check unset all on empty maps. assert (test_map.is_empty); @@ -431,9 +429,7 @@ public abstract class MapTests : Gee.TestCase { } public void test_has_all () { - var another_map = new HashMap (str_hash, - str_equal, - str_equal); + var another_map = new HashMap (); // Check empty. assert (test_map.has_all (another_map)); @@ -523,27 +519,67 @@ public abstract class MapTests : Gee.TestCase { assert (test_map != null); Value value; - value = Value (typeof (bool)); - test_map.get_property ("is-empty", ref value); - assert (value.get_boolean () == test_map.is_empty); - value.unset (); - value = Value (typeof (int)); test_map.get_property ("size", ref value); assert (value.get_int () == test_map.size); value.unset (); } + public void test_fold () { + test_map.set ("one", "one"); + test_map.set ("two", "two"); + test_map.set ("three", "three"); + + int count; + + count = test_map.map_iterator ().fold ((x, y, z) => {return z + 1;}, 0); + assert (count == 3); + + var iter = test_map.map_iterator (); + assert (iter.next ()); + count = iter.fold ((x, y, z) => {return z + 1;}, 0); + assert (count == 3); + } + + public void test_foreach () { + test_map.set ("one", "one"); + test_map.set ("two", "two"); + test_map.set ("three", "three"); + + int count = 0; + + test_map.map_iterator ().foreach ((x, y) => {count++; return true;}); + assert (count == 3); + + var iter = test_map.map_iterator (); + assert (iter.next ()); + iter.foreach ((x, y) => {count++; return true;}); + assert (count == 6); + } - - public class TestEntry : Map.Entry { + public static Map.Entry entry_for (string key, string value) { + return new TestEntry (key, value); + } + + public static bool check_entry (owned Map.Entry e, string key, string value) { + return e.key == key && e.value == value; + } + + public static void assert_entry (Map.Entry e, string key, string value) { + assert (e.key == key); + assert (e.value == value); + } + + private class TestEntry : Map.Entry { public TestEntry (K key, V value) { this._key = key; this.value = value; } - + public override K key { get {return _key; } } private K _key; public override V value { get; set; } + public override bool read_only { get { return false; } } } } + diff --git a/tests/testmultimap.c b/tests/testmultimap.c index f341696..d9a4204 100644 --- a/tests/testmultimap.c +++ b/tests/testmultimap.c @@ -90,7 +90,9 @@ enum { }; MultiMapTests* multi_map_tests_construct (GType object_type, const gchar* name); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void multi_map_tests_test_type_correctness (MultiMapTests* self); +static void _multi_map_tests_test_type_correctness_gee_test_case_test_method (gpointer self); static void multi_map_tests_test_size (MultiMapTests* self); static void _multi_map_tests_test_size_gee_test_case_test_method (gpointer self); static void multi_map_tests_test_getting_setting (MultiMapTests* self); @@ -100,6 +102,11 @@ static void _multi_map_tests_test_keys_all_keys_values_gee_test_case_test_method static void multi_map_tests_finalize (GObject* obj); +static void _multi_map_tests_test_type_correctness_gee_test_case_test_method (gpointer self) { + multi_map_tests_test_type_correctness (self); +} + + static void _multi_map_tests_test_size_gee_test_case_test_method (gpointer self) { multi_map_tests_test_size (self); } @@ -121,13 +128,36 @@ MultiMapTests* multi_map_tests_construct (GType object_type, const gchar* name) g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (MultiMapTests*) gee_test_case_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] size", _multi_map_tests_test_size_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] getting and setting", _multi_map_tests_test_getting_setting_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] keys, all keys and values", _multi_map_tests_test_keys_all_keys_values_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] type correctness", _multi_map_tests_test_type_correctness_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] size", _multi_map_tests_test_size_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] getting and setting", _multi_map_tests_test_getting_setting_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[MultiMap] keys, all keys and values", _multi_map_tests_test_keys_all_keys_values_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } +void multi_map_tests_test_type_correctness (MultiMapTests* self) { + GeeMultiMap* _tmp0_; + GeeMultiMap* _tmp1_; + GType _tmp2_; + GType _tmp3_; + GeeMultiMap* _tmp4_; + GType _tmp5_; + GType _tmp6_; + g_return_if_fail (self != NULL); + _tmp0_ = self->test_multi_map; + _vala_assert (_tmp0_ != NULL, "test_multi_map != null"); + _tmp1_ = self->test_multi_map; + _tmp2_ = gee_multi_map_get_key_type (_tmp1_); + _tmp3_ = _tmp2_; + _vala_assert (_tmp3_ == G_TYPE_STRING, "test_multi_map.key_type == typeof (string)"); + _tmp4_ = self->test_multi_map; + _tmp5_ = gee_multi_map_get_value_type (_tmp4_); + _tmp6_ = _tmp5_; + _vala_assert (_tmp6_ == G_TYPE_STRING, "test_multi_map.value_type == typeof (string)"); +} + + static void multi_map_tests_test_size (MultiMapTests* self) { GeeMultiMap* _tmp0_; GeeMultiMap* _tmp1_; diff --git a/tests/testmultimap.vala b/tests/testmultimap.vala index 7a2f9e0..0531be6 100644 --- a/tests/testmultimap.vala +++ b/tests/testmultimap.vala @@ -30,6 +30,7 @@ public abstract class MultiMapTests : Gee.TestCase { public MultiMapTests (string name) { base (name); + add_test ("[MultiMap] type correctness", test_type_correctness); add_test ("[MultiMap] size", test_size); add_test ("[MultiMap] getting and setting", test_getting_setting); add_test ("[MultiMap] keys, all keys and values", test_keys_all_keys_values); @@ -37,6 +38,15 @@ public abstract class MultiMapTests : Gee.TestCase { protected MultiMap test_multi_map; + public void test_type_correctness () { + // Check the multimap exists + assert (test_multi_map != null); + + // Check the advertised key and value types + assert (test_multi_map.key_type == typeof (string)); + assert (test_multi_map.value_type == typeof (string)); + } + private void test_size () { // Check the map exists assert (test_multi_map != null); diff --git a/tests/testmultiset.c b/tests/testmultiset.c index 81a4598..0ce6326 100644 --- a/tests/testmultiset.c +++ b/tests/testmultiset.c @@ -110,7 +110,7 @@ enum { }; MultiSetTests* multi_set_tests_construct (GType object_type, const gchar* name); CollectionTests* collection_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void multi_set_tests_test_duplicates_are_retained (MultiSetTests* self); static void _multi_set_tests_test_duplicates_are_retained_gee_test_case_test_method (gpointer self); @@ -126,7 +126,7 @@ MultiSetTests* multi_set_tests_construct (GType object_type, const gchar* name) g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (MultiSetTests*) collection_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[MultiSet] duplicates are retained", _multi_set_tests_test_duplicates_are_retained_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[MultiSet] duplicates are retained", _multi_set_tests_test_duplicates_are_retained_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } diff --git a/tests/testpriorityqueue.c b/tests/testpriorityqueue.c index 8bdbd4f..b64fc35 100644 --- a/tests/testpriorityqueue.c +++ b/tests/testpriorityqueue.c @@ -130,27 +130,13 @@ enum { PriorityQueueTests* priority_queue_tests_new (void); PriorityQueueTests* priority_queue_tests_construct (GType object_type); QueueTests* queue_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -static void priority_queue_tests_test_selected_functions (PriorityQueueTests* self); -static void _priority_queue_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void priority_queue_tests_test_gobject_properties (PriorityQueueTests* self); -static void _priority_queue_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); static void priority_queue_tests_test_poll_gives_minimum (PriorityQueueTests* self); static void _priority_queue_tests_test_poll_gives_minimum_gee_test_case_test_method (gpointer self); static void priority_queue_tests_real_set_up (GeeTestCase* base); static void priority_queue_tests_real_tear_down (GeeTestCase* base); -static void _priority_queue_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - priority_queue_tests_test_selected_functions (self); -} - - -static void _priority_queue_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - priority_queue_tests_test_gobject_properties (self); -} - - static void _priority_queue_tests_test_poll_gives_minimum_gee_test_case_test_method (gpointer self) { priority_queue_tests_test_poll_gives_minimum (self); } @@ -159,9 +145,7 @@ static void _priority_queue_tests_test_poll_gives_minimum_gee_test_case_test_met PriorityQueueTests* priority_queue_tests_construct (GType object_type) { PriorityQueueTests * self = NULL; self = (PriorityQueueTests*) queue_tests_construct (object_type, "PriorityQueue"); - gee_test_case_add_test ((GeeTestCase*) self, "[PriorityQueue] selected functions", _priority_queue_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[PriorityQueue] GObject properties", _priority_queue_tests_test_gobject_properties_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[PriorityQueue] poll gives minimum", _priority_queue_tests_test_poll_gives_minimum_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[PriorityQueue] poll gives minimum", _priority_queue_tests_test_poll_gives_minimum_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -175,7 +159,7 @@ static void priority_queue_tests_real_set_up (GeeTestCase* base) { PriorityQueueTests * self; GeePriorityQueue* _tmp0_; self = (PriorityQueueTests*) base; - _tmp0_ = gee_priority_queue_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_priority_queue_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -194,56 +178,6 @@ static gpointer _g_object_ref0 (gpointer self) { } -static void priority_queue_tests_test_selected_functions (PriorityQueueTests* self) { - GeeCollection* _tmp0_; - GeePriorityQueue* _tmp1_; - GeePriorityQueue* test_queue; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_PRIORITY_QUEUE) ? ((GeePriorityQueue*) _tmp0_) : NULL); - test_queue = _tmp1_; - _vala_assert (test_queue != NULL, "test_queue != null"); - _tmp2_ = gee_priority_queue_get_compare_func (test_queue); - _tmp3_ = _tmp2_; - _tmp4_ = g_strcmp0; - _vala_assert (_tmp3_ == ((GCompareFunc) _tmp4_), "test_queue.compare_func == (CompareFunc) strcmp"); - _g_object_unref0 (test_queue); -} - - -void priority_queue_tests_test_gobject_properties (PriorityQueueTests* self) { - GeeCollection* _tmp0_; - GeePriorityQueue* _tmp1_; - GeePriorityQueue* test_queue; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_PRIORITY_QUEUE) ? ((GeePriorityQueue*) _tmp0_) : NULL); - test_queue = _tmp1_; - _vala_assert (test_queue != NULL, "test_queue != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_queue, "compare-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_priority_queue_get_compare_func (test_queue); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_queue.compare_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_queue); -} - - static void priority_queue_tests_test_poll_gives_minimum (PriorityQueueTests* self) { GeeCollection* _tmp0_; GeeQueue* _tmp1_; diff --git a/tests/testpriorityqueue.vala b/tests/testpriorityqueue.vala index cbeac2f..676a814 100644 --- a/tests/testpriorityqueue.vala +++ b/tests/testpriorityqueue.vala @@ -26,8 +26,6 @@ public class PriorityQueueTests : QueueTests { public PriorityQueueTests () { base ("PriorityQueue"); - add_test ("[PriorityQueue] selected functions", test_selected_functions); - add_test ("[PriorityQueue] GObject properties", test_gobject_properties); add_test ("[PriorityQueue] poll gives minimum", test_poll_gives_minimum); } @@ -39,29 +37,6 @@ public class PriorityQueueTests : QueueTests { test_collection = null; } - private void test_selected_functions () { - var test_queue = test_collection as PriorityQueue; - - // Check the queue exists - assert (test_queue != null); - - // Check the selected compare function - assert (test_queue.compare_func == (CompareFunc) strcmp); - } - - public new void test_gobject_properties () { - var test_queue = test_collection as PriorityQueue; - - // Check the list exists - assert (test_queue != null); - Value value; - - value = Value (typeof (CompareFunc)); - test_queue.get_property ("compare-func", ref value); - assert (value.get_pointer () == (void*) test_queue.compare_func); - value.unset (); - } - private void test_poll_gives_minimum () { var test_queue = test_collection as Gee.Queue; diff --git a/tests/testqueue.c b/tests/testqueue.c index d31807b..549499b 100644 --- a/tests/testqueue.c +++ b/tests/testqueue.c @@ -108,7 +108,7 @@ enum { }; QueueTests* queue_tests_construct (GType object_type, const gchar* name); CollectionTests* collection_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void queue_tests_test_capacity_bound (QueueTests* self); static void _queue_tests_test_capacity_bound_gee_test_case_test_method (gpointer self); void queue_tests_test_one_element_operation (QueueTests* self); @@ -138,9 +138,9 @@ QueueTests* queue_tests_construct (GType object_type, const gchar* name) { g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (QueueTests*) collection_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Queue] capacity bound", _queue_tests_test_capacity_bound_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Queue] one element operation", _queue_tests_test_one_element_operation_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Queue] GObject properties", _queue_tests_test_gobject_properties_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Queue] capacity bound", _queue_tests_test_capacity_bound_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Queue] one element operation", _queue_tests_test_one_element_operation_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Queue] GObject properties", _queue_tests_test_gobject_properties_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -368,7 +368,7 @@ void queue_tests_test_one_element_operation (QueueTests* self) { _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_QUEUE) ? ((GeeQueue*) _tmp0_) : NULL); test_queue = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; _vala_assert (test_queue != NULL, "test_queue != null"); _tmp3_ = gee_queue_offer (test_queue, "one"); diff --git a/tests/testreadonlybidirlist.c b/tests/testreadonlybidirlist.c new file mode 100644 index 0000000..7b22f36 --- /dev/null +++ b/tests/testreadonlybidirlist.c @@ -0,0 +1,525 @@ +/* testreadonlybidirlist.c generated by valac 0.18.0, the Vala compiler + * generated from testreadonlybidirlist.vala, do not modify */ + +/* testreadonlybidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_READ_ONLY_COLLECTION_TESTS (read_only_collection_tests_get_type ()) +#define READ_ONLY_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTests)) +#define READ_ONLY_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTestsClass)) +#define IS_READ_ONLY_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_COLLECTION_TESTS)) +#define IS_READ_ONLY_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_COLLECTION_TESTS)) +#define READ_ONLY_COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_COLLECTION_TESTS, ReadOnlyCollectionTestsClass)) + +typedef struct _ReadOnlyCollectionTests ReadOnlyCollectionTests; +typedef struct _ReadOnlyCollectionTestsClass ReadOnlyCollectionTestsClass; +typedef struct _ReadOnlyCollectionTestsPrivate ReadOnlyCollectionTestsPrivate; + +#define TYPE_READ_ONLY_LIST_TESTS (read_only_list_tests_get_type ()) +#define READ_ONLY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTests)) +#define READ_ONLY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTestsClass)) +#define IS_READ_ONLY_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_LIST_TESTS)) +#define IS_READ_ONLY_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_LIST_TESTS)) +#define READ_ONLY_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_LIST_TESTS, ReadOnlyListTestsClass)) + +typedef struct _ReadOnlyListTests ReadOnlyListTests; +typedef struct _ReadOnlyListTestsClass ReadOnlyListTestsClass; +typedef struct _ReadOnlyListTestsPrivate ReadOnlyListTestsPrivate; + +#define TYPE_READ_ONLY_BIDIR_LIST_TESTS (read_only_bidir_list_tests_get_type ()) +#define READ_ONLY_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTests)) +#define READ_ONLY_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTestsClass)) +#define IS_READ_ONLY_BIDIR_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS)) +#define IS_READ_ONLY_BIDIR_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_READ_ONLY_BIDIR_LIST_TESTS)) +#define READ_ONLY_BIDIR_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_READ_ONLY_BIDIR_LIST_TESTS, ReadOnlyBidirListTestsClass)) + +typedef struct _ReadOnlyBidirListTests ReadOnlyBidirListTests; +typedef struct _ReadOnlyBidirListTestsClass ReadOnlyBidirListTestsClass; +typedef struct _ReadOnlyBidirListTestsPrivate ReadOnlyBidirListTestsPrivate; +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _ReadOnlyCollectionTests { + GeeTestCase parent_instance; + ReadOnlyCollectionTestsPrivate * priv; + GeeCollection* test_collection; + GeeCollection* ro_collection; +}; + +struct _ReadOnlyCollectionTestsClass { + GeeTestCaseClass parent_class; + GeeCollection* (*get_ro_view) (ReadOnlyCollectionTests* self, GeeCollection* collection); +}; + +struct _ReadOnlyListTests { + ReadOnlyCollectionTests parent_instance; + ReadOnlyListTestsPrivate * priv; +}; + +struct _ReadOnlyListTestsClass { + ReadOnlyCollectionTestsClass parent_class; +}; + +struct _ReadOnlyBidirListTests { + ReadOnlyListTests parent_instance; + ReadOnlyBidirListTestsPrivate * priv; +}; + +struct _ReadOnlyBidirListTestsClass { + ReadOnlyListTestsClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); + +static gpointer read_only_bidir_list_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType read_only_collection_tests_get_type (void) G_GNUC_CONST; +GType read_only_list_tests_get_type (void) G_GNUC_CONST; +GType read_only_bidir_list_tests_get_type (void) G_GNUC_CONST; +enum { + READ_ONLY_BIDIR_LIST_TESTS_DUMMY_PROPERTY +}; +ReadOnlyBidirListTests* read_only_bidir_list_tests_new (void); +ReadOnlyBidirListTests* read_only_bidir_list_tests_construct (GType object_type); +ReadOnlyListTests* read_only_list_tests_new_with_name (const gchar* name); +ReadOnlyListTests* read_only_list_tests_construct_with_name (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void read_only_bidir_list_tests_test_immutable_iterator (ReadOnlyBidirListTests* self); +static void _read_only_bidir_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self); +static GeeCollection* read_only_bidir_list_tests_real_get_ro_view (ReadOnlyCollectionTests* base, GeeCollection* collection); + + +static void _read_only_bidir_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self) { + read_only_bidir_list_tests_test_immutable_iterator (self); +} + + +ReadOnlyBidirListTests* read_only_bidir_list_tests_construct (GType object_type) { + ReadOnlyBidirListTests * self = NULL; + self = (ReadOnlyBidirListTests*) read_only_list_tests_construct_with_name (object_type, "ReadOnlyBidirList"); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyBidirList] immutable iterator", _read_only_bidir_list_tests_test_immutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +ReadOnlyBidirListTests* read_only_bidir_list_tests_new (void) { + return read_only_bidir_list_tests_construct (TYPE_READ_ONLY_BIDIR_LIST_TESTS); +} + + +static GeeCollection* read_only_bidir_list_tests_real_get_ro_view (ReadOnlyCollectionTests* base, GeeCollection* collection) { + ReadOnlyBidirListTests * self; + GeeCollection* result = NULL; + GeeCollection* _tmp0_; + GeeBidirList* _tmp1_; + GeeBidirList* _tmp2_; + self = (ReadOnlyBidirListTests*) base; + g_return_val_if_fail (collection != NULL, NULL); + _tmp0_ = collection; + _tmp1_ = gee_bidir_list_get_read_only_view (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_BIDIR_LIST, GeeBidirList)); + _tmp2_ = _tmp1_; + result = (GeeCollection*) _tmp2_; + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void read_only_bidir_list_tests_test_immutable_iterator (ReadOnlyBidirListTests* self) { + GeeCollection* _tmp0_; + GeeBidirList* _tmp1_; + GeeBidirList* test_list; + GeeCollection* _tmp2_; + GeeBidirList* _tmp3_; + GeeBidirList* ro_list; + GeeBidirList* _tmp4_; + gboolean _tmp5_ = FALSE; + GeeBidirList* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeBidirList* _tmp8_; + gint _tmp9_; + gint _tmp10_; + GeeBidirList* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeBidirList* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + GeeBidirList* _tmp17_; + GeeBidirListIterator* _tmp18_ = NULL; + GeeBidirListIterator* iterator; + GeeBidirListIterator* _tmp19_; + gboolean _tmp20_ = FALSE; + GeeBidirListIterator* _tmp21_; + gboolean _tmp22_ = FALSE; + GeeBidirListIterator* _tmp23_; + gpointer _tmp24_ = NULL; + gchar* _tmp25_; + GeeBidirListIterator* _tmp26_; + gint _tmp27_ = 0; + GeeBidirListIterator* _tmp28_; + gboolean _tmp29_ = FALSE; + GeeBidirListIterator* _tmp30_; + gboolean _tmp31_ = FALSE; + GeeBidirListIterator* _tmp32_; + gpointer _tmp33_ = NULL; + gchar* _tmp34_; + GeeBidirListIterator* _tmp35_; + gint _tmp36_ = 0; + GeeBidirListIterator* _tmp37_; + gboolean _tmp38_ = FALSE; + GeeBidirListIterator* _tmp39_; + gboolean _tmp40_ = FALSE; + GeeBidirListIterator* _tmp41_; + gboolean _tmp42_ = FALSE; + GeeBidirListIterator* _tmp43_; + gboolean _tmp44_ = FALSE; + GeeBidirListIterator* _tmp45_; + gpointer _tmp46_ = NULL; + gchar* _tmp47_; + GeeBidirListIterator* _tmp48_; + gint _tmp49_ = 0; + GeeBidirListIterator* _tmp50_; + gboolean _tmp51_ = FALSE; + GeeBidirListIterator* _tmp52_; + gpointer _tmp53_ = NULL; + gchar* _tmp54_; + GeeBidirListIterator* _tmp55_; + gint _tmp56_ = 0; + GeeBidirListIterator* _tmp57_; + gboolean _tmp58_ = FALSE; + GeeBidirListIterator* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + GeeBidirListIterator* _tmp62_; + gint _tmp63_ = 0; + gboolean _tmp64_ = FALSE; + GeeBidirList* _tmp66_; + gint _tmp67_; + gint _tmp68_; + GeeBidirList* _tmp69_; + gpointer _tmp70_ = NULL; + gchar* _tmp71_; + GeeBidirList* _tmp72_; + gpointer _tmp73_ = NULL; + gchar* _tmp74_; + GeeBidirListIterator* _tmp75_; + gint _tmp76_ = 0; + gboolean _tmp77_ = FALSE; + GeeBidirList* _tmp79_; + gint _tmp80_; + gint _tmp81_; + GeeBidirList* _tmp82_; + gpointer _tmp83_ = NULL; + gchar* _tmp84_; + GeeBidirList* _tmp85_; + gpointer _tmp86_ = NULL; + gchar* _tmp87_; + GeeBidirListIterator* _tmp88_; + gint _tmp89_ = 0; + gboolean _tmp90_ = FALSE; + GeeBidirList* _tmp92_; + gint _tmp93_; + gint _tmp94_; + GeeBidirList* _tmp95_; + gpointer _tmp96_ = NULL; + gchar* _tmp97_; + GeeBidirList* _tmp98_; + gpointer _tmp99_ = NULL; + gchar* _tmp100_; + GeeBidirListIterator* _tmp101_; + gint _tmp102_ = 0; + gboolean _tmp103_ = FALSE; + GeeBidirList* _tmp105_; + gint _tmp106_; + gint _tmp107_; + GeeBidirList* _tmp108_; + gpointer _tmp109_ = NULL; + gchar* _tmp110_; + GeeBidirList* _tmp111_; + gpointer _tmp112_ = NULL; + gchar* _tmp113_; + GeeBidirListIterator* _tmp114_; + gint _tmp115_ = 0; + g_return_if_fail (self != NULL); + _tmp0_ = ((ReadOnlyCollectionTests*) self)->test_collection; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_BIDIR_LIST) ? ((GeeBidirList*) _tmp0_) : NULL); + test_list = _tmp1_; + _tmp2_ = ((ReadOnlyCollectionTests*) self)->ro_collection; + _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_BIDIR_LIST) ? ((GeeBidirList*) _tmp2_) : NULL); + ro_list = _tmp3_; + _tmp4_ = test_list; + _tmp5_ = gee_collection_add ((GeeCollection*) _tmp4_, "one"); + _vala_assert (_tmp5_, "test_list.add (\"one\")"); + _tmp6_ = test_list; + _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "two"); + _vala_assert (_tmp7_, "test_list.add (\"two\")"); + _tmp8_ = ro_list; + _tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_); + _tmp10_ = _tmp9_; + _vala_assert (_tmp10_ == 2, "ro_list.size == 2"); + _tmp11_ = ro_list; + _tmp12_ = gee_list_get ((GeeList*) _tmp11_, 0); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (g_strcmp0 (_tmp13_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp13_); + _tmp14_ = ro_list; + _tmp15_ = gee_list_get ((GeeList*) _tmp14_, 1); + _tmp16_ = (gchar*) _tmp15_; + _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp16_); + _tmp17_ = ro_list; + _tmp18_ = gee_bidir_list_bidir_list_iterator (_tmp17_); + iterator = _tmp18_; + _tmp19_ = iterator; + _tmp20_ = gee_iterator_has_next ((GeeIterator*) _tmp19_); + _vala_assert (_tmp20_, "iterator.has_next ()"); + _tmp21_ = iterator; + _tmp22_ = gee_iterator_next ((GeeIterator*) _tmp21_); + _vala_assert (_tmp22_, "iterator.next ()"); + _tmp23_ = iterator; + _tmp24_ = gee_iterator_get ((GeeIterator*) _tmp23_); + _tmp25_ = (gchar*) _tmp24_; + _vala_assert (g_strcmp0 (_tmp25_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp25_); + _tmp26_ = iterator; + _tmp27_ = gee_list_iterator_index ((GeeListIterator*) _tmp26_); + _vala_assert (_tmp27_ == 0, "iterator.index () == 0"); + _tmp28_ = iterator; + _tmp29_ = gee_iterator_has_next ((GeeIterator*) _tmp28_); + _vala_assert (_tmp29_, "iterator.has_next ()"); + _tmp30_ = iterator; + _tmp31_ = gee_iterator_next ((GeeIterator*) _tmp30_); + _vala_assert (_tmp31_, "iterator.next ()"); + _tmp32_ = iterator; + _tmp33_ = gee_iterator_get ((GeeIterator*) _tmp32_); + _tmp34_ = (gchar*) _tmp33_; + _vala_assert (g_strcmp0 (_tmp34_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp34_); + _tmp35_ = iterator; + _tmp36_ = gee_list_iterator_index ((GeeListIterator*) _tmp35_); + _vala_assert (_tmp36_ == 1, "iterator.index () == 1"); + _tmp37_ = iterator; + _tmp38_ = gee_iterator_has_next ((GeeIterator*) _tmp37_); + _vala_assert (!_tmp38_, "! iterator.has_next ()"); + _tmp39_ = iterator; + _tmp40_ = gee_iterator_next ((GeeIterator*) _tmp39_); + _vala_assert (!_tmp40_, "! iterator.next ()"); + _tmp41_ = iterator; + _tmp42_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp41_); + _vala_assert (_tmp42_, "iterator.has_previous ()"); + _tmp43_ = iterator; + _tmp44_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp43_); + _vala_assert (_tmp44_, "iterator.previous ()"); + _tmp45_ = iterator; + _tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_); + _tmp47_ = (gchar*) _tmp46_; + _vala_assert (g_strcmp0 (_tmp47_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp47_); + _tmp48_ = iterator; + _tmp49_ = gee_list_iterator_index ((GeeListIterator*) _tmp48_); + _vala_assert (_tmp49_ == 0, "iterator.index () == 0"); + _tmp50_ = iterator; + _tmp51_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp50_); + _vala_assert (_tmp51_, "iterator.last ()"); + _tmp52_ = iterator; + _tmp53_ = gee_iterator_get ((GeeIterator*) _tmp52_); + _tmp54_ = (gchar*) _tmp53_; + _vala_assert (g_strcmp0 (_tmp54_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp54_); + _tmp55_ = iterator; + _tmp56_ = gee_list_iterator_index ((GeeListIterator*) _tmp55_); + _vala_assert (_tmp56_ == 1, "iterator.index () == 1"); + _tmp57_ = iterator; + _tmp58_ = gee_bidir_iterator_first ((GeeBidirIterator*) _tmp57_); + _vala_assert (_tmp58_, "iterator.first ()"); + _tmp59_ = iterator; + _tmp60_ = gee_iterator_get ((GeeIterator*) _tmp59_); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp61_); + _tmp62_ = iterator; + _tmp63_ = gee_list_iterator_index ((GeeListIterator*) _tmp62_); + _vala_assert (_tmp63_ == 0, "iterator.index () == 0"); + _tmp64_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp64_) { + GeeBidirListIterator* _tmp65_; + _tmp65_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp65_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp66_ = ro_list; + _tmp67_ = gee_collection_get_size ((GeeCollection*) _tmp66_); + _tmp68_ = _tmp67_; + _vala_assert (_tmp68_ == 2, "ro_list.size == 2"); + _tmp69_ = ro_list; + _tmp70_ = gee_list_get ((GeeList*) _tmp69_, 0); + _tmp71_ = (gchar*) _tmp70_; + _vala_assert (g_strcmp0 (_tmp71_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp71_); + _tmp72_ = ro_list; + _tmp73_ = gee_list_get ((GeeList*) _tmp72_, 1); + _tmp74_ = (gchar*) _tmp73_; + _vala_assert (g_strcmp0 (_tmp74_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp74_); + _tmp75_ = iterator; + _tmp76_ = gee_list_iterator_index ((GeeListIterator*) _tmp75_); + _vala_assert (_tmp76_ == 0, "iterator.index () == 0"); + _tmp77_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp77_) { + GeeBidirListIterator* _tmp78_; + _tmp78_ = iterator; + g_object_set ((GObject*) _tmp78_, "three", NULL); + exit (0); + } + g_test_trap_assert_failed (); + _tmp79_ = ro_list; + _tmp80_ = gee_collection_get_size ((GeeCollection*) _tmp79_); + _tmp81_ = _tmp80_; + _vala_assert (_tmp81_ == 2, "ro_list.size == 2"); + _tmp82_ = ro_list; + _tmp83_ = gee_list_get ((GeeList*) _tmp82_, 0); + _tmp84_ = (gchar*) _tmp83_; + _vala_assert (g_strcmp0 (_tmp84_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp84_); + _tmp85_ = ro_list; + _tmp86_ = gee_list_get ((GeeList*) _tmp85_, 1); + _tmp87_ = (gchar*) _tmp86_; + _vala_assert (g_strcmp0 (_tmp87_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp87_); + _tmp88_ = iterator; + _tmp89_ = gee_list_iterator_index ((GeeListIterator*) _tmp88_); + _vala_assert (_tmp89_ == 0, "iterator.index () == 0"); + _tmp90_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp90_) { + GeeBidirListIterator* _tmp91_; + _tmp91_ = iterator; + gee_bidir_list_iterator_insert (_tmp91_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + _tmp92_ = ro_list; + _tmp93_ = gee_collection_get_size ((GeeCollection*) _tmp92_); + _tmp94_ = _tmp93_; + _vala_assert (_tmp94_ == 2, "ro_list.size == 2"); + _tmp95_ = ro_list; + _tmp96_ = gee_list_get ((GeeList*) _tmp95_, 0); + _tmp97_ = (gchar*) _tmp96_; + _vala_assert (g_strcmp0 (_tmp97_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp97_); + _tmp98_ = ro_list; + _tmp99_ = gee_list_get ((GeeList*) _tmp98_, 1); + _tmp100_ = (gchar*) _tmp99_; + _vala_assert (g_strcmp0 (_tmp100_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp100_); + _tmp101_ = iterator; + _tmp102_ = gee_list_iterator_index ((GeeListIterator*) _tmp101_); + _vala_assert (_tmp102_ == 0, "iterator.index () == 0"); + _tmp103_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp103_) { + GeeBidirListIterator* _tmp104_; + _tmp104_ = iterator; + gee_list_iterator_add ((GeeListIterator*) _tmp104_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + _tmp105_ = ro_list; + _tmp106_ = gee_collection_get_size ((GeeCollection*) _tmp105_); + _tmp107_ = _tmp106_; + _vala_assert (_tmp107_ == 2, "ro_list.size == 2"); + _tmp108_ = ro_list; + _tmp109_ = gee_list_get ((GeeList*) _tmp108_, 0); + _tmp110_ = (gchar*) _tmp109_; + _vala_assert (g_strcmp0 (_tmp110_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp110_); + _tmp111_ = ro_list; + _tmp112_ = gee_list_get ((GeeList*) _tmp111_, 1); + _tmp113_ = (gchar*) _tmp112_; + _vala_assert (g_strcmp0 (_tmp113_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp113_); + _tmp114_ = iterator; + _tmp115_ = gee_list_iterator_index ((GeeListIterator*) _tmp114_); + _vala_assert (_tmp115_ == 0, "iterator.index () == 0"); + _g_object_unref0 (iterator); + _g_object_unref0 (ro_list); + _g_object_unref0 (test_list); +} + + +static void read_only_bidir_list_tests_class_init (ReadOnlyBidirListTestsClass * klass) { + read_only_bidir_list_tests_parent_class = g_type_class_peek_parent (klass); + READ_ONLY_COLLECTION_TESTS_CLASS (klass)->get_ro_view = read_only_bidir_list_tests_real_get_ro_view; +} + + +static void read_only_bidir_list_tests_instance_init (ReadOnlyBidirListTests * self) { +} + + +GType read_only_bidir_list_tests_get_type (void) { + static volatile gsize read_only_bidir_list_tests_type_id__volatile = 0; + if (g_once_init_enter (&read_only_bidir_list_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (ReadOnlyBidirListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) read_only_bidir_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ReadOnlyBidirListTests), 0, (GInstanceInitFunc) read_only_bidir_list_tests_instance_init, NULL }; + GType read_only_bidir_list_tests_type_id; + read_only_bidir_list_tests_type_id = g_type_register_static (TYPE_READ_ONLY_LIST_TESTS, "ReadOnlyBidirListTests", &g_define_type_info, 0); + g_once_init_leave (&read_only_bidir_list_tests_type_id__volatile, read_only_bidir_list_tests_type_id); + } + return read_only_bidir_list_tests_type_id__volatile; +} + + + diff --git a/tests/testreadonlybidirlist.vala b/tests/testreadonlybidirlist.vala new file mode 100644 index 0000000..409e744 --- /dev/null +++ b/tests/testreadonlybidirlist.vala @@ -0,0 +1,119 @@ +/* testreadonlybidirlist.vala + * + * Copyright (C) 2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +using Gee; + +public class ReadOnlyBidirListTests : ReadOnlyListTests { + + public ReadOnlyBidirListTests () { + base.with_name ("ReadOnlyBidirList"); + add_test ("[ReadOnlyBidirList] immutable iterator", test_immutable_iterator); + } + + protected override Collection get_ro_view (Collection collection) { + return ((Gee.BidirList) collection).read_only_view; + } + + public new void test_immutable_iterator () { + var test_list = test_collection as Gee.BidirList; + var ro_list = ro_collection as Gee.BidirList; + + assert (test_list.add ("one")); + assert (test_list.add ("two")); + + assert (ro_list.size == 2); + assert (ro_list.get (0) == "one"); + assert (ro_list.get (1) == "two"); + + Gee.BidirListIterator iterator = ro_list.bidir_list_iterator (); + + assert (iterator.has_next ()); + assert (iterator.next ()); + assert (iterator.get () == "one"); + assert (iterator.index () == 0); + + assert (iterator.has_next ()); + assert (iterator.next ()); + assert (iterator.get () == "two"); + assert (iterator.index () == 1); + + assert (! iterator.has_next ()); + assert (! iterator.next ()); + + assert (iterator.has_previous ()); + assert (iterator.previous ()); + assert (iterator.get () == "one"); + assert (iterator.index () == 0); + + assert (iterator.last ()); + assert (iterator.get () == "two"); + assert (iterator.index () == 1); + + assert (iterator.first ()); + assert (iterator.get () == "one"); + assert (iterator.index () == 0); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + assert (ro_list.size == 2); + assert (ro_list.get (0) == "one"); + assert (ro_list.get (1) == "two"); + assert (iterator.index () == 0); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.set ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + assert (ro_list.size == 2); + assert (ro_list.get (0) == "one"); + assert (ro_list.get (1) == "two"); + assert (iterator.index () == 0); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.insert ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + assert (ro_list.size == 2); + assert (ro_list.get (0) == "one"); + assert (ro_list.get (1) == "two"); + assert (iterator.index () == 0); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + iterator.add ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + assert (ro_list.size == 2); + assert (ro_list.get (0) == "one"); + assert (ro_list.get (1) == "two"); + assert (iterator.index () == 0); + } +} diff --git a/tests/testreadonlycollection.c b/tests/testreadonlycollection.c index 96122b6..db2b240 100644 --- a/tests/testreadonlycollection.c +++ b/tests/testreadonlycollection.c @@ -93,7 +93,7 @@ ReadOnlyCollectionTests* read_only_collection_tests_construct (GType object_type ReadOnlyCollectionTests* read_only_collection_tests_new_with_name (const gchar* name); ReadOnlyCollectionTests* read_only_collection_tests_construct_with_name (GType object_type, const gchar* name); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void read_only_collection_tests_test_unique_read_only_view_instance (ReadOnlyCollectionTests* self); static void _read_only_collection_tests_test_unique_read_only_view_instance_gee_test_case_test_method (gpointer self); void read_only_collection_tests_test_immutable_iterator (ReadOnlyCollectionTests* self); @@ -147,10 +147,10 @@ ReadOnlyCollectionTests* read_only_collection_tests_construct_with_name (GType o g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (ReadOnlyCollectionTests*) gee_test_case_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] unique read-only view instance", _read_only_collection_tests_test_unique_read_only_view_instance_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] immutable iterator", _read_only_collection_tests_test_immutable_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] immutable", _read_only_collection_tests_test_immutable_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] accurate view", _read_only_collection_tests_test_accurate_view_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] unique read-only view instance", _read_only_collection_tests_test_unique_read_only_view_instance_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] immutable iterator", _read_only_collection_tests_test_immutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] immutable", _read_only_collection_tests_test_immutable_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyCollection] accurate view", _read_only_collection_tests_test_accurate_view_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -166,7 +166,7 @@ static void read_only_collection_tests_real_set_up (GeeTestCase* base) { GeeCollection* _tmp1_; GeeCollection* _tmp2_ = NULL; self = (ReadOnlyCollectionTests*) base; - _tmp0_ = gee_hash_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_hash_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL); _g_object_unref0 (self->test_collection); self->test_collection = (GeeCollection*) _tmp0_; _tmp1_ = self->test_collection; @@ -275,22 +275,29 @@ void read_only_collection_tests_test_immutable_iterator (ReadOnlyCollectionTests GeeIterator* iterator; gboolean one_found; gboolean two_found; - gboolean _tmp22_; - gboolean _tmp23_; - GeeIterator* _tmp24_; - gboolean _tmp25_ = FALSE; - GeeIterator* _tmp26_; - gboolean _tmp27_ = FALSE; - GeeIterator* _tmp28_; - gboolean _tmp29_ = FALSE; + gboolean _tmp25_; + gboolean _tmp26_; + GeeIterator* _tmp27_; + gboolean _tmp28_ = FALSE; + GeeIterator* _tmp29_; gboolean _tmp30_ = FALSE; - GeeCollection* _tmp32_; - gint _tmp33_; - gint _tmp34_; - GeeCollection* _tmp35_; + GeeCollection* _tmp31_; + GeeIterator* _tmp32_ = NULL; + GeeIterator* _tmp33_; + gboolean _tmp34_ = FALSE; + GeeIterator* _tmp35_; gboolean _tmp36_ = FALSE; - GeeCollection* _tmp37_; - gboolean _tmp38_ = FALSE; + GeeIterator* _tmp37_; + gboolean _tmp38_; + gboolean _tmp39_; + gboolean _tmp40_ = FALSE; + GeeCollection* _tmp42_; + gint _tmp43_; + gint _tmp44_; + GeeCollection* _tmp45_; + gboolean _tmp46_ = FALSE; + GeeCollection* _tmp47_; + gboolean _tmp48_ = FALSE; g_return_if_fail (self != NULL); _tmp0_ = self->test_collection; _tmp1_ = gee_collection_add (_tmp0_, "one"); @@ -317,39 +324,46 @@ void read_only_collection_tests_test_immutable_iterator (ReadOnlyCollectionTests GeeIterator* _tmp13_; gboolean _tmp14_ = FALSE; GeeIterator* _tmp15_; - gpointer _tmp16_ = NULL; - gchar* _tmp17_; - GQuark _tmp19_ = 0U; - static GQuark _tmp18_label0 = 0; - static GQuark _tmp18_label1 = 0; + gboolean _tmp16_; + gboolean _tmp17_; + GeeIterator* _tmp18_; + gpointer _tmp19_ = NULL; + gchar* _tmp20_; + GQuark _tmp22_ = 0U; + static GQuark _tmp21_label0 = 0; + static GQuark _tmp21_label1 = 0; _tmp13_ = iterator; _tmp14_ = gee_iterator_next (_tmp13_); if (!_tmp14_) { break; } _tmp15_ = iterator; - _tmp16_ = gee_iterator_get (_tmp15_); - _tmp17_ = (gchar*) _tmp16_; - _tmp19_ = (NULL == _tmp17_) ? 0 : g_quark_from_string (_tmp17_); - g_free (_tmp17_); - if (_tmp19_ == ((0 != _tmp18_label0) ? _tmp18_label0 : (_tmp18_label0 = g_quark_from_static_string ("one")))) { + _tmp16_ = gee_iterator_get_valid (_tmp15_); + _tmp17_ = _tmp16_; + _vala_assert (_tmp17_, "iterator.valid"); + _tmp18_ = iterator; + _tmp19_ = gee_iterator_get (_tmp18_); + _tmp20_ = (gchar*) _tmp19_; + _tmp22_ = (NULL == _tmp20_) ? 0 : g_quark_from_string (_tmp20_); + g_free (_tmp20_); + if (_tmp22_ == ((0 != _tmp21_label0) ? _tmp21_label0 : (_tmp21_label0 = g_quark_from_static_string ("one")))) { switch (0) { default: { - gboolean _tmp20_; - _tmp20_ = one_found; - _vala_assert (!_tmp20_, "! one_found"); + gboolean _tmp23_; + _tmp23_ = one_found; + _vala_assert (!_tmp23_, "! one_found"); one_found = TRUE; break; } } - } else if (_tmp19_ == ((0 != _tmp18_label1) ? _tmp18_label1 : (_tmp18_label1 = g_quark_from_static_string ("two")))) { + } else if (_tmp22_ == ((0 != _tmp21_label1) ? _tmp21_label1 : (_tmp21_label1 = g_quark_from_static_string ("two")))) { switch (0) { default: { - gboolean _tmp21_; - _tmp21_ = two_found; - _vala_assert (!_tmp21_, "! two_found"); + gboolean _tmp24_; + _tmp24_ = two_found; + _vala_assert (!_tmp24_, "! two_found"); two_found = TRUE; break; } @@ -363,37 +377,48 @@ void read_only_collection_tests_test_immutable_iterator (ReadOnlyCollectionTests } } } - _tmp22_ = one_found; - _vala_assert (_tmp22_, "one_found"); - _tmp23_ = two_found; - _vala_assert (_tmp23_, "two_found"); - _tmp24_ = iterator; - _tmp25_ = gee_iterator_has_next (_tmp24_); - _vala_assert (!_tmp25_, "! iterator.has_next ()"); - _tmp26_ = iterator; - _tmp27_ = gee_iterator_next (_tmp26_); - _vala_assert (!_tmp27_, "! iterator.next ()"); - _tmp28_ = iterator; - _tmp29_ = gee_iterator_first (_tmp28_); - _vala_assert (_tmp29_, "iterator.first ()"); - _tmp30_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp30_) { - GeeIterator* _tmp31_; - _tmp31_ = iterator; - gee_iterator_remove (_tmp31_); + _tmp25_ = one_found; + _vala_assert (_tmp25_, "one_found"); + _tmp26_ = two_found; + _vala_assert (_tmp26_, "two_found"); + _tmp27_ = iterator; + _tmp28_ = gee_iterator_has_next (_tmp27_); + _vala_assert (!_tmp28_, "! iterator.has_next ()"); + _tmp29_ = iterator; + _tmp30_ = gee_iterator_next (_tmp29_); + _vala_assert (!_tmp30_, "! iterator.next ()"); + _tmp31_ = self->ro_collection; + _tmp32_ = gee_iterable_iterator ((GeeIterable*) _tmp31_); + _g_object_unref0 (iterator); + iterator = _tmp32_; + _tmp33_ = iterator; + _tmp34_ = gee_iterator_has_next (_tmp33_); + _vala_assert (_tmp34_, "iterator.has_next ()"); + _tmp35_ = iterator; + _tmp36_ = gee_iterator_next (_tmp35_); + _vala_assert (_tmp36_, "iterator.next ()"); + _tmp37_ = iterator; + _tmp38_ = gee_iterator_get_read_only (_tmp37_); + _tmp39_ = _tmp38_; + _vala_assert (_tmp39_, "iterator.read_only"); + _tmp40_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp40_) { + GeeIterator* _tmp41_; + _tmp41_ = iterator; + gee_iterator_remove (_tmp41_); exit (0); } g_test_trap_assert_failed (); - _tmp32_ = self->ro_collection; - _tmp33_ = gee_collection_get_size (_tmp32_); - _tmp34_ = _tmp33_; - _vala_assert (_tmp34_ == 2, "ro_collection.size == 2"); - _tmp35_ = self->ro_collection; - _tmp36_ = gee_collection_contains (_tmp35_, "one"); - _vala_assert (_tmp36_, "ro_collection.contains (\"one\")"); - _tmp37_ = self->ro_collection; - _tmp38_ = gee_collection_contains (_tmp37_, "two"); - _vala_assert (_tmp38_, "ro_collection.contains (\"two\")"); + _tmp42_ = self->ro_collection; + _tmp43_ = gee_collection_get_size (_tmp42_); + _tmp44_ = _tmp43_; + _vala_assert (_tmp44_ == 2, "ro_collection.size == 2"); + _tmp45_ = self->ro_collection; + _tmp46_ = gee_collection_contains (_tmp45_, "one"); + _vala_assert (_tmp46_, "ro_collection.contains (\"one\")"); + _tmp47_ = self->ro_collection; + _tmp48_ = gee_collection_contains (_tmp47_, "two"); + _vala_assert (_tmp48_, "ro_collection.contains (\"two\")"); _g_object_unref0 (iterator); } @@ -461,7 +486,7 @@ void read_only_collection_tests_test_immutable (ReadOnlyCollectionTests* self) { _tmp5_ = self->ro_collection; _tmp6_ = gee_collection_contains (_tmp5_, "one"); _vala_assert (_tmp6_, "ro_collection.contains (\"one\")"); - _tmp7_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp7_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = (GeeCollection*) _tmp7_; _tmp8_ = dummy; _tmp9_ = gee_collection_add (_tmp8_, "one"); @@ -648,14 +673,14 @@ void read_only_collection_tests_test_accurate_view (ReadOnlyCollectionTests* sel GeeCollection* _tmp61_; gboolean _tmp62_ = FALSE; g_return_if_fail (self != NULL); - _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = (GeeCollection*) _tmp0_; _tmp1_ = gee_collection_add (dummy, "one"); _vala_assert (_tmp1_, "dummy.add (\"one\")"); _tmp2_ = gee_collection_add (dummy, "two"); _vala_assert (_tmp2_, "dummy.add (\"two\")"); _tmp3_ = self->ro_collection; - _tmp4_ = gee_iterable_get_element_type ((GeeIterable*) _tmp3_); + _tmp4_ = gee_traversable_get_element_type ((GeeTraversable*) _tmp3_); _tmp5_ = _tmp4_; _vala_assert (_tmp5_ == G_TYPE_STRING, "ro_collection.element_type == typeof (string)"); _tmp6_ = self->ro_collection; diff --git a/tests/testreadonlycollection.vala b/tests/testreadonlycollection.vala index 42134f5..c2b7fc0 100644 --- a/tests/testreadonlycollection.vala +++ b/tests/testreadonlycollection.vala @@ -87,6 +87,7 @@ public class ReadOnlyCollectionTests : Gee.TestCase { bool two_found = false; while (iterator.next ()) { + assert (iterator.valid); switch(iterator.get ()) { case "one": assert (! one_found); @@ -107,8 +108,11 @@ public class ReadOnlyCollectionTests : Gee.TestCase { assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (iterator.first ()); + iterator = ro_collection.iterator (); + assert (iterator.has_next ()); + assert (iterator.next ()); + assert (iterator.read_only); if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | TestTrapFlags.SILENCE_STDERR)) { iterator.remove (); diff --git a/tests/testreadonlylist.c b/tests/testreadonlylist.c index 9a53a3c..b21055b 100644 --- a/tests/testreadonlylist.c +++ b/tests/testreadonlylist.c @@ -113,9 +113,11 @@ enum { }; ReadOnlyListTests* read_only_list_tests_new (void); ReadOnlyListTests* read_only_list_tests_construct (GType object_type); +ReadOnlyListTests* read_only_list_tests_new_with_name (const gchar* name); +ReadOnlyListTests* read_only_list_tests_construct_with_name (GType object_type, const gchar* name); ReadOnlyCollectionTests* read_only_collection_tests_new_with_name (const gchar* name); ReadOnlyCollectionTests* read_only_collection_tests_construct_with_name (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void read_only_list_tests_test_immutable_iterator (ReadOnlyListTests* self); static void _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self); void read_only_list_tests_test_immutable (ReadOnlyListTests* self); @@ -128,6 +130,18 @@ static void read_only_list_tests_real_tear_down (GeeTestCase* base); static GeeCollection* read_only_list_tests_real_get_ro_view (ReadOnlyCollectionTests* base, GeeCollection* collection); +ReadOnlyListTests* read_only_list_tests_construct (GType object_type) { + ReadOnlyListTests * self = NULL; + self = (ReadOnlyListTests*) read_only_list_tests_construct_with_name (object_type, "ReadOnlyList"); + return self; +} + + +ReadOnlyListTests* read_only_list_tests_new (void) { + return read_only_list_tests_construct (TYPE_READ_ONLY_LIST_TESTS); +} + + static void _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method (gpointer self) { read_only_list_tests_test_immutable_iterator (self); } @@ -143,18 +157,21 @@ static void _read_only_list_tests_test_accurate_view_gee_test_case_test_method ( } -ReadOnlyListTests* read_only_list_tests_construct (GType object_type) { +ReadOnlyListTests* read_only_list_tests_construct_with_name (GType object_type, const gchar* name) { ReadOnlyListTests * self = NULL; - self = (ReadOnlyListTests*) read_only_collection_tests_construct_with_name (object_type, "ReadOnlyList"); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable iterator", _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable", _read_only_list_tests_test_immutable_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] accurate view", _read_only_list_tests_test_accurate_view_gee_test_case_test_method, self); + const gchar* _tmp0_; + g_return_val_if_fail (name != NULL, NULL); + _tmp0_ = name; + self = (ReadOnlyListTests*) read_only_collection_tests_construct_with_name (object_type, _tmp0_); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable iterator", _read_only_list_tests_test_immutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] immutable", _read_only_list_tests_test_immutable_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyList] accurate view", _read_only_list_tests_test_accurate_view_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } -ReadOnlyListTests* read_only_list_tests_new (void) { - return read_only_list_tests_construct (TYPE_READ_ONLY_LIST_TESTS); +ReadOnlyListTests* read_only_list_tests_new_with_name (const gchar* name) { + return read_only_list_tests_construct_with_name (TYPE_READ_ONLY_LIST_TESTS, name); } @@ -164,7 +181,7 @@ static void read_only_list_tests_real_set_up (GeeTestCase* base) { GeeCollection* _tmp1_; GeeCollection* _tmp2_ = NULL; self = (ReadOnlyListTests*) base; - _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((ReadOnlyCollectionTests*) self)->test_collection); ((ReadOnlyCollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; _tmp1_ = ((ReadOnlyCollectionTests*) self)->test_collection; @@ -250,77 +267,57 @@ void read_only_list_tests_test_immutable_iterator (ReadOnlyListTests* self) { gboolean _tmp38_ = FALSE; GeeListIterator* _tmp39_; gboolean _tmp40_ = FALSE; - GeeListIterator* _tmp41_; - gboolean _tmp42_ = FALSE; + GeeList* _tmp41_; + GeeListIterator* _tmp42_ = NULL; GeeListIterator* _tmp43_; gboolean _tmp44_ = FALSE; - GeeListIterator* _tmp45_; - gpointer _tmp46_ = NULL; - gchar* _tmp47_; - GeeListIterator* _tmp48_; - gint _tmp49_ = 0; - GeeListIterator* _tmp50_; - gboolean _tmp51_ = FALSE; - GeeListIterator* _tmp52_; - gpointer _tmp53_ = NULL; - gchar* _tmp54_; - GeeListIterator* _tmp55_; - gint _tmp56_ = 0; - GeeListIterator* _tmp57_; + gboolean _tmp45_ = FALSE; + GeeList* _tmp47_; + gint _tmp48_; + gint _tmp49_; + GeeList* _tmp50_; + gpointer _tmp51_ = NULL; + gchar* _tmp52_; + GeeList* _tmp53_; + gpointer _tmp54_ = NULL; + gchar* _tmp55_; + GeeListIterator* _tmp56_; + gint _tmp57_ = 0; gboolean _tmp58_ = FALSE; - GeeListIterator* _tmp59_; - gpointer _tmp60_ = NULL; - gchar* _tmp61_; - GeeListIterator* _tmp62_; - gint _tmp63_ = 0; - gboolean _tmp64_ = FALSE; + GeeList* _tmp60_; + gint _tmp61_; + gint _tmp62_; + GeeList* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; GeeList* _tmp66_; - gint _tmp67_; - gint _tmp68_; - GeeList* _tmp69_; - gpointer _tmp70_ = NULL; - gchar* _tmp71_; - GeeList* _tmp72_; - gpointer _tmp73_ = NULL; - gchar* _tmp74_; - GeeListIterator* _tmp75_; - gint _tmp76_ = 0; - gboolean _tmp77_ = FALSE; - GeeList* _tmp79_; - gint _tmp80_; - gint _tmp81_; - GeeList* _tmp82_; - gpointer _tmp83_ = NULL; - gchar* _tmp84_; - GeeList* _tmp85_; - gpointer _tmp86_ = NULL; - gchar* _tmp87_; - GeeListIterator* _tmp88_; - gint _tmp89_ = 0; - gboolean _tmp90_ = FALSE; - GeeList* _tmp92_; - gint _tmp93_; - gint _tmp94_; - GeeList* _tmp95_; - gpointer _tmp96_ = NULL; - gchar* _tmp97_; - GeeList* _tmp98_; - gpointer _tmp99_ = NULL; - gchar* _tmp100_; - GeeListIterator* _tmp101_; - gint _tmp102_ = 0; - gboolean _tmp103_ = FALSE; - GeeList* _tmp105_; - gint _tmp106_; - gint _tmp107_; - GeeList* _tmp108_; - gpointer _tmp109_ = NULL; - gchar* _tmp110_; - GeeList* _tmp111_; - gpointer _tmp112_ = NULL; - gchar* _tmp113_; - GeeListIterator* _tmp114_; - gint _tmp115_ = 0; + gpointer _tmp67_ = NULL; + gchar* _tmp68_; + GeeListIterator* _tmp69_; + gint _tmp70_ = 0; + GeeList* _tmp71_; + gint _tmp72_; + gint _tmp73_; + GeeList* _tmp74_; + gpointer _tmp75_ = NULL; + gchar* _tmp76_; + GeeList* _tmp77_; + gpointer _tmp78_ = NULL; + gchar* _tmp79_; + GeeListIterator* _tmp80_; + gint _tmp81_ = 0; + gboolean _tmp82_ = FALSE; + GeeList* _tmp84_; + gint _tmp85_; + gint _tmp86_; + GeeList* _tmp87_; + gpointer _tmp88_ = NULL; + gchar* _tmp89_; + GeeList* _tmp90_; + gpointer _tmp91_ = NULL; + gchar* _tmp92_; + GeeListIterator* _tmp93_; + gint _tmp94_ = 0; g_return_if_fail (self != NULL); _tmp0_ = ((ReadOnlyCollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_LIST) ? ((GeeList*) _tmp0_) : NULL); @@ -385,142 +382,105 @@ void read_only_list_tests_test_immutable_iterator (ReadOnlyListTests* self) { _tmp39_ = iterator; _tmp40_ = gee_iterator_next ((GeeIterator*) _tmp39_); _vala_assert (!_tmp40_, "! iterator.next ()"); - _tmp41_ = iterator; - _tmp42_ = gee_bidir_iterator_has_previous ((GeeBidirIterator*) _tmp41_); - _vala_assert (_tmp42_, "iterator.has_previous ()"); + _tmp41_ = ro_list; + _tmp42_ = gee_list_list_iterator (_tmp41_); + _g_object_unref0 (iterator); + iterator = _tmp42_; _tmp43_ = iterator; - _tmp44_ = gee_bidir_iterator_previous ((GeeBidirIterator*) _tmp43_); - _vala_assert (_tmp44_, "iterator.previous ()"); - _tmp45_ = iterator; - _tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_); - _tmp47_ = (gchar*) _tmp46_; - _vala_assert (g_strcmp0 (_tmp47_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp47_); - _tmp48_ = iterator; - _tmp49_ = gee_list_iterator_index (_tmp48_); - _vala_assert (_tmp49_ == 0, "iterator.index () == 0"); - _tmp50_ = iterator; - _tmp51_ = gee_bidir_iterator_last ((GeeBidirIterator*) _tmp50_); - _vala_assert (_tmp51_, "iterator.last ()"); - _tmp52_ = iterator; - _tmp53_ = gee_iterator_get ((GeeIterator*) _tmp52_); - _tmp54_ = (gchar*) _tmp53_; - _vala_assert (g_strcmp0 (_tmp54_, "two") == 0, "iterator.get () == \"two\""); - _g_free0 (_tmp54_); - _tmp55_ = iterator; - _tmp56_ = gee_list_iterator_index (_tmp55_); - _vala_assert (_tmp56_ == 1, "iterator.index () == 1"); - _tmp57_ = iterator; - _tmp58_ = gee_iterator_first ((GeeIterator*) _tmp57_); - _vala_assert (_tmp58_, "iterator.first ()"); - _tmp59_ = iterator; - _tmp60_ = gee_iterator_get ((GeeIterator*) _tmp59_); - _tmp61_ = (gchar*) _tmp60_; - _vala_assert (g_strcmp0 (_tmp61_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp61_); - _tmp62_ = iterator; - _tmp63_ = gee_list_iterator_index (_tmp62_); - _vala_assert (_tmp63_ == 0, "iterator.index () == 0"); - _tmp64_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp64_) { - GeeListIterator* _tmp65_; - _tmp65_ = iterator; - gee_iterator_remove ((GeeIterator*) _tmp65_); - exit (0); - } - g_test_trap_assert_failed (); - _tmp66_ = ro_list; - _tmp67_ = gee_collection_get_size ((GeeCollection*) _tmp66_); - _tmp68_ = _tmp67_; - _vala_assert (_tmp68_ == 2, "ro_list.size == 2"); - _tmp69_ = ro_list; - _tmp70_ = gee_list_get (_tmp69_, 0); - _tmp71_ = (gchar*) _tmp70_; - _vala_assert (g_strcmp0 (_tmp71_, "one") == 0, "ro_list.get (0) == \"one\""); - _g_free0 (_tmp71_); - _tmp72_ = ro_list; - _tmp73_ = gee_list_get (_tmp72_, 1); - _tmp74_ = (gchar*) _tmp73_; - _vala_assert (g_strcmp0 (_tmp74_, "two") == 0, "ro_list.get (1) == \"two\""); - _g_free0 (_tmp74_); - _tmp75_ = iterator; - _tmp76_ = gee_list_iterator_index (_tmp75_); - _vala_assert (_tmp76_ == 0, "iterator.index () == 0"); - _tmp77_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp77_) { - GeeListIterator* _tmp78_; - _tmp78_ = iterator; - gee_list_iterator_set (_tmp78_, "three"); + _tmp44_ = gee_iterator_next ((GeeIterator*) _tmp43_); + _vala_assert (_tmp44_, "iterator.next ()"); + _tmp45_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp45_) { + GeeListIterator* _tmp46_; + _tmp46_ = iterator; + gee_iterator_remove ((GeeIterator*) _tmp46_); exit (0); } g_test_trap_assert_failed (); - _tmp79_ = ro_list; - _tmp80_ = gee_collection_get_size ((GeeCollection*) _tmp79_); - _tmp81_ = _tmp80_; - _vala_assert (_tmp81_ == 2, "ro_list.size == 2"); - _tmp82_ = ro_list; - _tmp83_ = gee_list_get (_tmp82_, 0); - _tmp84_ = (gchar*) _tmp83_; - _vala_assert (g_strcmp0 (_tmp84_, "one") == 0, "ro_list.get (0) == \"one\""); - _g_free0 (_tmp84_); - _tmp85_ = ro_list; - _tmp86_ = gee_list_get (_tmp85_, 1); - _tmp87_ = (gchar*) _tmp86_; - _vala_assert (g_strcmp0 (_tmp87_, "two") == 0, "ro_list.get (1) == \"two\""); - _g_free0 (_tmp87_); - _tmp88_ = iterator; - _tmp89_ = gee_list_iterator_index (_tmp88_); - _vala_assert (_tmp89_ == 0, "iterator.index () == 0"); - _tmp90_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp90_) { - GeeListIterator* _tmp91_; - _tmp91_ = iterator; - gee_list_iterator_insert (_tmp91_, "three"); + _tmp47_ = ro_list; + _tmp48_ = gee_collection_get_size ((GeeCollection*) _tmp47_); + _tmp49_ = _tmp48_; + _vala_assert (_tmp49_ == 2, "ro_list.size == 2"); + _tmp50_ = ro_list; + _tmp51_ = gee_list_get (_tmp50_, 0); + _tmp52_ = (gchar*) _tmp51_; + _vala_assert (g_strcmp0 (_tmp52_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp52_); + _tmp53_ = ro_list; + _tmp54_ = gee_list_get (_tmp53_, 1); + _tmp55_ = (gchar*) _tmp54_; + _vala_assert (g_strcmp0 (_tmp55_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp55_); + _tmp56_ = iterator; + _tmp57_ = gee_list_iterator_index (_tmp56_); + _vala_assert (_tmp57_ == 0, "iterator.index () == 0"); + _tmp58_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp58_) { + GeeListIterator* _tmp59_; + _tmp59_ = iterator; + gee_list_iterator_set (_tmp59_, "three"); exit (0); } g_test_trap_assert_failed (); - _tmp92_ = ro_list; - _tmp93_ = gee_collection_get_size ((GeeCollection*) _tmp92_); - _tmp94_ = _tmp93_; - _vala_assert (_tmp94_ == 2, "ro_list.size == 2"); - _tmp95_ = ro_list; - _tmp96_ = gee_list_get (_tmp95_, 0); - _tmp97_ = (gchar*) _tmp96_; - _vala_assert (g_strcmp0 (_tmp97_, "one") == 0, "ro_list.get (0) == \"one\""); - _g_free0 (_tmp97_); - _tmp98_ = ro_list; - _tmp99_ = gee_list_get (_tmp98_, 1); - _tmp100_ = (gchar*) _tmp99_; - _vala_assert (g_strcmp0 (_tmp100_, "two") == 0, "ro_list.get (1) == \"two\""); - _g_free0 (_tmp100_); - _tmp101_ = iterator; - _tmp102_ = gee_list_iterator_index (_tmp101_); - _vala_assert (_tmp102_ == 0, "iterator.index () == 0"); - _tmp103_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp103_) { - GeeListIterator* _tmp104_; - _tmp104_ = iterator; - gee_list_iterator_add (_tmp104_, "three"); + _tmp60_ = ro_list; + _tmp61_ = gee_collection_get_size ((GeeCollection*) _tmp60_); + _tmp62_ = _tmp61_; + _vala_assert (_tmp62_ == 2, "ro_list.size == 2"); + _tmp63_ = ro_list; + _tmp64_ = gee_list_get (_tmp63_, 0); + _tmp65_ = (gchar*) _tmp64_; + _vala_assert (g_strcmp0 (_tmp65_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp65_); + _tmp66_ = ro_list; + _tmp67_ = gee_list_get (_tmp66_, 1); + _tmp68_ = (gchar*) _tmp67_; + _vala_assert (g_strcmp0 (_tmp68_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp68_); + _tmp69_ = iterator; + _tmp70_ = gee_list_iterator_index (_tmp69_); + _vala_assert (_tmp70_ == 0, "iterator.index () == 0"); + _tmp71_ = ro_list; + _tmp72_ = gee_collection_get_size ((GeeCollection*) _tmp71_); + _tmp73_ = _tmp72_; + _vala_assert (_tmp73_ == 2, "ro_list.size == 2"); + _tmp74_ = ro_list; + _tmp75_ = gee_list_get (_tmp74_, 0); + _tmp76_ = (gchar*) _tmp75_; + _vala_assert (g_strcmp0 (_tmp76_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp76_); + _tmp77_ = ro_list; + _tmp78_ = gee_list_get (_tmp77_, 1); + _tmp79_ = (gchar*) _tmp78_; + _vala_assert (g_strcmp0 (_tmp79_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp79_); + _tmp80_ = iterator; + _tmp81_ = gee_list_iterator_index (_tmp80_); + _vala_assert (_tmp81_ == 0, "iterator.index () == 0"); + _tmp82_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp82_) { + GeeListIterator* _tmp83_; + _tmp83_ = iterator; + gee_list_iterator_add (_tmp83_, "three"); exit (0); } g_test_trap_assert_failed (); - _tmp105_ = ro_list; - _tmp106_ = gee_collection_get_size ((GeeCollection*) _tmp105_); - _tmp107_ = _tmp106_; - _vala_assert (_tmp107_ == 2, "ro_list.size == 2"); - _tmp108_ = ro_list; - _tmp109_ = gee_list_get (_tmp108_, 0); - _tmp110_ = (gchar*) _tmp109_; - _vala_assert (g_strcmp0 (_tmp110_, "one") == 0, "ro_list.get (0) == \"one\""); - _g_free0 (_tmp110_); - _tmp111_ = ro_list; - _tmp112_ = gee_list_get (_tmp111_, 1); - _tmp113_ = (gchar*) _tmp112_; - _vala_assert (g_strcmp0 (_tmp113_, "two") == 0, "ro_list.get (1) == \"two\""); - _g_free0 (_tmp113_); - _tmp114_ = iterator; - _tmp115_ = gee_list_iterator_index (_tmp114_); - _vala_assert (_tmp115_ == 0, "iterator.index () == 0"); + _tmp84_ = ro_list; + _tmp85_ = gee_collection_get_size ((GeeCollection*) _tmp84_); + _tmp86_ = _tmp85_; + _vala_assert (_tmp86_ == 2, "ro_list.size == 2"); + _tmp87_ = ro_list; + _tmp88_ = gee_list_get (_tmp87_, 0); + _tmp89_ = (gchar*) _tmp88_; + _vala_assert (g_strcmp0 (_tmp89_, "one") == 0, "ro_list.get (0) == \"one\""); + _g_free0 (_tmp89_); + _tmp90_ = ro_list; + _tmp91_ = gee_list_get (_tmp90_, 1); + _tmp92_ = (gchar*) _tmp91_; + _vala_assert (g_strcmp0 (_tmp92_, "two") == 0, "ro_list.get (1) == \"two\""); + _g_free0 (_tmp92_); + _tmp93_ = iterator; + _tmp94_ = gee_list_iterator_index (_tmp93_); + _vala_assert (_tmp94_ == 0, "iterator.index () == 0"); _g_object_unref0 (iterator); _g_object_unref0 (ro_list); _g_object_unref0 (test_list); @@ -594,7 +554,7 @@ void read_only_list_tests_test_immutable (ReadOnlyListTests* self) { _tmp9_ = ro_list; _tmp10_ = gee_collection_contains ((GeeCollection*) _tmp9_, "one"); _vala_assert (_tmp10_, "ro_list.contains (\"one\")"); - _tmp11_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp11_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = (GeeCollection*) _tmp11_; _tmp12_ = dummy; _tmp13_ = gee_collection_add (_tmp12_, "one"); @@ -672,7 +632,7 @@ void read_only_list_tests_test_immutable (ReadOnlyListTests* self) { if (_tmp47_) { GeeList* _tmp48_; _tmp48_ = ro_list; - gee_list_sort (_tmp48_, NULL); + gee_list_sort (_tmp48_, NULL, NULL, NULL); exit (0); } g_test_trap_assert_failed (); @@ -763,13 +723,13 @@ void read_only_list_tests_test_accurate_view (ReadOnlyListTests* self) { _tmp2_ = ((ReadOnlyCollectionTests*) self)->ro_collection; _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_LIST) ? ((GeeList*) _tmp2_) : NULL); ro_list = _tmp3_; - _tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); dummy = (GeeCollection*) _tmp4_; _tmp5_ = gee_collection_add (dummy, "one"); _vala_assert (_tmp5_, "dummy.add (\"one\")"); _tmp6_ = gee_collection_add (dummy, "two"); _vala_assert (_tmp6_, "dummy.add (\"two\")"); - _tmp7_ = gee_iterable_get_element_type ((GeeIterable*) ro_list); + _tmp7_ = gee_traversable_get_element_type ((GeeTraversable*) ro_list); _tmp8_ = _tmp7_; _vala_assert (_tmp8_ == G_TYPE_STRING, "ro_list.element_type == typeof (string)"); _tmp9_ = gee_collection_get_size ((GeeCollection*) ro_list); diff --git a/tests/testreadonlylist.vala b/tests/testreadonlylist.vala index d1b2220..9db5e40 100644 --- a/tests/testreadonlylist.vala +++ b/tests/testreadonlylist.vala @@ -28,7 +28,11 @@ using Gee; public class ReadOnlyListTests : ReadOnlyCollectionTests { public ReadOnlyListTests () { - base.with_name ("ReadOnlyList"); + this.with_name ("ReadOnlyList"); + } + + public ReadOnlyListTests.with_name (string name) { + base.with_name (name); add_test ("[ReadOnlyList] immutable iterator", test_immutable_iterator); add_test ("[ReadOnlyList] immutable", test_immutable); add_test ("[ReadOnlyList] accurate view", test_accurate_view); @@ -74,18 +78,8 @@ public class ReadOnlyListTests : ReadOnlyCollectionTests { assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (iterator.has_previous ()); - assert (iterator.previous ()); - assert (iterator.get () == "one"); - assert (iterator.index () == 0); - - assert (iterator.last ()); - assert (iterator.get () == "two"); - assert (iterator.index () == 1); - - assert (iterator.first ()); - assert (iterator.get () == "one"); - assert (iterator.index () == 0); + iterator = ro_list.list_iterator (); + assert (iterator.next ()); if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | TestTrapFlags.SILENCE_STDERR)) { @@ -109,12 +103,6 @@ public class ReadOnlyListTests : ReadOnlyCollectionTests { assert (ro_list.get (1) == "two"); assert (iterator.index () == 0); - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - iterator.insert ("three"); - Posix.exit (0); - } - Test.trap_assert_failed (); assert (ro_list.size == 2); assert (ro_list.get (0) == "one"); assert (ro_list.get (1) == "two"); diff --git a/tests/testreadonlymap.c b/tests/testreadonlymap.c index 67b82f1..cb79298 100644 --- a/tests/testreadonlymap.c +++ b/tests/testreadonlymap.c @@ -90,7 +90,7 @@ enum { ReadOnlyMapTests* read_only_map_tests_new (void); ReadOnlyMapTests* read_only_map_tests_construct (GType object_type); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void read_only_map_tests_test_unique_read_only_view_instance (ReadOnlyMapTests* self); static void _read_only_map_tests_test_unique_read_only_view_instance_gee_test_case_test_method (gpointer self); void read_only_map_tests_test_immutable_iterator (ReadOnlyMapTests* self); @@ -127,10 +127,10 @@ static void _read_only_map_tests_test_accurate_view_gee_test_case_test_method (g ReadOnlyMapTests* read_only_map_tests_construct (GType object_type) { ReadOnlyMapTests * self = NULL; self = (ReadOnlyMapTests*) gee_test_case_construct (object_type, "ReadOnlyMap"); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] unique read-only view instance", _read_only_map_tests_test_unique_read_only_view_instance_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] immutable iterator", _read_only_map_tests_test_immutable_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] immutable", _read_only_map_tests_test_immutable_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] accurate view", _read_only_map_tests_test_accurate_view_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] unique read-only view instance", _read_only_map_tests_test_unique_read_only_view_instance_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] immutable iterator", _read_only_map_tests_test_immutable_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] immutable", _read_only_map_tests_test_immutable_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[ReadOnlyMap] accurate view", _read_only_map_tests_test_accurate_view_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -147,7 +147,7 @@ static void read_only_map_tests_real_set_up (GeeTestCase* base) { GeeMap* _tmp2_; GeeMap* _tmp3_; self = (ReadOnlyMapTests*) base; - _tmp0_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (self->test_map); self->test_map = (GeeMap*) _tmp0_; _tmp1_ = self->test_map; @@ -265,23 +265,30 @@ void read_only_map_tests_test_immutable_iterator (ReadOnlyMapTests* self) { gboolean _tmp34_ = FALSE; GeeIterator* _tmp35_; gboolean _tmp36_ = FALSE; - GeeIterator* _tmp37_; - gboolean _tmp38_ = FALSE; - GeeIterator* _tmp39_; - gpointer _tmp40_ = NULL; - gchar* _tmp41_; - gboolean _tmp42_ = FALSE; - GeeMap* _tmp44_; - gint _tmp45_; - gint _tmp46_; - GeeMap* _tmp47_; - gboolean _tmp48_ = FALSE; - GeeMap* _tmp49_; - gboolean _tmp50_ = FALSE; + GeeMap* _tmp37_; + GeeSet* _tmp38_; + GeeSet* _tmp39_; + GeeSet* _tmp40_; + GeeIterator* _tmp41_ = NULL; + GeeIterator* _tmp42_; + gboolean _tmp43_ = FALSE; + GeeIterator* _tmp44_; + gboolean _tmp45_ = FALSE; + GeeIterator* _tmp46_; + gpointer _tmp47_ = NULL; + gchar* _tmp48_; + gboolean _tmp49_ = FALSE; GeeMap* _tmp51_; - gboolean _tmp52_ = FALSE; - GeeMap* _tmp53_; - gboolean _tmp54_ = FALSE; + gint _tmp52_; + gint _tmp53_; + GeeMap* _tmp54_; + gboolean _tmp55_ = FALSE; + GeeMap* _tmp56_; + gboolean _tmp57_ = FALSE; + GeeMap* _tmp58_; + gboolean _tmp59_ = FALSE; + GeeMap* _tmp60_; + gboolean _tmp61_ = FALSE; g_return_if_fail (self != NULL); _tmp0_ = self->test_map; gee_map_set (_tmp0_, "one", "one"); @@ -339,38 +346,49 @@ void read_only_map_tests_test_immutable_iterator (ReadOnlyMapTests* self) { _tmp35_ = iterator; _tmp36_ = gee_iterator_next (_tmp35_); _vala_assert (!_tmp36_, "! iterator.next ()"); - _tmp37_ = iterator; - _tmp38_ = gee_iterator_first (_tmp37_); - _vala_assert (_tmp38_, "iterator.first ()"); - _tmp39_ = iterator; - _tmp40_ = gee_iterator_get (_tmp39_); - _tmp41_ = (gchar*) _tmp40_; - _vala_assert (g_strcmp0 (_tmp41_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp41_); - _tmp42_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp42_) { - GeeIterator* _tmp43_; - _tmp43_ = iterator; - gee_iterator_remove (_tmp43_); + _tmp37_ = self->ro_map; + _tmp38_ = gee_map_get_keys (_tmp37_); + _tmp39_ = _tmp38_; + _tmp40_ = _tmp39_; + _tmp41_ = gee_iterable_iterator ((GeeIterable*) _tmp40_); + _g_object_unref0 (iterator); + iterator = _tmp41_; + _g_object_unref0 (_tmp40_); + _tmp42_ = iterator; + _tmp43_ = gee_iterator_has_next (_tmp42_); + _vala_assert (_tmp43_, "iterator.has_next ()"); + _tmp44_ = iterator; + _tmp45_ = gee_iterator_next (_tmp44_); + _vala_assert (_tmp45_, "iterator.next ()"); + _tmp46_ = iterator; + _tmp47_ = gee_iterator_get (_tmp46_); + _tmp48_ = (gchar*) _tmp47_; + _vala_assert (g_strcmp0 (_tmp48_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp48_); + _tmp49_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp49_) { + GeeIterator* _tmp50_; + _tmp50_ = iterator; + gee_iterator_remove (_tmp50_); exit (0); } g_test_trap_assert_failed (); - _tmp44_ = self->ro_map; - _tmp45_ = gee_map_get_size (_tmp44_); - _tmp46_ = _tmp45_; - _vala_assert (_tmp46_ == 2, "ro_map.size == 2"); - _tmp47_ = self->ro_map; - _tmp48_ = gee_map_has_key (_tmp47_, "one"); - _vala_assert (_tmp48_, "ro_map.has_key (\"one\")"); - _tmp49_ = self->ro_map; - _tmp50_ = gee_map_has (_tmp49_, "one", "one"); - _vala_assert (_tmp50_, "ro_map.has (\"one\", \"one\")"); _tmp51_ = self->ro_map; - _tmp52_ = gee_map_has_key (_tmp51_, "two"); - _vala_assert (_tmp52_, "ro_map.has_key (\"two\")"); - _tmp53_ = self->ro_map; - _tmp54_ = gee_map_has (_tmp53_, "two", "two"); - _vala_assert (_tmp54_, "ro_map.has (\"two\", \"two\")"); + _tmp52_ = gee_map_get_size (_tmp51_); + _tmp53_ = _tmp52_; + _vala_assert (_tmp53_ == 2, "ro_map.size == 2"); + _tmp54_ = self->ro_map; + _tmp55_ = gee_map_has_key (_tmp54_, "one"); + _vala_assert (_tmp55_, "ro_map.has_key (\"one\")"); + _tmp56_ = self->ro_map; + _tmp57_ = gee_map_has (_tmp56_, "one", "one"); + _vala_assert (_tmp57_, "ro_map.has (\"one\", \"one\")"); + _tmp58_ = self->ro_map; + _tmp59_ = gee_map_has_key (_tmp58_, "two"); + _vala_assert (_tmp59_, "ro_map.has_key (\"two\")"); + _tmp60_ = self->ro_map; + _tmp61_ = gee_map_has (_tmp60_, "two", "two"); + _vala_assert (_tmp61_, "ro_map.has (\"two\", \"two\")"); _g_object_unref0 (iterator); } @@ -441,7 +459,7 @@ void read_only_map_tests_test_immutable (ReadOnlyMapTests* self) { _tmp6_ = self->ro_map; _tmp7_ = gee_map_has (_tmp6_, "one", "one"); _vala_assert (_tmp7_, "ro_map.has (\"one\", \"one\")"); - _tmp8_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _tmp8_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); dummy = (GeeMap*) _tmp8_; _tmp9_ = dummy; gee_map_set (_tmp9_, "one", "one"); @@ -644,7 +662,7 @@ void read_only_map_tests_test_accurate_view (ReadOnlyMapTests* self) { gpointer _tmp90_ = NULL; gchar* _tmp91_; g_return_if_fail (self != NULL); - _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); dummy = (GeeMap*) _tmp0_; gee_map_set (dummy, "one", "one"); gee_map_set (dummy, "two", "two"); diff --git a/tests/testreadonlymap.vala b/tests/testreadonlymap.vala index c32f763..0cb6d2e 100644 --- a/tests/testreadonlymap.vala +++ b/tests/testreadonlymap.vala @@ -87,7 +87,9 @@ public class ReadOnlyMapTests : Gee.TestCase { assert (! iterator.has_next ()); assert (! iterator.next ()); - assert (iterator.first ()); + iterator = ro_map.keys.iterator (); + assert (iterator.has_next ()); + assert (iterator.next ()); assert (iterator.get () == "one"); if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | diff --git a/tests/testreadonlyset.c b/tests/testreadonlyset.c index fe8d420..8a22e30 100644 --- a/tests/testreadonlyset.c +++ b/tests/testreadonlyset.c @@ -135,7 +135,7 @@ static void read_only_set_tests_real_set_up (GeeTestCase* base) { GeeCollection* _tmp1_; GeeCollection* _tmp2_ = NULL; self = (ReadOnlySetTests*) base; - _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((ReadOnlyCollectionTests*) self)->test_collection); ((ReadOnlyCollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; _tmp1_ = ((ReadOnlyCollectionTests*) self)->test_collection; diff --git a/tests/tests.vala.stamp b/tests/tests.vala.stamp deleted file mode 100644 index e69de29..0000000 diff --git a/tests/tests_vala.stamp b/tests/tests_vala.stamp new file mode 100644 index 0000000..859afb1 --- /dev/null +++ b/tests/tests_vala.stamp @@ -0,0 +1 @@ +stamp diff --git a/tests/testset.c b/tests/testset.c index 2b29b70..9fb1d26 100644 --- a/tests/testset.c +++ b/tests/testset.c @@ -111,7 +111,7 @@ enum { }; SetTests* set_tests_construct (GType object_type, const gchar* name); CollectionTests* collection_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void set_tests_test_duplicates_are_ignored (SetTests* self); static void _set_tests_test_duplicates_are_ignored_gee_test_case_test_method (gpointer self); static void set_tests_real_test_duplicates_are_ignored (SetTests* self); @@ -128,7 +128,7 @@ SetTests* set_tests_construct (GType object_type, const gchar* name) { g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (SetTests*) collection_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Set] duplicates are ignored", _set_tests_test_duplicates_are_ignored_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Set] duplicates are ignored", _set_tests_test_duplicates_are_ignored_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } diff --git a/tests/testsortedmap.c b/tests/testsortedmap.c new file mode 100644 index 0000000..c61227e --- /dev/null +++ b/tests/testsortedmap.c @@ -0,0 +1,6438 @@ +/* testsortedmap.c generated by valac 0.18.0, the Vala compiler + * generated from testsortedmap.vala, do not modify */ + +/* sortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +#include +#include +#include +#include +#include + + +#define GEE_TYPE_TEST_CASE (gee_test_case_get_type ()) +#define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase)) +#define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) +#define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE)) +#define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE)) +#define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass)) + +typedef struct _GeeTestCase GeeTestCase; +typedef struct _GeeTestCaseClass GeeTestCaseClass; +typedef struct _GeeTestCasePrivate GeeTestCasePrivate; + +#define TYPE_MAP_TESTS (map_tests_get_type ()) +#define MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_TESTS, MapTests)) +#define MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_TESTS, MapTestsClass)) +#define IS_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_TESTS)) +#define IS_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_TESTS)) +#define MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_TESTS, MapTestsClass)) + +typedef struct _MapTests MapTests; +typedef struct _MapTestsClass MapTestsClass; +typedef struct _MapTestsPrivate MapTestsPrivate; + +#define GEE_TYPE_SORTED_MAP_TESTS (gee_sorted_map_tests_get_type ()) +#define GEE_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTests)) +#define GEE_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) +#define GEE_IS_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_IS_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) + +typedef struct _GeeSortedMapTests GeeSortedMapTests; +typedef struct _GeeSortedMapTestsClass GeeSortedMapTestsClass; +typedef struct _GeeSortedMapTestsPrivate GeeSortedMapTestsPrivate; + +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TYPE (gee_sorted_map_tests_sub_map_tests_type_get_type ()) + +#define GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS (gee_sorted_map_tests_sub_map_tests_get_type ()) +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, GeeSortedMapTestsSubMapTests)) +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, GeeSortedMapTestsSubMapTestsClass)) +#define GEE_SORTED_MAP_TESTS_IS_SUB_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_IS_SUB_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, GeeSortedMapTestsSubMapTestsClass)) + +typedef struct _GeeSortedMapTestsSubMapTests GeeSortedMapTestsSubMapTests; +typedef struct _GeeSortedMapTestsSubMapTestsClass GeeSortedMapTestsSubMapTestsClass; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _GeeSortedMapTestsSubMapTestsPrivate GeeSortedMapTestsSubMapTestsPrivate; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _GeeTestCase { + GObject parent_instance; + GeeTestCasePrivate * priv; +}; + +struct _GeeTestCaseClass { + GObjectClass parent_class; + void (*set_up) (GeeTestCase* self); + void (*tear_down) (GeeTestCase* self); +}; + +struct _MapTests { + GeeTestCase parent_instance; + MapTestsPrivate * priv; + GeeMap* test_map; +}; + +struct _MapTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _GeeSortedMapTests { + MapTests parent_instance; + GeeSortedMapTestsPrivate * priv; +}; + +struct _GeeSortedMapTestsClass { + MapTestsClass parent_class; +}; + +typedef void (*GeeTestCaseTestMethod) (void* user_data); +typedef enum { + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB, + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY +} GeeSortedMapTestsSubMapTestsType; + +struct _GeeSortedMapTestsSubMapTests { + GeeTestCase parent_instance; + GeeSortedMapTestsSubMapTestsPrivate * priv; +}; + +struct _GeeSortedMapTestsSubMapTestsClass { + GeeTestCaseClass parent_class; +}; + +struct _GeeSortedMapTestsSubMapTestsPrivate { + GeeSortedMap* master; + GeeSortedMap* submap; + GeeSortedMapTests* test; + GeeSortedMapTestsSubMapTestsType type; +}; + + +static gpointer gee_sorted_map_tests_parent_class = NULL; +static gpointer gee_sorted_map_tests_sub_map_tests_parent_class = NULL; + +GType gee_test_case_get_type (void) G_GNUC_CONST; +GType map_tests_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_tests_get_type (void) G_GNUC_CONST; +enum { + GEE_SORTED_MAP_TESTS_DUMMY_PROPERTY +}; +GeeSortedMapTests* gee_sorted_map_tests_construct (GType object_type, const gchar* name); +MapTests* map_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); +void gee_sorted_map_tests_test_key_ordering (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_key_ordering_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_first (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_first_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_last (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_last_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_iterator_at (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_iterator_at_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_lower (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_lower_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_higher (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_higher_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_floor (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_floor_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_test_ceil (GeeSortedMapTests* self); +static void _gee_sorted_map_tests_test_ceil_gee_test_case_test_method (gpointer self); +GTestSuite* gee_test_case_get_suite (GeeTestCase* self); +GType gee_sorted_map_tests_sub_map_tests_type_get_type (void) G_GNUC_CONST; +GeeSortedMapTestsSubMapTests* gee_sorted_map_tests_sub_map_tests_new (GeeSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type); +GeeSortedMapTestsSubMapTests* gee_sorted_map_tests_sub_map_tests_construct (GType object_type, GeeSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type); +GType gee_sorted_map_tests_sub_map_tests_get_type (void) G_GNUC_CONST; +void map_tests_assert_entry (GeeMapEntry* e, const gchar* key, const gchar* value); +GeeMapEntry* map_tests_entry_for (const gchar* key, const gchar* value); +#define GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, GeeSortedMapTestsSubMapTestsPrivate)) +enum { + GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_DUMMY_PROPERTY +}; +const gchar* gee_sorted_map_tests_sub_map_tests_type_to_string (GeeSortedMapTestsSubMapTestsType self); +GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); +void gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_keys (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_keys_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_values (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_values_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_entries (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_entries_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_get (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_get_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_set (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_set_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_unset (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_unset_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_clear (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_clear_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_iterators (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_iterators_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_boundaries (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_boundaries_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_lower (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_lower_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_higher (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_higher_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_floor (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_floor_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_ceil (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_ceil_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_iterator_at (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_iterator_at_gee_test_case_test_method (gpointer self); +void gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets (GeeSortedMapTestsSubMapTests* self); +static void _gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets_gee_test_case_test_method (gpointer self); +static void gee_sorted_map_tests_sub_map_tests_real_set_up (GeeTestCase* base); +void gee_test_case_set_up (GeeTestCase* self); +static void gee_sorted_map_tests_sub_map_tests_real_tear_down (GeeTestCase* base); +void gee_test_case_tear_down (GeeTestCase* self); +void gee_sorted_map_tests_sub_map_tests_set_default_values (GeeSortedMapTestsSubMapTests* self, gchar*** contains, int* contains_length1, gchar*** not_contains, int* not_contains_length1); +static void gee_sorted_map_tests_sub_map_tests_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +static void _gee_sorted_map_tests_test_key_ordering_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_key_ordering (self); +} + + +static void _gee_sorted_map_tests_test_first_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_first (self); +} + + +static void _gee_sorted_map_tests_test_last_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_last (self); +} + + +static void _gee_sorted_map_tests_test_iterator_at_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_iterator_at (self); +} + + +static void _gee_sorted_map_tests_test_lower_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_lower (self); +} + + +static void _gee_sorted_map_tests_test_higher_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_higher (self); +} + + +static void _gee_sorted_map_tests_test_floor_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_floor (self); +} + + +static void _gee_sorted_map_tests_test_ceil_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_test_ceil (self); +} + + +GeeSortedMapTests* gee_sorted_map_tests_construct (GType object_type, const gchar* name) { + GeeSortedMapTests * self = NULL; + const gchar* _tmp0_; + GTestSuite* _tmp1_ = NULL; + GeeSortedMapTestsSubMapTests* _tmp2_; + GeeSortedMapTestsSubMapTests* _tmp3_; + GTestSuite* _tmp4_ = NULL; + GTestSuite* _tmp5_ = NULL; + GeeSortedMapTestsSubMapTests* _tmp6_; + GeeSortedMapTestsSubMapTests* _tmp7_; + GTestSuite* _tmp8_ = NULL; + GTestSuite* _tmp9_ = NULL; + GeeSortedMapTestsSubMapTests* _tmp10_; + GeeSortedMapTestsSubMapTests* _tmp11_; + GTestSuite* _tmp12_ = NULL; + GTestSuite* _tmp13_ = NULL; + GeeSortedMapTestsSubMapTests* _tmp14_; + GeeSortedMapTestsSubMapTests* _tmp15_; + GTestSuite* _tmp16_ = NULL; + g_return_val_if_fail (name != NULL, NULL); + _tmp0_ = name; + self = (GeeSortedMapTests*) map_tests_construct (object_type, _tmp0_); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] key ordering", _gee_sorted_map_tests_test_key_ordering_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] first", _gee_sorted_map_tests_test_first_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] last", _gee_sorted_map_tests_test_last_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] iterator_at", _gee_sorted_map_tests_test_iterator_at_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] lower", _gee_sorted_map_tests_test_lower_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] higher", _gee_sorted_map_tests_test_higher_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] floor", _gee_sorted_map_tests_test_floor_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] ceil", _gee_sorted_map_tests_test_ceil_gee_test_case_test_method, g_object_ref (self), g_object_unref); + _tmp1_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp2_ = gee_sorted_map_tests_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD); + _tmp3_ = _tmp2_; + _tmp4_ = gee_test_case_get_suite ((GeeTestCase*) _tmp3_); + g_test_suite_add_suite (_tmp1_, _tmp4_); + _g_object_unref0 (_tmp3_); + _tmp5_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp6_ = gee_sorted_map_tests_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL); + _tmp7_ = _tmp6_; + _tmp8_ = gee_test_case_get_suite ((GeeTestCase*) _tmp7_); + g_test_suite_add_suite (_tmp5_, _tmp8_); + _g_object_unref0 (_tmp7_); + _tmp9_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp10_ = gee_sorted_map_tests_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB); + _tmp11_ = _tmp10_; + _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) _tmp11_); + g_test_suite_add_suite (_tmp9_, _tmp12_); + _g_object_unref0 (_tmp11_); + _tmp13_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp14_ = gee_sorted_map_tests_sub_map_tests_new (self, GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY); + _tmp15_ = _tmp14_; + _tmp16_ = gee_test_case_get_suite ((GeeTestCase*) _tmp15_); + g_test_suite_add_suite (_tmp13_, _tmp16_); + _g_object_unref0 (_tmp15_); + return self; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +void gee_sorted_map_tests_test_key_ordering (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSet* _tmp2_; + GeeSet* _tmp3_; + GeeSet* _tmp4_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* _tmp6_; + GeeIterator* iterator; + gboolean _tmp7_ = FALSE; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + gboolean _tmp10_ = FALSE; + gpointer _tmp11_ = NULL; + gchar* _tmp12_; + gboolean _tmp13_ = FALSE; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + gboolean _tmp16_ = FALSE; + gpointer _tmp17_ = NULL; + gchar* _tmp18_; + gboolean _tmp19_ = FALSE; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + gboolean _tmp22_ = FALSE; + gpointer _tmp23_ = NULL; + gchar* _tmp24_; + gboolean _tmp25_ = FALSE; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + gboolean _tmp28_ = FALSE; + gpointer _tmp29_ = NULL; + gchar* _tmp30_; + gboolean _tmp31_ = FALSE; + gpointer _tmp32_ = NULL; + gchar* _tmp33_; + gboolean _tmp34_ = FALSE; + gpointer _tmp35_ = NULL; + gchar* _tmp36_; + gboolean _tmp37_ = FALSE; + gpointer _tmp38_ = NULL; + gchar* _tmp39_; + gboolean _tmp40_ = FALSE; + gpointer _tmp41_ = NULL; + gchar* _tmp42_; + gboolean _tmp43_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _vala_assert (test_sorted_map != NULL, "test_sorted_map != null"); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + gee_map_set ((GeeMap*) test_sorted_map, "seven", "seven"); + gee_map_set ((GeeMap*) test_sorted_map, "eight", "eight"); + gee_map_set ((GeeMap*) test_sorted_map, "nine", "nine"); + gee_map_set ((GeeMap*) test_sorted_map, "ten", "ten"); + gee_map_set ((GeeMap*) test_sorted_map, "eleven", "eleven"); + gee_map_set ((GeeMap*) test_sorted_map, "twelve", "twelve"); + _tmp2_ = gee_map_get_keys ((GeeMap*) test_sorted_map); + _tmp3_ = _tmp2_; + _tmp4_ = _tmp3_; + _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); + _tmp6_ = _tmp5_; + _g_object_unref0 (_tmp4_); + iterator = _tmp6_; + _tmp7_ = gee_iterator_next (iterator); + _vala_assert (_tmp7_, "iterator.next ()"); + _tmp8_ = gee_iterator_get (iterator); + _tmp9_ = (gchar*) _tmp8_; + _vala_assert (g_strcmp0 (_tmp9_, "eight") == 0, "iterator.get () == \"eight\""); + _g_free0 (_tmp9_); + _tmp10_ = gee_iterator_next (iterator); + _vala_assert (_tmp10_, "iterator.next ()"); + _tmp11_ = gee_iterator_get (iterator); + _tmp12_ = (gchar*) _tmp11_; + _vala_assert (g_strcmp0 (_tmp12_, "eleven") == 0, "iterator.get () == \"eleven\""); + _g_free0 (_tmp12_); + _tmp13_ = gee_iterator_next (iterator); + _vala_assert (_tmp13_, "iterator.next ()"); + _tmp14_ = gee_iterator_get (iterator); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "five") == 0, "iterator.get () == \"five\""); + _g_free0 (_tmp15_); + _tmp16_ = gee_iterator_next (iterator); + _vala_assert (_tmp16_, "iterator.next ()"); + _tmp17_ = gee_iterator_get (iterator); + _tmp18_ = (gchar*) _tmp17_; + _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "iterator.get () == \"four\""); + _g_free0 (_tmp18_); + _tmp19_ = gee_iterator_next (iterator); + _vala_assert (_tmp19_, "iterator.next ()"); + _tmp20_ = gee_iterator_get (iterator); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "nine") == 0, "iterator.get () == \"nine\""); + _g_free0 (_tmp21_); + _tmp22_ = gee_iterator_next (iterator); + _vala_assert (_tmp22_, "iterator.next ()"); + _tmp23_ = gee_iterator_get (iterator); + _tmp24_ = (gchar*) _tmp23_; + _vala_assert (g_strcmp0 (_tmp24_, "one") == 0, "iterator.get () == \"one\""); + _g_free0 (_tmp24_); + _tmp25_ = gee_iterator_next (iterator); + _vala_assert (_tmp25_, "iterator.next ()"); + _tmp26_ = gee_iterator_get (iterator); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp27_, "seven") == 0, "iterator.get () == \"seven\""); + _g_free0 (_tmp27_); + _tmp28_ = gee_iterator_next (iterator); + _vala_assert (_tmp28_, "iterator.next ()"); + _tmp29_ = gee_iterator_get (iterator); + _tmp30_ = (gchar*) _tmp29_; + _vala_assert (g_strcmp0 (_tmp30_, "six") == 0, "iterator.get () == \"six\""); + _g_free0 (_tmp30_); + _tmp31_ = gee_iterator_next (iterator); + _vala_assert (_tmp31_, "iterator.next ()"); + _tmp32_ = gee_iterator_get (iterator); + _tmp33_ = (gchar*) _tmp32_; + _vala_assert (g_strcmp0 (_tmp33_, "ten") == 0, "iterator.get () == \"ten\""); + _g_free0 (_tmp33_); + _tmp34_ = gee_iterator_next (iterator); + _vala_assert (_tmp34_, "iterator.next ()"); + _tmp35_ = gee_iterator_get (iterator); + _tmp36_ = (gchar*) _tmp35_; + _vala_assert (g_strcmp0 (_tmp36_, "three") == 0, "iterator.get () == \"three\""); + _g_free0 (_tmp36_); + _tmp37_ = gee_iterator_next (iterator); + _vala_assert (_tmp37_, "iterator.next ()"); + _tmp38_ = gee_iterator_get (iterator); + _tmp39_ = (gchar*) _tmp38_; + _vala_assert (g_strcmp0 (_tmp39_, "twelve") == 0, "iterator.get () == \"twelve\""); + _g_free0 (_tmp39_); + _tmp40_ = gee_iterator_next (iterator); + _vala_assert (_tmp40_, "iterator.next ()"); + _tmp41_ = gee_iterator_get (iterator); + _tmp42_ = (gchar*) _tmp41_; + _vala_assert (g_strcmp0 (_tmp42_, "two") == 0, "iterator.get () == \"two\""); + _g_free0 (_tmp42_); + _tmp43_ = gee_iterator_next (iterator); + _vala_assert (_tmp43_ == FALSE, "iterator.next () == false"); + _g_object_unref0 (iterator); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_first (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedMap* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* keys; + GeeSortedMap* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + GeeSortedSet* entries; + GeeSortedMap* _tmp8_; + gboolean _tmp9_ = FALSE; + gboolean _tmp13_ = FALSE; + GeeSortedMap* _tmp17_; + GeeSortedMap* _tmp18_; + GeeSortedMap* _tmp19_; + GeeSortedMap* _tmp20_; + GeeSortedMap* _tmp21_; + GeeSortedMap* _tmp22_; + GeeSortedMap* _tmp23_; + GeeSortedMap* _tmp24_; + GeeSortedMap* _tmp25_; + GeeSortedMap* _tmp26_; + GeeSortedMap* _tmp27_; + GeeSortedMap* _tmp28_; + GeeSortedSet* _tmp29_; + gpointer _tmp30_ = NULL; + gchar* _tmp31_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = test_sorted_map; + _tmp3_ = gee_sorted_map_get_ascending_keys (_tmp2_); + _tmp4_ = _tmp3_; + keys = _tmp4_; + _tmp5_ = test_sorted_map; + _tmp6_ = gee_sorted_map_get_ascending_entries (_tmp5_); + _tmp7_ = _tmp6_; + entries = _tmp7_; + _tmp8_ = test_sorted_map; + _vala_assert (_tmp8_ != NULL, "test_sorted_map != null"); + _tmp9_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp9_) { + GeeSortedSet* _tmp10_; + gpointer _tmp11_ = NULL; + gchar* _tmp12_; + _tmp10_ = keys; + _tmp11_ = gee_sorted_set_first (_tmp10_); + _tmp12_ = (gchar*) _tmp11_; + _g_free0 (_tmp12_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp13_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp13_) { + GeeSortedSet* _tmp14_; + gpointer _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + _tmp14_ = entries; + _tmp15_ = gee_sorted_set_first (_tmp14_); + _tmp16_ = (GeeMapEntry*) _tmp15_; + _g_object_unref0 (_tmp16_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp17_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp17_, "one", "one"); + _tmp18_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp18_, "two", "two"); + _tmp19_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp19_, "three", "three"); + _tmp20_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp20_, "four", "four"); + _tmp21_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp21_, "five", "five"); + _tmp22_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp22_, "six", "six"); + _tmp23_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp23_, "seven", "seven"); + _tmp24_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp24_, "eight", "eight"); + _tmp25_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp25_, "nine", "nine"); + _tmp26_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp26_, "ten", "ten"); + _tmp27_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp27_, "eleven", "eleven"); + _tmp28_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp28_, "twelve", "twelve"); + _tmp29_ = keys; + _tmp30_ = gee_sorted_set_first (_tmp29_); + _tmp31_ = (gchar*) _tmp30_; + _vala_assert (g_strcmp0 (_tmp31_, "eight") == 0, "keys.first () == \"eight\""); + _g_free0 (_tmp31_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_last (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedMap* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* keys; + GeeSortedMap* _tmp5_; + GeeSortedSet* _tmp6_; + GeeSortedSet* _tmp7_; + GeeSortedSet* entries; + GeeSortedMap* _tmp8_; + gboolean _tmp9_ = FALSE; + gboolean _tmp13_ = FALSE; + GeeSortedMap* _tmp17_; + GeeSortedMap* _tmp18_; + GeeSortedMap* _tmp19_; + GeeSortedMap* _tmp20_; + GeeSortedMap* _tmp21_; + GeeSortedMap* _tmp22_; + GeeSortedMap* _tmp23_; + GeeSortedMap* _tmp24_; + GeeSortedMap* _tmp25_; + GeeSortedMap* _tmp26_; + GeeSortedMap* _tmp27_; + GeeSortedMap* _tmp28_; + GeeSortedSet* _tmp29_; + gpointer _tmp30_ = NULL; + gchar* _tmp31_; + GeeSortedSet* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = test_sorted_map; + _tmp3_ = gee_sorted_map_get_ascending_keys (_tmp2_); + _tmp4_ = _tmp3_; + keys = _tmp4_; + _tmp5_ = test_sorted_map; + _tmp6_ = gee_sorted_map_get_ascending_entries (_tmp5_); + _tmp7_ = _tmp6_; + entries = _tmp7_; + _tmp8_ = test_sorted_map; + _vala_assert (_tmp8_ != NULL, "test_sorted_map != null"); + _tmp9_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp9_) { + GeeSortedSet* _tmp10_; + gpointer _tmp11_ = NULL; + gchar* _tmp12_; + _tmp10_ = keys; + _tmp11_ = gee_sorted_set_last (_tmp10_); + _tmp12_ = (gchar*) _tmp11_; + _g_free0 (_tmp12_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp13_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp13_) { + GeeSortedSet* _tmp14_; + gpointer _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + _tmp14_ = entries; + _tmp15_ = gee_sorted_set_last (_tmp14_); + _tmp16_ = (GeeMapEntry*) _tmp15_; + _g_object_unref0 (_tmp16_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp17_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp17_, "one", "one"); + _tmp18_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp18_, "two", "two"); + _tmp19_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp19_, "three", "three"); + _tmp20_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp20_, "four", "four"); + _tmp21_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp21_, "five", "five"); + _tmp22_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp22_, "six", "six"); + _tmp23_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp23_, "seven", "seven"); + _tmp24_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp24_, "eight", "eight"); + _tmp25_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp25_, "nine", "nine"); + _tmp26_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp26_, "ten", "ten"); + _tmp27_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp27_, "eleven", "eleven"); + _tmp28_ = test_sorted_map; + gee_map_set ((GeeMap*) _tmp28_, "twelve", "twelve"); + _tmp29_ = keys; + _tmp30_ = gee_sorted_set_last (_tmp29_); + _tmp31_ = (gchar*) _tmp30_; + _vala_assert (g_strcmp0 (_tmp31_, "two") == 0, "keys.last () == \"two\""); + _g_free0 (_tmp31_); + _tmp32_ = entries; + _tmp33_ = gee_sorted_set_last (_tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + map_tests_assert_entry (_tmp34_, "two", "two"); + _g_object_unref0 (_tmp34_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_iterator_at (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + GeeMap* _tmp6_; + GeeMap* _tmp7_; + GeeMap* _tmp8_; + GeeIterator* _tmp9_ = NULL; + GeeIterator* keys_iter; + GeeIterator* _tmp10_; + GeeIterator* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeMapEntry* _tmp14_ = NULL; + GeeMapEntry* _tmp15_; + GeeIterator* _tmp16_ = NULL; + GeeIterator* _tmp17_; + GeeIterator* entries_iter; + GeeIterator* _tmp18_; + GeeIterator* _tmp19_; + gpointer _tmp20_ = NULL; + GeeMapEntry* _tmp21_; + GeeIterator* _tmp22_ = NULL; + GeeIterator* _tmp23_; + GeeIterator* _tmp24_; + gpointer _tmp25_ = NULL; + gchar* _tmp26_; + GeeMapEntry* _tmp27_ = NULL; + GeeMapEntry* _tmp28_; + GeeIterator* _tmp29_ = NULL; + GeeIterator* _tmp30_; + GeeIterator* _tmp31_; + gpointer _tmp32_ = NULL; + GeeMapEntry* _tmp33_; + GeeIterator* _tmp34_ = NULL; + GeeIterator* _tmp35_; + GeeIterator* _tmp36_; + gpointer _tmp37_ = NULL; + gchar* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + GeeIterator* _tmp41_ = NULL; + GeeIterator* _tmp42_; + GeeIterator* _tmp43_; + gpointer _tmp44_ = NULL; + GeeMapEntry* _tmp45_; + GeeIterator* _tmp46_ = NULL; + GeeIterator* _tmp47_; + GeeMapEntry* _tmp48_ = NULL; + GeeMapEntry* _tmp49_; + GeeIterator* _tmp50_ = NULL; + GeeIterator* _tmp51_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys (test_sorted_map); + _tmp3_ = _tmp2_; + keys = _tmp3_; + _tmp4_ = gee_sorted_map_get_ascending_entries (test_sorted_map); + _tmp5_ = _tmp4_; + entries = _tmp5_; + _tmp6_ = ((MapTests*) self)->test_map; + gee_map_set (_tmp6_, "one", "one"); + _tmp7_ = ((MapTests*) self)->test_map; + gee_map_set (_tmp7_, "two", "two"); + _tmp8_ = ((MapTests*) self)->test_map; + gee_map_set (_tmp8_, "three", "three"); + _tmp9_ = gee_sorted_set_iterator_at (keys, "one"); + keys_iter = _tmp9_; + _tmp10_ = keys_iter; + _vala_assert (_tmp10_ != NULL, "keys_iter != null"); + _tmp11_ = keys_iter; + _tmp12_ = gee_iterator_get (_tmp11_); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (g_strcmp0 (_tmp13_, "one") == 0, "keys_iter.get () == \"one\""); + _g_free0 (_tmp13_); + _tmp14_ = map_tests_entry_for ("one", "one"); + _tmp15_ = _tmp14_; + _tmp16_ = gee_sorted_set_iterator_at (entries, _tmp15_); + _tmp17_ = _tmp16_; + _g_object_unref0 (_tmp15_); + entries_iter = _tmp17_; + _tmp18_ = entries_iter; + _vala_assert (_tmp18_ != NULL, "entries_iter != null"); + _tmp19_ = entries_iter; + _tmp20_ = gee_iterator_get (_tmp19_); + _tmp21_ = (GeeMapEntry*) _tmp20_; + map_tests_assert_entry (_tmp21_, "one", "one"); + _g_object_unref0 (_tmp21_); + _tmp22_ = gee_sorted_set_iterator_at (keys, "two"); + _g_object_unref0 (keys_iter); + keys_iter = _tmp22_; + _tmp23_ = keys_iter; + _vala_assert (_tmp23_ != NULL, "keys_iter != null"); + _tmp24_ = keys_iter; + _tmp25_ = gee_iterator_get (_tmp24_); + _tmp26_ = (gchar*) _tmp25_; + _vala_assert (g_strcmp0 (_tmp26_, "two") == 0, "keys_iter.get () == \"two\""); + _g_free0 (_tmp26_); + _tmp27_ = map_tests_entry_for ("two", "two"); + _tmp28_ = _tmp27_; + _tmp29_ = gee_sorted_set_iterator_at (entries, _tmp28_); + _g_object_unref0 (entries_iter); + entries_iter = _tmp29_; + _g_object_unref0 (_tmp28_); + _tmp30_ = entries_iter; + _vala_assert (_tmp30_ != NULL, "entries_iter != null"); + _tmp31_ = entries_iter; + _tmp32_ = gee_iterator_get (_tmp31_); + _tmp33_ = (GeeMapEntry*) _tmp32_; + map_tests_assert_entry (_tmp33_, "two", "two"); + _g_object_unref0 (_tmp33_); + _tmp34_ = gee_sorted_set_iterator_at (keys, "three"); + _g_object_unref0 (keys_iter); + keys_iter = _tmp34_; + _tmp35_ = keys_iter; + _vala_assert (_tmp35_ != NULL, "keys_iter != null"); + _tmp36_ = keys_iter; + _tmp37_ = gee_iterator_get (_tmp36_); + _tmp38_ = (gchar*) _tmp37_; + _vala_assert (g_strcmp0 (_tmp38_, "three") == 0, "keys_iter.get () == \"three\""); + _g_free0 (_tmp38_); + _tmp39_ = map_tests_entry_for ("three", "three"); + _tmp40_ = _tmp39_; + _tmp41_ = gee_sorted_set_iterator_at (entries, _tmp40_); + _g_object_unref0 (entries_iter); + entries_iter = _tmp41_; + _g_object_unref0 (_tmp40_); + _tmp42_ = entries_iter; + _vala_assert (_tmp42_ != NULL, "entries_iter != null"); + _tmp43_ = entries_iter; + _tmp44_ = gee_iterator_get (_tmp43_); + _tmp45_ = (GeeMapEntry*) _tmp44_; + map_tests_assert_entry (_tmp45_, "three", "three"); + _g_object_unref0 (_tmp45_); + _tmp46_ = gee_sorted_set_iterator_at (keys, "zero"); + _g_object_unref0 (keys_iter); + keys_iter = _tmp46_; + _tmp47_ = keys_iter; + _vala_assert (_tmp47_ == NULL, "keys_iter == null"); + _tmp48_ = map_tests_entry_for ("zero", "zero"); + _tmp49_ = _tmp48_; + _tmp50_ = gee_sorted_set_iterator_at (entries, _tmp49_); + _g_object_unref0 (entries_iter); + entries_iter = _tmp50_; + _g_object_unref0 (_tmp49_); + _tmp51_ = entries_iter; + _vala_assert (_tmp51_ == NULL, "entries_iter == null"); + _g_object_unref0 (entries_iter); + _g_object_unref0 (keys_iter); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_lower (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gpointer _tmp6_ = NULL; + gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + GeeMapEntry* _tmp10_ = NULL; + GeeMapEntry* _tmp11_; + gpointer _tmp12_ = NULL; + GeeMapEntry* _tmp13_; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + GeeMapEntry* _tmp16_ = NULL; + GeeMapEntry* _tmp17_; + gpointer _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeMapEntry* _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + gpointer _tmp24_ = NULL; + GeeMapEntry* _tmp25_; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + GeeMapEntry* _tmp28_ = NULL; + GeeMapEntry* _tmp29_; + gpointer _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + gpointer _tmp32_ = NULL; + gchar* _tmp33_; + GeeMapEntry* _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + gpointer _tmp36_ = NULL; + GeeMapEntry* _tmp37_; + gpointer _tmp38_ = NULL; + gchar* _tmp39_; + GeeMapEntry* _tmp40_ = NULL; + GeeMapEntry* _tmp41_; + gpointer _tmp42_ = NULL; + GeeMapEntry* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeMapEntry* _tmp46_ = NULL; + GeeMapEntry* _tmp47_; + gpointer _tmp48_ = NULL; + GeeMapEntry* _tmp49_; + gpointer _tmp50_ = NULL; + gchar* _tmp51_; + GeeMapEntry* _tmp52_ = NULL; + GeeMapEntry* _tmp53_; + gpointer _tmp54_ = NULL; + GeeMapEntry* _tmp55_; + gpointer _tmp56_ = NULL; + gchar* _tmp57_; + GeeMapEntry* _tmp58_ = NULL; + GeeMapEntry* _tmp59_; + gpointer _tmp60_ = NULL; + GeeMapEntry* _tmp61_; + gpointer _tmp62_ = NULL; + gchar* _tmp63_; + GeeMapEntry* _tmp64_ = NULL; + GeeMapEntry* _tmp65_; + gpointer _tmp66_ = NULL; + GeeMapEntry* _tmp67_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys (test_sorted_map); + _tmp3_ = _tmp2_; + keys = _tmp3_; + _tmp4_ = gee_sorted_map_get_ascending_entries (test_sorted_map); + _tmp5_ = _tmp4_; + entries = _tmp5_; + _tmp6_ = gee_sorted_set_lower (keys, "one"); + _tmp7_ = (gchar*) _tmp6_; + _vala_assert (_tmp7_ == NULL, "keys.lower (\"one\") == null"); + _g_free0 (_tmp7_); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp8_ = gee_sorted_set_lower (keys, "one"); + _tmp9_ = (gchar*) _tmp8_; + _vala_assert (g_strcmp0 (_tmp9_, "four") == 0, "keys.lower (\"one\") == \"four\""); + _g_free0 (_tmp9_); + _tmp10_ = map_tests_entry_for ("one", "one"); + _tmp11_ = _tmp10_; + _tmp12_ = gee_sorted_set_lower (entries, _tmp11_); + _tmp13_ = (GeeMapEntry*) _tmp12_; + map_tests_assert_entry (_tmp13_, "four", "four"); + _g_object_unref0 (_tmp13_); + _g_object_unref0 (_tmp11_); + _tmp14_ = gee_sorted_set_lower (keys, "o"); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "four") == 0, "keys.lower (\"o\") == \"four\""); + _g_free0 (_tmp15_); + _tmp16_ = map_tests_entry_for ("o", "one"); + _tmp17_ = _tmp16_; + _tmp18_ = gee_sorted_set_lower (entries, _tmp17_); + _tmp19_ = (GeeMapEntry*) _tmp18_; + map_tests_assert_entry (_tmp19_, "four", "four"); + _g_object_unref0 (_tmp19_); + _g_object_unref0 (_tmp17_); + _tmp20_ = gee_sorted_set_lower (keys, "two"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "three") == 0, "keys.lower (\"two\") == \"three\""); + _g_free0 (_tmp21_); + _tmp22_ = map_tests_entry_for ("two", "two"); + _tmp23_ = _tmp22_; + _tmp24_ = gee_sorted_set_lower (entries, _tmp23_); + _tmp25_ = (GeeMapEntry*) _tmp24_; + map_tests_assert_entry (_tmp25_, "three", "three"); + _g_object_unref0 (_tmp25_); + _g_object_unref0 (_tmp23_); + _tmp26_ = gee_sorted_set_lower (keys, "t"); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp27_, "six") == 0, "keys.lower (\"t\") == \"six\""); + _g_free0 (_tmp27_); + _tmp28_ = map_tests_entry_for ("t", "two"); + _tmp29_ = _tmp28_; + _tmp30_ = gee_sorted_set_lower (entries, _tmp29_); + _tmp31_ = (GeeMapEntry*) _tmp30_; + map_tests_assert_entry (_tmp31_, "six", "six"); + _g_object_unref0 (_tmp31_); + _g_object_unref0 (_tmp29_); + _tmp32_ = gee_sorted_set_lower (keys, "three"); + _tmp33_ = (gchar*) _tmp32_; + _vala_assert (g_strcmp0 (_tmp33_, "six") == 0, "keys.lower (\"three\") == \"six\""); + _g_free0 (_tmp33_); + _tmp34_ = map_tests_entry_for ("three", "three"); + _tmp35_ = _tmp34_; + _tmp36_ = gee_sorted_set_lower (entries, _tmp35_); + _tmp37_ = (GeeMapEntry*) _tmp36_; + map_tests_assert_entry (_tmp37_, "six", "six"); + _g_object_unref0 (_tmp37_); + _g_object_unref0 (_tmp35_); + _tmp38_ = gee_sorted_set_lower (keys, "four"); + _tmp39_ = (gchar*) _tmp38_; + _vala_assert (g_strcmp0 (_tmp39_, "five") == 0, "keys.lower (\"four\") == \"five\""); + _g_free0 (_tmp39_); + _tmp40_ = map_tests_entry_for ("four", "four"); + _tmp41_ = _tmp40_; + _tmp42_ = gee_sorted_set_lower (entries, _tmp41_); + _tmp43_ = (GeeMapEntry*) _tmp42_; + map_tests_assert_entry (_tmp43_, "five", "five"); + _g_object_unref0 (_tmp43_); + _g_object_unref0 (_tmp41_); + _tmp44_ = gee_sorted_set_lower (keys, "f"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (_tmp45_ == NULL, "keys.lower (\"f\") == null"); + _g_free0 (_tmp45_); + _tmp46_ = map_tests_entry_for ("f", "four"); + _tmp47_ = _tmp46_; + _tmp48_ = gee_sorted_set_lower (entries, _tmp47_); + _tmp49_ = (GeeMapEntry*) _tmp48_; + _vala_assert (_tmp49_ == NULL, "entries.lower (entry_for (\"f\", \"four\")) == null"); + _g_object_unref0 (_tmp49_); + _g_object_unref0 (_tmp47_); + _tmp50_ = gee_sorted_set_lower (keys, "five"); + _tmp51_ = (gchar*) _tmp50_; + _vala_assert (_tmp51_ == NULL, "keys.lower (\"five\") == null"); + _g_free0 (_tmp51_); + _tmp52_ = map_tests_entry_for ("five", "five"); + _tmp53_ = _tmp52_; + _tmp54_ = gee_sorted_set_lower (entries, _tmp53_); + _tmp55_ = (GeeMapEntry*) _tmp54_; + _vala_assert (_tmp55_ == NULL, "entries.lower (entry_for (\"five\", \"five\")) == null"); + _g_object_unref0 (_tmp55_); + _g_object_unref0 (_tmp53_); + _tmp56_ = gee_sorted_set_lower (keys, "six"); + _tmp57_ = (gchar*) _tmp56_; + _vala_assert (g_strcmp0 (_tmp57_, "one") == 0, "keys.lower (\"six\") == \"one\""); + _g_free0 (_tmp57_); + _tmp58_ = map_tests_entry_for ("six", "six"); + _tmp59_ = _tmp58_; + _tmp60_ = gee_sorted_set_lower (entries, _tmp59_); + _tmp61_ = (GeeMapEntry*) _tmp60_; + map_tests_assert_entry (_tmp61_, "one", "one"); + _g_object_unref0 (_tmp61_); + _g_object_unref0 (_tmp59_); + _tmp62_ = gee_sorted_set_lower (keys, "s"); + _tmp63_ = (gchar*) _tmp62_; + _vala_assert (g_strcmp0 (_tmp63_, "one") == 0, "keys.lower (\"s\") == \"one\""); + _g_free0 (_tmp63_); + _tmp64_ = map_tests_entry_for ("s", "six"); + _tmp65_ = _tmp64_; + _tmp66_ = gee_sorted_set_lower (entries, _tmp65_); + _tmp67_ = (GeeMapEntry*) _tmp66_; + map_tests_assert_entry (_tmp67_, "one", "one"); + _g_object_unref0 (_tmp67_); + _g_object_unref0 (_tmp65_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_higher (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gpointer _tmp6_ = NULL; + gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + GeeMapEntry* _tmp10_ = NULL; + GeeMapEntry* _tmp11_; + gpointer _tmp12_ = NULL; + GeeMapEntry* _tmp13_; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + GeeMapEntry* _tmp16_ = NULL; + GeeMapEntry* _tmp17_; + gpointer _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeMapEntry* _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + gpointer _tmp24_ = NULL; + GeeMapEntry* _tmp25_; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + GeeMapEntry* _tmp28_ = NULL; + GeeMapEntry* _tmp29_; + gpointer _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + gpointer _tmp32_ = NULL; + gchar* _tmp33_; + GeeMapEntry* _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + gpointer _tmp36_ = NULL; + GeeMapEntry* _tmp37_; + gpointer _tmp38_ = NULL; + gchar* _tmp39_; + GeeMapEntry* _tmp40_ = NULL; + GeeMapEntry* _tmp41_; + gpointer _tmp42_ = NULL; + GeeMapEntry* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeMapEntry* _tmp46_ = NULL; + GeeMapEntry* _tmp47_; + gpointer _tmp48_ = NULL; + GeeMapEntry* _tmp49_; + gpointer _tmp50_ = NULL; + gchar* _tmp51_; + GeeMapEntry* _tmp52_ = NULL; + GeeMapEntry* _tmp53_; + gpointer _tmp54_ = NULL; + GeeMapEntry* _tmp55_; + gpointer _tmp56_ = NULL; + gchar* _tmp57_; + GeeMapEntry* _tmp58_ = NULL; + GeeMapEntry* _tmp59_; + gpointer _tmp60_ = NULL; + GeeMapEntry* _tmp61_; + gpointer _tmp62_ = NULL; + gchar* _tmp63_; + GeeMapEntry* _tmp64_ = NULL; + GeeMapEntry* _tmp65_; + gpointer _tmp66_ = NULL; + GeeMapEntry* _tmp67_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys (test_sorted_map); + _tmp3_ = _tmp2_; + keys = _tmp3_; + _tmp4_ = gee_sorted_map_get_ascending_entries (test_sorted_map); + _tmp5_ = _tmp4_; + entries = _tmp5_; + _tmp6_ = gee_sorted_set_higher (keys, "one"); + _tmp7_ = (gchar*) _tmp6_; + _vala_assert (_tmp7_ == NULL, "keys.higher (\"one\") == null"); + _g_free0 (_tmp7_); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp8_ = gee_sorted_set_higher (keys, "one"); + _tmp9_ = (gchar*) _tmp8_; + _vala_assert (g_strcmp0 (_tmp9_, "six") == 0, "keys.higher (\"one\") == \"six\""); + _g_free0 (_tmp9_); + _tmp10_ = map_tests_entry_for ("one", "one"); + _tmp11_ = _tmp10_; + _tmp12_ = gee_sorted_set_higher (entries, _tmp11_); + _tmp13_ = (GeeMapEntry*) _tmp12_; + map_tests_assert_entry (_tmp13_, "six", "six"); + _g_object_unref0 (_tmp13_); + _g_object_unref0 (_tmp11_); + _tmp14_ = gee_sorted_set_higher (keys, "o"); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "one") == 0, "keys.higher (\"o\") == \"one\""); + _g_free0 (_tmp15_); + _tmp16_ = map_tests_entry_for ("o", "one"); + _tmp17_ = _tmp16_; + _tmp18_ = gee_sorted_set_higher (entries, _tmp17_); + _tmp19_ = (GeeMapEntry*) _tmp18_; + map_tests_assert_entry (_tmp19_, "one", "one"); + _g_object_unref0 (_tmp19_); + _g_object_unref0 (_tmp17_); + _tmp20_ = gee_sorted_set_higher (keys, "two"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (_tmp21_ == NULL, "keys.higher (\"two\") == null"); + _g_free0 (_tmp21_); + _tmp22_ = map_tests_entry_for ("two", "two"); + _tmp23_ = _tmp22_; + _tmp24_ = gee_sorted_set_higher (entries, _tmp23_); + _tmp25_ = (GeeMapEntry*) _tmp24_; + _vala_assert (_tmp25_ == NULL, "entries.higher (entry_for (\"two\", \"two\")) == null"); + _g_object_unref0 (_tmp25_); + _g_object_unref0 (_tmp23_); + _tmp26_ = gee_sorted_set_higher (keys, "t"); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp27_, "three") == 0, "keys.higher (\"t\") == \"three\""); + _g_free0 (_tmp27_); + _tmp28_ = map_tests_entry_for ("t", "two"); + _tmp29_ = _tmp28_; + _tmp30_ = gee_sorted_set_higher (entries, _tmp29_); + _tmp31_ = (GeeMapEntry*) _tmp30_; + map_tests_assert_entry (_tmp31_, "three", "three"); + _g_object_unref0 (_tmp31_); + _g_object_unref0 (_tmp29_); + _tmp32_ = gee_sorted_set_higher (keys, "three"); + _tmp33_ = (gchar*) _tmp32_; + _vala_assert (g_strcmp0 (_tmp33_, "two") == 0, "keys.higher (\"three\") == \"two\""); + _g_free0 (_tmp33_); + _tmp34_ = map_tests_entry_for ("three", "three"); + _tmp35_ = _tmp34_; + _tmp36_ = gee_sorted_set_higher (entries, _tmp35_); + _tmp37_ = (GeeMapEntry*) _tmp36_; + map_tests_assert_entry (_tmp37_, "two", "two"); + _g_object_unref0 (_tmp37_); + _g_object_unref0 (_tmp35_); + _tmp38_ = gee_sorted_set_higher (keys, "four"); + _tmp39_ = (gchar*) _tmp38_; + _vala_assert (g_strcmp0 (_tmp39_, "one") == 0, "keys.higher (\"four\") == \"one\""); + _g_free0 (_tmp39_); + _tmp40_ = map_tests_entry_for ("four", "four"); + _tmp41_ = _tmp40_; + _tmp42_ = gee_sorted_set_higher (entries, _tmp41_); + _tmp43_ = (GeeMapEntry*) _tmp42_; + map_tests_assert_entry (_tmp43_, "one", "one"); + _g_object_unref0 (_tmp43_); + _g_object_unref0 (_tmp41_); + _tmp44_ = gee_sorted_set_higher (keys, "f"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (g_strcmp0 (_tmp45_, "five") == 0, "keys.higher (\"f\") == \"five\""); + _g_free0 (_tmp45_); + _tmp46_ = map_tests_entry_for ("f", "four"); + _tmp47_ = _tmp46_; + _tmp48_ = gee_sorted_set_higher (entries, _tmp47_); + _tmp49_ = (GeeMapEntry*) _tmp48_; + map_tests_assert_entry (_tmp49_, "five", "five"); + _g_object_unref0 (_tmp49_); + _g_object_unref0 (_tmp47_); + _tmp50_ = gee_sorted_set_higher (keys, "five"); + _tmp51_ = (gchar*) _tmp50_; + _vala_assert (g_strcmp0 (_tmp51_, "four") == 0, "keys.higher (\"five\") == \"four\""); + _g_free0 (_tmp51_); + _tmp52_ = map_tests_entry_for ("five", "five"); + _tmp53_ = _tmp52_; + _tmp54_ = gee_sorted_set_higher (entries, _tmp53_); + _tmp55_ = (GeeMapEntry*) _tmp54_; + map_tests_assert_entry (_tmp55_, "four", "four"); + _g_object_unref0 (_tmp55_); + _g_object_unref0 (_tmp53_); + _tmp56_ = gee_sorted_set_higher (keys, "six"); + _tmp57_ = (gchar*) _tmp56_; + _vala_assert (g_strcmp0 (_tmp57_, "three") == 0, "keys.higher (\"six\") == \"three\""); + _g_free0 (_tmp57_); + _tmp58_ = map_tests_entry_for ("six", "six"); + _tmp59_ = _tmp58_; + _tmp60_ = gee_sorted_set_higher (entries, _tmp59_); + _tmp61_ = (GeeMapEntry*) _tmp60_; + map_tests_assert_entry (_tmp61_, "three", "three"); + _g_object_unref0 (_tmp61_); + _g_object_unref0 (_tmp59_); + _tmp62_ = gee_sorted_set_higher (keys, "s"); + _tmp63_ = (gchar*) _tmp62_; + _vala_assert (g_strcmp0 (_tmp63_, "six") == 0, "keys.higher (\"s\") == \"six\""); + _g_free0 (_tmp63_); + _tmp64_ = map_tests_entry_for ("s", "six"); + _tmp65_ = _tmp64_; + _tmp66_ = gee_sorted_set_higher (entries, _tmp65_); + _tmp67_ = (GeeMapEntry*) _tmp66_; + map_tests_assert_entry (_tmp67_, "six", "six"); + _g_object_unref0 (_tmp67_); + _g_object_unref0 (_tmp65_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_floor (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gpointer _tmp6_ = NULL; + gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + GeeMapEntry* _tmp10_ = NULL; + GeeMapEntry* _tmp11_; + gpointer _tmp12_ = NULL; + GeeMapEntry* _tmp13_; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + GeeMapEntry* _tmp16_ = NULL; + GeeMapEntry* _tmp17_; + gpointer _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeMapEntry* _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + gpointer _tmp24_ = NULL; + GeeMapEntry* _tmp25_; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + GeeMapEntry* _tmp28_ = NULL; + GeeMapEntry* _tmp29_; + gpointer _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + gpointer _tmp32_ = NULL; + gchar* _tmp33_; + GeeMapEntry* _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + gpointer _tmp36_ = NULL; + GeeMapEntry* _tmp37_; + gpointer _tmp38_ = NULL; + gchar* _tmp39_; + GeeMapEntry* _tmp40_ = NULL; + GeeMapEntry* _tmp41_; + gpointer _tmp42_ = NULL; + GeeMapEntry* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeMapEntry* _tmp46_ = NULL; + GeeMapEntry* _tmp47_; + gpointer _tmp48_ = NULL; + GeeMapEntry* _tmp49_; + gpointer _tmp50_ = NULL; + gchar* _tmp51_; + GeeMapEntry* _tmp52_ = NULL; + GeeMapEntry* _tmp53_; + gpointer _tmp54_ = NULL; + GeeMapEntry* _tmp55_; + gpointer _tmp56_ = NULL; + gchar* _tmp57_; + GeeMapEntry* _tmp58_ = NULL; + GeeMapEntry* _tmp59_; + gpointer _tmp60_ = NULL; + GeeMapEntry* _tmp61_; + gpointer _tmp62_ = NULL; + gchar* _tmp63_; + GeeMapEntry* _tmp64_ = NULL; + GeeMapEntry* _tmp65_; + gpointer _tmp66_ = NULL; + GeeMapEntry* _tmp67_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys (test_sorted_map); + _tmp3_ = _tmp2_; + keys = _tmp3_; + _tmp4_ = gee_sorted_map_get_ascending_entries (test_sorted_map); + _tmp5_ = _tmp4_; + entries = _tmp5_; + _tmp6_ = gee_sorted_set_floor (keys, "one"); + _tmp7_ = (gchar*) _tmp6_; + _vala_assert (_tmp7_ == NULL, "keys.floor (\"one\") == null"); + _g_free0 (_tmp7_); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp8_ = gee_sorted_set_floor (keys, "one"); + _tmp9_ = (gchar*) _tmp8_; + _vala_assert (g_strcmp0 (_tmp9_, "one") == 0, "keys.floor (\"one\") == \"one\""); + _g_free0 (_tmp9_); + _tmp10_ = map_tests_entry_for ("one", "one"); + _tmp11_ = _tmp10_; + _tmp12_ = gee_sorted_set_floor (entries, _tmp11_); + _tmp13_ = (GeeMapEntry*) _tmp12_; + map_tests_assert_entry (_tmp13_, "one", "one"); + _g_object_unref0 (_tmp13_); + _g_object_unref0 (_tmp11_); + _tmp14_ = gee_sorted_set_floor (keys, "o"); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "four") == 0, "keys.floor (\"o\") == \"four\""); + _g_free0 (_tmp15_); + _tmp16_ = map_tests_entry_for ("o", "one"); + _tmp17_ = _tmp16_; + _tmp18_ = gee_sorted_set_floor (entries, _tmp17_); + _tmp19_ = (GeeMapEntry*) _tmp18_; + map_tests_assert_entry (_tmp19_, "four", "four"); + _g_object_unref0 (_tmp19_); + _g_object_unref0 (_tmp17_); + _tmp20_ = gee_sorted_set_floor (keys, "two"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "two") == 0, "keys.floor (\"two\") == \"two\""); + _g_free0 (_tmp21_); + _tmp22_ = map_tests_entry_for ("two", "two"); + _tmp23_ = _tmp22_; + _tmp24_ = gee_sorted_set_floor (entries, _tmp23_); + _tmp25_ = (GeeMapEntry*) _tmp24_; + map_tests_assert_entry (_tmp25_, "two", "two"); + _g_object_unref0 (_tmp25_); + _g_object_unref0 (_tmp23_); + _tmp26_ = gee_sorted_set_floor (keys, "t"); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp27_, "six") == 0, "keys.floor (\"t\") == \"six\""); + _g_free0 (_tmp27_); + _tmp28_ = map_tests_entry_for ("t", "two"); + _tmp29_ = _tmp28_; + _tmp30_ = gee_sorted_set_floor (entries, _tmp29_); + _tmp31_ = (GeeMapEntry*) _tmp30_; + map_tests_assert_entry (_tmp31_, "six", "six"); + _g_object_unref0 (_tmp31_); + _g_object_unref0 (_tmp29_); + _tmp32_ = gee_sorted_set_floor (keys, "three"); + _tmp33_ = (gchar*) _tmp32_; + _vala_assert (g_strcmp0 (_tmp33_, "three") == 0, "keys.floor (\"three\") == \"three\""); + _g_free0 (_tmp33_); + _tmp34_ = map_tests_entry_for ("three", "three"); + _tmp35_ = _tmp34_; + _tmp36_ = gee_sorted_set_floor (entries, _tmp35_); + _tmp37_ = (GeeMapEntry*) _tmp36_; + map_tests_assert_entry (_tmp37_, "three", "three"); + _g_object_unref0 (_tmp37_); + _g_object_unref0 (_tmp35_); + _tmp38_ = gee_sorted_set_floor (keys, "four"); + _tmp39_ = (gchar*) _tmp38_; + _vala_assert (g_strcmp0 (_tmp39_, "four") == 0, "keys.floor (\"four\") == \"four\""); + _g_free0 (_tmp39_); + _tmp40_ = map_tests_entry_for ("four", "four"); + _tmp41_ = _tmp40_; + _tmp42_ = gee_sorted_set_floor (entries, _tmp41_); + _tmp43_ = (GeeMapEntry*) _tmp42_; + map_tests_assert_entry (_tmp43_, "four", "four"); + _g_object_unref0 (_tmp43_); + _g_object_unref0 (_tmp41_); + _tmp44_ = gee_sorted_set_floor (keys, "f"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (_tmp45_ == NULL, "keys.floor (\"f\") == null"); + _g_free0 (_tmp45_); + _tmp46_ = map_tests_entry_for ("f", "four"); + _tmp47_ = _tmp46_; + _tmp48_ = gee_sorted_set_floor (entries, _tmp47_); + _tmp49_ = (GeeMapEntry*) _tmp48_; + _vala_assert (_tmp49_ == NULL, "entries.floor (entry_for (\"f\", \"four\")) == null"); + _g_object_unref0 (_tmp49_); + _g_object_unref0 (_tmp47_); + _tmp50_ = gee_sorted_set_floor (keys, "five"); + _tmp51_ = (gchar*) _tmp50_; + _vala_assert (g_strcmp0 (_tmp51_, "five") == 0, "keys.floor (\"five\") == \"five\""); + _g_free0 (_tmp51_); + _tmp52_ = map_tests_entry_for ("five", "five"); + _tmp53_ = _tmp52_; + _tmp54_ = gee_sorted_set_floor (entries, _tmp53_); + _tmp55_ = (GeeMapEntry*) _tmp54_; + map_tests_assert_entry (_tmp55_, "five", "five"); + _g_object_unref0 (_tmp55_); + _g_object_unref0 (_tmp53_); + _tmp56_ = gee_sorted_set_floor (keys, "six"); + _tmp57_ = (gchar*) _tmp56_; + _vala_assert (g_strcmp0 (_tmp57_, "six") == 0, "keys.floor (\"six\") == \"six\""); + _g_free0 (_tmp57_); + _tmp58_ = map_tests_entry_for ("six", "six"); + _tmp59_ = _tmp58_; + _tmp60_ = gee_sorted_set_floor (entries, _tmp59_); + _tmp61_ = (GeeMapEntry*) _tmp60_; + map_tests_assert_entry (_tmp61_, "six", "six"); + _g_object_unref0 (_tmp61_); + _g_object_unref0 (_tmp59_); + _tmp62_ = gee_sorted_set_floor (keys, "s"); + _tmp63_ = (gchar*) _tmp62_; + _vala_assert (g_strcmp0 (_tmp63_, "one") == 0, "keys.floor (\"s\") == \"one\""); + _g_free0 (_tmp63_); + _tmp64_ = map_tests_entry_for ("s", "six"); + _tmp65_ = _tmp64_; + _tmp66_ = gee_sorted_set_floor (entries, _tmp65_); + _tmp67_ = (GeeMapEntry*) _tmp66_; + map_tests_assert_entry (_tmp67_, "one", "one"); + _g_object_unref0 (_tmp67_); + _g_object_unref0 (_tmp65_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +void gee_sorted_map_tests_test_ceil (GeeSortedMapTests* self) { + GeeMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* test_sorted_map; + GeeSortedSet* _tmp2_; + GeeSortedSet* _tmp3_; + GeeSortedSet* keys; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gpointer _tmp6_ = NULL; + gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + GeeMapEntry* _tmp10_ = NULL; + GeeMapEntry* _tmp11_; + gpointer _tmp12_ = NULL; + GeeMapEntry* _tmp13_; + gpointer _tmp14_ = NULL; + gchar* _tmp15_; + GeeMapEntry* _tmp16_ = NULL; + GeeMapEntry* _tmp17_; + gpointer _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeMapEntry* _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + gpointer _tmp24_ = NULL; + GeeMapEntry* _tmp25_; + gpointer _tmp26_ = NULL; + gchar* _tmp27_; + GeeMapEntry* _tmp28_ = NULL; + GeeMapEntry* _tmp29_; + gpointer _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + gpointer _tmp32_ = NULL; + gchar* _tmp33_; + GeeMapEntry* _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + gpointer _tmp36_ = NULL; + GeeMapEntry* _tmp37_; + gpointer _tmp38_ = NULL; + gchar* _tmp39_; + GeeMapEntry* _tmp40_ = NULL; + GeeMapEntry* _tmp41_; + gpointer _tmp42_ = NULL; + GeeMapEntry* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeMapEntry* _tmp46_ = NULL; + GeeMapEntry* _tmp47_; + gpointer _tmp48_ = NULL; + GeeMapEntry* _tmp49_; + gpointer _tmp50_ = NULL; + gchar* _tmp51_; + GeeMapEntry* _tmp52_ = NULL; + GeeMapEntry* _tmp53_; + gpointer _tmp54_ = NULL; + GeeMapEntry* _tmp55_; + gpointer _tmp56_ = NULL; + gchar* _tmp57_; + GeeMapEntry* _tmp58_ = NULL; + GeeMapEntry* _tmp59_; + gpointer _tmp60_ = NULL; + GeeMapEntry* _tmp61_; + gpointer _tmp62_ = NULL; + gchar* _tmp63_; + GeeMapEntry* _tmp64_ = NULL; + GeeMapEntry* _tmp65_; + gpointer _tmp66_ = NULL; + GeeMapEntry* _tmp67_; + g_return_if_fail (self != NULL); + _tmp0_ = ((MapTests*) self)->test_map; + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp0_) : NULL); + test_sorted_map = _tmp1_; + _tmp2_ = gee_sorted_map_get_ascending_keys (test_sorted_map); + _tmp3_ = _tmp2_; + keys = _tmp3_; + _tmp4_ = gee_sorted_map_get_ascending_entries (test_sorted_map); + _tmp5_ = _tmp4_; + entries = _tmp5_; + _tmp6_ = gee_sorted_set_ceil (keys, "one"); + _tmp7_ = (gchar*) _tmp6_; + _vala_assert (_tmp7_ == NULL, "keys.ceil (\"one\") == null"); + _g_free0 (_tmp7_); + gee_map_set ((GeeMap*) test_sorted_map, "one", "one"); + gee_map_set ((GeeMap*) test_sorted_map, "two", "two"); + gee_map_set ((GeeMap*) test_sorted_map, "three", "three"); + gee_map_set ((GeeMap*) test_sorted_map, "four", "four"); + gee_map_set ((GeeMap*) test_sorted_map, "five", "five"); + gee_map_set ((GeeMap*) test_sorted_map, "six", "six"); + _tmp8_ = gee_sorted_set_ceil (keys, "one"); + _tmp9_ = (gchar*) _tmp8_; + _vala_assert (g_strcmp0 (_tmp9_, "one") == 0, "keys.ceil (\"one\") == \"one\""); + _g_free0 (_tmp9_); + _tmp10_ = map_tests_entry_for ("one", "one"); + _tmp11_ = _tmp10_; + _tmp12_ = gee_sorted_set_ceil (entries, _tmp11_); + _tmp13_ = (GeeMapEntry*) _tmp12_; + map_tests_assert_entry (_tmp13_, "one", "one"); + _g_object_unref0 (_tmp13_); + _g_object_unref0 (_tmp11_); + _tmp14_ = gee_sorted_set_ceil (keys, "o"); + _tmp15_ = (gchar*) _tmp14_; + _vala_assert (g_strcmp0 (_tmp15_, "one") == 0, "keys.ceil (\"o\") == \"one\""); + _g_free0 (_tmp15_); + _tmp16_ = map_tests_entry_for ("o", "one"); + _tmp17_ = _tmp16_; + _tmp18_ = gee_sorted_set_ceil (entries, _tmp17_); + _tmp19_ = (GeeMapEntry*) _tmp18_; + map_tests_assert_entry (_tmp19_, "one", "one"); + _g_object_unref0 (_tmp19_); + _g_object_unref0 (_tmp17_); + _tmp20_ = gee_sorted_set_ceil (keys, "two"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "two") == 0, "keys.ceil (\"two\") == \"two\""); + _g_free0 (_tmp21_); + _tmp22_ = map_tests_entry_for ("two", "two"); + _tmp23_ = _tmp22_; + _tmp24_ = gee_sorted_set_ceil (entries, _tmp23_); + _tmp25_ = (GeeMapEntry*) _tmp24_; + map_tests_assert_entry (_tmp25_, "two", "two"); + _g_object_unref0 (_tmp25_); + _g_object_unref0 (_tmp23_); + _tmp26_ = gee_sorted_set_ceil (keys, "t"); + _tmp27_ = (gchar*) _tmp26_; + _vala_assert (g_strcmp0 (_tmp27_, "three") == 0, "keys.ceil (\"t\") == \"three\""); + _g_free0 (_tmp27_); + _tmp28_ = map_tests_entry_for ("t", "two"); + _tmp29_ = _tmp28_; + _tmp30_ = gee_sorted_set_ceil (entries, _tmp29_); + _tmp31_ = (GeeMapEntry*) _tmp30_; + map_tests_assert_entry (_tmp31_, "three", "three"); + _g_object_unref0 (_tmp31_); + _g_object_unref0 (_tmp29_); + _tmp32_ = gee_sorted_set_ceil (keys, "three"); + _tmp33_ = (gchar*) _tmp32_; + _vala_assert (g_strcmp0 (_tmp33_, "three") == 0, "keys.ceil (\"three\") == \"three\""); + _g_free0 (_tmp33_); + _tmp34_ = map_tests_entry_for ("three", "three"); + _tmp35_ = _tmp34_; + _tmp36_ = gee_sorted_set_ceil (entries, _tmp35_); + _tmp37_ = (GeeMapEntry*) _tmp36_; + map_tests_assert_entry (_tmp37_, "three", "three"); + _g_object_unref0 (_tmp37_); + _g_object_unref0 (_tmp35_); + _tmp38_ = gee_sorted_set_ceil (keys, "four"); + _tmp39_ = (gchar*) _tmp38_; + _vala_assert (g_strcmp0 (_tmp39_, "four") == 0, "keys.ceil (\"four\") == \"four\""); + _g_free0 (_tmp39_); + _tmp40_ = map_tests_entry_for ("four", "four"); + _tmp41_ = _tmp40_; + _tmp42_ = gee_sorted_set_ceil (entries, _tmp41_); + _tmp43_ = (GeeMapEntry*) _tmp42_; + map_tests_assert_entry (_tmp43_, "four", "four"); + _g_object_unref0 (_tmp43_); + _g_object_unref0 (_tmp41_); + _tmp44_ = gee_sorted_set_ceil (keys, "f"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (g_strcmp0 (_tmp45_, "five") == 0, "keys.ceil (\"f\") == \"five\""); + _g_free0 (_tmp45_); + _tmp46_ = map_tests_entry_for ("f", "four"); + _tmp47_ = _tmp46_; + _tmp48_ = gee_sorted_set_ceil (entries, _tmp47_); + _tmp49_ = (GeeMapEntry*) _tmp48_; + map_tests_assert_entry (_tmp49_, "five", "five"); + _g_object_unref0 (_tmp49_); + _g_object_unref0 (_tmp47_); + _tmp50_ = gee_sorted_set_ceil (keys, "five"); + _tmp51_ = (gchar*) _tmp50_; + _vala_assert (g_strcmp0 (_tmp51_, "five") == 0, "keys.ceil (\"five\") == \"five\""); + _g_free0 (_tmp51_); + _tmp52_ = map_tests_entry_for ("five", "five"); + _tmp53_ = _tmp52_; + _tmp54_ = gee_sorted_set_ceil (entries, _tmp53_); + _tmp55_ = (GeeMapEntry*) _tmp54_; + map_tests_assert_entry (_tmp55_, "five", "five"); + _g_object_unref0 (_tmp55_); + _g_object_unref0 (_tmp53_); + _tmp56_ = gee_sorted_set_ceil (keys, "six"); + _tmp57_ = (gchar*) _tmp56_; + _vala_assert (g_strcmp0 (_tmp57_, "six") == 0, "keys.ceil (\"six\") == \"six\""); + _g_free0 (_tmp57_); + _tmp58_ = map_tests_entry_for ("six", "six"); + _tmp59_ = _tmp58_; + _tmp60_ = gee_sorted_set_ceil (entries, _tmp59_); + _tmp61_ = (GeeMapEntry*) _tmp60_; + map_tests_assert_entry (_tmp61_, "six", "six"); + _g_object_unref0 (_tmp61_); + _g_object_unref0 (_tmp59_); + _tmp62_ = gee_sorted_set_ceil (keys, "s"); + _tmp63_ = (gchar*) _tmp62_; + _vala_assert (g_strcmp0 (_tmp63_, "six") == 0, "keys.ceil (\"s\") == \"six\""); + _g_free0 (_tmp63_); + _tmp64_ = map_tests_entry_for ("s", "six"); + _tmp65_ = _tmp64_; + _tmp66_ = gee_sorted_set_ceil (entries, _tmp65_); + _tmp67_ = (GeeMapEntry*) _tmp66_; + map_tests_assert_entry (_tmp67_, "six", "six"); + _g_object_unref0 (_tmp67_); + _g_object_unref0 (_tmp65_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + _g_object_unref0 (test_sorted_map); +} + + +const gchar* gee_sorted_map_tests_sub_map_tests_type_to_string (GeeSortedMapTestsSubMapTestsType self) { + const gchar* result = NULL; + switch (self) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + result = "Head"; + return result; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + result = "Tail"; + return result; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + result = "Range"; + return result; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + result = "Empty"; + return result; + } + default: + { + g_assert_not_reached (); + } + } +} + + +GType gee_sorted_map_tests_sub_map_tests_type_get_type (void) { + static volatile gsize gee_sorted_map_tests_sub_map_tests_type_type_id__volatile = 0; + if (g_once_init_enter (&gee_sorted_map_tests_sub_map_tests_type_type_id__volatile)) { + static const GEnumValue values[] = {{GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD, "GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD", "head"}, {GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL, "GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL", "tail"}, {GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB, "GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB", "sub"}, {GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY, "GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY", "empty"}, {0, NULL, NULL}}; + GType gee_sorted_map_tests_sub_map_tests_type_type_id; + gee_sorted_map_tests_sub_map_tests_type_type_id = g_enum_register_static ("GeeSortedMapTestsSubMapTestsType", values); + g_once_init_leave (&gee_sorted_map_tests_sub_map_tests_type_type_id__volatile, gee_sorted_map_tests_sub_map_tests_type_type_id); + } + return gee_sorted_map_tests_sub_map_tests_type_type_id__volatile; +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_keys_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_keys (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_values_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_values (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_entries_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_entries (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_get_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_get (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_set_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_set (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_unset_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_unset (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_clear_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_clear (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_iterators_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_iterators (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_boundaries_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_boundaries (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_lower_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_lower (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_higher_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_higher (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_floor_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_floor (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_ceil_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_ceil (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_iterator_at_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_iterator_at (self); +} + + +static void _gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets_gee_test_case_test_method (gpointer self) { + gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets (self); +} + + +GeeSortedMapTestsSubMapTests* gee_sorted_map_tests_sub_map_tests_construct (GType object_type, GeeSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type) { + GeeSortedMapTestsSubMapTests * self = NULL; + GeeSortedMapTestsSubMapTestsType _tmp0_; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_; + GeeSortedMapTests* _tmp4_; + GeeSortedMapTests* _tmp5_; + GeeSortedMapTestsSubMapTestsType _tmp6_; + g_return_val_if_fail (test != NULL, NULL); + _tmp0_ = type; + _tmp1_ = gee_sorted_map_tests_sub_map_tests_type_to_string (_tmp0_); + _tmp2_ = g_strdup_printf ("%s Submap", _tmp1_); + _tmp3_ = _tmp2_; + self = (GeeSortedMapTestsSubMapTests*) gee_test_case_construct (object_type, _tmp3_); + _g_free0 (_tmp3_); + _tmp4_ = test; + _tmp5_ = _g_object_ref0 (_tmp4_); + _g_object_unref0 (self->priv->test); + self->priv->test = _tmp5_; + _tmp6_ = type; + self->priv->type = _tmp6_; + gee_test_case_add_test ((GeeTestCase*) self, "[Map] has_key, size and is_empty", _gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] keys", _gee_sorted_map_tests_sub_map_tests_test_keys_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] values", _gee_sorted_map_tests_sub_map_tests_test_values_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] entries", _gee_sorted_map_tests_sub_map_tests_test_entries_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] get", _gee_sorted_map_tests_sub_map_tests_test_get_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] set", _gee_sorted_map_tests_sub_map_tests_test_set_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] unset", _gee_sorted_map_tests_sub_map_tests_test_unset_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] clear", _gee_sorted_map_tests_sub_map_tests_test_clear_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Map] iterators", _gee_sorted_map_tests_sub_map_tests_test_iterators_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] boundaries", _gee_sorted_map_tests_sub_map_tests_test_boundaries_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] lower", _gee_sorted_map_tests_sub_map_tests_test_lower_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] higher", _gee_sorted_map_tests_sub_map_tests_test_higher_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] floor", _gee_sorted_map_tests_sub_map_tests_test_floor_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] ceil", _gee_sorted_map_tests_sub_map_tests_test_ceil_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] iterator_at", _gee_sorted_map_tests_sub_map_tests_test_iterator_at_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedMap] submap and subsets", _gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets_gee_test_case_test_method, g_object_ref (self), g_object_unref); + return self; +} + + +GeeSortedMapTestsSubMapTests* gee_sorted_map_tests_sub_map_tests_new (GeeSortedMapTests* test, GeeSortedMapTestsSubMapTestsType type) { + return gee_sorted_map_tests_sub_map_tests_construct (GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, test, type); +} + + +static void gee_sorted_map_tests_sub_map_tests_real_set_up (GeeTestCase* base) { + GeeSortedMapTestsSubMapTests * self; + GeeSortedMapTests* _tmp0_; + GeeSortedMapTests* _tmp1_; + GeeMap* _tmp2_; + GeeSortedMap* _tmp3_; + GeeSortedMapTestsSubMapTestsType _tmp4_; + self = (GeeSortedMapTestsSubMapTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_set_up ((GeeTestCase*) _tmp0_); + _tmp1_ = self->priv->test; + _tmp2_ = ((MapTests*) _tmp1_)->test_map; + _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GEE_TYPE_SORTED_MAP) ? ((GeeSortedMap*) _tmp2_) : NULL); + _g_object_unref0 (self->priv->master); + self->priv->master = _tmp3_; + _tmp4_ = self->priv->type; + switch (_tmp4_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedMap* _tmp5_; + GeeSortedMap* _tmp6_ = NULL; + _tmp5_ = self->priv->master; + _tmp6_ = gee_sorted_map_head_map (_tmp5_, "one"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = _tmp6_; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedMap* _tmp7_; + GeeSortedMap* _tmp8_ = NULL; + _tmp7_ = self->priv->master; + _tmp8_ = gee_sorted_map_tail_map (_tmp7_, "six"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = _tmp8_; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedMap* _tmp9_; + GeeSortedMap* _tmp10_ = NULL; + _tmp9_ = self->priv->master; + _tmp10_ = gee_sorted_map_sub_map (_tmp9_, "four", "three"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = _tmp10_; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedMap* _tmp11_; + GeeSortedMap* _tmp12_ = NULL; + _tmp11_ = self->priv->master; + _tmp12_ = gee_sorted_map_sub_map (_tmp11_, "three", "four"); + _g_object_unref0 (self->priv->submap); + self->priv->submap = _tmp12_; + break; + } + default: + { + g_assert_not_reached (); + } + } +} + + +static void gee_sorted_map_tests_sub_map_tests_real_tear_down (GeeTestCase* base) { + GeeSortedMapTestsSubMapTests * self; + GeeSortedMapTests* _tmp0_; + self = (GeeSortedMapTestsSubMapTests*) base; + _tmp0_ = self->priv->test; + gee_test_case_tear_down ((GeeTestCase*) _tmp0_); +} + + +void gee_sorted_map_tests_sub_map_tests_set_default_values (GeeSortedMapTestsSubMapTests* self, gchar*** contains, int* contains_length1, gchar*** not_contains, int* not_contains_length1) { + gchar** _vala_contains = NULL; + int _vala_contains_length1 = 0; + gchar** _vala_not_contains = NULL; + int _vala_not_contains_length1 = 0; + GeeSortedMap* _tmp0_; + GeeSortedMap* _tmp1_; + GeeSortedMap* _tmp2_; + GeeSortedMap* _tmp3_; + GeeSortedMap* _tmp4_; + GeeSortedMap* _tmp5_; + GeeSortedMapTestsSubMapTestsType _tmp6_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp0_, "one", "one"); + _tmp1_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp1_, "two", "two"); + _tmp2_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp2_, "three", "three"); + _tmp3_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp3_, "four", "four"); + _tmp4_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp4_, "five", "five"); + _tmp5_ = self->priv->master; + gee_map_set ((GeeMap*) _tmp5_, "six", "six"); + _tmp6_ = self->priv->type; + switch (_tmp6_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + gchar* _tmp7_; + gchar* _tmp8_; + gchar** _tmp9_ = NULL; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar** _tmp14_ = NULL; + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("four"); + _tmp9_ = g_new0 (gchar*, 2 + 1); + _tmp9_[0] = _tmp7_; + _tmp9_[1] = _tmp8_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp9_; + _vala_contains_length1 = 2; + _tmp10_ = g_strdup ("one"); + _tmp11_ = g_strdup ("two"); + _tmp12_ = g_strdup ("three"); + _tmp13_ = g_strdup ("six"); + _tmp14_ = g_new0 (gchar*, 4 + 1); + _tmp14_[0] = _tmp10_; + _tmp14_[1] = _tmp11_; + _tmp14_[2] = _tmp12_; + _tmp14_[3] = _tmp13_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp14_; + _vala_not_contains_length1 = 4; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + gchar* _tmp15_; + gchar* _tmp16_; + gchar* _tmp17_; + gchar** _tmp18_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; + gchar** _tmp22_ = NULL; + _tmp15_ = g_strdup ("six"); + _tmp16_ = g_strdup ("three"); + _tmp17_ = g_strdup ("two"); + _tmp18_ = g_new0 (gchar*, 3 + 1); + _tmp18_[0] = _tmp15_; + _tmp18_[1] = _tmp16_; + _tmp18_[2] = _tmp17_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp18_; + _vala_contains_length1 = 3; + _tmp19_ = g_strdup ("one"); + _tmp20_ = g_strdup ("four"); + _tmp21_ = g_strdup ("five"); + _tmp22_ = g_new0 (gchar*, 3 + 1); + _tmp22_[0] = _tmp19_; + _tmp22_[1] = _tmp20_; + _tmp22_[2] = _tmp21_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp22_; + _vala_not_contains_length1 = 3; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + gchar* _tmp23_; + gchar* _tmp24_; + gchar* _tmp25_; + gchar** _tmp26_ = NULL; + gchar* _tmp27_; + gchar* _tmp28_; + gchar* _tmp29_; + gchar** _tmp30_ = NULL; + _tmp23_ = g_strdup ("four"); + _tmp24_ = g_strdup ("one"); + _tmp25_ = g_strdup ("six"); + _tmp26_ = g_new0 (gchar*, 3 + 1); + _tmp26_[0] = _tmp23_; + _tmp26_[1] = _tmp24_; + _tmp26_[2] = _tmp25_; + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp26_; + _vala_contains_length1 = 3; + _tmp27_ = g_strdup ("two"); + _tmp28_ = g_strdup ("three"); + _tmp29_ = g_strdup ("five"); + _tmp30_ = g_new0 (gchar*, 3 + 1); + _tmp30_[0] = _tmp27_; + _tmp30_[1] = _tmp28_; + _tmp30_[2] = _tmp29_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp30_; + _vala_not_contains_length1 = 3; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + gchar** _tmp31_ = NULL; + gchar* _tmp32_; + gchar* _tmp33_; + gchar* _tmp34_; + gchar* _tmp35_; + gchar* _tmp36_; + gchar* _tmp37_; + gchar** _tmp38_ = NULL; + _tmp31_ = g_new0 (gchar*, 0 + 1); + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_contains = _tmp31_; + _vala_contains_length1 = 0; + _tmp32_ = g_strdup ("one"); + _tmp33_ = g_strdup ("two"); + _tmp34_ = g_strdup ("three"); + _tmp35_ = g_strdup ("four"); + _tmp36_ = g_strdup ("five"); + _tmp37_ = g_strdup ("six"); + _tmp38_ = g_new0 (gchar*, 6 + 1); + _tmp38_[0] = _tmp32_; + _tmp38_[1] = _tmp33_; + _tmp38_[2] = _tmp34_; + _tmp38_[3] = _tmp35_; + _tmp38_[4] = _tmp36_; + _tmp38_[5] = _tmp37_; + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + _vala_not_contains = _tmp38_; + _vala_not_contains_length1 = 6; + break; + } + default: + { + g_assert_not_reached (); + } + } + if (contains) { + *contains = _vala_contains; + } else { + _vala_contains = (_vala_array_free (_vala_contains, _vala_contains_length1, (GDestroyNotify) g_free), NULL); + } + if (contains_length1) { + *contains_length1 = _vala_contains_length1; + } + if (not_contains) { + *not_contains = _vala_not_contains; + } else { + _vala_not_contains = (_vala_array_free (_vala_not_contains, _vala_not_contains_length1, (GDestroyNotify) g_free), NULL); + } + if (not_contains_length1) { + *not_contains_length1 = _vala_not_contains_length1; + } +} + + +void gee_sorted_map_tests_sub_map_tests_test_has_key_size_is_empty (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp0_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gint _tmp3_ = 0; + GeeSortedMap* _tmp4_; + gint _tmp5_; + gint _tmp6_; + gchar** _tmp7_; + gint _tmp7__length1; + GeeSortedMap* _tmp8_; + gboolean _tmp9_; + gboolean _tmp10_; + gchar** _tmp11_; + gint _tmp11__length1; + gchar** _tmp12_; + gint _tmp12__length1; + gchar** _tmp21_; + gint _tmp21__length1; + g_return_if_fail (self != NULL); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp0_; + contains_length1 = _tmp1_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp2_; + not_contains_length1 = _tmp3_; + _not_contains_size_ = not_contains_length1; + _tmp4_ = self->priv->submap; + _tmp5_ = gee_map_get_size ((GeeMap*) _tmp4_); + _tmp6_ = _tmp5_; + _tmp7_ = contains; + _tmp7__length1 = contains_length1; + _vala_assert (_tmp6_ == _tmp7__length1, "submap.size == contains.length"); + _tmp8_ = self->priv->submap; + _tmp9_ = gee_map_get_is_empty ((GeeMap*) _tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = contains; + _tmp11__length1 = contains_length1; + _vala_assert (_tmp10_ == (_tmp11__length1 == 0), "submap.is_empty == (contains.length == 0)"); + _tmp12_ = contains; + _tmp12__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp12_; + s_collection_length1 = _tmp12__length1; + for (s_it = 0; s_it < _tmp12__length1; s_it = s_it + 1) { + gchar* _tmp13_; + gchar* s = NULL; + _tmp13_ = g_strdup (s_collection[s_it]); + s = _tmp13_; + { + GeeSortedMap* _tmp14_; + const gchar* _tmp15_; + gboolean _tmp16_ = FALSE; + GeeSortedMap* _tmp17_; + const gchar* _tmp18_; + const gchar* _tmp19_; + gboolean _tmp20_ = FALSE; + _tmp14_ = self->priv->submap; + _tmp15_ = s; + _tmp16_ = gee_map_has_key ((GeeMap*) _tmp14_, _tmp15_); + _vala_assert (_tmp16_, "submap.has_key (s)"); + _tmp17_ = self->priv->submap; + _tmp18_ = s; + _tmp19_ = s; + _tmp20_ = gee_map_has ((GeeMap*) _tmp17_, _tmp18_, _tmp19_); + _vala_assert (_tmp20_, "submap.has (s, s)"); + _g_free0 (s); + } + } + } + _tmp21_ = not_contains; + _tmp21__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp21_; + s_collection_length1 = _tmp21__length1; + for (s_it = 0; s_it < _tmp21__length1; s_it = s_it + 1) { + gchar* _tmp22_; + gchar* s = NULL; + _tmp22_ = g_strdup (s_collection[s_it]); + s = _tmp22_; + { + GeeSortedMap* _tmp23_; + const gchar* _tmp24_; + gboolean _tmp25_ = FALSE; + GeeSortedMap* _tmp26_; + const gchar* _tmp27_; + const gchar* _tmp28_; + gboolean _tmp29_ = FALSE; + _tmp23_ = self->priv->submap; + _tmp24_ = s; + _tmp25_ = gee_map_has_key ((GeeMap*) _tmp23_, _tmp24_); + _vala_assert (!_tmp25_, "!submap.has_key (s)"); + _tmp26_ = self->priv->submap; + _tmp27_ = s; + _tmp28_ = s; + _tmp29_ = gee_map_has ((GeeMap*) _tmp26_, _tmp27_, _tmp28_); + _vala_assert (!_tmp29_, "!submap.has (s, s)"); + _g_free0 (s); + } + } + } + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_get (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp0_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gint _tmp3_ = 0; + gchar** _tmp4_; + gint _tmp4__length1; + g_return_if_fail (self != NULL); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp0_; + contains_length1 = _tmp1_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp2_; + not_contains_length1 = _tmp3_; + _not_contains_size_ = not_contains_length1; + _tmp4_ = contains; + _tmp4__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp4_; + s_collection_length1 = _tmp4__length1; + for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) { + gchar* _tmp5_; + gchar* s = NULL; + _tmp5_ = g_strdup (s_collection[s_it]); + s = _tmp5_; + { + GeeSortedMap* _tmp6_; + const gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gchar* _tmp9_; + const gchar* _tmp10_; + _tmp6_ = self->priv->submap; + _tmp7_ = s; + _tmp8_ = gee_map_get ((GeeMap*) _tmp6_, _tmp7_); + _tmp9_ = (gchar*) _tmp8_; + _tmp10_ = s; + _vala_assert (g_strcmp0 (_tmp9_, _tmp10_) == 0, "submap.get (s) == s"); + _g_free0 (_tmp9_); + _g_free0 (s); + } + } + } + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_keys (GeeSortedMapTestsSubMapTests* self) { + GeeSortedMap* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* keys; + GeeSet* _tmp3_; + gint _tmp4_; + gint _tmp5_; + GeeSet* _tmp6_; + gboolean _tmp7_; + gboolean _tmp8_; + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp9_ = NULL; + gint _tmp10_ = 0; + gchar** _tmp11_ = NULL; + gint _tmp12_ = 0; + GeeSet* _tmp13_; + gint _tmp14_; + gint _tmp15_; + gchar** _tmp16_; + gint _tmp16__length1; + gchar** _tmp17_; + gint _tmp17__length1; + gchar** _tmp22_; + gint _tmp22__length1; + gboolean _tmp27_ = FALSE; + gboolean _tmp29_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_map_get_keys ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = keys; + _tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_); + _tmp5_ = _tmp4_; + _vala_assert (_tmp5_ == 0, "keys.size == 0"); + _tmp6_ = keys; + _tmp7_ = gee_collection_get_is_empty ((GeeCollection*) _tmp6_); + _tmp8_ = _tmp7_; + _vala_assert (_tmp8_, "keys.is_empty"); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp9_, &_tmp10_, &_tmp11_, &_tmp12_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp9_; + contains_length1 = _tmp10_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp11_; + not_contains_length1 = _tmp12_; + _not_contains_size_ = not_contains_length1; + _tmp13_ = keys; + _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = contains; + _tmp16__length1 = contains_length1; + _vala_assert (_tmp15_ == _tmp16__length1, "keys.size == contains.length"); + _tmp17_ = contains; + _tmp17__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp17_; + s_collection_length1 = _tmp17__length1; + for (s_it = 0; s_it < _tmp17__length1; s_it = s_it + 1) { + gchar* _tmp18_; + gchar* s = NULL; + _tmp18_ = g_strdup (s_collection[s_it]); + s = _tmp18_; + { + GeeSet* _tmp19_; + const gchar* _tmp20_; + gboolean _tmp21_ = FALSE; + _tmp19_ = keys; + _tmp20_ = s; + _tmp21_ = gee_collection_contains ((GeeCollection*) _tmp19_, _tmp20_); + _vala_assert (_tmp21_, "keys.contains (s)"); + _g_free0 (s); + } + } + } + _tmp22_ = not_contains; + _tmp22__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp22_; + s_collection_length1 = _tmp22__length1; + for (s_it = 0; s_it < _tmp22__length1; s_it = s_it + 1) { + gchar* _tmp23_; + gchar* s = NULL; + _tmp23_ = g_strdup (s_collection[s_it]); + s = _tmp23_; + { + GeeSet* _tmp24_; + const gchar* _tmp25_; + gboolean _tmp26_ = FALSE; + _tmp24_ = keys; + _tmp25_ = s; + _tmp26_ = gee_collection_contains ((GeeCollection*) _tmp24_, _tmp25_); + _vala_assert (!_tmp26_, "!keys.contains (s)"); + _g_free0 (s); + } + } + } + _tmp27_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp27_) { + GeeSet* _tmp28_; + _tmp28_ = keys; + gee_collection_add ((GeeCollection*) _tmp28_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + _tmp29_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp29_) { + GeeSet* _tmp30_; + _tmp30_ = keys; + gee_collection_remove ((GeeCollection*) _tmp30_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + _g_object_unref0 (keys); +} + + +void gee_sorted_map_tests_sub_map_tests_test_values (GeeSortedMapTestsSubMapTests* self) { + GeeSortedMap* _tmp0_; + GeeCollection* _tmp1_; + GeeCollection* _tmp2_; + GeeCollection* values; + GeeCollection* _tmp3_; + gint _tmp4_; + gint _tmp5_; + GeeCollection* _tmp6_; + gboolean _tmp7_; + gboolean _tmp8_; + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp9_ = NULL; + gint _tmp10_ = 0; + gchar** _tmp11_ = NULL; + gint _tmp12_ = 0; + GeeCollection* _tmp13_; + gint _tmp14_; + gint _tmp15_; + gchar** _tmp16_; + gint _tmp16__length1; + gchar** _tmp17_; + gint _tmp17__length1; + gchar** _tmp22_; + gint _tmp22__length1; + gboolean _tmp27_ = FALSE; + gboolean _tmp29_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_map_get_values ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + values = _tmp2_; + _tmp3_ = values; + _tmp4_ = gee_collection_get_size (_tmp3_); + _tmp5_ = _tmp4_; + _vala_assert (_tmp5_ == 0, "values.size == 0"); + _tmp6_ = values; + _tmp7_ = gee_collection_get_is_empty (_tmp6_); + _tmp8_ = _tmp7_; + _vala_assert (_tmp8_, "values.is_empty"); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp9_, &_tmp10_, &_tmp11_, &_tmp12_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp9_; + contains_length1 = _tmp10_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp11_; + not_contains_length1 = _tmp12_; + _not_contains_size_ = not_contains_length1; + _tmp13_ = values; + _tmp14_ = gee_collection_get_size (_tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = contains; + _tmp16__length1 = contains_length1; + _vala_assert (_tmp15_ == _tmp16__length1, "values.size == contains.length"); + _tmp17_ = contains; + _tmp17__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp17_; + s_collection_length1 = _tmp17__length1; + for (s_it = 0; s_it < _tmp17__length1; s_it = s_it + 1) { + gchar* _tmp18_; + gchar* s = NULL; + _tmp18_ = g_strdup (s_collection[s_it]); + s = _tmp18_; + { + GeeCollection* _tmp19_; + const gchar* _tmp20_; + gboolean _tmp21_ = FALSE; + _tmp19_ = values; + _tmp20_ = s; + _tmp21_ = gee_collection_contains (_tmp19_, _tmp20_); + _vala_assert (_tmp21_, "values.contains (s)"); + _g_free0 (s); + } + } + } + _tmp22_ = not_contains; + _tmp22__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp22_; + s_collection_length1 = _tmp22__length1; + for (s_it = 0; s_it < _tmp22__length1; s_it = s_it + 1) { + gchar* _tmp23_; + gchar* s = NULL; + _tmp23_ = g_strdup (s_collection[s_it]); + s = _tmp23_; + { + GeeCollection* _tmp24_; + const gchar* _tmp25_; + gboolean _tmp26_ = FALSE; + _tmp24_ = values; + _tmp25_ = s; + _tmp26_ = gee_collection_contains (_tmp24_, _tmp25_); + _vala_assert (!_tmp26_, "!values.contains (s)"); + _g_free0 (s); + } + } + } + _tmp27_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp27_) { + GeeCollection* _tmp28_; + _tmp28_ = values; + gee_collection_add (_tmp28_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + _tmp29_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp29_) { + GeeCollection* _tmp30_; + _tmp30_ = values; + gee_collection_remove (_tmp30_, "three"); + exit (0); + } + g_test_trap_assert_failed (); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + _g_object_unref0 (values); +} + + +void gee_sorted_map_tests_sub_map_tests_test_entries (GeeSortedMapTestsSubMapTests* self) { + GeeSortedMap* _tmp0_; + GeeSet* _tmp1_; + GeeSet* _tmp2_; + GeeSet* entries; + GeeSet* _tmp3_; + gint _tmp4_; + gint _tmp5_; + GeeSet* _tmp6_; + gboolean _tmp7_; + gboolean _tmp8_; + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp9_ = NULL; + gint _tmp10_ = 0; + gchar** _tmp11_ = NULL; + gint _tmp12_ = 0; + GeeSet* _tmp13_; + gint _tmp14_; + gint _tmp15_; + gchar** _tmp16_; + gint _tmp16__length1; + gchar** _tmp17_; + gint _tmp17__length1; + gchar** _tmp25_; + gint _tmp25__length1; + gboolean _tmp33_ = FALSE; + gboolean _tmp37_ = FALSE; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_map_get_entries ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + entries = _tmp2_; + _tmp3_ = entries; + _tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_); + _tmp5_ = _tmp4_; + _vala_assert (_tmp5_ == 0, "entries.size == 0"); + _tmp6_ = entries; + _tmp7_ = gee_collection_get_is_empty ((GeeCollection*) _tmp6_); + _tmp8_ = _tmp7_; + _vala_assert (_tmp8_, "entries.is_empty"); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp9_, &_tmp10_, &_tmp11_, &_tmp12_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp9_; + contains_length1 = _tmp10_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp11_; + not_contains_length1 = _tmp12_; + _not_contains_size_ = not_contains_length1; + _tmp13_ = entries; + _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = contains; + _tmp16__length1 = contains_length1; + _vala_assert (_tmp15_ == _tmp16__length1, "entries.size == contains.length"); + _tmp17_ = contains; + _tmp17__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp17_; + s_collection_length1 = _tmp17__length1; + for (s_it = 0; s_it < _tmp17__length1; s_it = s_it + 1) { + gchar* _tmp18_; + gchar* s = NULL; + _tmp18_ = g_strdup (s_collection[s_it]); + s = _tmp18_; + { + GeeSet* _tmp19_; + const gchar* _tmp20_; + const gchar* _tmp21_; + GeeMapEntry* _tmp22_ = NULL; + GeeMapEntry* _tmp23_; + gboolean _tmp24_ = FALSE; + _tmp19_ = entries; + _tmp20_ = s; + _tmp21_ = s; + _tmp22_ = map_tests_entry_for (_tmp20_, _tmp21_); + _tmp23_ = _tmp22_; + _tmp24_ = gee_collection_contains ((GeeCollection*) _tmp19_, _tmp23_); + _vala_assert (_tmp24_, "entries.contains (MapTests.entry_for (s, s))"); + _g_object_unref0 (_tmp23_); + _g_free0 (s); + } + } + } + _tmp25_ = not_contains; + _tmp25__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp25_; + s_collection_length1 = _tmp25__length1; + for (s_it = 0; s_it < _tmp25__length1; s_it = s_it + 1) { + gchar* _tmp26_; + gchar* s = NULL; + _tmp26_ = g_strdup (s_collection[s_it]); + s = _tmp26_; + { + GeeSet* _tmp27_; + const gchar* _tmp28_; + const gchar* _tmp29_; + GeeMapEntry* _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + gboolean _tmp32_ = FALSE; + _tmp27_ = entries; + _tmp28_ = s; + _tmp29_ = s; + _tmp30_ = map_tests_entry_for (_tmp28_, _tmp29_); + _tmp31_ = _tmp30_; + _tmp32_ = gee_collection_contains ((GeeCollection*) _tmp27_, _tmp31_); + _vala_assert (!_tmp32_, "!entries.contains (MapTests.entry_for (s, s))"); + _g_object_unref0 (_tmp31_); + _g_free0 (s); + } + } + } + _tmp33_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp33_) { + GeeSet* _tmp34_; + GeeMapEntry* _tmp35_ = NULL; + GeeMapEntry* _tmp36_; + _tmp34_ = entries; + _tmp35_ = map_tests_entry_for ("three", "three"); + _tmp36_ = _tmp35_; + gee_collection_add ((GeeCollection*) _tmp34_, _tmp36_); + _g_object_unref0 (_tmp36_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp37_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp37_) { + GeeSet* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + _tmp38_ = entries; + _tmp39_ = map_tests_entry_for ("three", "three"); + _tmp40_ = _tmp39_; + gee_collection_remove ((GeeCollection*) _tmp38_, _tmp40_); + _g_object_unref0 (_tmp40_); + exit (0); + } + g_test_trap_assert_failed (); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + _g_object_unref0 (entries); +} + + +void gee_sorted_map_tests_sub_map_tests_test_set (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp0_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gint _tmp3_ = 0; + gchar** success = NULL; + gint success_length1 = 0; + gint _success_size_ = 0; + gchar** fail = NULL; + gint fail_length1 = 0; + gint _fail_size_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp4_; + gchar** _tmp29_; + gint _tmp29__length1; + gchar** _tmp42_; + gint _tmp42__length1; + GeeSortedMap* _tmp53_; + gint _tmp54_; + gint _tmp55_; + gchar** _tmp56_; + gint _tmp56__length1; + g_return_if_fail (self != NULL); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp0_; + contains_length1 = _tmp1_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp2_; + not_contains_length1 = _tmp3_; + _not_contains_size_ = not_contains_length1; + _tmp4_ = self->priv->type; + switch (_tmp4_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + gchar* _tmp5_; + gchar* _tmp6_; + gchar** _tmp7_ = NULL; + gchar* _tmp8_; + gchar* _tmp9_; + gchar** _tmp10_ = NULL; + _tmp5_ = g_strdup ("a"); + _tmp6_ = g_strdup ("o"); + _tmp7_ = g_new0 (gchar*, 2 + 1); + _tmp7_[0] = _tmp5_; + _tmp7_[1] = _tmp6_; + success = (_vala_array_free (success, success_length1, (GDestroyNotify) g_free), NULL); + success = _tmp7_; + success_length1 = 2; + _success_size_ = success_length1; + _tmp8_ = g_strdup ("oz"); + _tmp9_ = g_strdup ("z"); + _tmp10_ = g_new0 (gchar*, 2 + 1); + _tmp10_[0] = _tmp8_; + _tmp10_[1] = _tmp9_; + fail = (_vala_array_free (fail, fail_length1, (GDestroyNotify) g_free), NULL); + fail = _tmp10_; + fail_length1 = 2; + _fail_size_ = fail_length1; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + gchar* _tmp11_; + gchar* _tmp12_; + gchar** _tmp13_ = NULL; + gchar* _tmp14_; + gchar* _tmp15_; + gchar** _tmp16_ = NULL; + _tmp11_ = g_strdup ("siz"); + _tmp12_ = g_strdup ("z"); + _tmp13_ = g_new0 (gchar*, 2 + 1); + _tmp13_[0] = _tmp11_; + _tmp13_[1] = _tmp12_; + success = (_vala_array_free (success, success_length1, (GDestroyNotify) g_free), NULL); + success = _tmp13_; + success_length1 = 2; + _success_size_ = success_length1; + _tmp14_ = g_strdup ("sia"); + _tmp15_ = g_strdup ("a"); + _tmp16_ = g_new0 (gchar*, 2 + 1); + _tmp16_[0] = _tmp14_; + _tmp16_[1] = _tmp15_; + fail = (_vala_array_free (fail, fail_length1, (GDestroyNotify) g_free), NULL); + fail = _tmp16_; + fail_length1 = 2; + _fail_size_ = fail_length1; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + gchar* _tmp17_; + gchar* _tmp18_; + gchar** _tmp19_ = NULL; + gchar* _tmp20_; + gchar* _tmp21_; + gchar** _tmp22_ = NULL; + _tmp17_ = g_strdup ("o"); + _tmp18_ = g_strdup ("th"); + _tmp19_ = g_new0 (gchar*, 2 + 1); + _tmp19_[0] = _tmp17_; + _tmp19_[1] = _tmp18_; + success = (_vala_array_free (success, success_length1, (GDestroyNotify) g_free), NULL); + success = _tmp19_; + success_length1 = 2; + _success_size_ = success_length1; + _tmp20_ = g_strdup ("f"); + _tmp21_ = g_strdup ("u"); + _tmp22_ = g_new0 (gchar*, 2 + 1); + _tmp22_[0] = _tmp20_; + _tmp22_[1] = _tmp21_; + fail = (_vala_array_free (fail, fail_length1, (GDestroyNotify) g_free), NULL); + fail = _tmp22_; + fail_length1 = 2; + _fail_size_ = fail_length1; + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + gchar** _tmp23_ = NULL; + gchar* _tmp24_; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; + gchar** _tmp28_ = NULL; + _tmp23_ = g_new0 (gchar*, 0 + 1); + success = (_vala_array_free (success, success_length1, (GDestroyNotify) g_free), NULL); + success = _tmp23_; + success_length1 = 0; + _success_size_ = success_length1; + _tmp24_ = g_strdup ("o"); + _tmp25_ = g_strdup ("th"); + _tmp26_ = g_strdup ("f"); + _tmp27_ = g_strdup ("u"); + _tmp28_ = g_new0 (gchar*, 4 + 1); + _tmp28_[0] = _tmp24_; + _tmp28_[1] = _tmp25_; + _tmp28_[2] = _tmp26_; + _tmp28_[3] = _tmp27_; + fail = (_vala_array_free (fail, fail_length1, (GDestroyNotify) g_free), NULL); + fail = _tmp28_; + fail_length1 = 4; + _fail_size_ = fail_length1; + break; + } + default: + { + g_assert_not_reached (); + } + } + _tmp29_ = success; + _tmp29__length1 = success_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp29_; + s_collection_length1 = _tmp29__length1; + for (s_it = 0; s_it < _tmp29__length1; s_it = s_it + 1) { + gchar* _tmp30_; + gchar* s = NULL; + _tmp30_ = g_strdup (s_collection[s_it]); + s = _tmp30_; + { + GeeSortedMap* _tmp31_; + const gchar* _tmp32_; + const gchar* _tmp33_; + GeeSortedMap* _tmp34_; + const gchar* _tmp35_; + const gchar* _tmp36_; + gboolean _tmp37_ = FALSE; + GeeSortedMap* _tmp38_; + const gchar* _tmp39_; + const gchar* _tmp40_; + gboolean _tmp41_ = FALSE; + _tmp31_ = self->priv->submap; + _tmp32_ = s; + _tmp33_ = s; + gee_map_set ((GeeMap*) _tmp31_, _tmp32_, _tmp33_); + _tmp34_ = self->priv->submap; + _tmp35_ = s; + _tmp36_ = s; + _tmp37_ = gee_map_has ((GeeMap*) _tmp34_, _tmp35_, _tmp36_); + _vala_assert (_tmp37_, "submap.has (s, s)"); + _tmp38_ = self->priv->master; + _tmp39_ = s; + _tmp40_ = s; + _tmp41_ = gee_map_has ((GeeMap*) _tmp38_, _tmp39_, _tmp40_); + _vala_assert (_tmp41_, "master.has (s, s)"); + _g_free0 (s); + } + } + } + _tmp42_ = fail; + _tmp42__length1 = fail_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp42_; + s_collection_length1 = _tmp42__length1; + for (s_it = 0; s_it < _tmp42__length1; s_it = s_it + 1) { + gchar* _tmp43_; + gchar* s = NULL; + _tmp43_ = g_strdup (s_collection[s_it]); + s = _tmp43_; + { + GeeSortedMap* _tmp44_; + const gchar* _tmp45_; + const gchar* _tmp46_; + GeeSortedMap* _tmp47_; + const gchar* _tmp48_; + gboolean _tmp49_ = FALSE; + GeeSortedMap* _tmp50_; + const gchar* _tmp51_; + gboolean _tmp52_ = FALSE; + _tmp44_ = self->priv->submap; + _tmp45_ = s; + _tmp46_ = s; + gee_map_set ((GeeMap*) _tmp44_, _tmp45_, _tmp46_); + _tmp47_ = self->priv->submap; + _tmp48_ = s; + _tmp49_ = gee_map_has_key ((GeeMap*) _tmp47_, _tmp48_); + _vala_assert (!_tmp49_, "!submap.has_key (s)"); + _tmp50_ = self->priv->master; + _tmp51_ = s; + _tmp52_ = gee_map_has_key ((GeeMap*) _tmp50_, _tmp51_); + _vala_assert (!_tmp52_, "!master.has_key (s)"); + _g_free0 (s); + } + } + } + _tmp53_ = self->priv->master; + _tmp54_ = gee_map_get_size ((GeeMap*) _tmp53_); + _tmp55_ = _tmp54_; + _tmp56_ = success; + _tmp56__length1 = success_length1; + _vala_assert (_tmp55_ == (6 + _tmp56__length1), "master.size == 6 + success.length"); + fail = (_vala_array_free (fail, fail_length1, (GDestroyNotify) g_free), NULL); + success = (_vala_array_free (success, success_length1, (GDestroyNotify) g_free), NULL); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_unset (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp0_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gint _tmp3_ = 0; + gchar** _tmp4_; + gint _tmp4__length1; + gchar** _tmp15_; + gint _tmp15__length1; + GeeSortedMap* _tmp24_; + gint _tmp25_; + gint _tmp26_; + gchar** _tmp27_; + gint _tmp27__length1; + g_return_if_fail (self != NULL); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp0_; + contains_length1 = _tmp1_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp2_; + not_contains_length1 = _tmp3_; + _not_contains_size_ = not_contains_length1; + _tmp4_ = contains; + _tmp4__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp4_; + s_collection_length1 = _tmp4__length1; + for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) { + gchar* _tmp5_; + gchar* s = NULL; + _tmp5_ = g_strdup (s_collection[s_it]); + s = _tmp5_; + { + gchar* value = NULL; + GeeSortedMap* _tmp6_; + const gchar* _tmp7_; + gpointer _tmp8_ = NULL; + gboolean _tmp9_ = FALSE; + const gchar* _tmp10_; + const gchar* _tmp11_; + GeeSortedMap* _tmp12_; + const gchar* _tmp13_; + gboolean _tmp14_ = FALSE; + _tmp6_ = self->priv->submap; + _tmp7_ = s; + _tmp9_ = gee_map_unset ((GeeMap*) _tmp6_, _tmp7_, &_tmp8_); + _g_free0 (value); + value = _tmp8_; + _vala_assert (_tmp9_, "submap.unset (s, out value)"); + _tmp10_ = value; + _tmp11_ = s; + _vala_assert (g_strcmp0 (_tmp10_, _tmp11_) == 0, "value == s"); + _tmp12_ = self->priv->master; + _tmp13_ = s; + _tmp14_ = gee_map_has_key ((GeeMap*) _tmp12_, _tmp13_); + _vala_assert (!_tmp14_, "!master.has_key (s)"); + _g_free0 (value); + _g_free0 (s); + } + } + } + _tmp15_ = not_contains; + _tmp15__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp15_; + s_collection_length1 = _tmp15__length1; + for (s_it = 0; s_it < _tmp15__length1; s_it = s_it + 1) { + gchar* _tmp16_; + gchar* s = NULL; + _tmp16_ = g_strdup (s_collection[s_it]); + s = _tmp16_; + { + GeeSortedMap* _tmp17_; + const gchar* _tmp18_; + gboolean _tmp19_ = FALSE; + GeeSortedMap* _tmp20_; + const gchar* _tmp21_; + const gchar* _tmp22_; + gboolean _tmp23_ = FALSE; + _tmp17_ = self->priv->submap; + _tmp18_ = s; + _tmp19_ = gee_map_unset ((GeeMap*) _tmp17_, _tmp18_, NULL); + _vala_assert (!_tmp19_, "!submap.unset (s)"); + _tmp20_ = self->priv->master; + _tmp21_ = s; + _tmp22_ = s; + _tmp23_ = gee_map_has ((GeeMap*) _tmp20_, _tmp21_, _tmp22_); + _vala_assert (_tmp23_, "master.has (s, s)"); + _g_free0 (s); + } + } + } + _tmp24_ = self->priv->master; + _tmp25_ = gee_map_get_size ((GeeMap*) _tmp24_); + _tmp26_ = _tmp25_; + _tmp27_ = contains; + _tmp27__length1 = contains_length1; + _vala_assert (_tmp26_ == (6 - _tmp27__length1), "master.size == 6 - contains.length"); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_clear (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp0_ = NULL; + gint _tmp1_ = 0; + gchar** _tmp2_ = NULL; + gint _tmp3_ = 0; + GeeSortedMap* _tmp4_; + gchar** _tmp5_; + gint _tmp5__length1; + gchar** _tmp10_; + gint _tmp10__length1; + GeeSortedMap* _tmp19_; + gint _tmp20_; + gint _tmp21_; + gchar** _tmp22_; + gint _tmp22__length1; + g_return_if_fail (self != NULL); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp0_; + contains_length1 = _tmp1_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp2_; + not_contains_length1 = _tmp3_; + _not_contains_size_ = not_contains_length1; + _tmp4_ = self->priv->submap; + gee_map_clear ((GeeMap*) _tmp4_); + _tmp5_ = contains; + _tmp5__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp5_; + s_collection_length1 = _tmp5__length1; + for (s_it = 0; s_it < _tmp5__length1; s_it = s_it + 1) { + gchar* _tmp6_; + gchar* s = NULL; + _tmp6_ = g_strdup (s_collection[s_it]); + s = _tmp6_; + { + GeeSortedMap* _tmp7_; + const gchar* _tmp8_; + gboolean _tmp9_ = FALSE; + _tmp7_ = self->priv->master; + _tmp8_ = s; + _tmp9_ = gee_map_has_key ((GeeMap*) _tmp7_, _tmp8_); + _vala_assert (!_tmp9_, "!master.has_key (s)"); + _g_free0 (s); + } + } + } + _tmp10_ = not_contains; + _tmp10__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp10_; + s_collection_length1 = _tmp10__length1; + for (s_it = 0; s_it < _tmp10__length1; s_it = s_it + 1) { + gchar* _tmp11_; + gchar* s = NULL; + _tmp11_ = g_strdup (s_collection[s_it]); + s = _tmp11_; + { + GeeSortedMap* _tmp12_; + const gchar* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeSortedMap* _tmp15_; + const gchar* _tmp16_; + const gchar* _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp12_ = self->priv->submap; + _tmp13_ = s; + _tmp14_ = gee_map_unset ((GeeMap*) _tmp12_, _tmp13_, NULL); + _vala_assert (!_tmp14_, "!submap.unset (s)"); + _tmp15_ = self->priv->master; + _tmp16_ = s; + _tmp17_ = s; + _tmp18_ = gee_map_has ((GeeMap*) _tmp15_, _tmp16_, _tmp17_); + _vala_assert (_tmp18_, "master.has (s, s)"); + _g_free0 (s); + } + } + } + _tmp19_ = self->priv->master; + _tmp20_ = gee_map_get_size ((GeeMap*) _tmp19_); + _tmp21_ = _tmp20_; + _tmp22_ = contains; + _tmp22__length1 = contains_length1; + _vala_assert (_tmp21_ == (6 - _tmp22__length1), "master.size == 6 - contains.length"); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_iterators (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeMapIterator* _tmp1_ = NULL; + GeeMapIterator* _map_iter; + GeeMapIterator* _tmp2_; + gboolean _tmp3_ = FALSE; + GeeMapIterator* _tmp4_; + gboolean _tmp5_ = FALSE; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + gint i; + GeeSortedMap* _tmp10_; + GeeMapIterator* _tmp11_ = NULL; + gint _tmp27_; + gchar** _tmp28_; + gint _tmp28__length1; + gint _tmp43_; + gchar** _tmp44_; + gint _tmp44__length1; + gint _tmp63_; + gchar** _tmp64_; + gint _tmp64__length1; + GeeSortedMapTestsSubMapTestsType _tmp65_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_map_map_iterator ((GeeMap*) _tmp0_); + _map_iter = _tmp1_; + _tmp2_ = _map_iter; + _tmp3_ = gee_map_iterator_has_next (_tmp2_); + _vala_assert (!_tmp3_, "!_map_iter.has_next ()"); + _tmp4_ = _map_iter; + _tmp5_ = gee_map_iterator_next (_tmp4_); + _vala_assert (!_tmp5_, "!_map_iter.next ()"); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + i = 0; + _tmp10_ = self->priv->submap; + _tmp11_ = gee_map_map_iterator ((GeeMap*) _tmp10_); + _g_object_unref0 (_map_iter); + _map_iter = _tmp11_; + while (TRUE) { + GeeMapIterator* _tmp12_; + gboolean _tmp13_ = FALSE; + GeeMapIterator* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + gchar** _tmp17_; + gint _tmp17__length1; + gint _tmp18_; + const gchar* _tmp19_; + GeeMapIterator* _tmp20_; + gpointer _tmp21_ = NULL; + gchar* _tmp22_; + gchar** _tmp23_; + gint _tmp23__length1; + gint _tmp24_; + const gchar* _tmp25_; + gint _tmp26_; + _tmp12_ = _map_iter; + _tmp13_ = gee_map_iterator_next (_tmp12_); + if (!_tmp13_) { + break; + } + _tmp14_ = _map_iter; + _tmp15_ = gee_map_iterator_get_key (_tmp14_); + _tmp16_ = (gchar*) _tmp15_; + _tmp17_ = contains; + _tmp17__length1 = contains_length1; + _tmp18_ = i; + _tmp19_ = _tmp17_[_tmp18_]; + _vala_assert (g_strcmp0 (_tmp16_, _tmp19_) == 0, "_map_iter.get_key () == contains[i]"); + _g_free0 (_tmp16_); + _tmp20_ = _map_iter; + _tmp21_ = gee_map_iterator_get_value (_tmp20_); + _tmp22_ = (gchar*) _tmp21_; + _tmp23_ = contains; + _tmp23__length1 = contains_length1; + _tmp24_ = i; + _tmp25_ = _tmp23_[_tmp24_]; + _vala_assert (g_strcmp0 (_tmp22_, _tmp25_) == 0, "_map_iter.get_value () == contains[i]"); + _g_free0 (_tmp22_); + _tmp26_ = i; + i = _tmp26_ + 1; + } + _tmp27_ = i; + _tmp28_ = contains; + _tmp28__length1 = contains_length1; + _vala_assert (_tmp27_ == _tmp28__length1, "i == contains.length"); + i = 0; + { + GeeSortedMap* _tmp29_; + GeeSet* _tmp30_; + GeeSet* _tmp31_; + GeeSet* _tmp32_; + GeeIterator* _tmp33_ = NULL; + GeeIterator* _tmp34_; + GeeIterator* _k_it; + _tmp29_ = self->priv->submap; + _tmp30_ = gee_map_get_keys ((GeeMap*) _tmp29_); + _tmp31_ = _tmp30_; + _tmp32_ = _tmp31_; + _tmp33_ = gee_iterable_iterator ((GeeIterable*) _tmp32_); + _tmp34_ = _tmp33_; + _g_object_unref0 (_tmp32_); + _k_it = _tmp34_; + while (TRUE) { + GeeIterator* _tmp35_; + gboolean _tmp36_ = FALSE; + GeeIterator* _tmp37_; + gpointer _tmp38_ = NULL; + gchar* k; + const gchar* _tmp39_; + gchar** _tmp40_; + gint _tmp40__length1; + gint _tmp41_; + const gchar* _tmp42_; + _tmp35_ = _k_it; + _tmp36_ = gee_iterator_next (_tmp35_); + if (!_tmp36_) { + break; + } + _tmp37_ = _k_it; + _tmp38_ = gee_iterator_get (_tmp37_); + k = (gchar*) _tmp38_; + _tmp39_ = k; + _tmp40_ = contains; + _tmp40__length1 = contains_length1; + _tmp41_ = i; + i = _tmp41_ + 1; + _tmp42_ = _tmp40_[_tmp41_]; + _vala_assert (g_strcmp0 (_tmp39_, _tmp42_) == 0, "k == contains[i++]"); + _g_free0 (k); + } + _g_object_unref0 (_k_it); + } + _tmp43_ = i; + _tmp44_ = contains; + _tmp44__length1 = contains_length1; + _vala_assert (_tmp43_ == _tmp44__length1, "i == contains.length"); + i = 0; + { + GeeSortedMap* _tmp45_; + GeeSet* _tmp46_; + GeeSet* _tmp47_; + GeeSet* _tmp48_; + GeeIterator* _tmp49_ = NULL; + GeeIterator* _tmp50_; + GeeIterator* _e_it; + _tmp45_ = self->priv->submap; + _tmp46_ = gee_map_get_entries ((GeeMap*) _tmp45_); + _tmp47_ = _tmp46_; + _tmp48_ = _tmp47_; + _tmp49_ = gee_iterable_iterator ((GeeIterable*) _tmp48_); + _tmp50_ = _tmp49_; + _g_object_unref0 (_tmp48_); + _e_it = _tmp50_; + while (TRUE) { + GeeIterator* _tmp51_; + gboolean _tmp52_ = FALSE; + GeeIterator* _tmp53_; + gpointer _tmp54_ = NULL; + GeeMapEntry* e; + GeeMapEntry* _tmp55_; + gchar** _tmp56_; + gint _tmp56__length1; + gint _tmp57_; + const gchar* _tmp58_; + gchar** _tmp59_; + gint _tmp59__length1; + gint _tmp60_; + const gchar* _tmp61_; + gint _tmp62_; + _tmp51_ = _e_it; + _tmp52_ = gee_iterator_next (_tmp51_); + if (!_tmp52_) { + break; + } + _tmp53_ = _e_it; + _tmp54_ = gee_iterator_get (_tmp53_); + e = (GeeMapEntry*) _tmp54_; + _tmp55_ = e; + _tmp56_ = contains; + _tmp56__length1 = contains_length1; + _tmp57_ = i; + _tmp58_ = _tmp56_[_tmp57_]; + _tmp59_ = contains; + _tmp59__length1 = contains_length1; + _tmp60_ = i; + _tmp61_ = _tmp59_[_tmp60_]; + map_tests_assert_entry (_tmp55_, _tmp58_, _tmp61_); + _tmp62_ = i; + i = _tmp62_ + 1; + _g_object_unref0 (e); + } + _g_object_unref0 (_e_it); + } + _tmp63_ = i; + _tmp64_ = contains; + _tmp64__length1 = contains_length1; + _vala_assert (_tmp63_ == _tmp64__length1, "i == contains.length"); + _tmp65_ = self->priv->type; + if (_tmp65_ != GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY) { + GeeSortedMap* _tmp66_; + GeeMapIterator* _tmp67_ = NULL; + GeeMapIterator* map_iter; + GeeMapIterator* _tmp68_; + gboolean _tmp69_ = FALSE; + GeeMapIterator* _tmp70_; + gpointer _tmp71_ = NULL; + gchar* _tmp72_; + gchar** _tmp73_; + gint _tmp73__length1; + const gchar* _tmp74_; + GeeMapIterator* _tmp75_; + gpointer _tmp76_ = NULL; + gchar* _tmp77_; + gchar** _tmp78_; + gint _tmp78__length1; + const gchar* _tmp79_; + GeeMapIterator* _tmp80_; + gboolean _tmp81_ = FALSE; + GeeMapIterator* _tmp82_; + gboolean _tmp83_ = FALSE; + GeeMapIterator* _tmp84_; + gpointer _tmp85_ = NULL; + gchar* _tmp86_; + gchar** _tmp87_; + gint _tmp87__length1; + const gchar* _tmp88_; + GeeMapIterator* _tmp89_; + gpointer _tmp90_ = NULL; + gchar* _tmp91_; + gchar** _tmp92_; + gint _tmp92__length1; + const gchar* _tmp93_; + GeeSortedMap* _tmp94_; + gchar** _tmp95_ = NULL; + gint _tmp96_ = 0; + gchar** _tmp97_ = NULL; + gint _tmp98_ = 0; + GeeSortedMap* _tmp99_; + GeeSortedSet* _tmp100_; + GeeSortedSet* _tmp101_; + GeeSortedSet* _tmp102_; + GeeIterator* _tmp103_ = NULL; + GeeIterator* _tmp104_; + GeeIterator* keys_iter; + GeeIterator* _tmp105_; + gboolean _tmp106_ = FALSE; + GeeIterator* _tmp107_; + gboolean _tmp108_ = FALSE; + GeeIterator* _tmp109_; + gpointer _tmp110_ = NULL; + gchar* _tmp111_; + gchar** _tmp112_; + gint _tmp112__length1; + const gchar* _tmp113_; + GeeIterator* _tmp114_; + gboolean _tmp115_ = FALSE; + GeeIterator* _tmp116_; + gboolean _tmp117_ = FALSE; + GeeIterator* _tmp118_; + gpointer _tmp119_ = NULL; + gchar* _tmp120_; + gchar** _tmp121_; + gint _tmp121__length1; + const gchar* _tmp122_; + GeeSortedMap* _tmp123_; + gchar** _tmp124_ = NULL; + gint _tmp125_ = 0; + gchar** _tmp126_ = NULL; + gint _tmp127_ = 0; + GeeSortedMap* _tmp128_; + GeeSortedSet* _tmp129_; + GeeSortedSet* _tmp130_; + GeeSortedSet* _tmp131_; + GeeIterator* _tmp132_ = NULL; + GeeIterator* _tmp133_; + GeeIterator* entries_iter; + GeeIterator* _tmp134_; + gboolean _tmp135_ = FALSE; + GeeIterator* _tmp136_; + gboolean _tmp137_ = FALSE; + GeeIterator* _tmp138_; + gpointer _tmp139_ = NULL; + GeeMapEntry* _tmp140_; + gchar** _tmp141_; + gint _tmp141__length1; + const gchar* _tmp142_; + gchar** _tmp143_; + gint _tmp143__length1; + const gchar* _tmp144_; + GeeIterator* _tmp145_; + gboolean _tmp146_ = FALSE; + GeeIterator* _tmp147_; + gboolean _tmp148_ = FALSE; + GeeIterator* _tmp149_; + gpointer _tmp150_ = NULL; + GeeMapEntry* _tmp151_; + gchar** _tmp152_; + gint _tmp152__length1; + const gchar* _tmp153_; + gchar** _tmp154_; + gint _tmp154__length1; + const gchar* _tmp155_; + _tmp66_ = self->priv->submap; + _tmp67_ = gee_map_map_iterator ((GeeMap*) _tmp66_); + map_iter = _tmp67_; + _tmp68_ = map_iter; + _tmp69_ = gee_map_iterator_next (_tmp68_); + _vala_assert (_tmp69_, "map_iter.next ()"); + _tmp70_ = map_iter; + _tmp71_ = gee_map_iterator_get_key (_tmp70_); + _tmp72_ = (gchar*) _tmp71_; + _tmp73_ = contains; + _tmp73__length1 = contains_length1; + _tmp74_ = _tmp73_[0]; + _vala_assert (g_strcmp0 (_tmp72_, _tmp74_) == 0, "map_iter.get_key () == contains[0]"); + _g_free0 (_tmp72_); + _tmp75_ = map_iter; + _tmp76_ = gee_map_iterator_get_value (_tmp75_); + _tmp77_ = (gchar*) _tmp76_; + _tmp78_ = contains; + _tmp78__length1 = contains_length1; + _tmp79_ = _tmp78_[0]; + _vala_assert (g_strcmp0 (_tmp77_, _tmp79_) == 0, "map_iter.get_value () == contains[0]"); + _g_free0 (_tmp77_); + _tmp80_ = map_iter; + _tmp81_ = gee_map_iterator_has_next (_tmp80_); + _vala_assert (_tmp81_, "map_iter.has_next ()"); + _tmp82_ = map_iter; + _tmp83_ = gee_map_iterator_next (_tmp82_); + _vala_assert (_tmp83_, "map_iter.next ()"); + _tmp84_ = map_iter; + _tmp85_ = gee_map_iterator_get_key (_tmp84_); + _tmp86_ = (gchar*) _tmp85_; + _tmp87_ = contains; + _tmp87__length1 = contains_length1; + _tmp88_ = _tmp87_[1]; + _vala_assert (g_strcmp0 (_tmp86_, _tmp88_) == 0, "map_iter.get_key () == contains[1]"); + _g_free0 (_tmp86_); + _tmp89_ = map_iter; + _tmp90_ = gee_map_iterator_get_value (_tmp89_); + _tmp91_ = (gchar*) _tmp90_; + _tmp92_ = contains; + _tmp92__length1 = contains_length1; + _tmp93_ = _tmp92_[1]; + _vala_assert (g_strcmp0 (_tmp91_, _tmp93_) == 0, "map_iter.get_value () == contains[1]"); + _g_free0 (_tmp91_); + _tmp94_ = self->priv->master; + gee_map_clear ((GeeMap*) _tmp94_); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp95_, &_tmp96_, &_tmp97_, &_tmp98_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp95_; + contains_length1 = _tmp96_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp97_; + not_contains_length1 = _tmp98_; + _not_contains_size_ = not_contains_length1; + _tmp99_ = self->priv->submap; + _tmp100_ = gee_sorted_map_get_ascending_keys (_tmp99_); + _tmp101_ = _tmp100_; + _tmp102_ = _tmp101_; + _tmp103_ = gee_iterable_iterator ((GeeIterable*) _tmp102_); + _tmp104_ = _tmp103_; + _g_object_unref0 (_tmp102_); + keys_iter = _tmp104_; + _tmp105_ = keys_iter; + _tmp106_ = gee_iterator_has_next (_tmp105_); + _vala_assert (_tmp106_, "keys_iter.has_next ()"); + _tmp107_ = keys_iter; + _tmp108_ = gee_iterator_next (_tmp107_); + _vala_assert (_tmp108_, "keys_iter.next ()"); + _tmp109_ = keys_iter; + _tmp110_ = gee_iterator_get (_tmp109_); + _tmp111_ = (gchar*) _tmp110_; + _tmp112_ = contains; + _tmp112__length1 = contains_length1; + _tmp113_ = _tmp112_[0]; + _vala_assert (g_strcmp0 (_tmp111_, _tmp113_) == 0, "keys_iter.get () == contains[0]"); + _g_free0 (_tmp111_); + _tmp114_ = keys_iter; + _tmp115_ = gee_iterator_has_next (_tmp114_); + _vala_assert (_tmp115_, "keys_iter.has_next ()"); + _tmp116_ = keys_iter; + _tmp117_ = gee_iterator_next (_tmp116_); + _vala_assert (_tmp117_, "keys_iter.next ()"); + _tmp118_ = keys_iter; + _tmp119_ = gee_iterator_get (_tmp118_); + _tmp120_ = (gchar*) _tmp119_; + _tmp121_ = contains; + _tmp121__length1 = contains_length1; + _tmp122_ = _tmp121_[1]; + _vala_assert (g_strcmp0 (_tmp120_, _tmp122_) == 0, "keys_iter.get () == contains[1]"); + _g_free0 (_tmp120_); + _tmp123_ = self->priv->master; + gee_map_clear ((GeeMap*) _tmp123_); + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp124_, &_tmp125_, &_tmp126_, &_tmp127_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp124_; + contains_length1 = _tmp125_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp126_; + not_contains_length1 = _tmp127_; + _not_contains_size_ = not_contains_length1; + _tmp128_ = self->priv->submap; + _tmp129_ = gee_sorted_map_get_ascending_entries (_tmp128_); + _tmp130_ = _tmp129_; + _tmp131_ = _tmp130_; + _tmp132_ = gee_iterable_iterator ((GeeIterable*) _tmp131_); + _tmp133_ = _tmp132_; + _g_object_unref0 (_tmp131_); + entries_iter = _tmp133_; + _tmp134_ = entries_iter; + _tmp135_ = gee_iterator_has_next (_tmp134_); + _vala_assert (_tmp135_, "entries_iter.has_next ()"); + _tmp136_ = entries_iter; + _tmp137_ = gee_iterator_next (_tmp136_); + _vala_assert (_tmp137_, "entries_iter.next ()"); + _tmp138_ = entries_iter; + _tmp139_ = gee_iterator_get (_tmp138_); + _tmp140_ = (GeeMapEntry*) _tmp139_; + _tmp141_ = contains; + _tmp141__length1 = contains_length1; + _tmp142_ = _tmp141_[0]; + _tmp143_ = contains; + _tmp143__length1 = contains_length1; + _tmp144_ = _tmp143_[0]; + map_tests_assert_entry (_tmp140_, _tmp142_, _tmp144_); + _g_object_unref0 (_tmp140_); + _tmp145_ = entries_iter; + _tmp146_ = gee_iterator_has_next (_tmp145_); + _vala_assert (_tmp146_, "entries_iter.has_next ()"); + _tmp147_ = entries_iter; + _tmp148_ = gee_iterator_next (_tmp147_); + _vala_assert (_tmp148_, "entries_iter.next ()"); + _tmp149_ = entries_iter; + _tmp150_ = gee_iterator_get (_tmp149_); + _tmp151_ = (GeeMapEntry*) _tmp150_; + _tmp152_ = contains; + _tmp152__length1 = contains_length1; + _tmp153_ = _tmp152_[1]; + _tmp154_ = contains; + _tmp154__length1 = contains_length1; + _tmp155_ = _tmp154_[1]; + map_tests_assert_entry (_tmp151_, _tmp153_, _tmp155_); + _g_object_unref0 (_tmp151_); + _g_object_unref0 (entries_iter); + _g_object_unref0 (keys_iter); + _g_object_unref0 (map_iter); + } else { + GeeSortedMap* _tmp156_; + GeeSortedSet* _tmp157_; + GeeSortedSet* _tmp158_; + GeeSortedSet* _tmp159_; + GeeIterator* _tmp160_ = NULL; + GeeIterator* _tmp161_; + GeeIterator* keys_iter; + gboolean _tmp162_ = FALSE; + _tmp156_ = self->priv->submap; + _tmp157_ = gee_sorted_map_get_ascending_keys (_tmp156_); + _tmp158_ = _tmp157_; + _tmp159_ = _tmp158_; + _tmp160_ = gee_iterable_iterator ((GeeIterable*) _tmp159_); + _tmp161_ = _tmp160_; + _g_object_unref0 (_tmp159_); + keys_iter = _tmp161_; + _tmp162_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp162_) { + GeeIterator* _tmp163_; + _tmp163_ = keys_iter; + gee_iterator_remove (_tmp163_); + exit (0); + } + g_test_trap_assert_failed (); + _g_object_unref0 (keys_iter); + } + _g_object_unref0 (_map_iter); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_boundaries (GeeSortedMapTestsSubMapTests* self) { + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedSet* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeSortedSet* _tmp14_; + gpointer _tmp15_ = NULL; + gchar* _tmp16_; + GeeSortedSet* _tmp17_; + gpointer _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + GeeSortedSet* _tmp20_; + gpointer _tmp21_ = NULL; + GeeMapEntry* _tmp22_; + _tmp11_ = keys; + _tmp12_ = gee_sorted_set_first (_tmp11_); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (g_strcmp0 (_tmp13_, "five") == 0, "keys.first () == \"five\""); + _g_free0 (_tmp13_); + _tmp14_ = keys; + _tmp15_ = gee_sorted_set_last (_tmp14_); + _tmp16_ = (gchar*) _tmp15_; + _vala_assert (g_strcmp0 (_tmp16_, "four") == 0, "keys.last () == \"four\""); + _g_free0 (_tmp16_); + _tmp17_ = entries; + _tmp18_ = gee_sorted_set_first (_tmp17_); + _tmp19_ = (GeeMapEntry*) _tmp18_; + map_tests_assert_entry (_tmp19_, "five", "five"); + _g_object_unref0 (_tmp19_); + _tmp20_ = entries; + _tmp21_ = gee_sorted_set_last (_tmp20_); + _tmp22_ = (GeeMapEntry*) _tmp21_; + map_tests_assert_entry (_tmp22_, "four", "four"); + _g_object_unref0 (_tmp22_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedSet* _tmp23_; + gpointer _tmp24_ = NULL; + gchar* _tmp25_; + GeeSortedSet* _tmp26_; + gpointer _tmp27_ = NULL; + gchar* _tmp28_; + GeeSortedSet* _tmp29_; + gpointer _tmp30_ = NULL; + GeeMapEntry* _tmp31_; + GeeSortedSet* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + _tmp23_ = keys; + _tmp24_ = gee_sorted_set_first (_tmp23_); + _tmp25_ = (gchar*) _tmp24_; + _vala_assert (g_strcmp0 (_tmp25_, "six") == 0, "keys.first () == \"six\""); + _g_free0 (_tmp25_); + _tmp26_ = keys; + _tmp27_ = gee_sorted_set_last (_tmp26_); + _tmp28_ = (gchar*) _tmp27_; + _vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "keys.last () == \"two\""); + _g_free0 (_tmp28_); + _tmp29_ = entries; + _tmp30_ = gee_sorted_set_first (_tmp29_); + _tmp31_ = (GeeMapEntry*) _tmp30_; + map_tests_assert_entry (_tmp31_, "six", "six"); + _g_object_unref0 (_tmp31_); + _tmp32_ = entries; + _tmp33_ = gee_sorted_set_last (_tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + map_tests_assert_entry (_tmp34_, "two", "two"); + _g_object_unref0 (_tmp34_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedSet* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeSortedSet* _tmp38_; + gpointer _tmp39_ = NULL; + gchar* _tmp40_; + GeeSortedSet* _tmp41_; + gpointer _tmp42_ = NULL; + GeeMapEntry* _tmp43_; + GeeSortedSet* _tmp44_; + gpointer _tmp45_ = NULL; + GeeMapEntry* _tmp46_; + _tmp35_ = keys; + _tmp36_ = gee_sorted_set_first (_tmp35_); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (g_strcmp0 (_tmp37_, "four") == 0, "keys.first () == \"four\""); + _g_free0 (_tmp37_); + _tmp38_ = keys; + _tmp39_ = gee_sorted_set_last (_tmp38_); + _tmp40_ = (gchar*) _tmp39_; + _vala_assert (g_strcmp0 (_tmp40_, "six") == 0, "keys.last () == \"six\""); + _g_free0 (_tmp40_); + _tmp41_ = entries; + _tmp42_ = gee_sorted_set_first (_tmp41_); + _tmp43_ = (GeeMapEntry*) _tmp42_; + map_tests_assert_entry (_tmp43_, "four", "four"); + _g_object_unref0 (_tmp43_); + _tmp44_ = entries; + _tmp45_ = gee_sorted_set_last (_tmp44_); + _tmp46_ = (GeeMapEntry*) _tmp45_; + map_tests_assert_entry (_tmp46_, "six", "six"); + _g_object_unref0 (_tmp46_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + gboolean _tmp47_ = FALSE; + gboolean _tmp51_ = FALSE; + gboolean _tmp55_ = FALSE; + gboolean _tmp59_ = FALSE; + _tmp47_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp47_) { + GeeSortedSet* _tmp48_; + gpointer _tmp49_ = NULL; + gchar* _tmp50_; + _tmp48_ = keys; + _tmp49_ = gee_sorted_set_first (_tmp48_); + _tmp50_ = (gchar*) _tmp49_; + _g_free0 (_tmp50_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp51_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp51_) { + GeeSortedSet* _tmp52_; + gpointer _tmp53_ = NULL; + gchar* _tmp54_; + _tmp52_ = keys; + _tmp53_ = gee_sorted_set_last (_tmp52_); + _tmp54_ = (gchar*) _tmp53_; + _g_free0 (_tmp54_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp55_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp55_) { + GeeSortedSet* _tmp56_; + gpointer _tmp57_ = NULL; + GeeMapEntry* _tmp58_; + _tmp56_ = entries; + _tmp57_ = gee_sorted_set_first (_tmp56_); + _tmp58_ = (GeeMapEntry*) _tmp57_; + _g_object_unref0 (_tmp58_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp59_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp59_) { + GeeSortedSet* _tmp60_; + gpointer _tmp61_ = NULL; + GeeMapEntry* _tmp62_; + _tmp60_ = entries; + _tmp61_ = gee_sorted_set_last (_tmp60_); + _tmp62_ = (GeeMapEntry*) _tmp61_; + _g_object_unref0 (_tmp62_); + exit (0); + } + g_test_trap_assert_failed (); + break; + } + default: + { + g_assert_not_reached (); + } + } + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + _g_object_unref0 (entries); + _g_object_unref0 (keys); +} + + +void gee_sorted_map_tests_sub_map_tests_test_lower (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedSet* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeSortedSet* _tmp14_; + GeeMapEntry* _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + gpointer _tmp17_ = NULL; + GeeMapEntry* _tmp18_; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeSortedSet* _tmp22_; + GeeMapEntry* _tmp23_ = NULL; + GeeMapEntry* _tmp24_; + gpointer _tmp25_ = NULL; + GeeMapEntry* _tmp26_; + GeeSortedSet* _tmp27_; + gpointer _tmp28_ = NULL; + gchar* _tmp29_; + GeeSortedSet* _tmp30_; + GeeMapEntry* _tmp31_ = NULL; + GeeMapEntry* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + GeeSortedSet* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeSortedSet* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + gpointer _tmp41_ = NULL; + GeeMapEntry* _tmp42_; + _tmp11_ = keys; + _tmp12_ = gee_sorted_set_lower (_tmp11_, "a"); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (_tmp13_ == NULL, "keys.lower (\"a\") == null"); + _g_free0 (_tmp13_); + _tmp14_ = entries; + _tmp15_ = map_tests_entry_for ("a", "a"); + _tmp16_ = _tmp15_; + _tmp17_ = gee_sorted_set_lower (_tmp14_, _tmp16_); + _tmp18_ = (GeeMapEntry*) _tmp17_; + _vala_assert (_tmp18_ == NULL, "entries.lower (MapTests.entry_for (\"a\", \"a\")) == null"); + _g_object_unref0 (_tmp18_); + _g_object_unref0 (_tmp16_); + _tmp19_ = keys; + _tmp20_ = gee_sorted_set_lower (_tmp19_, "five"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (_tmp21_ == NULL, "keys.lower (\"five\") == null"); + _g_free0 (_tmp21_); + _tmp22_ = entries; + _tmp23_ = map_tests_entry_for ("five", "five"); + _tmp24_ = _tmp23_; + _tmp25_ = gee_sorted_set_lower (_tmp22_, _tmp24_); + _tmp26_ = (GeeMapEntry*) _tmp25_; + _vala_assert (_tmp26_ == NULL, "entries.lower (MapTests.entry_for (\"five\", \"five\")) == null"); + _g_object_unref0 (_tmp26_); + _g_object_unref0 (_tmp24_); + _tmp27_ = keys; + _tmp28_ = gee_sorted_set_lower (_tmp27_, "four"); + _tmp29_ = (gchar*) _tmp28_; + _vala_assert (g_strcmp0 (_tmp29_, "five") == 0, "keys.lower (\"four\") == \"five\""); + _g_free0 (_tmp29_); + _tmp30_ = entries; + _tmp31_ = map_tests_entry_for ("four", "four"); + _tmp32_ = _tmp31_; + _tmp33_ = gee_sorted_set_lower (_tmp30_, _tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + map_tests_assert_entry (_tmp34_, "five", "five"); + _g_object_unref0 (_tmp34_); + _g_object_unref0 (_tmp32_); + _tmp35_ = keys; + _tmp36_ = gee_sorted_set_lower (_tmp35_, "six"); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (g_strcmp0 (_tmp37_, "four") == 0, "keys.lower (\"six\") == \"four\""); + _g_free0 (_tmp37_); + _tmp38_ = entries; + _tmp39_ = map_tests_entry_for ("six", "six"); + _tmp40_ = _tmp39_; + _tmp41_ = gee_sorted_set_lower (_tmp38_, _tmp40_); + _tmp42_ = (GeeMapEntry*) _tmp41_; + map_tests_assert_entry (_tmp42_, "four", "four"); + _g_object_unref0 (_tmp42_); + _g_object_unref0 (_tmp40_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedSet* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeSortedSet* _tmp46_; + GeeMapEntry* _tmp47_ = NULL; + GeeMapEntry* _tmp48_; + gpointer _tmp49_ = NULL; + GeeMapEntry* _tmp50_; + GeeSortedSet* _tmp51_; + gpointer _tmp52_ = NULL; + gchar* _tmp53_; + GeeSortedSet* _tmp54_; + GeeMapEntry* _tmp55_ = NULL; + GeeMapEntry* _tmp56_; + gpointer _tmp57_ = NULL; + GeeMapEntry* _tmp58_; + GeeSortedSet* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + GeeSortedSet* _tmp62_; + GeeMapEntry* _tmp63_ = NULL; + GeeMapEntry* _tmp64_; + gpointer _tmp65_ = NULL; + GeeMapEntry* _tmp66_; + GeeSortedSet* _tmp67_; + gpointer _tmp68_ = NULL; + gchar* _tmp69_; + GeeSortedSet* _tmp70_; + GeeMapEntry* _tmp71_ = NULL; + GeeMapEntry* _tmp72_; + gpointer _tmp73_ = NULL; + GeeMapEntry* _tmp74_; + GeeSortedSet* _tmp75_; + gpointer _tmp76_ = NULL; + gchar* _tmp77_; + GeeSortedSet* _tmp78_; + GeeMapEntry* _tmp79_ = NULL; + GeeMapEntry* _tmp80_; + gpointer _tmp81_ = NULL; + GeeMapEntry* _tmp82_; + _tmp43_ = keys; + _tmp44_ = gee_sorted_set_lower (_tmp43_, "one"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (_tmp45_ == NULL, "keys.lower (\"one\") == null"); + _g_free0 (_tmp45_); + _tmp46_ = entries; + _tmp47_ = map_tests_entry_for ("one", "one"); + _tmp48_ = _tmp47_; + _tmp49_ = gee_sorted_set_lower (_tmp46_, _tmp48_); + _tmp50_ = (GeeMapEntry*) _tmp49_; + _vala_assert (_tmp50_ == NULL, "entries.lower (MapTests.entry_for (\"one\", \"one\")) == null"); + _g_object_unref0 (_tmp50_); + _g_object_unref0 (_tmp48_); + _tmp51_ = keys; + _tmp52_ = gee_sorted_set_lower (_tmp51_, "six"); + _tmp53_ = (gchar*) _tmp52_; + _vala_assert (_tmp53_ == NULL, "keys.lower (\"six\") == null"); + _g_free0 (_tmp53_); + _tmp54_ = entries; + _tmp55_ = map_tests_entry_for ("six", "six"); + _tmp56_ = _tmp55_; + _tmp57_ = gee_sorted_set_lower (_tmp54_, _tmp56_); + _tmp58_ = (GeeMapEntry*) _tmp57_; + _vala_assert (_tmp58_ == NULL, "entries.lower (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp58_); + _g_object_unref0 (_tmp56_); + _tmp59_ = keys; + _tmp60_ = gee_sorted_set_lower (_tmp59_, "three"); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "six") == 0, "keys.lower (\"three\") == \"six\""); + _g_free0 (_tmp61_); + _tmp62_ = entries; + _tmp63_ = map_tests_entry_for ("three", "three"); + _tmp64_ = _tmp63_; + _tmp65_ = gee_sorted_set_lower (_tmp62_, _tmp64_); + _tmp66_ = (GeeMapEntry*) _tmp65_; + map_tests_assert_entry (_tmp66_, "six", "six"); + _g_object_unref0 (_tmp66_); + _g_object_unref0 (_tmp64_); + _tmp67_ = keys; + _tmp68_ = gee_sorted_set_lower (_tmp67_, "two"); + _tmp69_ = (gchar*) _tmp68_; + _vala_assert (g_strcmp0 (_tmp69_, "three") == 0, "keys.lower (\"two\") == \"three\""); + _g_free0 (_tmp69_); + _tmp70_ = entries; + _tmp71_ = map_tests_entry_for ("two", "two"); + _tmp72_ = _tmp71_; + _tmp73_ = gee_sorted_set_lower (_tmp70_, _tmp72_); + _tmp74_ = (GeeMapEntry*) _tmp73_; + map_tests_assert_entry (_tmp74_, "three", "three"); + _g_object_unref0 (_tmp74_); + _g_object_unref0 (_tmp72_); + _tmp75_ = keys; + _tmp76_ = gee_sorted_set_lower (_tmp75_, "z"); + _tmp77_ = (gchar*) _tmp76_; + _vala_assert (g_strcmp0 (_tmp77_, "two") == 0, "keys.lower (\"z\") == \"two\""); + _g_free0 (_tmp77_); + _tmp78_ = entries; + _tmp79_ = map_tests_entry_for ("z", "z"); + _tmp80_ = _tmp79_; + _tmp81_ = gee_sorted_set_lower (_tmp78_, _tmp80_); + _tmp82_ = (GeeMapEntry*) _tmp81_; + map_tests_assert_entry (_tmp82_, "two", "two"); + _g_object_unref0 (_tmp82_); + _g_object_unref0 (_tmp80_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedSet* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeSortedSet* _tmp86_; + GeeMapEntry* _tmp87_ = NULL; + GeeMapEntry* _tmp88_; + gpointer _tmp89_ = NULL; + GeeMapEntry* _tmp90_; + GeeSortedSet* _tmp91_; + gpointer _tmp92_ = NULL; + gchar* _tmp93_; + GeeSortedSet* _tmp94_; + GeeMapEntry* _tmp95_ = NULL; + GeeMapEntry* _tmp96_; + gpointer _tmp97_ = NULL; + GeeMapEntry* _tmp98_; + GeeSortedSet* _tmp99_; + gpointer _tmp100_ = NULL; + gchar* _tmp101_; + GeeSortedSet* _tmp102_; + GeeMapEntry* _tmp103_ = NULL; + GeeMapEntry* _tmp104_; + gpointer _tmp105_ = NULL; + GeeMapEntry* _tmp106_; + GeeSortedSet* _tmp107_; + gpointer _tmp108_ = NULL; + gchar* _tmp109_; + GeeSortedSet* _tmp110_; + GeeMapEntry* _tmp111_ = NULL; + GeeMapEntry* _tmp112_; + gpointer _tmp113_ = NULL; + GeeMapEntry* _tmp114_; + GeeSortedSet* _tmp115_; + gpointer _tmp116_ = NULL; + gchar* _tmp117_; + GeeSortedSet* _tmp118_; + GeeMapEntry* _tmp119_ = NULL; + GeeMapEntry* _tmp120_; + gpointer _tmp121_ = NULL; + GeeMapEntry* _tmp122_; + _tmp83_ = keys; + _tmp84_ = gee_sorted_set_lower (_tmp83_, "five"); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (_tmp85_ == NULL, "keys.lower (\"five\") == null"); + _g_free0 (_tmp85_); + _tmp86_ = entries; + _tmp87_ = map_tests_entry_for ("five", "five"); + _tmp88_ = _tmp87_; + _tmp89_ = gee_sorted_set_lower (_tmp86_, _tmp88_); + _tmp90_ = (GeeMapEntry*) _tmp89_; + _vala_assert (_tmp90_ == NULL, "entries.lower (MapTests.entry_for (\"five\", \"five\")) == null"); + _g_object_unref0 (_tmp90_); + _g_object_unref0 (_tmp88_); + _tmp91_ = keys; + _tmp92_ = gee_sorted_set_lower (_tmp91_, "four"); + _tmp93_ = (gchar*) _tmp92_; + _vala_assert (_tmp93_ == NULL, "keys.lower (\"four\") == null"); + _g_free0 (_tmp93_); + _tmp94_ = entries; + _tmp95_ = map_tests_entry_for ("four", "four"); + _tmp96_ = _tmp95_; + _tmp97_ = gee_sorted_set_lower (_tmp94_, _tmp96_); + _tmp98_ = (GeeMapEntry*) _tmp97_; + _vala_assert (_tmp98_ == NULL, "entries.lower (MapTests.entry_for (\"four\", \"four\")) == null"); + _g_object_unref0 (_tmp98_); + _g_object_unref0 (_tmp96_); + _tmp99_ = keys; + _tmp100_ = gee_sorted_set_lower (_tmp99_, "one"); + _tmp101_ = (gchar*) _tmp100_; + _vala_assert (g_strcmp0 (_tmp101_, "four") == 0, "keys.lower (\"one\") == \"four\""); + _g_free0 (_tmp101_); + _tmp102_ = entries; + _tmp103_ = map_tests_entry_for ("one", "one"); + _tmp104_ = _tmp103_; + _tmp105_ = gee_sorted_set_lower (_tmp102_, _tmp104_); + _tmp106_ = (GeeMapEntry*) _tmp105_; + map_tests_assert_entry (_tmp106_, "four", "four"); + _g_object_unref0 (_tmp106_); + _g_object_unref0 (_tmp104_); + _tmp107_ = keys; + _tmp108_ = gee_sorted_set_lower (_tmp107_, "six"); + _tmp109_ = (gchar*) _tmp108_; + _vala_assert (g_strcmp0 (_tmp109_, "one") == 0, "keys.lower (\"six\") == \"one\""); + _g_free0 (_tmp109_); + _tmp110_ = entries; + _tmp111_ = map_tests_entry_for ("six", "six"); + _tmp112_ = _tmp111_; + _tmp113_ = gee_sorted_set_lower (_tmp110_, _tmp112_); + _tmp114_ = (GeeMapEntry*) _tmp113_; + map_tests_assert_entry (_tmp114_, "one", "one"); + _g_object_unref0 (_tmp114_); + _g_object_unref0 (_tmp112_); + _tmp115_ = keys; + _tmp116_ = gee_sorted_set_lower (_tmp115_, "three"); + _tmp117_ = (gchar*) _tmp116_; + _vala_assert (g_strcmp0 (_tmp117_, "six") == 0, "keys.lower (\"three\") == \"six\""); + _g_free0 (_tmp117_); + _tmp118_ = entries; + _tmp119_ = map_tests_entry_for ("three", "three"); + _tmp120_ = _tmp119_; + _tmp121_ = gee_sorted_set_lower (_tmp118_, _tmp120_); + _tmp122_ = (GeeMapEntry*) _tmp121_; + map_tests_assert_entry (_tmp122_, "six", "six"); + _g_object_unref0 (_tmp122_); + _g_object_unref0 (_tmp120_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedSet* _tmp123_; + gpointer _tmp124_ = NULL; + gchar* _tmp125_; + GeeSortedSet* _tmp126_; + GeeMapEntry* _tmp127_ = NULL; + GeeMapEntry* _tmp128_; + gpointer _tmp129_ = NULL; + GeeMapEntry* _tmp130_; + _tmp123_ = keys; + _tmp124_ = gee_sorted_set_lower (_tmp123_, "six"); + _tmp125_ = (gchar*) _tmp124_; + _vala_assert (_tmp125_ == NULL, "keys.lower (\"six\") == null"); + _g_free0 (_tmp125_); + _tmp126_ = entries; + _tmp127_ = map_tests_entry_for ("six", "six"); + _tmp128_ = _tmp127_; + _tmp129_ = gee_sorted_set_lower (_tmp126_, _tmp128_); + _tmp130_ = (GeeMapEntry*) _tmp129_; + _vala_assert (_tmp130_ == NULL, "entries.lower (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp130_); + _g_object_unref0 (_tmp128_); + break; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_higher (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedSet* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeSortedSet* _tmp14_; + GeeMapEntry* _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + gpointer _tmp17_ = NULL; + GeeMapEntry* _tmp18_; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeSortedSet* _tmp22_; + GeeMapEntry* _tmp23_ = NULL; + GeeMapEntry* _tmp24_; + gpointer _tmp25_ = NULL; + GeeMapEntry* _tmp26_; + GeeSortedSet* _tmp27_; + gpointer _tmp28_ = NULL; + gchar* _tmp29_; + GeeSortedSet* _tmp30_; + GeeMapEntry* _tmp31_ = NULL; + GeeMapEntry* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + GeeSortedSet* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeSortedSet* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + gpointer _tmp41_ = NULL; + GeeMapEntry* _tmp42_; + _tmp11_ = keys; + _tmp12_ = gee_sorted_set_higher (_tmp11_, "a"); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (g_strcmp0 (_tmp13_, "five") == 0, "keys.higher (\"a\") == \"five\""); + _g_free0 (_tmp13_); + _tmp14_ = entries; + _tmp15_ = map_tests_entry_for ("a", "a"); + _tmp16_ = _tmp15_; + _tmp17_ = gee_sorted_set_higher (_tmp14_, _tmp16_); + _tmp18_ = (GeeMapEntry*) _tmp17_; + map_tests_assert_entry (_tmp18_, "five", "five"); + _g_object_unref0 (_tmp18_); + _g_object_unref0 (_tmp16_); + _tmp19_ = keys; + _tmp20_ = gee_sorted_set_higher (_tmp19_, "five"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "four") == 0, "keys.higher (\"five\") == \"four\""); + _g_free0 (_tmp21_); + _tmp22_ = entries; + _tmp23_ = map_tests_entry_for ("five", "five"); + _tmp24_ = _tmp23_; + _tmp25_ = gee_sorted_set_higher (_tmp22_, _tmp24_); + _tmp26_ = (GeeMapEntry*) _tmp25_; + map_tests_assert_entry (_tmp26_, "four", "four"); + _g_object_unref0 (_tmp26_); + _g_object_unref0 (_tmp24_); + _tmp27_ = keys; + _tmp28_ = gee_sorted_set_higher (_tmp27_, "four"); + _tmp29_ = (gchar*) _tmp28_; + _vala_assert (_tmp29_ == NULL, "keys.higher (\"four\") == null"); + _g_free0 (_tmp29_); + _tmp30_ = entries; + _tmp31_ = map_tests_entry_for ("four", "four"); + _tmp32_ = _tmp31_; + _tmp33_ = gee_sorted_set_higher (_tmp30_, _tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + _vala_assert (_tmp34_ == NULL, "entries.higher (MapTests.entry_for (\"four\", \"four\")) == null"); + _g_object_unref0 (_tmp34_); + _g_object_unref0 (_tmp32_); + _tmp35_ = keys; + _tmp36_ = gee_sorted_set_higher (_tmp35_, "six"); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (_tmp37_ == NULL, "keys.higher (\"six\") == null"); + _g_free0 (_tmp37_); + _tmp38_ = entries; + _tmp39_ = map_tests_entry_for ("six", "six"); + _tmp40_ = _tmp39_; + _tmp41_ = gee_sorted_set_higher (_tmp38_, _tmp40_); + _tmp42_ = (GeeMapEntry*) _tmp41_; + _vala_assert (_tmp42_ == NULL, "entries.higher (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp42_); + _g_object_unref0 (_tmp40_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedSet* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeSortedSet* _tmp46_; + GeeMapEntry* _tmp47_ = NULL; + GeeMapEntry* _tmp48_; + gpointer _tmp49_ = NULL; + GeeMapEntry* _tmp50_; + GeeSortedSet* _tmp51_; + gpointer _tmp52_ = NULL; + gchar* _tmp53_; + GeeSortedSet* _tmp54_; + GeeMapEntry* _tmp55_ = NULL; + GeeMapEntry* _tmp56_; + gpointer _tmp57_ = NULL; + GeeMapEntry* _tmp58_; + GeeSortedSet* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + GeeSortedSet* _tmp62_; + GeeMapEntry* _tmp63_ = NULL; + GeeMapEntry* _tmp64_; + gpointer _tmp65_ = NULL; + GeeMapEntry* _tmp66_; + GeeSortedSet* _tmp67_; + gpointer _tmp68_ = NULL; + gchar* _tmp69_; + GeeSortedSet* _tmp70_; + GeeMapEntry* _tmp71_ = NULL; + GeeMapEntry* _tmp72_; + gpointer _tmp73_ = NULL; + GeeMapEntry* _tmp74_; + GeeSortedSet* _tmp75_; + gpointer _tmp76_ = NULL; + gchar* _tmp77_; + GeeSortedSet* _tmp78_; + GeeMapEntry* _tmp79_ = NULL; + GeeMapEntry* _tmp80_; + gpointer _tmp81_ = NULL; + GeeMapEntry* _tmp82_; + _tmp43_ = keys; + _tmp44_ = gee_sorted_set_higher (_tmp43_, "one"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (g_strcmp0 (_tmp45_, "six") == 0, "keys.higher (\"one\") == \"six\""); + _g_free0 (_tmp45_); + _tmp46_ = entries; + _tmp47_ = map_tests_entry_for ("one", "one"); + _tmp48_ = _tmp47_; + _tmp49_ = gee_sorted_set_higher (_tmp46_, _tmp48_); + _tmp50_ = (GeeMapEntry*) _tmp49_; + map_tests_assert_entry (_tmp50_, "six", "six"); + _g_object_unref0 (_tmp50_); + _g_object_unref0 (_tmp48_); + _tmp51_ = keys; + _tmp52_ = gee_sorted_set_higher (_tmp51_, "six"); + _tmp53_ = (gchar*) _tmp52_; + _vala_assert (g_strcmp0 (_tmp53_, "three") == 0, "keys.higher (\"six\") == \"three\""); + _g_free0 (_tmp53_); + _tmp54_ = entries; + _tmp55_ = map_tests_entry_for ("six", "six"); + _tmp56_ = _tmp55_; + _tmp57_ = gee_sorted_set_higher (_tmp54_, _tmp56_); + _tmp58_ = (GeeMapEntry*) _tmp57_; + map_tests_assert_entry (_tmp58_, "three", "three"); + _g_object_unref0 (_tmp58_); + _g_object_unref0 (_tmp56_); + _tmp59_ = keys; + _tmp60_ = gee_sorted_set_higher (_tmp59_, "three"); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "two") == 0, "keys.higher (\"three\") == \"two\""); + _g_free0 (_tmp61_); + _tmp62_ = entries; + _tmp63_ = map_tests_entry_for ("three", "three"); + _tmp64_ = _tmp63_; + _tmp65_ = gee_sorted_set_higher (_tmp62_, _tmp64_); + _tmp66_ = (GeeMapEntry*) _tmp65_; + map_tests_assert_entry (_tmp66_, "two", "two"); + _g_object_unref0 (_tmp66_); + _g_object_unref0 (_tmp64_); + _tmp67_ = keys; + _tmp68_ = gee_sorted_set_higher (_tmp67_, "two"); + _tmp69_ = (gchar*) _tmp68_; + _vala_assert (_tmp69_ == NULL, "keys.higher (\"two\") == null"); + _g_free0 (_tmp69_); + _tmp70_ = entries; + _tmp71_ = map_tests_entry_for ("two", "two"); + _tmp72_ = _tmp71_; + _tmp73_ = gee_sorted_set_higher (_tmp70_, _tmp72_); + _tmp74_ = (GeeMapEntry*) _tmp73_; + _vala_assert (_tmp74_ == NULL, "entries.higher (MapTests.entry_for (\"two\", \"two\")) == null"); + _g_object_unref0 (_tmp74_); + _g_object_unref0 (_tmp72_); + _tmp75_ = keys; + _tmp76_ = gee_sorted_set_higher (_tmp75_, "z"); + _tmp77_ = (gchar*) _tmp76_; + _vala_assert (_tmp77_ == NULL, "keys.higher (\"z\") == null"); + _g_free0 (_tmp77_); + _tmp78_ = entries; + _tmp79_ = map_tests_entry_for ("z", "z"); + _tmp80_ = _tmp79_; + _tmp81_ = gee_sorted_set_higher (_tmp78_, _tmp80_); + _tmp82_ = (GeeMapEntry*) _tmp81_; + _vala_assert (_tmp82_ == NULL, "entries.higher (MapTests.entry_for (\"z\", \"z\")) == null"); + _g_object_unref0 (_tmp82_); + _g_object_unref0 (_tmp80_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedSet* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeSortedSet* _tmp86_; + GeeMapEntry* _tmp87_ = NULL; + GeeMapEntry* _tmp88_; + gpointer _tmp89_ = NULL; + GeeMapEntry* _tmp90_; + GeeSortedSet* _tmp91_; + gpointer _tmp92_ = NULL; + gchar* _tmp93_; + GeeSortedSet* _tmp94_; + GeeMapEntry* _tmp95_ = NULL; + GeeMapEntry* _tmp96_; + gpointer _tmp97_ = NULL; + GeeMapEntry* _tmp98_; + GeeSortedSet* _tmp99_; + gpointer _tmp100_ = NULL; + gchar* _tmp101_; + GeeSortedSet* _tmp102_; + GeeMapEntry* _tmp103_ = NULL; + GeeMapEntry* _tmp104_; + gpointer _tmp105_ = NULL; + GeeMapEntry* _tmp106_; + GeeSortedSet* _tmp107_; + gpointer _tmp108_ = NULL; + gchar* _tmp109_; + GeeSortedSet* _tmp110_; + GeeMapEntry* _tmp111_ = NULL; + GeeMapEntry* _tmp112_; + gpointer _tmp113_ = NULL; + GeeMapEntry* _tmp114_; + GeeSortedSet* _tmp115_; + gpointer _tmp116_ = NULL; + gchar* _tmp117_; + GeeSortedSet* _tmp118_; + GeeMapEntry* _tmp119_ = NULL; + GeeMapEntry* _tmp120_; + gpointer _tmp121_ = NULL; + GeeMapEntry* _tmp122_; + _tmp83_ = keys; + _tmp84_ = gee_sorted_set_higher (_tmp83_, "five"); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (g_strcmp0 (_tmp85_, "four") == 0, "keys.higher (\"five\") == \"four\""); + _g_free0 (_tmp85_); + _tmp86_ = entries; + _tmp87_ = map_tests_entry_for ("five", "five"); + _tmp88_ = _tmp87_; + _tmp89_ = gee_sorted_set_higher (_tmp86_, _tmp88_); + _tmp90_ = (GeeMapEntry*) _tmp89_; + map_tests_assert_entry (_tmp90_, "four", "four"); + _g_object_unref0 (_tmp90_); + _g_object_unref0 (_tmp88_); + _tmp91_ = keys; + _tmp92_ = gee_sorted_set_higher (_tmp91_, "four"); + _tmp93_ = (gchar*) _tmp92_; + _vala_assert (g_strcmp0 (_tmp93_, "one") == 0, "keys.higher (\"four\") == \"one\""); + _g_free0 (_tmp93_); + _tmp94_ = entries; + _tmp95_ = map_tests_entry_for ("four", "four"); + _tmp96_ = _tmp95_; + _tmp97_ = gee_sorted_set_higher (_tmp94_, _tmp96_); + _tmp98_ = (GeeMapEntry*) _tmp97_; + map_tests_assert_entry (_tmp98_, "one", "one"); + _g_object_unref0 (_tmp98_); + _g_object_unref0 (_tmp96_); + _tmp99_ = keys; + _tmp100_ = gee_sorted_set_higher (_tmp99_, "one"); + _tmp101_ = (gchar*) _tmp100_; + _vala_assert (g_strcmp0 (_tmp101_, "six") == 0, "keys.higher (\"one\") == \"six\""); + _g_free0 (_tmp101_); + _tmp102_ = entries; + _tmp103_ = map_tests_entry_for ("one", "one"); + _tmp104_ = _tmp103_; + _tmp105_ = gee_sorted_set_higher (_tmp102_, _tmp104_); + _tmp106_ = (GeeMapEntry*) _tmp105_; + map_tests_assert_entry (_tmp106_, "six", "six"); + _g_object_unref0 (_tmp106_); + _g_object_unref0 (_tmp104_); + _tmp107_ = keys; + _tmp108_ = gee_sorted_set_higher (_tmp107_, "six"); + _tmp109_ = (gchar*) _tmp108_; + _vala_assert (_tmp109_ == NULL, "keys.higher (\"six\") == null"); + _g_free0 (_tmp109_); + _tmp110_ = entries; + _tmp111_ = map_tests_entry_for ("six", "six"); + _tmp112_ = _tmp111_; + _tmp113_ = gee_sorted_set_higher (_tmp110_, _tmp112_); + _tmp114_ = (GeeMapEntry*) _tmp113_; + _vala_assert (_tmp114_ == NULL, "entries.higher (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp114_); + _g_object_unref0 (_tmp112_); + _tmp115_ = keys; + _tmp116_ = gee_sorted_set_higher (_tmp115_, "three"); + _tmp117_ = (gchar*) _tmp116_; + _vala_assert (_tmp117_ == NULL, "keys.higher (\"three\") == null"); + _g_free0 (_tmp117_); + _tmp118_ = entries; + _tmp119_ = map_tests_entry_for ("three", "three"); + _tmp120_ = _tmp119_; + _tmp121_ = gee_sorted_set_higher (_tmp118_, _tmp120_); + _tmp122_ = (GeeMapEntry*) _tmp121_; + _vala_assert (_tmp122_ == NULL, "entries.higher (MapTests.entry_for (\"three\", \"three\")) == null"); + _g_object_unref0 (_tmp122_); + _g_object_unref0 (_tmp120_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedSet* _tmp123_; + gpointer _tmp124_ = NULL; + gchar* _tmp125_; + GeeSortedSet* _tmp126_; + GeeMapEntry* _tmp127_ = NULL; + GeeMapEntry* _tmp128_; + gpointer _tmp129_ = NULL; + GeeMapEntry* _tmp130_; + _tmp123_ = keys; + _tmp124_ = gee_sorted_set_higher (_tmp123_, "six"); + _tmp125_ = (gchar*) _tmp124_; + _vala_assert (_tmp125_ == NULL, "keys.higher (\"six\") == null"); + _g_free0 (_tmp125_); + _tmp126_ = entries; + _tmp127_ = map_tests_entry_for ("six", "six"); + _tmp128_ = _tmp127_; + _tmp129_ = gee_sorted_set_higher (_tmp126_, _tmp128_); + _tmp130_ = (GeeMapEntry*) _tmp129_; + _vala_assert (_tmp130_ == NULL, "entries.higher (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp130_); + _g_object_unref0 (_tmp128_); + break; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_floor (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedSet* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeSortedSet* _tmp14_; + GeeMapEntry* _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + gpointer _tmp17_ = NULL; + GeeMapEntry* _tmp18_; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeSortedSet* _tmp22_; + GeeMapEntry* _tmp23_ = NULL; + GeeMapEntry* _tmp24_; + gpointer _tmp25_ = NULL; + GeeMapEntry* _tmp26_; + GeeSortedSet* _tmp27_; + gpointer _tmp28_ = NULL; + gchar* _tmp29_; + GeeSortedSet* _tmp30_; + GeeMapEntry* _tmp31_ = NULL; + GeeMapEntry* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + GeeSortedSet* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeSortedSet* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + gpointer _tmp41_ = NULL; + GeeMapEntry* _tmp42_; + _tmp11_ = keys; + _tmp12_ = gee_sorted_set_floor (_tmp11_, "a"); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (_tmp13_ == NULL, "keys.floor (\"a\") == null"); + _g_free0 (_tmp13_); + _tmp14_ = entries; + _tmp15_ = map_tests_entry_for ("a", "a"); + _tmp16_ = _tmp15_; + _tmp17_ = gee_sorted_set_floor (_tmp14_, _tmp16_); + _tmp18_ = (GeeMapEntry*) _tmp17_; + _vala_assert (_tmp18_ == NULL, "entries.floor (MapTests.entry_for (\"a\", \"a\")) == null"); + _g_object_unref0 (_tmp18_); + _g_object_unref0 (_tmp16_); + _tmp19_ = keys; + _tmp20_ = gee_sorted_set_floor (_tmp19_, "five"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "five") == 0, "keys.floor (\"five\") == \"five\""); + _g_free0 (_tmp21_); + _tmp22_ = entries; + _tmp23_ = map_tests_entry_for ("five", "fiv"); + _tmp24_ = _tmp23_; + _tmp25_ = gee_sorted_set_floor (_tmp22_, _tmp24_); + _tmp26_ = (GeeMapEntry*) _tmp25_; + map_tests_assert_entry (_tmp26_, "five", "five"); + _g_object_unref0 (_tmp26_); + _g_object_unref0 (_tmp24_); + _tmp27_ = keys; + _tmp28_ = gee_sorted_set_floor (_tmp27_, "four"); + _tmp29_ = (gchar*) _tmp28_; + _vala_assert (g_strcmp0 (_tmp29_, "four") == 0, "keys.floor (\"four\") == \"four\""); + _g_free0 (_tmp29_); + _tmp30_ = entries; + _tmp31_ = map_tests_entry_for ("four", "four"); + _tmp32_ = _tmp31_; + _tmp33_ = gee_sorted_set_floor (_tmp30_, _tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + map_tests_assert_entry (_tmp34_, "four", "four"); + _g_object_unref0 (_tmp34_); + _g_object_unref0 (_tmp32_); + _tmp35_ = keys; + _tmp36_ = gee_sorted_set_floor (_tmp35_, "six"); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (g_strcmp0 (_tmp37_, "four") == 0, "keys.floor (\"six\") == \"four\""); + _g_free0 (_tmp37_); + _tmp38_ = entries; + _tmp39_ = map_tests_entry_for ("six", "six"); + _tmp40_ = _tmp39_; + _tmp41_ = gee_sorted_set_floor (_tmp38_, _tmp40_); + _tmp42_ = (GeeMapEntry*) _tmp41_; + map_tests_assert_entry (_tmp42_, "four", "four"); + _g_object_unref0 (_tmp42_); + _g_object_unref0 (_tmp40_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedSet* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeSortedSet* _tmp46_; + GeeMapEntry* _tmp47_ = NULL; + GeeMapEntry* _tmp48_; + gpointer _tmp49_ = NULL; + GeeMapEntry* _tmp50_; + GeeSortedSet* _tmp51_; + gpointer _tmp52_ = NULL; + gchar* _tmp53_; + GeeSortedSet* _tmp54_; + GeeMapEntry* _tmp55_ = NULL; + GeeMapEntry* _tmp56_; + gpointer _tmp57_ = NULL; + GeeMapEntry* _tmp58_; + GeeSortedSet* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + GeeSortedSet* _tmp62_; + GeeMapEntry* _tmp63_ = NULL; + GeeMapEntry* _tmp64_; + gpointer _tmp65_ = NULL; + GeeMapEntry* _tmp66_; + GeeSortedSet* _tmp67_; + gpointer _tmp68_ = NULL; + gchar* _tmp69_; + GeeSortedSet* _tmp70_; + GeeMapEntry* _tmp71_ = NULL; + GeeMapEntry* _tmp72_; + gpointer _tmp73_ = NULL; + GeeMapEntry* _tmp74_; + GeeSortedSet* _tmp75_; + gpointer _tmp76_ = NULL; + gchar* _tmp77_; + GeeSortedSet* _tmp78_; + GeeMapEntry* _tmp79_ = NULL; + GeeMapEntry* _tmp80_; + gpointer _tmp81_ = NULL; + GeeMapEntry* _tmp82_; + _tmp43_ = keys; + _tmp44_ = gee_sorted_set_floor (_tmp43_, "one"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (_tmp45_ == NULL, "keys.floor (\"one\") == null"); + _g_free0 (_tmp45_); + _tmp46_ = entries; + _tmp47_ = map_tests_entry_for ("one", "one"); + _tmp48_ = _tmp47_; + _tmp49_ = gee_sorted_set_floor (_tmp46_, _tmp48_); + _tmp50_ = (GeeMapEntry*) _tmp49_; + _vala_assert (_tmp50_ == NULL, "entries.floor (MapTests.entry_for (\"one\", \"one\")) == null"); + _g_object_unref0 (_tmp50_); + _g_object_unref0 (_tmp48_); + _tmp51_ = keys; + _tmp52_ = gee_sorted_set_floor (_tmp51_, "six"); + _tmp53_ = (gchar*) _tmp52_; + _vala_assert (g_strcmp0 (_tmp53_, "six") == 0, "keys.floor (\"six\") == \"six\""); + _g_free0 (_tmp53_); + _tmp54_ = entries; + _tmp55_ = map_tests_entry_for ("six", "six"); + _tmp56_ = _tmp55_; + _tmp57_ = gee_sorted_set_floor (_tmp54_, _tmp56_); + _tmp58_ = (GeeMapEntry*) _tmp57_; + map_tests_assert_entry (_tmp58_, "six", "six"); + _g_object_unref0 (_tmp58_); + _g_object_unref0 (_tmp56_); + _tmp59_ = keys; + _tmp60_ = gee_sorted_set_floor (_tmp59_, "three"); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "three") == 0, "keys.floor (\"three\") == \"three\""); + _g_free0 (_tmp61_); + _tmp62_ = entries; + _tmp63_ = map_tests_entry_for ("three", "three"); + _tmp64_ = _tmp63_; + _tmp65_ = gee_sorted_set_floor (_tmp62_, _tmp64_); + _tmp66_ = (GeeMapEntry*) _tmp65_; + map_tests_assert_entry (_tmp66_, "three", "three"); + _g_object_unref0 (_tmp66_); + _g_object_unref0 (_tmp64_); + _tmp67_ = keys; + _tmp68_ = gee_sorted_set_floor (_tmp67_, "two"); + _tmp69_ = (gchar*) _tmp68_; + _vala_assert (g_strcmp0 (_tmp69_, "two") == 0, "keys.floor (\"two\") == \"two\""); + _g_free0 (_tmp69_); + _tmp70_ = entries; + _tmp71_ = map_tests_entry_for ("two", "two"); + _tmp72_ = _tmp71_; + _tmp73_ = gee_sorted_set_floor (_tmp70_, _tmp72_); + _tmp74_ = (GeeMapEntry*) _tmp73_; + map_tests_assert_entry (_tmp74_, "two", "two"); + _g_object_unref0 (_tmp74_); + _g_object_unref0 (_tmp72_); + _tmp75_ = keys; + _tmp76_ = gee_sorted_set_floor (_tmp75_, "z"); + _tmp77_ = (gchar*) _tmp76_; + _vala_assert (g_strcmp0 (_tmp77_, "two") == 0, "keys.floor (\"z\") == \"two\""); + _g_free0 (_tmp77_); + _tmp78_ = entries; + _tmp79_ = map_tests_entry_for ("z", "z"); + _tmp80_ = _tmp79_; + _tmp81_ = gee_sorted_set_floor (_tmp78_, _tmp80_); + _tmp82_ = (GeeMapEntry*) _tmp81_; + map_tests_assert_entry (_tmp82_, "two", "two"); + _g_object_unref0 (_tmp82_); + _g_object_unref0 (_tmp80_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedSet* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeSortedSet* _tmp86_; + GeeMapEntry* _tmp87_ = NULL; + GeeMapEntry* _tmp88_; + gpointer _tmp89_ = NULL; + GeeMapEntry* _tmp90_; + GeeSortedSet* _tmp91_; + gpointer _tmp92_ = NULL; + gchar* _tmp93_; + GeeSortedSet* _tmp94_; + GeeMapEntry* _tmp95_ = NULL; + GeeMapEntry* _tmp96_; + gpointer _tmp97_ = NULL; + GeeMapEntry* _tmp98_; + GeeSortedSet* _tmp99_; + gpointer _tmp100_ = NULL; + gchar* _tmp101_; + GeeSortedSet* _tmp102_; + GeeMapEntry* _tmp103_ = NULL; + GeeMapEntry* _tmp104_; + gpointer _tmp105_ = NULL; + GeeMapEntry* _tmp106_; + GeeSortedSet* _tmp107_; + gpointer _tmp108_ = NULL; + gchar* _tmp109_; + GeeSortedSet* _tmp110_; + GeeMapEntry* _tmp111_ = NULL; + GeeMapEntry* _tmp112_; + gpointer _tmp113_ = NULL; + GeeMapEntry* _tmp114_; + GeeSortedSet* _tmp115_; + gpointer _tmp116_ = NULL; + gchar* _tmp117_; + GeeSortedSet* _tmp118_; + GeeMapEntry* _tmp119_ = NULL; + GeeMapEntry* _tmp120_; + gpointer _tmp121_ = NULL; + GeeMapEntry* _tmp122_; + _tmp83_ = keys; + _tmp84_ = gee_sorted_set_floor (_tmp83_, "five"); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (_tmp85_ == NULL, "keys.floor (\"five\") == null"); + _g_free0 (_tmp85_); + _tmp86_ = entries; + _tmp87_ = map_tests_entry_for ("five", "five"); + _tmp88_ = _tmp87_; + _tmp89_ = gee_sorted_set_floor (_tmp86_, _tmp88_); + _tmp90_ = (GeeMapEntry*) _tmp89_; + _vala_assert (_tmp90_ == NULL, "entries.floor (MapTests.entry_for (\"five\", \"five\")) == null"); + _g_object_unref0 (_tmp90_); + _g_object_unref0 (_tmp88_); + _tmp91_ = keys; + _tmp92_ = gee_sorted_set_floor (_tmp91_, "four"); + _tmp93_ = (gchar*) _tmp92_; + _vala_assert (g_strcmp0 (_tmp93_, "four") == 0, "keys.floor (\"four\") == \"four\""); + _g_free0 (_tmp93_); + _tmp94_ = entries; + _tmp95_ = map_tests_entry_for ("four", "four"); + _tmp96_ = _tmp95_; + _tmp97_ = gee_sorted_set_floor (_tmp94_, _tmp96_); + _tmp98_ = (GeeMapEntry*) _tmp97_; + map_tests_assert_entry (_tmp98_, "four", "four"); + _g_object_unref0 (_tmp98_); + _g_object_unref0 (_tmp96_); + _tmp99_ = keys; + _tmp100_ = gee_sorted_set_floor (_tmp99_, "one"); + _tmp101_ = (gchar*) _tmp100_; + _vala_assert (g_strcmp0 (_tmp101_, "one") == 0, "keys.floor (\"one\") == \"one\""); + _g_free0 (_tmp101_); + _tmp102_ = entries; + _tmp103_ = map_tests_entry_for ("one", "one"); + _tmp104_ = _tmp103_; + _tmp105_ = gee_sorted_set_floor (_tmp102_, _tmp104_); + _tmp106_ = (GeeMapEntry*) _tmp105_; + map_tests_assert_entry (_tmp106_, "one", "one"); + _g_object_unref0 (_tmp106_); + _g_object_unref0 (_tmp104_); + _tmp107_ = keys; + _tmp108_ = gee_sorted_set_floor (_tmp107_, "six"); + _tmp109_ = (gchar*) _tmp108_; + _vala_assert (g_strcmp0 (_tmp109_, "six") == 0, "keys.floor (\"six\") == \"six\""); + _g_free0 (_tmp109_); + _tmp110_ = entries; + _tmp111_ = map_tests_entry_for ("six", "six"); + _tmp112_ = _tmp111_; + _tmp113_ = gee_sorted_set_floor (_tmp110_, _tmp112_); + _tmp114_ = (GeeMapEntry*) _tmp113_; + map_tests_assert_entry (_tmp114_, "six", "six"); + _g_object_unref0 (_tmp114_); + _g_object_unref0 (_tmp112_); + _tmp115_ = keys; + _tmp116_ = gee_sorted_set_floor (_tmp115_, "three"); + _tmp117_ = (gchar*) _tmp116_; + _vala_assert (g_strcmp0 (_tmp117_, "six") == 0, "keys.floor (\"three\") == \"six\""); + _g_free0 (_tmp117_); + _tmp118_ = entries; + _tmp119_ = map_tests_entry_for ("three", "three"); + _tmp120_ = _tmp119_; + _tmp121_ = gee_sorted_set_floor (_tmp118_, _tmp120_); + _tmp122_ = (GeeMapEntry*) _tmp121_; + map_tests_assert_entry (_tmp122_, "six", "six"); + _g_object_unref0 (_tmp122_); + _g_object_unref0 (_tmp120_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedSet* _tmp123_; + gpointer _tmp124_ = NULL; + gchar* _tmp125_; + GeeSortedSet* _tmp126_; + GeeMapEntry* _tmp127_ = NULL; + GeeMapEntry* _tmp128_; + gpointer _tmp129_ = NULL; + GeeMapEntry* _tmp130_; + _tmp123_ = keys; + _tmp124_ = gee_sorted_set_floor (_tmp123_, "six"); + _tmp125_ = (gchar*) _tmp124_; + _vala_assert (_tmp125_ == NULL, "keys.floor (\"six\") == null"); + _g_free0 (_tmp125_); + _tmp126_ = entries; + _tmp127_ = map_tests_entry_for ("six", "six"); + _tmp128_ = _tmp127_; + _tmp129_ = gee_sorted_set_floor (_tmp126_, _tmp128_); + _tmp130_ = (GeeMapEntry*) _tmp129_; + _vala_assert (_tmp130_ == NULL, "entries.floor (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp130_); + _g_object_unref0 (_tmp128_); + break; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_ceil (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedSet* _tmp11_; + gpointer _tmp12_ = NULL; + gchar* _tmp13_; + GeeSortedSet* _tmp14_; + GeeMapEntry* _tmp15_ = NULL; + GeeMapEntry* _tmp16_; + gpointer _tmp17_ = NULL; + GeeMapEntry* _tmp18_; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; + GeeSortedSet* _tmp22_; + GeeMapEntry* _tmp23_ = NULL; + GeeMapEntry* _tmp24_; + gpointer _tmp25_ = NULL; + GeeMapEntry* _tmp26_; + GeeSortedSet* _tmp27_; + gpointer _tmp28_ = NULL; + gchar* _tmp29_; + GeeSortedSet* _tmp30_; + GeeMapEntry* _tmp31_ = NULL; + GeeMapEntry* _tmp32_; + gpointer _tmp33_ = NULL; + GeeMapEntry* _tmp34_; + GeeSortedSet* _tmp35_; + gpointer _tmp36_ = NULL; + gchar* _tmp37_; + GeeSortedSet* _tmp38_; + GeeMapEntry* _tmp39_ = NULL; + GeeMapEntry* _tmp40_; + gpointer _tmp41_ = NULL; + GeeMapEntry* _tmp42_; + _tmp11_ = keys; + _tmp12_ = gee_sorted_set_ceil (_tmp11_, "a"); + _tmp13_ = (gchar*) _tmp12_; + _vala_assert (g_strcmp0 (_tmp13_, "five") == 0, "keys.ceil (\"a\") == \"five\""); + _g_free0 (_tmp13_); + _tmp14_ = entries; + _tmp15_ = map_tests_entry_for ("a", "a"); + _tmp16_ = _tmp15_; + _tmp17_ = gee_sorted_set_ceil (_tmp14_, _tmp16_); + _tmp18_ = (GeeMapEntry*) _tmp17_; + map_tests_assert_entry (_tmp18_, "five", "five"); + _g_object_unref0 (_tmp18_); + _g_object_unref0 (_tmp16_); + _tmp19_ = keys; + _tmp20_ = gee_sorted_set_ceil (_tmp19_, "five"); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "five") == 0, "keys.ceil (\"five\") == \"five\""); + _g_free0 (_tmp21_); + _tmp22_ = entries; + _tmp23_ = map_tests_entry_for ("five", "five"); + _tmp24_ = _tmp23_; + _tmp25_ = gee_sorted_set_ceil (_tmp22_, _tmp24_); + _tmp26_ = (GeeMapEntry*) _tmp25_; + map_tests_assert_entry (_tmp26_, "five", "five"); + _g_object_unref0 (_tmp26_); + _g_object_unref0 (_tmp24_); + _tmp27_ = keys; + _tmp28_ = gee_sorted_set_ceil (_tmp27_, "four"); + _tmp29_ = (gchar*) _tmp28_; + _vala_assert (g_strcmp0 (_tmp29_, "four") == 0, "keys.ceil (\"four\") == \"four\""); + _g_free0 (_tmp29_); + _tmp30_ = entries; + _tmp31_ = map_tests_entry_for ("four", "four"); + _tmp32_ = _tmp31_; + _tmp33_ = gee_sorted_set_ceil (_tmp30_, _tmp32_); + _tmp34_ = (GeeMapEntry*) _tmp33_; + map_tests_assert_entry (_tmp34_, "four", "four"); + _g_object_unref0 (_tmp34_); + _g_object_unref0 (_tmp32_); + _tmp35_ = keys; + _tmp36_ = gee_sorted_set_ceil (_tmp35_, "six"); + _tmp37_ = (gchar*) _tmp36_; + _vala_assert (_tmp37_ == NULL, "keys.ceil (\"six\") == null"); + _g_free0 (_tmp37_); + _tmp38_ = entries; + _tmp39_ = map_tests_entry_for ("six", "six"); + _tmp40_ = _tmp39_; + _tmp41_ = gee_sorted_set_ceil (_tmp38_, _tmp40_); + _tmp42_ = (GeeMapEntry*) _tmp41_; + _vala_assert (_tmp42_ == NULL, "entries.ceil (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp42_); + _g_object_unref0 (_tmp40_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedSet* _tmp43_; + gpointer _tmp44_ = NULL; + gchar* _tmp45_; + GeeSortedSet* _tmp46_; + GeeMapEntry* _tmp47_ = NULL; + GeeMapEntry* _tmp48_; + gpointer _tmp49_ = NULL; + GeeMapEntry* _tmp50_; + GeeSortedSet* _tmp51_; + gpointer _tmp52_ = NULL; + gchar* _tmp53_; + GeeSortedSet* _tmp54_; + GeeMapEntry* _tmp55_ = NULL; + GeeMapEntry* _tmp56_; + gpointer _tmp57_ = NULL; + GeeMapEntry* _tmp58_; + GeeSortedSet* _tmp59_; + gpointer _tmp60_ = NULL; + gchar* _tmp61_; + GeeSortedSet* _tmp62_; + GeeMapEntry* _tmp63_ = NULL; + GeeMapEntry* _tmp64_; + gpointer _tmp65_ = NULL; + GeeMapEntry* _tmp66_; + GeeSortedSet* _tmp67_; + gpointer _tmp68_ = NULL; + gchar* _tmp69_; + GeeSortedSet* _tmp70_; + GeeMapEntry* _tmp71_ = NULL; + GeeMapEntry* _tmp72_; + gpointer _tmp73_ = NULL; + GeeMapEntry* _tmp74_; + GeeSortedSet* _tmp75_; + gpointer _tmp76_ = NULL; + gchar* _tmp77_; + GeeSortedSet* _tmp78_; + GeeMapEntry* _tmp79_ = NULL; + GeeMapEntry* _tmp80_; + gpointer _tmp81_ = NULL; + GeeMapEntry* _tmp82_; + _tmp43_ = keys; + _tmp44_ = gee_sorted_set_ceil (_tmp43_, "one"); + _tmp45_ = (gchar*) _tmp44_; + _vala_assert (g_strcmp0 (_tmp45_, "six") == 0, "keys.ceil (\"one\") == \"six\""); + _g_free0 (_tmp45_); + _tmp46_ = entries; + _tmp47_ = map_tests_entry_for ("one", "one"); + _tmp48_ = _tmp47_; + _tmp49_ = gee_sorted_set_ceil (_tmp46_, _tmp48_); + _tmp50_ = (GeeMapEntry*) _tmp49_; + map_tests_assert_entry (_tmp50_, "six", "six"); + _g_object_unref0 (_tmp50_); + _g_object_unref0 (_tmp48_); + _tmp51_ = keys; + _tmp52_ = gee_sorted_set_ceil (_tmp51_, "six"); + _tmp53_ = (gchar*) _tmp52_; + _vala_assert (g_strcmp0 (_tmp53_, "six") == 0, "keys.ceil (\"six\") == \"six\""); + _g_free0 (_tmp53_); + _tmp54_ = entries; + _tmp55_ = map_tests_entry_for ("six", "six"); + _tmp56_ = _tmp55_; + _tmp57_ = gee_sorted_set_ceil (_tmp54_, _tmp56_); + _tmp58_ = (GeeMapEntry*) _tmp57_; + map_tests_assert_entry (_tmp58_, "six", "six"); + _g_object_unref0 (_tmp58_); + _g_object_unref0 (_tmp56_); + _tmp59_ = keys; + _tmp60_ = gee_sorted_set_ceil (_tmp59_, "three"); + _tmp61_ = (gchar*) _tmp60_; + _vala_assert (g_strcmp0 (_tmp61_, "three") == 0, "keys.ceil (\"three\") == \"three\""); + _g_free0 (_tmp61_); + _tmp62_ = entries; + _tmp63_ = map_tests_entry_for ("three", "three"); + _tmp64_ = _tmp63_; + _tmp65_ = gee_sorted_set_ceil (_tmp62_, _tmp64_); + _tmp66_ = (GeeMapEntry*) _tmp65_; + map_tests_assert_entry (_tmp66_, "three", "three"); + _g_object_unref0 (_tmp66_); + _g_object_unref0 (_tmp64_); + _tmp67_ = keys; + _tmp68_ = gee_sorted_set_ceil (_tmp67_, "two"); + _tmp69_ = (gchar*) _tmp68_; + _vala_assert (g_strcmp0 (_tmp69_, "two") == 0, "keys.ceil (\"two\") == \"two\""); + _g_free0 (_tmp69_); + _tmp70_ = entries; + _tmp71_ = map_tests_entry_for ("two", "two"); + _tmp72_ = _tmp71_; + _tmp73_ = gee_sorted_set_ceil (_tmp70_, _tmp72_); + _tmp74_ = (GeeMapEntry*) _tmp73_; + map_tests_assert_entry (_tmp74_, "two", "two"); + _g_object_unref0 (_tmp74_); + _g_object_unref0 (_tmp72_); + _tmp75_ = keys; + _tmp76_ = gee_sorted_set_ceil (_tmp75_, "z"); + _tmp77_ = (gchar*) _tmp76_; + _vala_assert (_tmp77_ == NULL, "keys.ceil (\"z\") == null"); + _g_free0 (_tmp77_); + _tmp78_ = entries; + _tmp79_ = map_tests_entry_for ("z", "z"); + _tmp80_ = _tmp79_; + _tmp81_ = gee_sorted_set_ceil (_tmp78_, _tmp80_); + _tmp82_ = (GeeMapEntry*) _tmp81_; + _vala_assert (_tmp82_ == NULL, "entries.ceil (MapTests.entry_for (\"z\", \"z\")) == null"); + _g_object_unref0 (_tmp82_); + _g_object_unref0 (_tmp80_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedSet* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeSortedSet* _tmp86_; + GeeMapEntry* _tmp87_ = NULL; + GeeMapEntry* _tmp88_; + gpointer _tmp89_ = NULL; + GeeMapEntry* _tmp90_; + GeeSortedSet* _tmp91_; + gpointer _tmp92_ = NULL; + gchar* _tmp93_; + GeeSortedSet* _tmp94_; + GeeMapEntry* _tmp95_ = NULL; + GeeMapEntry* _tmp96_; + gpointer _tmp97_ = NULL; + GeeMapEntry* _tmp98_; + GeeSortedSet* _tmp99_; + gpointer _tmp100_ = NULL; + gchar* _tmp101_; + GeeSortedSet* _tmp102_; + GeeMapEntry* _tmp103_ = NULL; + GeeMapEntry* _tmp104_; + gpointer _tmp105_ = NULL; + GeeMapEntry* _tmp106_; + GeeSortedSet* _tmp107_; + gpointer _tmp108_ = NULL; + gchar* _tmp109_; + GeeSortedSet* _tmp110_; + GeeMapEntry* _tmp111_ = NULL; + GeeMapEntry* _tmp112_; + gpointer _tmp113_ = NULL; + GeeMapEntry* _tmp114_; + GeeSortedSet* _tmp115_; + gpointer _tmp116_ = NULL; + gchar* _tmp117_; + GeeSortedSet* _tmp118_; + GeeMapEntry* _tmp119_ = NULL; + GeeMapEntry* _tmp120_; + gpointer _tmp121_ = NULL; + GeeMapEntry* _tmp122_; + _tmp83_ = keys; + _tmp84_ = gee_sorted_set_ceil (_tmp83_, "five"); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (g_strcmp0 (_tmp85_, "four") == 0, "keys.ceil (\"five\") == \"four\""); + _g_free0 (_tmp85_); + _tmp86_ = entries; + _tmp87_ = map_tests_entry_for ("five", "five"); + _tmp88_ = _tmp87_; + _tmp89_ = gee_sorted_set_ceil (_tmp86_, _tmp88_); + _tmp90_ = (GeeMapEntry*) _tmp89_; + map_tests_assert_entry (_tmp90_, "four", "four"); + _g_object_unref0 (_tmp90_); + _g_object_unref0 (_tmp88_); + _tmp91_ = keys; + _tmp92_ = gee_sorted_set_ceil (_tmp91_, "four"); + _tmp93_ = (gchar*) _tmp92_; + _vala_assert (g_strcmp0 (_tmp93_, "four") == 0, "keys.ceil (\"four\") == \"four\""); + _g_free0 (_tmp93_); + _tmp94_ = entries; + _tmp95_ = map_tests_entry_for ("four", "four"); + _tmp96_ = _tmp95_; + _tmp97_ = gee_sorted_set_ceil (_tmp94_, _tmp96_); + _tmp98_ = (GeeMapEntry*) _tmp97_; + map_tests_assert_entry (_tmp98_, "four", "four"); + _g_object_unref0 (_tmp98_); + _g_object_unref0 (_tmp96_); + _tmp99_ = keys; + _tmp100_ = gee_sorted_set_ceil (_tmp99_, "one"); + _tmp101_ = (gchar*) _tmp100_; + _vala_assert (g_strcmp0 (_tmp101_, "one") == 0, "keys.ceil (\"one\") == \"one\""); + _g_free0 (_tmp101_); + _tmp102_ = entries; + _tmp103_ = map_tests_entry_for ("one", "one"); + _tmp104_ = _tmp103_; + _tmp105_ = gee_sorted_set_ceil (_tmp102_, _tmp104_); + _tmp106_ = (GeeMapEntry*) _tmp105_; + map_tests_assert_entry (_tmp106_, "one", "one"); + _g_object_unref0 (_tmp106_); + _g_object_unref0 (_tmp104_); + _tmp107_ = keys; + _tmp108_ = gee_sorted_set_ceil (_tmp107_, "six"); + _tmp109_ = (gchar*) _tmp108_; + _vala_assert (g_strcmp0 (_tmp109_, "six") == 0, "keys.ceil (\"six\") == \"six\""); + _g_free0 (_tmp109_); + _tmp110_ = entries; + _tmp111_ = map_tests_entry_for ("six", "six"); + _tmp112_ = _tmp111_; + _tmp113_ = gee_sorted_set_ceil (_tmp110_, _tmp112_); + _tmp114_ = (GeeMapEntry*) _tmp113_; + map_tests_assert_entry (_tmp114_, "six", "six"); + _g_object_unref0 (_tmp114_); + _g_object_unref0 (_tmp112_); + _tmp115_ = keys; + _tmp116_ = gee_sorted_set_ceil (_tmp115_, "three"); + _tmp117_ = (gchar*) _tmp116_; + _vala_assert (_tmp117_ == NULL, "keys.ceil (\"three\") == null"); + _g_free0 (_tmp117_); + _tmp118_ = entries; + _tmp119_ = map_tests_entry_for ("three", "three"); + _tmp120_ = _tmp119_; + _tmp121_ = gee_sorted_set_ceil (_tmp118_, _tmp120_); + _tmp122_ = (GeeMapEntry*) _tmp121_; + _vala_assert (_tmp122_ == NULL, "entries.ceil (MapTests.entry_for (\"three\", \"three\")) == null"); + _g_object_unref0 (_tmp122_); + _g_object_unref0 (_tmp120_); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedSet* _tmp123_; + gpointer _tmp124_ = NULL; + gchar* _tmp125_; + GeeSortedSet* _tmp126_; + GeeMapEntry* _tmp127_ = NULL; + GeeMapEntry* _tmp128_; + gpointer _tmp129_ = NULL; + GeeMapEntry* _tmp130_; + _tmp123_ = keys; + _tmp124_ = gee_sorted_set_ceil (_tmp123_, "six"); + _tmp125_ = (gchar*) _tmp124_; + _vala_assert (_tmp125_ == NULL, "keys.ceil (\"six\") == null"); + _g_free0 (_tmp125_); + _tmp126_ = entries; + _tmp127_ = map_tests_entry_for ("six", "six"); + _tmp128_ = _tmp127_; + _tmp129_ = gee_sorted_set_ceil (_tmp126_, _tmp128_); + _tmp130_ = (GeeMapEntry*) _tmp129_; + _vala_assert (_tmp130_ == NULL, "entries.ceil (MapTests.entry_for (\"six\", \"six\")) == null"); + _g_object_unref0 (_tmp130_); + _g_object_unref0 (_tmp128_); + break; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_iterator_at (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + gchar** _tmp10_; + gint _tmp10__length1; + gchar** _tmp32_; + gint _tmp32__length1; + GeeSortedSet* _tmp46_; + GeeIterator* _tmp47_ = NULL; + GeeIterator* _tmp48_; + GeeSortedSet* _tmp49_; + GeeMapEntry* _tmp50_ = NULL; + GeeMapEntry* _tmp51_; + GeeIterator* _tmp52_ = NULL; + GeeIterator* _tmp53_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = contains; + _tmp10__length1 = contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp10_; + s_collection_length1 = _tmp10__length1; + for (s_it = 0; s_it < _tmp10__length1; s_it = s_it + 1) { + gchar* _tmp11_; + gchar* s = NULL; + _tmp11_ = g_strdup (s_collection[s_it]); + s = _tmp11_; + { + GeeSortedSet* _tmp12_; + const gchar* _tmp13_; + GeeIterator* _tmp14_ = NULL; + GeeIterator* key_iter; + GeeSortedSet* _tmp15_; + const gchar* _tmp16_; + const gchar* _tmp17_; + GeeMapEntry* _tmp18_ = NULL; + GeeMapEntry* _tmp19_; + GeeIterator* _tmp20_ = NULL; + GeeIterator* _tmp21_; + GeeIterator* entry_iter; + GeeIterator* _tmp22_; + GeeIterator* _tmp23_; + gpointer _tmp24_ = NULL; + gchar* _tmp25_; + const gchar* _tmp26_; + GeeIterator* _tmp27_; + gpointer _tmp28_ = NULL; + GeeMapEntry* _tmp29_; + const gchar* _tmp30_; + const gchar* _tmp31_; + _tmp12_ = keys; + _tmp13_ = s; + _tmp14_ = gee_sorted_set_iterator_at (_tmp12_, _tmp13_); + key_iter = _tmp14_; + _tmp15_ = entries; + _tmp16_ = s; + _tmp17_ = s; + _tmp18_ = map_tests_entry_for (_tmp16_, _tmp17_); + _tmp19_ = _tmp18_; + _tmp20_ = gee_sorted_set_iterator_at (_tmp15_, _tmp19_); + _tmp21_ = _tmp20_; + _g_object_unref0 (_tmp19_); + entry_iter = _tmp21_; + _tmp22_ = key_iter; + _vala_assert (_tmp22_ != NULL, "key_iter != null"); + _tmp23_ = key_iter; + _tmp24_ = gee_iterator_get (_tmp23_); + _tmp25_ = (gchar*) _tmp24_; + _tmp26_ = s; + _vala_assert (g_strcmp0 (_tmp25_, _tmp26_) == 0, "key_iter.get () == s"); + _g_free0 (_tmp25_); + _tmp27_ = entry_iter; + _tmp28_ = gee_iterator_get (_tmp27_); + _tmp29_ = (GeeMapEntry*) _tmp28_; + _tmp30_ = s; + _tmp31_ = s; + map_tests_assert_entry (_tmp29_, _tmp30_, _tmp31_); + _g_object_unref0 (_tmp29_); + _g_object_unref0 (entry_iter); + _g_object_unref0 (key_iter); + _g_free0 (s); + } + } + } + _tmp32_ = not_contains; + _tmp32__length1 = not_contains_length1; + { + gchar** s_collection = NULL; + gint s_collection_length1 = 0; + gint _s_collection_size_ = 0; + gint s_it = 0; + s_collection = _tmp32_; + s_collection_length1 = _tmp32__length1; + for (s_it = 0; s_it < _tmp32__length1; s_it = s_it + 1) { + gchar* _tmp33_; + gchar* s = NULL; + _tmp33_ = g_strdup (s_collection[s_it]); + s = _tmp33_; + { + GeeSortedSet* _tmp34_; + const gchar* _tmp35_; + GeeIterator* _tmp36_ = NULL; + GeeIterator* key_iter; + GeeSortedSet* _tmp37_; + const gchar* _tmp38_; + const gchar* _tmp39_; + GeeMapEntry* _tmp40_ = NULL; + GeeMapEntry* _tmp41_; + GeeIterator* _tmp42_ = NULL; + GeeIterator* _tmp43_; + GeeIterator* entry_iter; + GeeIterator* _tmp44_; + GeeIterator* _tmp45_; + _tmp34_ = keys; + _tmp35_ = s; + _tmp36_ = gee_sorted_set_iterator_at (_tmp34_, _tmp35_); + key_iter = _tmp36_; + _tmp37_ = entries; + _tmp38_ = s; + _tmp39_ = s; + _tmp40_ = map_tests_entry_for (_tmp38_, _tmp39_); + _tmp41_ = _tmp40_; + _tmp42_ = gee_sorted_set_iterator_at (_tmp37_, _tmp41_); + _tmp43_ = _tmp42_; + _g_object_unref0 (_tmp41_); + entry_iter = _tmp43_; + _tmp44_ = key_iter; + _vala_assert (_tmp44_ == NULL, "key_iter == null"); + _tmp45_ = entry_iter; + _vala_assert (_tmp45_ == NULL, "entry_iter == null"); + _g_object_unref0 (entry_iter); + _g_object_unref0 (key_iter); + _g_free0 (s); + } + } + } + _tmp46_ = keys; + _tmp47_ = gee_sorted_set_iterator_at (_tmp46_, "seven"); + _tmp48_ = _tmp47_; + _vala_assert (_tmp48_ == NULL, "keys.iterator_at (\"seven\") == null"); + _g_object_unref0 (_tmp48_); + _tmp49_ = entries; + _tmp50_ = map_tests_entry_for ("seven", "seven"); + _tmp51_ = _tmp50_; + _tmp52_ = gee_sorted_set_iterator_at (_tmp49_, _tmp51_); + _tmp53_ = _tmp52_; + _vala_assert (_tmp53_ == NULL, "entries.iterator_at (MapTests.entry_for (\"seven\", \"seven\")) == null"); + _g_object_unref0 (_tmp53_); + _g_object_unref0 (_tmp51_); + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +void gee_sorted_map_tests_sub_map_tests_test_submap_and_subsets (GeeSortedMapTestsSubMapTests* self) { + gchar** contains = NULL; + gint contains_length1 = 0; + gint _contains_size_ = 0; + gchar** not_contains = NULL; + gint not_contains_length1 = 0; + gint _not_contains_size_ = 0; + GeeSortedMap* _tmp0_; + GeeSortedSet* _tmp1_; + GeeSortedSet* _tmp2_; + GeeSortedSet* keys; + GeeSortedMap* _tmp3_; + GeeSortedSet* _tmp4_; + GeeSortedSet* _tmp5_; + GeeSortedSet* entries; + gchar** _tmp6_ = NULL; + gint _tmp7_ = 0; + gchar** _tmp8_ = NULL; + gint _tmp9_ = 0; + GeeSortedMapTestsSubMapTestsType _tmp10_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->submap; + _tmp1_ = gee_sorted_map_get_ascending_keys (_tmp0_); + _tmp2_ = _tmp1_; + keys = _tmp2_; + _tmp3_ = self->priv->submap; + _tmp4_ = gee_sorted_map_get_ascending_entries (_tmp3_); + _tmp5_ = _tmp4_; + entries = _tmp5_; + gee_sorted_map_tests_sub_map_tests_set_default_values (self, &_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); + contains = _tmp6_; + contains_length1 = _tmp7_; + _contains_size_ = contains_length1; + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + not_contains = _tmp8_; + not_contains_length1 = _tmp9_; + _not_contains_size_ = not_contains_length1; + _tmp10_ = self->priv->type; + switch (_tmp10_) { + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_HEAD: + { + GeeSortedMap* _tmp11_; + GeeSortedMap* _tmp12_ = NULL; + GeeSortedMap* subsubmap; + GeeSortedSet* _tmp13_; + GeeSortedSet* _tmp14_ = NULL; + GeeSortedSet* keyssubset; + GeeSortedSet* _tmp15_; + GeeMapEntry* _tmp16_ = NULL; + GeeMapEntry* _tmp17_; + GeeSortedSet* _tmp18_ = NULL; + GeeSortedSet* _tmp19_; + GeeSortedSet* entriessubset; + GeeSortedMap* _tmp20_; + gint _tmp21_; + gint _tmp22_; + GeeSortedSet* _tmp23_; + gint _tmp24_; + gint _tmp25_; + GeeSortedSet* _tmp26_; + gint _tmp27_; + gint _tmp28_; + GeeSortedMap* _tmp29_; + GeeSortedMap* _tmp30_ = NULL; + GeeSortedSet* _tmp31_; + GeeSortedSet* _tmp32_ = NULL; + GeeSortedSet* _tmp33_; + GeeMapEntry* _tmp34_ = NULL; + GeeMapEntry* _tmp35_; + GeeSortedSet* _tmp36_ = NULL; + GeeSortedMap* _tmp37_; + gint _tmp38_; + gint _tmp39_; + GeeSortedSet* _tmp40_; + gint _tmp41_; + gint _tmp42_; + GeeSortedSet* _tmp43_; + gint _tmp44_; + gint _tmp45_; + GeeSortedMap* _tmp46_; + GeeSortedMap* _tmp47_ = NULL; + GeeSortedSet* _tmp48_; + GeeSortedSet* _tmp49_ = NULL; + GeeSortedSet* _tmp50_; + GeeMapEntry* _tmp51_ = NULL; + GeeMapEntry* _tmp52_; + GeeMapEntry* _tmp53_ = NULL; + GeeMapEntry* _tmp54_; + GeeSortedSet* _tmp55_ = NULL; + GeeSortedMap* _tmp56_; + gint _tmp57_; + gint _tmp58_; + GeeSortedSet* _tmp59_; + gint _tmp60_; + gint _tmp61_; + GeeSortedSet* _tmp62_; + gint _tmp63_; + gint _tmp64_; + GeeSortedMap* _tmp65_; + GeeSortedMap* _tmp66_ = NULL; + GeeSortedSet* _tmp67_; + GeeSortedSet* _tmp68_ = NULL; + GeeSortedSet* _tmp69_; + GeeMapEntry* _tmp70_ = NULL; + GeeMapEntry* _tmp71_; + GeeMapEntry* _tmp72_ = NULL; + GeeMapEntry* _tmp73_; + GeeSortedSet* _tmp74_ = NULL; + GeeSortedMap* _tmp75_; + gint _tmp76_; + gint _tmp77_; + GeeSortedSet* _tmp78_; + gint _tmp79_; + gint _tmp80_; + GeeSortedSet* _tmp81_; + gint _tmp82_; + gint _tmp83_; + _tmp11_ = self->priv->submap; + _tmp12_ = gee_sorted_map_head_map (_tmp11_, "four"); + subsubmap = _tmp12_; + _tmp13_ = keys; + _tmp14_ = gee_sorted_set_head_set (_tmp13_, "four"); + keyssubset = _tmp14_; + _tmp15_ = entries; + _tmp16_ = map_tests_entry_for ("four", "four"); + _tmp17_ = _tmp16_; + _tmp18_ = gee_sorted_set_head_set (_tmp15_, _tmp17_); + _tmp19_ = _tmp18_; + _g_object_unref0 (_tmp17_); + entriessubset = _tmp19_; + _tmp20_ = subsubmap; + _tmp21_ = gee_map_get_size ((GeeMap*) _tmp20_); + _tmp22_ = _tmp21_; + _vala_assert (_tmp22_ == 1, "subsubmap.size == 1"); + _tmp23_ = keyssubset; + _tmp24_ = gee_collection_get_size ((GeeCollection*) _tmp23_); + _tmp25_ = _tmp24_; + _vala_assert (_tmp25_ == 1, "keyssubset.size == 1"); + _tmp26_ = entriessubset; + _tmp27_ = gee_collection_get_size ((GeeCollection*) _tmp26_); + _tmp28_ = _tmp27_; + _vala_assert (_tmp28_ == 1, "entriessubset.size == 1"); + _tmp29_ = self->priv->submap; + _tmp30_ = gee_sorted_map_tail_map (_tmp29_, "four"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp30_; + _tmp31_ = keys; + _tmp32_ = gee_sorted_set_tail_set (_tmp31_, "four"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp32_; + _tmp33_ = entries; + _tmp34_ = map_tests_entry_for ("four", "four"); + _tmp35_ = _tmp34_; + _tmp36_ = gee_sorted_set_tail_set (_tmp33_, _tmp35_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp36_; + _g_object_unref0 (_tmp35_); + _tmp37_ = subsubmap; + _tmp38_ = gee_map_get_size ((GeeMap*) _tmp37_); + _tmp39_ = _tmp38_; + _vala_assert (_tmp39_ == 1, "subsubmap.size == 1"); + _tmp40_ = keyssubset; + _tmp41_ = gee_collection_get_size ((GeeCollection*) _tmp40_); + _tmp42_ = _tmp41_; + _vala_assert (_tmp42_ == 1, "keyssubset.size == 1"); + _tmp43_ = entriessubset; + _tmp44_ = gee_collection_get_size ((GeeCollection*) _tmp43_); + _tmp45_ = _tmp44_; + _vala_assert (_tmp45_ == 1, "entriessubset.size == 1"); + _tmp46_ = self->priv->submap; + _tmp47_ = gee_sorted_map_sub_map (_tmp46_, "four", "one"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp47_; + _tmp48_ = keys; + _tmp49_ = gee_sorted_set_sub_set (_tmp48_, "four", "one"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp49_; + _tmp50_ = entries; + _tmp51_ = map_tests_entry_for ("four", "four"); + _tmp52_ = _tmp51_; + _tmp53_ = map_tests_entry_for ("one", "one"); + _tmp54_ = _tmp53_; + _tmp55_ = gee_sorted_set_sub_set (_tmp50_, _tmp52_, _tmp54_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp55_; + _g_object_unref0 (_tmp54_); + _g_object_unref0 (_tmp52_); + _tmp56_ = subsubmap; + _tmp57_ = gee_map_get_size ((GeeMap*) _tmp56_); + _tmp58_ = _tmp57_; + _vala_assert (_tmp58_ == 1, "subsubmap.size == 1"); + _tmp59_ = keyssubset; + _tmp60_ = gee_collection_get_size ((GeeCollection*) _tmp59_); + _tmp61_ = _tmp60_; + _vala_assert (_tmp61_ == 1, "keyssubset.size == 1"); + _tmp62_ = entriessubset; + _tmp63_ = gee_collection_get_size ((GeeCollection*) _tmp62_); + _tmp64_ = _tmp63_; + _vala_assert (_tmp64_ == 1, "entriessubset.size == 1"); + _tmp65_ = self->priv->submap; + _tmp66_ = gee_sorted_map_sub_map (_tmp65_, "four", "four"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp66_; + _tmp67_ = keys; + _tmp68_ = gee_sorted_set_sub_set (_tmp67_, "four", "four"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp68_; + _tmp69_ = entries; + _tmp70_ = map_tests_entry_for ("four", "four"); + _tmp71_ = _tmp70_; + _tmp72_ = map_tests_entry_for ("four", "four"); + _tmp73_ = _tmp72_; + _tmp74_ = gee_sorted_set_sub_set (_tmp69_, _tmp71_, _tmp73_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp74_; + _g_object_unref0 (_tmp73_); + _g_object_unref0 (_tmp71_); + _tmp75_ = subsubmap; + _tmp76_ = gee_map_get_size ((GeeMap*) _tmp75_); + _tmp77_ = _tmp76_; + _vala_assert (_tmp77_ == 0, "subsubmap.size == 0"); + _tmp78_ = keyssubset; + _tmp79_ = gee_collection_get_size ((GeeCollection*) _tmp78_); + _tmp80_ = _tmp79_; + _vala_assert (_tmp80_ == 0, "keyssubset.size == 0"); + _tmp81_ = entriessubset; + _tmp82_ = gee_collection_get_size ((GeeCollection*) _tmp81_); + _tmp83_ = _tmp82_; + _vala_assert (_tmp83_ == 0, "entriessubset.size == 0"); + _g_object_unref0 (entriessubset); + _g_object_unref0 (keyssubset); + _g_object_unref0 (subsubmap); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_TAIL: + { + GeeSortedMap* _tmp84_; + GeeSortedMap* _tmp85_ = NULL; + GeeSortedMap* subsubmap; + GeeSortedSet* _tmp86_; + GeeSortedSet* _tmp87_ = NULL; + GeeSortedSet* keyssubset; + GeeSortedSet* _tmp88_; + GeeMapEntry* _tmp89_ = NULL; + GeeMapEntry* _tmp90_; + GeeSortedSet* _tmp91_ = NULL; + GeeSortedSet* _tmp92_; + GeeSortedSet* entriessubset; + GeeSortedMap* _tmp93_; + gint _tmp94_; + gint _tmp95_; + GeeSortedSet* _tmp96_; + gint _tmp97_; + gint _tmp98_; + GeeSortedSet* _tmp99_; + gint _tmp100_; + gint _tmp101_; + GeeSortedMap* _tmp102_; + GeeSortedMap* _tmp103_ = NULL; + GeeSortedSet* _tmp104_; + GeeSortedSet* _tmp105_ = NULL; + GeeSortedSet* _tmp106_; + GeeMapEntry* _tmp107_ = NULL; + GeeMapEntry* _tmp108_; + GeeSortedSet* _tmp109_ = NULL; + GeeSortedMap* _tmp110_; + gint _tmp111_; + gint _tmp112_; + GeeSortedSet* _tmp113_; + gint _tmp114_; + gint _tmp115_; + GeeSortedSet* _tmp116_; + gint _tmp117_; + gint _tmp118_; + GeeSortedMap* _tmp119_; + GeeSortedMap* _tmp120_ = NULL; + GeeSortedSet* _tmp121_; + GeeSortedSet* _tmp122_ = NULL; + GeeSortedSet* _tmp123_; + GeeMapEntry* _tmp124_ = NULL; + GeeMapEntry* _tmp125_; + GeeMapEntry* _tmp126_ = NULL; + GeeMapEntry* _tmp127_; + GeeSortedSet* _tmp128_ = NULL; + GeeSortedMap* _tmp129_; + gint _tmp130_; + gint _tmp131_; + GeeSortedSet* _tmp132_; + gint _tmp133_; + gint _tmp134_; + GeeSortedSet* _tmp135_; + gint _tmp136_; + gint _tmp137_; + _tmp84_ = self->priv->submap; + _tmp85_ = gee_sorted_map_head_map (_tmp84_, "two"); + subsubmap = _tmp85_; + _tmp86_ = keys; + _tmp87_ = gee_sorted_set_head_set (_tmp86_, "two"); + keyssubset = _tmp87_; + _tmp88_ = entries; + _tmp89_ = map_tests_entry_for ("two", "two"); + _tmp90_ = _tmp89_; + _tmp91_ = gee_sorted_set_head_set (_tmp88_, _tmp90_); + _tmp92_ = _tmp91_; + _g_object_unref0 (_tmp90_); + entriessubset = _tmp92_; + _tmp93_ = subsubmap; + _tmp94_ = gee_map_get_size ((GeeMap*) _tmp93_); + _tmp95_ = _tmp94_; + _vala_assert (_tmp95_ == 2, "subsubmap.size == 2"); + _tmp96_ = keyssubset; + _tmp97_ = gee_collection_get_size ((GeeCollection*) _tmp96_); + _tmp98_ = _tmp97_; + _vala_assert (_tmp98_ == 2, "keyssubset.size == 2"); + _tmp99_ = entriessubset; + _tmp100_ = gee_collection_get_size ((GeeCollection*) _tmp99_); + _tmp101_ = _tmp100_; + _vala_assert (_tmp101_ == 2, "entriessubset.size == 2"); + _tmp102_ = self->priv->submap; + _tmp103_ = gee_sorted_map_tail_map (_tmp102_, "three"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp103_; + _tmp104_ = keys; + _tmp105_ = gee_sorted_set_tail_set (_tmp104_, "three"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp105_; + _tmp106_ = entries; + _tmp107_ = map_tests_entry_for ("three", "three"); + _tmp108_ = _tmp107_; + _tmp109_ = gee_sorted_set_tail_set (_tmp106_, _tmp108_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp109_; + _g_object_unref0 (_tmp108_); + _tmp110_ = subsubmap; + _tmp111_ = gee_map_get_size ((GeeMap*) _tmp110_); + _tmp112_ = _tmp111_; + _vala_assert (_tmp112_ == 2, "subsubmap.size == 2"); + _tmp113_ = keyssubset; + _tmp114_ = gee_collection_get_size ((GeeCollection*) _tmp113_); + _tmp115_ = _tmp114_; + _vala_assert (_tmp115_ == 2, "keyssubset.size == 2"); + _tmp116_ = entriessubset; + _tmp117_ = gee_collection_get_size ((GeeCollection*) _tmp116_); + _tmp118_ = _tmp117_; + _vala_assert (_tmp118_ == 2, "entriessubset.size == 2"); + _tmp119_ = self->priv->submap; + _tmp120_ = gee_sorted_map_sub_map (_tmp119_, "three", "two"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp120_; + _tmp121_ = keys; + _tmp122_ = gee_sorted_set_sub_set (_tmp121_, "three", "two"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp122_; + _tmp123_ = entries; + _tmp124_ = map_tests_entry_for ("three", "three"); + _tmp125_ = _tmp124_; + _tmp126_ = map_tests_entry_for ("two", "two"); + _tmp127_ = _tmp126_; + _tmp128_ = gee_sorted_set_sub_set (_tmp123_, _tmp125_, _tmp127_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp128_; + _g_object_unref0 (_tmp127_); + _g_object_unref0 (_tmp125_); + _tmp129_ = subsubmap; + _tmp130_ = gee_map_get_size ((GeeMap*) _tmp129_); + _tmp131_ = _tmp130_; + _vala_assert (_tmp131_ == 1, "subsubmap.size == 1"); + _tmp132_ = keyssubset; + _tmp133_ = gee_collection_get_size ((GeeCollection*) _tmp132_); + _tmp134_ = _tmp133_; + _vala_assert (_tmp134_ == 1, "keyssubset.size == 1"); + _tmp135_ = entriessubset; + _tmp136_ = gee_collection_get_size ((GeeCollection*) _tmp135_); + _tmp137_ = _tmp136_; + _vala_assert (_tmp137_ == 1, "entriessubset.size == 1"); + _g_object_unref0 (entriessubset); + _g_object_unref0 (keyssubset); + _g_object_unref0 (subsubmap); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_SUB: + { + GeeSortedMap* _tmp138_; + GeeSortedMap* _tmp139_ = NULL; + GeeSortedMap* subsubmap; + GeeSortedSet* _tmp140_; + GeeSortedSet* _tmp141_ = NULL; + GeeSortedSet* keyssubset; + GeeSortedSet* _tmp142_; + GeeMapEntry* _tmp143_ = NULL; + GeeMapEntry* _tmp144_; + GeeSortedSet* _tmp145_ = NULL; + GeeSortedSet* _tmp146_; + GeeSortedSet* entriessubset; + GeeSortedMap* _tmp147_; + gint _tmp148_; + gint _tmp149_; + GeeSortedSet* _tmp150_; + gint _tmp151_; + gint _tmp152_; + GeeSortedSet* _tmp153_; + gint _tmp154_; + gint _tmp155_; + GeeSortedMap* _tmp156_; + GeeSortedMap* _tmp157_ = NULL; + GeeSortedSet* _tmp158_; + GeeSortedSet* _tmp159_ = NULL; + GeeSortedSet* _tmp160_; + GeeMapEntry* _tmp161_ = NULL; + GeeMapEntry* _tmp162_; + GeeSortedSet* _tmp163_ = NULL; + GeeSortedMap* _tmp164_; + gint _tmp165_; + gint _tmp166_; + GeeSortedSet* _tmp167_; + gint _tmp168_; + gint _tmp169_; + GeeSortedSet* _tmp170_; + gint _tmp171_; + gint _tmp172_; + GeeSortedMap* _tmp173_; + GeeSortedMap* _tmp174_ = NULL; + GeeSortedSet* _tmp175_; + GeeSortedSet* _tmp176_ = NULL; + GeeSortedSet* _tmp177_; + GeeMapEntry* _tmp178_ = NULL; + GeeMapEntry* _tmp179_; + GeeMapEntry* _tmp180_ = NULL; + GeeMapEntry* _tmp181_; + GeeSortedSet* _tmp182_ = NULL; + GeeSortedMap* _tmp183_; + gint _tmp184_; + gint _tmp185_; + GeeSortedSet* _tmp186_; + gint _tmp187_; + gint _tmp188_; + GeeSortedSet* _tmp189_; + gint _tmp190_; + gint _tmp191_; + GeeSortedMap* _tmp192_; + GeeSortedMap* _tmp193_ = NULL; + GeeSortedSet* _tmp194_; + GeeSortedSet* _tmp195_ = NULL; + GeeSortedSet* _tmp196_; + GeeMapEntry* _tmp197_ = NULL; + GeeMapEntry* _tmp198_; + GeeMapEntry* _tmp199_ = NULL; + GeeMapEntry* _tmp200_; + GeeSortedSet* _tmp201_ = NULL; + GeeSortedMap* _tmp202_; + gint _tmp203_; + gint _tmp204_; + GeeSortedSet* _tmp205_; + gint _tmp206_; + gint _tmp207_; + GeeSortedSet* _tmp208_; + gint _tmp209_; + gint _tmp210_; + _tmp138_ = self->priv->submap; + _tmp139_ = gee_sorted_map_head_map (_tmp138_, "six"); + subsubmap = _tmp139_; + _tmp140_ = keys; + _tmp141_ = gee_sorted_set_head_set (_tmp140_, "six"); + keyssubset = _tmp141_; + _tmp142_ = entries; + _tmp143_ = map_tests_entry_for ("six", "six"); + _tmp144_ = _tmp143_; + _tmp145_ = gee_sorted_set_head_set (_tmp142_, _tmp144_); + _tmp146_ = _tmp145_; + _g_object_unref0 (_tmp144_); + entriessubset = _tmp146_; + _tmp147_ = subsubmap; + _tmp148_ = gee_map_get_size ((GeeMap*) _tmp147_); + _tmp149_ = _tmp148_; + _vala_assert (_tmp149_ == 2, "subsubmap.size == 2"); + _tmp150_ = keyssubset; + _tmp151_ = gee_collection_get_size ((GeeCollection*) _tmp150_); + _tmp152_ = _tmp151_; + _vala_assert (_tmp152_ == 2, "keyssubset.size == 2"); + _tmp153_ = entriessubset; + _tmp154_ = gee_collection_get_size ((GeeCollection*) _tmp153_); + _tmp155_ = _tmp154_; + _vala_assert (_tmp155_ == 2, "entriessubset.size == 2"); + _tmp156_ = self->priv->submap; + _tmp157_ = gee_sorted_map_tail_map (_tmp156_, "one"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp157_; + _tmp158_ = keys; + _tmp159_ = gee_sorted_set_tail_set (_tmp158_, "one"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp159_; + _tmp160_ = entries; + _tmp161_ = map_tests_entry_for ("one", "one"); + _tmp162_ = _tmp161_; + _tmp163_ = gee_sorted_set_tail_set (_tmp160_, _tmp162_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp163_; + _g_object_unref0 (_tmp162_); + _tmp164_ = subsubmap; + _tmp165_ = gee_map_get_size ((GeeMap*) _tmp164_); + _tmp166_ = _tmp165_; + _vala_assert (_tmp166_ == 2, "subsubmap.size == 2"); + _tmp167_ = keyssubset; + _tmp168_ = gee_collection_get_size ((GeeCollection*) _tmp167_); + _tmp169_ = _tmp168_; + _vala_assert (_tmp169_ == 2, "keyssubset.size == 2"); + _tmp170_ = entriessubset; + _tmp171_ = gee_collection_get_size ((GeeCollection*) _tmp170_); + _tmp172_ = _tmp171_; + _vala_assert (_tmp172_ == 2, "entriessubset.size == 2"); + _tmp173_ = self->priv->submap; + _tmp174_ = gee_sorted_map_sub_map (_tmp173_, "one", "six"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp174_; + _tmp175_ = keys; + _tmp176_ = gee_sorted_set_sub_set (_tmp175_, "one", "six"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp176_; + _tmp177_ = entries; + _tmp178_ = map_tests_entry_for ("one", "one"); + _tmp179_ = _tmp178_; + _tmp180_ = map_tests_entry_for ("six", "six"); + _tmp181_ = _tmp180_; + _tmp182_ = gee_sorted_set_sub_set (_tmp177_, _tmp179_, _tmp181_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp182_; + _g_object_unref0 (_tmp181_); + _g_object_unref0 (_tmp179_); + _tmp183_ = subsubmap; + _tmp184_ = gee_map_get_size ((GeeMap*) _tmp183_); + _tmp185_ = _tmp184_; + _vala_assert (_tmp185_ == 1, "subsubmap.size == 1"); + _tmp186_ = keyssubset; + _tmp187_ = gee_collection_get_size ((GeeCollection*) _tmp186_); + _tmp188_ = _tmp187_; + _vala_assert (_tmp188_ == 1, "keyssubset.size == 1"); + _tmp189_ = entriessubset; + _tmp190_ = gee_collection_get_size ((GeeCollection*) _tmp189_); + _tmp191_ = _tmp190_; + _vala_assert (_tmp191_ == 1, "entriessubset.size == 1"); + _tmp192_ = self->priv->submap; + _tmp193_ = gee_sorted_map_sub_map (_tmp192_, "five", "two"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp193_; + _tmp194_ = keys; + _tmp195_ = gee_sorted_set_sub_set (_tmp194_, "five", "two"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp195_; + _tmp196_ = entries; + _tmp197_ = map_tests_entry_for ("five", "five"); + _tmp198_ = _tmp197_; + _tmp199_ = map_tests_entry_for ("two", "two"); + _tmp200_ = _tmp199_; + _tmp201_ = gee_sorted_set_sub_set (_tmp196_, _tmp198_, _tmp200_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp201_; + _g_object_unref0 (_tmp200_); + _g_object_unref0 (_tmp198_); + _tmp202_ = subsubmap; + _tmp203_ = gee_map_get_size ((GeeMap*) _tmp202_); + _tmp204_ = _tmp203_; + _vala_assert (_tmp204_ == 3, "subsubmap.size == 3"); + _tmp205_ = keyssubset; + _tmp206_ = gee_collection_get_size ((GeeCollection*) _tmp205_); + _tmp207_ = _tmp206_; + _vala_assert (_tmp207_ == 3, "keyssubset.size == 3"); + _tmp208_ = entriessubset; + _tmp209_ = gee_collection_get_size ((GeeCollection*) _tmp208_); + _tmp210_ = _tmp209_; + _vala_assert (_tmp210_ == 3, "entriessubset.size == 3"); + _g_object_unref0 (entriessubset); + _g_object_unref0 (keyssubset); + _g_object_unref0 (subsubmap); + break; + } + case GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_TYPE_EMPTY: + { + GeeSortedMap* _tmp211_; + GeeSortedMap* _tmp212_ = NULL; + GeeSortedMap* subsubmap; + GeeSortedSet* _tmp213_; + GeeSortedSet* _tmp214_ = NULL; + GeeSortedSet* keyssubset; + GeeSortedSet* _tmp215_; + GeeMapEntry* _tmp216_ = NULL; + GeeMapEntry* _tmp217_; + GeeSortedSet* _tmp218_ = NULL; + GeeSortedSet* _tmp219_; + GeeSortedSet* entriessubset; + GeeSortedMap* _tmp220_; + gint _tmp221_; + gint _tmp222_; + GeeSortedSet* _tmp223_; + gint _tmp224_; + gint _tmp225_; + GeeSortedSet* _tmp226_; + gint _tmp227_; + gint _tmp228_; + GeeSortedMap* _tmp229_; + GeeSortedMap* _tmp230_ = NULL; + GeeSortedSet* _tmp231_; + GeeSortedSet* _tmp232_ = NULL; + GeeSortedSet* _tmp233_; + GeeMapEntry* _tmp234_ = NULL; + GeeMapEntry* _tmp235_; + GeeSortedSet* _tmp236_ = NULL; + GeeSortedMap* _tmp237_; + gint _tmp238_; + gint _tmp239_; + GeeSortedSet* _tmp240_; + gint _tmp241_; + gint _tmp242_; + GeeSortedSet* _tmp243_; + gint _tmp244_; + gint _tmp245_; + GeeSortedMap* _tmp246_; + GeeSortedMap* _tmp247_ = NULL; + GeeSortedSet* _tmp248_; + GeeSortedSet* _tmp249_ = NULL; + GeeSortedSet* _tmp250_; + GeeMapEntry* _tmp251_ = NULL; + GeeMapEntry* _tmp252_; + GeeMapEntry* _tmp253_ = NULL; + GeeMapEntry* _tmp254_; + GeeSortedSet* _tmp255_ = NULL; + GeeSortedMap* _tmp256_; + gint _tmp257_; + gint _tmp258_; + GeeSortedSet* _tmp259_; + gint _tmp260_; + gint _tmp261_; + GeeSortedSet* _tmp262_; + gint _tmp263_; + gint _tmp264_; + _tmp211_ = self->priv->submap; + _tmp212_ = gee_sorted_map_head_map (_tmp211_, "six"); + subsubmap = _tmp212_; + _tmp213_ = keys; + _tmp214_ = gee_sorted_set_head_set (_tmp213_, "six"); + keyssubset = _tmp214_; + _tmp215_ = entries; + _tmp216_ = map_tests_entry_for ("six", "six"); + _tmp217_ = _tmp216_; + _tmp218_ = gee_sorted_set_head_set (_tmp215_, _tmp217_); + _tmp219_ = _tmp218_; + _g_object_unref0 (_tmp217_); + entriessubset = _tmp219_; + _tmp220_ = subsubmap; + _tmp221_ = gee_map_get_size ((GeeMap*) _tmp220_); + _tmp222_ = _tmp221_; + _vala_assert (_tmp222_ == 0, "subsubmap.size == 0"); + _tmp223_ = keyssubset; + _tmp224_ = gee_collection_get_size ((GeeCollection*) _tmp223_); + _tmp225_ = _tmp224_; + _vala_assert (_tmp225_ == 0, "keyssubset.size == 0"); + _tmp226_ = entriessubset; + _tmp227_ = gee_collection_get_size ((GeeCollection*) _tmp226_); + _tmp228_ = _tmp227_; + _vala_assert (_tmp228_ == 0, "entriessubset.size == 0"); + _tmp229_ = self->priv->submap; + _tmp230_ = gee_sorted_map_tail_map (_tmp229_, "three"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp230_; + _tmp231_ = keys; + _tmp232_ = gee_sorted_set_tail_set (_tmp231_, "three"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp232_; + _tmp233_ = entries; + _tmp234_ = map_tests_entry_for ("three", "three"); + _tmp235_ = _tmp234_; + _tmp236_ = gee_sorted_set_tail_set (_tmp233_, _tmp235_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp236_; + _g_object_unref0 (_tmp235_); + _tmp237_ = subsubmap; + _tmp238_ = gee_map_get_size ((GeeMap*) _tmp237_); + _tmp239_ = _tmp238_; + _vala_assert (_tmp239_ == 0, "subsubmap.size == 0"); + _tmp240_ = keyssubset; + _tmp241_ = gee_collection_get_size ((GeeCollection*) _tmp240_); + _tmp242_ = _tmp241_; + _vala_assert (_tmp242_ == 0, "keyssubset.size == 0"); + _tmp243_ = entriessubset; + _tmp244_ = gee_collection_get_size ((GeeCollection*) _tmp243_); + _tmp245_ = _tmp244_; + _vala_assert (_tmp245_ == 0, "entriessubset.size == 0"); + _tmp246_ = self->priv->submap; + _tmp247_ = gee_sorted_map_sub_map (_tmp246_, "one", "six"); + _g_object_unref0 (subsubmap); + subsubmap = _tmp247_; + _tmp248_ = keys; + _tmp249_ = gee_sorted_set_sub_set (_tmp248_, "one", "six"); + _g_object_unref0 (keyssubset); + keyssubset = _tmp249_; + _tmp250_ = entries; + _tmp251_ = map_tests_entry_for ("one", "one"); + _tmp252_ = _tmp251_; + _tmp253_ = map_tests_entry_for ("six", "six"); + _tmp254_ = _tmp253_; + _tmp255_ = gee_sorted_set_sub_set (_tmp250_, _tmp252_, _tmp254_); + _g_object_unref0 (entriessubset); + entriessubset = _tmp255_; + _g_object_unref0 (_tmp254_); + _g_object_unref0 (_tmp252_); + _tmp256_ = subsubmap; + _tmp257_ = gee_map_get_size ((GeeMap*) _tmp256_); + _tmp258_ = _tmp257_; + _vala_assert (_tmp258_ == 0, "subsubmap.size == 0"); + _tmp259_ = keyssubset; + _tmp260_ = gee_collection_get_size ((GeeCollection*) _tmp259_); + _tmp261_ = _tmp260_; + _vala_assert (_tmp261_ == 0, "keyssubset.size == 0"); + _tmp262_ = entriessubset; + _tmp263_ = gee_collection_get_size ((GeeCollection*) _tmp262_); + _tmp264_ = _tmp263_; + _vala_assert (_tmp264_ == 0, "entriessubset.size == 0"); + _g_object_unref0 (entriessubset); + _g_object_unref0 (keyssubset); + _g_object_unref0 (subsubmap); + break; + } + default: + { + g_assert_not_reached (); + } + } + _g_object_unref0 (entries); + _g_object_unref0 (keys); + not_contains = (_vala_array_free (not_contains, not_contains_length1, (GDestroyNotify) g_free), NULL); + contains = (_vala_array_free (contains, contains_length1, (GDestroyNotify) g_free), NULL); +} + + +static void gee_sorted_map_tests_sub_map_tests_class_init (GeeSortedMapTestsSubMapTestsClass * klass) { + gee_sorted_map_tests_sub_map_tests_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (GeeSortedMapTestsSubMapTestsPrivate)); + GEE_TEST_CASE_CLASS (klass)->set_up = gee_sorted_map_tests_sub_map_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = gee_sorted_map_tests_sub_map_tests_real_tear_down; + G_OBJECT_CLASS (klass)->finalize = gee_sorted_map_tests_sub_map_tests_finalize; +} + + +static void gee_sorted_map_tests_sub_map_tests_instance_init (GeeSortedMapTestsSubMapTests * self) { + self->priv = GEE_SORTED_MAP_TESTS_SUB_MAP_TESTS_GET_PRIVATE (self); +} + + +static void gee_sorted_map_tests_sub_map_tests_finalize (GObject* obj) { + GeeSortedMapTestsSubMapTests * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_SORTED_MAP_TESTS_TYPE_SUB_MAP_TESTS, GeeSortedMapTestsSubMapTests); + _g_object_unref0 (self->priv->master); + _g_object_unref0 (self->priv->submap); + _g_object_unref0 (self->priv->test); + G_OBJECT_CLASS (gee_sorted_map_tests_sub_map_tests_parent_class)->finalize (obj); +} + + +GType gee_sorted_map_tests_sub_map_tests_get_type (void) { + static volatile gsize gee_sorted_map_tests_sub_map_tests_type_id__volatile = 0; + if (g_once_init_enter (&gee_sorted_map_tests_sub_map_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeSortedMapTestsSubMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_sorted_map_tests_sub_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeSortedMapTestsSubMapTests), 0, (GInstanceInitFunc) gee_sorted_map_tests_sub_map_tests_instance_init, NULL }; + GType gee_sorted_map_tests_sub_map_tests_type_id; + gee_sorted_map_tests_sub_map_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "GeeSortedMapTestsSubMapTests", &g_define_type_info, 0); + g_once_init_leave (&gee_sorted_map_tests_sub_map_tests_type_id__volatile, gee_sorted_map_tests_sub_map_tests_type_id); + } + return gee_sorted_map_tests_sub_map_tests_type_id__volatile; +} + + +static void gee_sorted_map_tests_class_init (GeeSortedMapTestsClass * klass) { + gee_sorted_map_tests_parent_class = g_type_class_peek_parent (klass); +} + + +static void gee_sorted_map_tests_instance_init (GeeSortedMapTests * self) { +} + + +GType gee_sorted_map_tests_get_type (void) { + static volatile gsize gee_sorted_map_tests_type_id__volatile = 0; + if (g_once_init_enter (&gee_sorted_map_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (GeeSortedMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_sorted_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeSortedMapTests), 0, (GInstanceInitFunc) gee_sorted_map_tests_instance_init, NULL }; + GType gee_sorted_map_tests_type_id; + gee_sorted_map_tests_type_id = g_type_register_static (TYPE_MAP_TESTS, "GeeSortedMapTests", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_once_init_leave (&gee_sorted_map_tests_type_id__volatile, gee_sorted_map_tests_type_id); + } + return gee_sorted_map_tests_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/tests/testsortedmap.vala b/tests/testsortedmap.vala new file mode 100644 index 0000000..abfbfc8 --- /dev/null +++ b/tests/testsortedmap.vala @@ -0,0 +1,1174 @@ +/* sortedset.vala + * + * Copyright (C) 2009-2011 Maciej Piechotka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Maciej Piechotka + */ + +public abstract class Gee.SortedMapTests : MapTests { + public SortedMapTests (string name) { + base (name); + add_test ("[SortedMap] key ordering", test_key_ordering); + add_test ("[SortedMap] first", test_first); + add_test ("[SortedMap] last", test_last); + add_test ("[SortedMap] iterator_at", test_iterator_at); + add_test ("[SortedMap] lower", test_lower); + add_test ("[SortedMap] higher", test_higher); + add_test ("[SortedMap] floor", test_floor); + add_test ("[SortedMap] ceil", test_ceil); + get_suite ().add_suite (new SubMapTests (this, SubMapTests.Type.HEAD).get_suite ()); + get_suite ().add_suite (new SubMapTests (this, SubMapTests.Type.TAIL).get_suite ()); + get_suite ().add_suite (new SubMapTests (this, SubMapTests.Type.SUB).get_suite ()); + get_suite ().add_suite (new SubMapTests (this, SubMapTests.Type.EMPTY).get_suite ()); + } + + public void test_key_ordering () { + var test_sorted_map = test_map as SortedMap; + + // Check the map exists + assert (test_sorted_map != null); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + test_sorted_map.set ("seven", "seven"); + test_sorted_map.set ("eight", "eight"); + test_sorted_map.set ("nine", "nine"); + test_sorted_map.set ("ten", "ten"); + test_sorted_map.set ("eleven", "eleven"); + test_sorted_map.set ("twelve", "twelve"); + + Iterator iterator = test_sorted_map.keys.iterator (); + assert (iterator.next ()); + assert (iterator.get () == "eight"); + assert (iterator.next ()); + assert (iterator.get () == "eleven"); + assert (iterator.next ()); + assert (iterator.get () == "five"); + assert (iterator.next ()); + assert (iterator.get () == "four"); + assert (iterator.next ()); + assert (iterator.get () == "nine"); + assert (iterator.next ()); + assert (iterator.get () == "one"); + assert (iterator.next ()); + assert (iterator.get () == "seven"); + assert (iterator.next ()); + assert (iterator.get () == "six"); + assert (iterator.next ()); + assert (iterator.get () == "ten"); + assert (iterator.next ()); + assert (iterator.get () == "three"); + assert (iterator.next ()); + assert (iterator.get () == "twelve"); + assert (iterator.next ()); + assert (iterator.get () == "two"); + assert (iterator.next () == false); + } + + public void test_first () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + // Check the map exists + assert (test_sorted_map != null); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + test_sorted_map.set ("seven", "seven"); + test_sorted_map.set ("eight", "eight"); + test_sorted_map.set ("nine", "nine"); + test_sorted_map.set ("ten", "ten"); + test_sorted_map.set ("eleven", "eleven"); + test_sorted_map.set ("twelve", "twelve"); + + assert (keys.first () == "eight"); + /*assert_entry (entries.first (), "eight", "eight");*/ + } + + public void test_last () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + // Check the map exists + assert (test_sorted_map != null); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + test_sorted_map.set ("seven", "seven"); + test_sorted_map.set ("eight", "eight"); + test_sorted_map.set ("nine", "nine"); + test_sorted_map.set ("ten", "ten"); + test_sorted_map.set ("eleven", "eleven"); + test_sorted_map.set ("twelve", "twelve"); + + assert (keys.last () == "two"); + assert_entry (entries.last (), "two", "two"); + } + + public void test_iterator_at () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + test_map.set ("one", "one"); + test_map.set ("two", "two"); + test_map.set ("three", "three"); + + var keys_iter = keys.iterator_at ("one"); + assert (keys_iter != null); + assert (keys_iter.get () == "one"); + + var entries_iter = entries.iterator_at (entry_for ("one", "one")); + assert (entries_iter != null); + assert_entry (entries_iter.get (), "one", "one"); + + keys_iter = keys.iterator_at ("two"); + assert (keys_iter != null); + assert (keys_iter.get () == "two"); + + entries_iter = entries.iterator_at (entry_for ("two", "two")); + assert (entries_iter != null); + assert_entry (entries_iter.get (), "two", "two"); + + keys_iter = keys.iterator_at ("three"); + assert (keys_iter != null); + assert (keys_iter.get () == "three"); + + entries_iter = entries.iterator_at (entry_for ("three", "three")); + assert (entries_iter != null); + assert_entry (entries_iter.get (), "three", "three"); + + keys_iter = keys.iterator_at ("zero"); + assert (keys_iter == null); + + entries_iter = entries.iterator_at (entry_for ("zero", "zero")); + assert (entries_iter == null); + } + + public void test_lower () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + assert (keys.lower ("one") == null); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + assert (keys.lower ("one") == "four"); + assert_entry (entries.lower (entry_for ("one", "one")), "four", "four"); + + assert (keys.lower ("o") == "four"); + assert_entry (entries.lower (entry_for ("o", "one")), "four", "four"); + + assert (keys.lower ("two") == "three"); + assert_entry (entries.lower (entry_for ("two", "two")), "three", "three"); + + assert (keys.lower ("t") == "six"); + assert_entry (entries.lower (entry_for ("t", "two")), "six", "six"); + + assert (keys.lower ("three") == "six"); + assert_entry (entries.lower (entry_for ("three", "three")), "six", "six"); + + assert (keys.lower ("four") == "five"); + assert_entry (entries.lower (entry_for ("four", "four")), "five", "five"); + + assert (keys.lower ("f") == null); + assert (entries.lower (entry_for ("f", "four")) == null); + + assert (keys.lower ("five") == null); + assert (entries.lower (entry_for ("five", "five")) == null); + + assert (keys.lower ("six") == "one"); + assert_entry (entries.lower (entry_for ("six", "six")), "one", "one"); + + assert (keys.lower ("s") == "one"); + assert_entry (entries.lower (entry_for ("s", "six")), "one", "one"); + + } + + public void test_higher () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + assert (keys.higher ("one") == null); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + assert (keys.higher ("one") == "six"); + assert_entry (entries.higher (entry_for ("one", "one")), "six", "six"); + + assert (keys.higher ("o") == "one"); + assert_entry (entries.higher (entry_for ("o", "one")), "one", "one"); + + assert (keys.higher ("two") == null); + assert (entries.higher (entry_for ("two", "two")) == null); + + assert (keys.higher ("t") == "three"); + assert_entry (entries.higher (entry_for ("t", "two")), "three", "three"); + + assert (keys.higher ("three") == "two"); + assert_entry (entries.higher (entry_for ("three", "three")), "two", "two"); + + assert (keys.higher ("four") == "one"); + assert_entry (entries.higher (entry_for ("four", "four")), "one", "one"); + + assert (keys.higher ("f") == "five"); + assert_entry (entries.higher (entry_for ("f", "four")), "five", "five"); + + assert (keys.higher ("five") == "four"); + assert_entry (entries.higher (entry_for ("five", "five")), "four", "four"); + + assert (keys.higher ("six") == "three"); + assert_entry (entries.higher (entry_for ("six", "six")), "three", "three"); + + assert (keys.higher ("s") == "six"); + assert_entry (entries.higher (entry_for ("s", "six")), "six", "six"); + } + + public void test_floor () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + assert (keys.floor ("one") == null); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + assert (keys.floor ("one") == "one"); + assert_entry (entries.floor (entry_for ("one", "one")), "one", "one"); + + assert (keys.floor ("o") == "four"); + assert_entry (entries.floor (entry_for ("o", "one")), "four", "four"); + + assert (keys.floor ("two") == "two"); + assert_entry (entries.floor (entry_for ("two", "two")), "two", "two"); + + assert (keys.floor ("t") == "six"); + assert_entry (entries.floor (entry_for ("t", "two")), "six", "six"); + + assert (keys.floor ("three") == "three"); + assert_entry (entries.floor (entry_for ("three", "three")), "three", "three"); + + assert (keys.floor ("four") == "four"); + assert_entry (entries.floor (entry_for ("four", "four")), "four", "four"); + + assert (keys.floor ("f") == null); + assert (entries.floor (entry_for ("f", "four")) == null); + + assert (keys.floor ("five") == "five"); + assert_entry (entries.floor (entry_for ("five", "five")), "five", "five"); + + assert (keys.floor ("six") == "six"); + assert_entry (entries.floor (entry_for ("six", "six")), "six", "six"); + + assert (keys.floor ("s") == "one"); + assert_entry (entries.floor (entry_for ("s", "six")), "one", "one"); + } + + public void test_ceil () { + var test_sorted_map = test_map as SortedMap; + var keys = test_sorted_map.ascending_keys; + var entries = test_sorted_map.ascending_entries; + + assert (keys.ceil ("one") == null); + + test_sorted_map.set ("one", "one"); + test_sorted_map.set ("two", "two"); + test_sorted_map.set ("three", "three"); + test_sorted_map.set ("four", "four"); + test_sorted_map.set ("five", "five"); + test_sorted_map.set ("six", "six"); + + assert (keys.ceil ("one") == "one"); + assert_entry (entries.ceil (entry_for ("one", "one")), "one", "one"); + + assert (keys.ceil ("o") == "one"); + assert_entry (entries.ceil (entry_for ("o", "one")), "one", "one"); + + assert (keys.ceil ("two") == "two"); + assert_entry (entries.ceil (entry_for ("two", "two")), "two", "two"); + + assert (keys.ceil ("t") == "three"); + assert_entry (entries.ceil (entry_for ("t", "two")), "three", "three"); + + assert (keys.ceil ("three") == "three"); + assert_entry (entries.ceil (entry_for ("three", "three")), "three", "three"); + + assert (keys.ceil ("four") == "four"); + assert_entry (entries.ceil (entry_for ("four", "four")), "four", "four"); + + assert (keys.ceil ("f") == "five"); + assert_entry (entries.ceil (entry_for ("f", "four")), "five", "five"); + + assert (keys.ceil ("five") == "five"); + assert_entry (entries.ceil (entry_for ("five", "five")), "five", "five"); + + assert (keys.ceil ("six") == "six"); + assert_entry (entries.ceil (entry_for ("six", "six")), "six", "six"); + + assert (keys.ceil ("s") == "six"); + assert_entry (entries.ceil (entry_for ("s", "six")), "six", "six"); + } + + public class SubMapTests : Gee.TestCase { + private SortedMap master; + private SortedMap submap; + private SortedMapTests test; + public enum Type { + HEAD, + TAIL, + SUB, + EMPTY; + public unowned string to_string () { + switch (this) { + case Type.HEAD: return "Head"; + case Type.TAIL: return "Tail"; + case Type.SUB: return "Range"; + case Type.EMPTY: return "Empty"; + default: assert_not_reached (); + } + } + } + private Type type; + + public SubMapTests (SortedMapTests test, Type type) { + base ("%s Submap".printf (type.to_string ())); + this.test = test; + this.type = type; + add_test ("[Map] has_key, size and is_empty", + test_has_key_size_is_empty); + add_test ("[Map] keys", test_keys); + add_test ("[Map] values", test_values); + add_test ("[Map] entries", test_entries); + add_test ("[Map] get", test_get); + add_test ("[Map] set", test_set); + add_test ("[Map] unset", test_unset); + add_test ("[Map] clear", test_clear); + add_test ("[Map] iterators", test_iterators); + add_test ("[SortedMap] boundaries", test_boundaries); + add_test ("[SortedMap] lower", test_lower); + add_test ("[SortedMap] higher", test_higher); + add_test ("[SortedMap] floor", test_floor); + add_test ("[SortedMap] ceil", test_ceil); + add_test ("[SortedMap] iterator_at", test_iterator_at); + add_test ("[SortedMap] submap and subsets", test_submap_and_subsets); + } + + public override void set_up () { + test.set_up (); + master = test.test_map as SortedMap; + switch (type) { + case Type.HEAD: + submap = master.head_map ("one"); break; + case Type.TAIL: + submap = master.tail_map ("six"); break; + case Type.SUB: + submap = master.sub_map ("four", "three"); break; + case Type.EMPTY: + submap = master.sub_map ("three", "four"); break; + default: + assert_not_reached (); + } + } + + public override void tear_down () { + test.tear_down (); + } + + protected void set_default_values (out string[] contains = null, out string[] not_contains = null) { + master.set ("one", "one"); + master.set ("two", "two"); + master.set ("three", "three"); + master.set ("four", "four"); + master.set ("five", "five"); + master.set ("six", "six"); + switch (type) { + case Type.HEAD: + contains = {"five", "four"}; + not_contains = {"one", "two", "three", "six"}; + break; + case Type.TAIL: + contains = {"six", "three", "two"}; + not_contains = {"one", "four", "five"}; + break; + case Type.SUB: + contains = {"four", "one", "six"}; + not_contains = {"two", "three", "five"}; + break; + case Type.EMPTY: + contains = {}; + not_contains = {"one", "two", "three", "four", "five", "six"}; + break; + default: + assert_not_reached (); + } + } + + public void test_has_key_size_is_empty () { + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + assert (submap.size == contains.length); + assert (submap.is_empty == (contains.length == 0)); + + foreach (var s in contains) { + assert (submap.has_key (s)); + assert (submap.has (s, s)); + } + foreach (var s in not_contains) { + assert (!submap.has_key (s)); + assert (!submap.has (s, s)); + } + } + + public void test_get () { + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + foreach (var s in contains) { + assert (submap.get (s) == s); + } + } + + public void test_keys () { + var keys = submap.keys; + + assert (keys.size == 0); + assert (keys.is_empty); + + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + assert (keys.size == contains.length); + foreach (var s in contains) + assert (keys.contains (s)); + foreach (var s in not_contains) + assert (!keys.contains (s)); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.add ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.remove ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + + public void test_values () { + var values = submap.values; + + assert (values.size == 0); + assert (values.is_empty); + + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + assert (values.size == contains.length); + foreach (var s in contains) + assert (values.contains (s)); + foreach (var s in not_contains) + assert (!values.contains (s)); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + values.add ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + values.remove ("three"); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + + public void test_entries () { + var entries = submap.entries; + + assert (entries.size == 0); + assert (entries.is_empty); + + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + assert (entries.size == contains.length); + foreach (var s in contains) + assert (entries.contains (MapTests.entry_for (s, s))); + foreach (var s in not_contains) + assert (!entries.contains (MapTests.entry_for (s, s))); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.add (MapTests.entry_for ("three", "three")); + Posix.exit (0); + } + Test.trap_assert_failed (); + + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.remove (MapTests.entry_for ("three", "three")); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + + public void test_set () { + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + string[] success, fail; + switch (type) { + case Type.HEAD: + success = {"a", "o"}; + fail = {"oz", "z"}; + break; + case Type.TAIL: + success = {"siz", "z"}; + fail = {"sia", "a"}; + break; + case Type.SUB: + success = {"o", "th"}; + fail = {"f", "u"}; + break; + case Type.EMPTY: + success = {}; + fail = {"o", "th", "f", "u"}; + break; + default: + assert_not_reached (); + } + + foreach (var s in success) { + submap.set (s, s); + assert (submap.has (s, s)); + assert (master.has (s, s)); + } + + foreach (var s in fail) { + submap.set (s, s); + assert (!submap.has_key (s)); + assert (!master.has_key (s)); + } + + assert (master.size == 6 + success.length); + } + + public void test_unset () { + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + foreach (var s in contains) { + string? value; + assert (submap.unset (s, out value)); + assert (value == s); + assert (!master.has_key (s)); + } + foreach (var s in not_contains) { + assert (!submap.unset (s)); + assert (master.has (s, s)); + } + + assert (master.size == 6 - contains.length); + } + + public void test_clear () { + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + submap.clear (); + + foreach (var s in contains) { + assert (!master.has_key (s)); + } + foreach (var s in not_contains) { + assert (!submap.unset (s)); + assert (master.has (s, s)); + } + + assert (master.size == 6 - contains.length); + } + + public void test_iterators () { + string[] contains, not_contains; + + var _map_iter = submap.map_iterator (); + + assert (!_map_iter.has_next ()); + assert (!_map_iter.next ()); + + set_default_values (out contains, out not_contains); + + var i = 0; + _map_iter = submap.map_iterator (); + while (_map_iter.next ()) { + assert (_map_iter.get_key () == contains[i]); + assert (_map_iter.get_value () == contains[i]); + i++; + } + assert (i == contains.length); + + i = 0; + foreach (var k in submap.keys) + assert (k == contains[i++]); + assert (i == contains.length); + + i = 0; + foreach (var e in submap.entries) { + MapTests.assert_entry (e, contains[i], contains[i]); + i++; + } + assert (i == contains.length); + + if (type != Type.EMPTY) { + var map_iter = submap.map_iterator (); + assert (map_iter.next ()); + + assert (map_iter.get_key () == contains[0]); + assert (map_iter.get_value () == contains[0]); + + assert (map_iter.has_next ()); + assert (map_iter.next ()); + assert (map_iter.get_key () == contains[1]); + assert (map_iter.get_value () == contains[1]); + + // Repeat for keys + master.clear (); + set_default_values (out contains, out not_contains); + var keys_iter = submap.ascending_keys.iterator (); + + assert (keys_iter.has_next ()); + assert (keys_iter.next ()); + + assert (keys_iter.get () == contains[0]); + assert (keys_iter.has_next ()); + assert (keys_iter.next ()); + assert (keys_iter.get () == contains[1]); + + // Repeat for entries + master.clear (); + set_default_values (out contains, out not_contains); + var entries_iter = submap.ascending_entries.iterator (); + + assert (entries_iter.has_next ()); + assert (entries_iter.next ()); + + MapTests.assert_entry (entries_iter.get (), contains[0], contains[0]); + assert (entries_iter.has_next ()); + assert (entries_iter.next ()); + MapTests.assert_entry (entries_iter.get (), contains[1], contains[1]); + } else { + var keys_iter = submap.ascending_keys.iterator (); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys_iter.remove (); + Posix.exit (0); + } + Test.trap_assert_failed (); + } + } + + public void test_boundaries () { + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + string[] contains, not_contains; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + assert (keys.first () == "five"); + assert (keys.last () == "four"); + assert_entry (entries.first (), "five", "five"); + assert_entry (entries.last (), "four", "four"); + break; + case Type.TAIL: + assert (keys.first () == "six"); + assert (keys.last () == "two"); + assert_entry (entries.first (), "six", "six"); + assert_entry (entries.last (), "two", "two"); + break; + case Type.SUB: + assert (keys.first () == "four"); + assert (keys.last () == "six"); + assert_entry (entries.first (), "four", "four"); + assert_entry (entries.last (), "six", "six"); + break; + case Type.EMPTY: + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + keys.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + entries.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); + break; + default: + assert_not_reached (); + } + } + + public void test_lower () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + assert (keys.lower ("a") == null); + assert (entries.lower (MapTests.entry_for ("a", "a")) == null); + assert (keys.lower ("five") == null); + assert (entries.lower (MapTests.entry_for ("five", "five")) == null); + assert (keys.lower ("four") == "five"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("four", "four")), "five", "five"); + assert (keys.lower ("six") == "four"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("six", "six")), "four", "four"); + break; + case Type.TAIL: + assert (keys.lower ("one") == null); + assert (entries.lower (MapTests.entry_for ("one", "one")) == null); + assert (keys.lower ("six") == null); + assert (entries.lower (MapTests.entry_for ("six", "six")) == null); + assert (keys.lower ("three") == "six"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("three", "three")), "six", "six"); + assert (keys.lower ("two") == "three"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("two", "two")), "three", "three"); + assert (keys.lower ("z") == "two"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("z", "z")), "two", "two"); + break; + case Type.SUB: + assert (keys.lower ("five") == null); + assert (entries.lower (MapTests.entry_for ("five", "five")) == null); + assert (keys.lower ("four") == null); + assert (entries.lower (MapTests.entry_for ("four", "four")) == null); + assert (keys.lower ("one") == "four"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("one", "one")), "four", "four"); + assert (keys.lower ("six") == "one"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("six", "six")), "one", "one"); + assert (keys.lower ("three") == "six"); + MapTests.assert_entry (entries.lower (MapTests.entry_for ("three", "three")), "six", "six"); + break; + case Type.EMPTY: + assert (keys.lower ("six") == null); + assert (entries.lower (MapTests.entry_for ("six", "six")) == null); + break; + default: + assert_not_reached (); + } + } + + public void test_higher () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + assert (keys.higher ("a") == "five"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("a", "a")), "five", "five"); + assert (keys.higher ("five") == "four"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("five", "five")), "four", "four"); + assert (keys.higher ("four") == null); + assert (entries.higher (MapTests.entry_for ("four", "four")) == null); + assert (keys.higher ("six") == null); + assert (entries.higher (MapTests.entry_for ("six", "six")) == null); + break; + case Type.TAIL: + assert (keys.higher ("one") == "six"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("one", "one")), "six", "six"); + assert (keys.higher ("six") == "three"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("six", "six")), "three", "three"); + assert (keys.higher ("three") == "two"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("three", "three")), "two", "two"); + assert (keys.higher ("two") == null); + assert (entries.higher (MapTests.entry_for ("two", "two")) == null); + assert (keys.higher ("z") == null); + assert (entries.higher (MapTests.entry_for ("z", "z")) == null); + break; + case Type.SUB: + assert (keys.higher ("five") == "four"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("five", "five")), "four", "four"); + assert (keys.higher ("four") == "one"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("four", "four")), "one", "one"); + assert (keys.higher ("one") == "six"); + MapTests.assert_entry (entries.higher (MapTests.entry_for ("one", "one")), "six", "six"); + assert (keys.higher ("six") == null); + assert (entries.higher (MapTests.entry_for ("six", "six")) == null); + assert (keys.higher ("three") == null); + assert (entries.higher (MapTests.entry_for ("three", "three")) == null); + break; + case Type.EMPTY: + assert (keys.higher ("six") == null); + assert (entries.higher (MapTests.entry_for ("six", "six")) == null); + break; + default: + assert_not_reached (); + } + } + + public void test_floor () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + assert (keys.floor ("a") == null); + assert (entries.floor (MapTests.entry_for ("a", "a")) == null); + assert (keys.floor ("five") == "five"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("five", "fiv")), "five", "five"); + assert (keys.floor ("four") == "four"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("four", "four")), "four", "four"); + assert (keys.floor ("six") == "four"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("six", "six")), "four", "four"); + break; + case Type.TAIL: + assert (keys.floor ("one") == null); + assert (entries.floor (MapTests.entry_for ("one", "one")) == null); + assert (keys.floor ("six") == "six"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("six", "six")), "six", "six"); + assert (keys.floor ("three") == "three"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("three", "three")), "three", "three"); + assert (keys.floor ("two") == "two"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("two", "two")), "two", "two"); + assert (keys.floor ("z") == "two"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("z", "z")), "two", "two"); + break; + case Type.SUB: + assert (keys.floor ("five") == null); + assert (entries.floor (MapTests.entry_for ("five", "five")) == null); + assert (keys.floor ("four") == "four"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("four", "four")), "four", "four"); + assert (keys.floor ("one") == "one"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("one", "one")), "one", "one"); + assert (keys.floor ("six") == "six"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("six", "six")), "six", "six"); + assert (keys.floor ("three") == "six"); + MapTests.assert_entry (entries.floor (MapTests.entry_for ("three", "three")), "six", "six"); + break; + case Type.EMPTY: + assert (keys.floor ("six") == null); + assert (entries.floor (MapTests.entry_for ("six", "six")) == null); + break; + default: + assert_not_reached (); + } + } + + public void test_ceil () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + assert (keys.ceil ("a") == "five"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("a", "a")), "five", "five"); + assert (keys.ceil ("five") == "five"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("five", "five")), "five", "five"); + assert (keys.ceil ("four") == "four"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("four", "four")), "four", "four"); + assert (keys.ceil ("six") == null); + assert (entries.ceil (MapTests.entry_for ("six", "six")) == null); + break; + case Type.TAIL: + assert (keys.ceil ("one") == "six"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("one", "one")), "six", "six"); + assert (keys.ceil ("six") == "six"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("six", "six")), "six", "six"); + assert (keys.ceil ("three") == "three"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("three", "three")), "three", "three"); + assert (keys.ceil ("two") == "two"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("two", "two")), "two", "two"); + assert (keys.ceil ("z") == null); + assert (entries.ceil (MapTests.entry_for ("z", "z")) == null); + break; + case Type.SUB: + assert (keys.ceil ("five") == "four"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("five", "five")), "four", "four"); + assert (keys.ceil ("four") == "four"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("four", "four")), "four", "four"); + assert (keys.ceil ("one") == "one"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("one", "one")), "one", "one"); + assert (keys.ceil ("six") == "six"); + MapTests.assert_entry (entries.ceil (MapTests.entry_for ("six", "six")), "six", "six"); + assert (keys.ceil ("three") == null); + assert (entries.ceil (MapTests.entry_for ("three", "three")) == null); + break; + case Type.EMPTY: + assert (keys.ceil ("six") == null); + assert (entries.ceil (MapTests.entry_for ("six", "six")) == null); + break; + default: + assert_not_reached (); + } + } + + public void test_iterator_at () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + foreach (var s in contains) { + var key_iter = keys.iterator_at (s); + var entry_iter = entries.iterator_at (MapTests.entry_for (s, s)); + assert (key_iter != null); + assert (key_iter.get () == s); + MapTests.assert_entry (entry_iter.get (), s, s); + } + foreach (var s in not_contains) { + var key_iter = keys.iterator_at (s); + var entry_iter = entries.iterator_at (MapTests.entry_for (s, s)); + assert (key_iter == null); + assert (entry_iter == null); + } + assert (keys.iterator_at ("seven") == null); + assert (entries.iterator_at (MapTests.entry_for ("seven", "seven")) == null); + } + + public void test_submap_and_subsets () { + string[] contains, not_contains; + var keys = submap.ascending_keys; + var entries = submap.ascending_entries; + + set_default_values (out contains, out not_contains); + + switch (type) { + case Type.HEAD: + var subsubmap = submap.head_map ("four"); + var keyssubset = keys.head_set ("four"); + var entriessubset = entries.head_set (MapTests.entry_for ("four", "four")); + + assert (subsubmap.size == 1); + assert (keyssubset.size == 1); + assert (entriessubset.size == 1); + + subsubmap = submap.tail_map ("four"); + keyssubset = keys.tail_set ("four"); + entriessubset = entries.tail_set (MapTests.entry_for ("four", "four")); + + assert (subsubmap.size == 1); + assert (keyssubset.size == 1); + assert (entriessubset.size == 1); + + subsubmap = submap.sub_map ("four", "one"); + keyssubset = keys.sub_set ("four", "one"); + entriessubset = entries.sub_set (MapTests.entry_for ("four", "four"), MapTests.entry_for ("one", "one")); + + assert (subsubmap.size == 1); + assert (keyssubset.size == 1); + assert (entriessubset.size == 1); + + subsubmap = submap.sub_map ("four", "four"); + keyssubset = keys.sub_set ("four", "four"); + entriessubset = entries.sub_set (MapTests.entry_for ("four", "four"), MapTests.entry_for ("four", "four")); + + assert (subsubmap.size == 0); + assert (keyssubset.size == 0); + assert (entriessubset.size == 0); + break; + case Type.TAIL: + var subsubmap = submap.head_map ("two"); + var keyssubset = keys.head_set ("two"); + var entriessubset = entries.head_set (MapTests.entry_for ("two", "two")); + + assert (subsubmap.size == 2); + assert (keyssubset.size == 2); + assert (entriessubset.size == 2); + + subsubmap = submap.tail_map ("three"); + keyssubset = keys.tail_set ("three"); + entriessubset = entries.tail_set (MapTests.entry_for ("three", "three")); + + assert (subsubmap.size == 2); + assert (keyssubset.size == 2); + assert (entriessubset.size == 2); + + subsubmap = submap.sub_map ("three", "two"); + keyssubset = keys.sub_set ("three", "two"); + entriessubset = entries.sub_set (MapTests.entry_for ("three", "three"), MapTests.entry_for ("two", "two")); + + assert (subsubmap.size == 1); + assert (keyssubset.size == 1); + assert (entriessubset.size == 1); + break; + case Type.SUB: + var subsubmap = submap.head_map ("six"); + var keyssubset = keys.head_set ("six"); + var entriessubset = entries.head_set (MapTests.entry_for ("six", "six")); + + assert (subsubmap.size == 2); + assert (keyssubset.size == 2); + assert (entriessubset.size == 2); + + subsubmap = submap.tail_map ("one"); + keyssubset = keys.tail_set ("one"); + entriessubset = entries.tail_set (MapTests.entry_for ("one", "one")); + + assert (subsubmap.size == 2); + assert (keyssubset.size == 2); + assert (entriessubset.size == 2); + + subsubmap = submap.sub_map ("one", "six"); + keyssubset = keys.sub_set ("one", "six"); + entriessubset = entries.sub_set (MapTests.entry_for ("one", "one"), MapTests.entry_for ("six", "six")); + + assert (subsubmap.size == 1); + assert (keyssubset.size == 1); + assert (entriessubset.size == 1); + + subsubmap = submap.sub_map ("five", "two"); + keyssubset = keys.sub_set ("five", "two"); + entriessubset = entries.sub_set (MapTests.entry_for ("five", "five"), MapTests.entry_for ("two", "two")); + + assert (subsubmap.size == 3); + assert (keyssubset.size == 3); + assert (entriessubset.size == 3); + break; + case Type.EMPTY: + var subsubmap = submap.head_map ("six"); + var keyssubset = keys.head_set ("six"); + var entriessubset = entries.head_set (MapTests.entry_for ("six", "six")); + + assert (subsubmap.size == 0); + assert (keyssubset.size == 0); + assert (entriessubset.size == 0); + + subsubmap = submap.tail_map ("three"); + keyssubset = keys.tail_set ("three"); + entriessubset = entries.tail_set (MapTests.entry_for ("three", "three")); + + assert (subsubmap.size == 0); + assert (keyssubset.size == 0); + assert (entriessubset.size == 0); + + subsubmap = submap.sub_map ("one", "six"); + keyssubset = keys.sub_set ("one", "six"); + entriessubset = entries.sub_set (MapTests.entry_for ("one", "one"), MapTests.entry_for ("six", "six")); + + assert (subsubmap.size == 0); + assert (keyssubset.size == 0); + assert (entriessubset.size == 0); + break; + default: + assert_not_reached (); + } + } + } +} + diff --git a/tests/testsortedset.c b/tests/testsortedset.c index 5b09260..00b2b55 100644 --- a/tests/testsortedset.c +++ b/tests/testsortedset.c @@ -74,20 +74,20 @@ typedef struct _SortedSetTests SortedSetTests; typedef struct _SortedSetTestsClass SortedSetTestsClass; typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate; -#define SORTED_SET_TESTS_SUB_SET_TYPE_TYPE (sorted_set_tests_sub_set_type_get_type ()) +#define SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TYPE (sorted_set_tests_sub_set_tests_type_get_type ()) -#define SORTED_SET_TESTS_TYPE_SUB_SET (sorted_set_tests_sub_set_get_type ()) -#define SORTED_SET_TESTS_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SORTED_SET_TESTS_TYPE_SUB_SET, SortedSetTestsSubSet)) -#define SORTED_SET_TESTS_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SORTED_SET_TESTS_TYPE_SUB_SET, SortedSetTestsSubSetClass)) -#define SORTED_SET_TESTS_IS_SUB_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SORTED_SET_TESTS_TYPE_SUB_SET)) -#define SORTED_SET_TESTS_IS_SUB_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SORTED_SET_TESTS_TYPE_SUB_SET)) -#define SORTED_SET_TESTS_SUB_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SORTED_SET_TESTS_TYPE_SUB_SET, SortedSetTestsSubSetClass)) +#define SORTED_SET_TESTS_TYPE_SUB_SET_TESTS (sorted_set_tests_sub_set_tests_get_type ()) +#define SORTED_SET_TESTS_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, SortedSetTestsSubSetTests)) +#define SORTED_SET_TESTS_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, SortedSetTestsSubSetTestsClass)) +#define SORTED_SET_TESTS_IS_SUB_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS)) +#define SORTED_SET_TESTS_IS_SUB_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS)) +#define SORTED_SET_TESTS_SUB_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, SortedSetTestsSubSetTestsClass)) -typedef struct _SortedSetTestsSubSet SortedSetTestsSubSet; -typedef struct _SortedSetTestsSubSetClass SortedSetTestsSubSetClass; +typedef struct _SortedSetTestsSubSetTests SortedSetTestsSubSetTests; +typedef struct _SortedSetTestsSubSetTestsClass SortedSetTestsSubSetTestsClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) -typedef struct _SortedSetTestsSubSetPrivate SortedSetTestsSubSetPrivate; +typedef struct _SortedSetTestsSubSetTestsPrivate SortedSetTestsSubSetTestsPrivate; #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { @@ -130,44 +130,50 @@ struct _SortedSetTestsClass { SetTestsClass parent_class; }; +struct _SortedSetTestsPrivate { + gboolean strict; +}; + typedef void (*GeeTestCaseTestMethod) (void* user_data); typedef enum { - SORTED_SET_TESTS_SUB_SET_TYPE_HEAD, - SORTED_SET_TESTS_SUB_SET_TYPE_TAIL, - SORTED_SET_TESTS_SUB_SET_TYPE_SUB, - SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY -} SortedSetTestsSubSetType; + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB, + SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY +} SortedSetTestsSubSetTestsType; -struct _SortedSetTestsSubSet { +struct _SortedSetTestsSubSetTests { GeeTestCase parent_instance; - SortedSetTestsSubSetPrivate * priv; + SortedSetTestsSubSetTestsPrivate * priv; }; -struct _SortedSetTestsSubSetClass { +struct _SortedSetTestsSubSetTestsClass { GeeTestCaseClass parent_class; }; -struct _SortedSetTestsSubSetPrivate { +struct _SortedSetTestsSubSetTestsPrivate { GeeSortedSet* master; GeeSortedSet* subset; SortedSetTests* test; - SortedSetTestsSubSetType type; + SortedSetTestsSubSetTestsType type; + gboolean strict; }; static gpointer sorted_set_tests_parent_class = NULL; -static gpointer sorted_set_tests_sub_set_parent_class = NULL; +static gpointer sorted_set_tests_sub_set_tests_parent_class = NULL; GType gee_test_case_get_type (void) G_GNUC_CONST; GType collection_tests_get_type (void) G_GNUC_CONST; GType set_tests_get_type (void) G_GNUC_CONST; GType sorted_set_tests_get_type (void) G_GNUC_CONST; +#define SORTED_SET_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SORTED_SET_TESTS, SortedSetTestsPrivate)) enum { SORTED_SET_TESTS_DUMMY_PROPERTY }; -SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name); +SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict); SetTests* set_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void sorted_set_tests_test_first (SortedSetTests* self); static void _sorted_set_tests_test_first_gee_test_case_test_method (gpointer self); void sorted_set_tests_test_last (SortedSetTests* self); @@ -184,54 +190,49 @@ void sorted_set_tests_test_floor (SortedSetTests* self); static void _sorted_set_tests_test_floor_gee_test_case_test_method (gpointer self); void sorted_set_tests_test_ceil (SortedSetTests* self); static void _sorted_set_tests_test_ceil_gee_test_case_test_method (gpointer self); -void sorted_set_tests_test_bidir_iterator_can_go_backward (SortedSetTests* self); -static void _sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self); -void sorted_set_tests_test_mutable_bidir_iterator (SortedSetTests* self); -static void _sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self); -void sorted_set_tests_test_bidir_iterator_last (SortedSetTests* self); -static void _sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self); GTestSuite* gee_test_case_get_suite (GeeTestCase* self); -GType sorted_set_tests_sub_set_type_get_type (void) G_GNUC_CONST; -SortedSetTestsSubSet* sorted_set_tests_sub_set_new (SortedSetTests* test, SortedSetTestsSubSetType type); -SortedSetTestsSubSet* sorted_set_tests_sub_set_construct (GType object_type, SortedSetTests* test, SortedSetTestsSubSetType type); -GType sorted_set_tests_sub_set_get_type (void) G_GNUC_CONST; -#define SORTED_SET_TESTS_SUB_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SORTED_SET_TESTS_TYPE_SUB_SET, SortedSetTestsSubSetPrivate)) +GType sorted_set_tests_sub_set_tests_type_get_type (void) G_GNUC_CONST; +SortedSetTestsSubSetTests* sorted_set_tests_sub_set_tests_new (SortedSetTests* test, SortedSetTestsSubSetTestsType type, gboolean strict); +SortedSetTestsSubSetTests* sorted_set_tests_sub_set_tests_construct (GType object_type, SortedSetTests* test, SortedSetTestsSubSetTestsType type, gboolean strict); +GType sorted_set_tests_sub_set_tests_get_type (void) G_GNUC_CONST; +#define SORTED_SET_TESTS_SUB_SET_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, SortedSetTestsSubSetTestsPrivate)) enum { - SORTED_SET_TESTS_SUB_SET_DUMMY_PROPERTY + SORTED_SET_TESTS_SUB_SET_TESTS_DUMMY_PROPERTY }; -const gchar* sorted_set_tests_sub_set_type_to_string (SortedSetTestsSubSetType self); +const gchar* sorted_set_tests_sub_set_tests_type_to_string (SortedSetTestsSubSetTestsType self); GeeTestCase* gee_test_case_construct (GType object_type, const gchar* name); -void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_size_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_contains_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_add_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_remove_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_iterator_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_clear_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_iterator_at_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_lower_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_higher_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_ceil_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_floor_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_subsets_gee_test_case_test_method (gpointer self); -void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self); -static void _sorted_set_tests_sub_set_test_boundaries_gee_test_case_test_method (gpointer self); -static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base); +void sorted_set_tests_sub_set_tests_test_size (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_size_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_contains (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_contains_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_add (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_add_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_remove (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_remove_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_iterator (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_iterator_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_clear (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_clear_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_iterator_at (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_iterator_at_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_lower (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_lower_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_higher (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_higher_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_ceil (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_ceil_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_floor (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_floor_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_subsets (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_subsets_gee_test_case_test_method (gpointer self); +void sorted_set_tests_sub_set_tests_test_boundaries (SortedSetTestsSubSetTests* self); +static void _sorted_set_tests_sub_set_tests_test_boundaries_gee_test_case_test_method (gpointer self); +static void sorted_set_tests_sub_set_tests_real_set_up (GeeTestCase* base); void gee_test_case_set_up (GeeTestCase* self); -static void sorted_set_tests_sub_set_real_tear_down (GeeTestCase* base); +static void sorted_set_tests_sub_set_tests_real_tear_down (GeeTestCase* base); void gee_test_case_tear_down (GeeTestCase* self); -static void sorted_set_tests_sub_set_finalize (GObject* obj); +static void sorted_set_tests_sub_set_tests_finalize (GObject* obj); +static void sorted_set_tests_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); @@ -276,78 +277,71 @@ static void _sorted_set_tests_test_ceil_gee_test_case_test_method (gpointer self } -static void _sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method (gpointer self) { - sorted_set_tests_test_bidir_iterator_can_go_backward (self); -} - - -static void _sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method (gpointer self) { - sorted_set_tests_test_mutable_bidir_iterator (self); -} - - -static void _sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method (gpointer self) { - sorted_set_tests_test_bidir_iterator_last (self); -} - - -SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name) { +SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict) { SortedSetTests * self = NULL; const gchar* _tmp0_; - GTestSuite* _tmp1_ = NULL; - SortedSetTestsSubSet* _tmp2_; - SortedSetTestsSubSet* _tmp3_; - GTestSuite* _tmp4_ = NULL; - GTestSuite* _tmp5_ = NULL; - SortedSetTestsSubSet* _tmp6_; - SortedSetTestsSubSet* _tmp7_; - GTestSuite* _tmp8_ = NULL; - GTestSuite* _tmp9_ = NULL; - SortedSetTestsSubSet* _tmp10_; - SortedSetTestsSubSet* _tmp11_; + gboolean _tmp1_; + GTestSuite* _tmp2_ = NULL; + gboolean _tmp3_; + SortedSetTestsSubSetTests* _tmp4_; + SortedSetTestsSubSetTests* _tmp5_; + GTestSuite* _tmp6_ = NULL; + GTestSuite* _tmp7_ = NULL; + gboolean _tmp8_; + SortedSetTestsSubSetTests* _tmp9_; + SortedSetTestsSubSetTests* _tmp10_; + GTestSuite* _tmp11_ = NULL; GTestSuite* _tmp12_ = NULL; - GTestSuite* _tmp13_ = NULL; - SortedSetTestsSubSet* _tmp14_; - SortedSetTestsSubSet* _tmp15_; + gboolean _tmp13_; + SortedSetTestsSubSetTests* _tmp14_; + SortedSetTestsSubSetTests* _tmp15_; GTestSuite* _tmp16_ = NULL; + GTestSuite* _tmp17_ = NULL; + gboolean _tmp18_; + SortedSetTestsSubSetTests* _tmp19_; + SortedSetTestsSubSetTests* _tmp20_; + GTestSuite* _tmp21_ = NULL; g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (SortedSetTests*) set_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] first", _sorted_set_tests_test_first_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] last", _sorted_set_tests_test_last_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ordering", _sorted_set_tests_test_ordering_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] iterator at", _sorted_set_tests_test_iterator_at_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] lower", _sorted_set_tests_test_lower_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] higher", _sorted_set_tests_test_higher_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] floor", _sorted_set_tests_test_floor_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ceil", _sorted_set_tests_test_ceil_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can go backward", _sorted_set_tests_test_bidir_iterator_can_go_backward_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators are mutable", _sorted_set_tests_test_mutable_bidir_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] bi-directional iterators can to end", _sorted_set_tests_test_bidir_iterator_last_gee_test_case_test_method, self); - _tmp1_ = gee_test_case_get_suite ((GeeTestCase*) self); - _tmp2_ = sorted_set_tests_sub_set_new (self, SORTED_SET_TESTS_SUB_SET_TYPE_HEAD); - _tmp3_ = _tmp2_; - _tmp4_ = gee_test_case_get_suite ((GeeTestCase*) _tmp3_); - g_test_suite_add_suite (_tmp1_, _tmp4_); - _g_object_unref0 (_tmp3_); - _tmp5_ = gee_test_case_get_suite ((GeeTestCase*) self); - _tmp6_ = sorted_set_tests_sub_set_new (self, SORTED_SET_TESTS_SUB_SET_TYPE_TAIL); - _tmp7_ = _tmp6_; - _tmp8_ = gee_test_case_get_suite ((GeeTestCase*) _tmp7_); - g_test_suite_add_suite (_tmp5_, _tmp8_); - _g_object_unref0 (_tmp7_); - _tmp9_ = gee_test_case_get_suite ((GeeTestCase*) self); - _tmp10_ = sorted_set_tests_sub_set_new (self, SORTED_SET_TESTS_SUB_SET_TYPE_SUB); - _tmp11_ = _tmp10_; - _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) _tmp11_); - g_test_suite_add_suite (_tmp9_, _tmp12_); - _g_object_unref0 (_tmp11_); - _tmp13_ = gee_test_case_get_suite ((GeeTestCase*) self); - _tmp14_ = sorted_set_tests_sub_set_new (self, SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY); + _tmp1_ = strict; + self->priv->strict = _tmp1_; + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] first", _sorted_set_tests_test_first_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] last", _sorted_set_tests_test_last_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ordering", _sorted_set_tests_test_ordering_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] iterator at", _sorted_set_tests_test_iterator_at_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] lower", _sorted_set_tests_test_lower_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] higher", _sorted_set_tests_test_higher_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] floor", _sorted_set_tests_test_floor_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ceil", _sorted_set_tests_test_ceil_gee_test_case_test_method, g_object_ref (self), g_object_unref); + _tmp2_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp3_ = strict; + _tmp4_ = sorted_set_tests_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD, _tmp3_); + _tmp5_ = _tmp4_; + _tmp6_ = gee_test_case_get_suite ((GeeTestCase*) _tmp5_); + g_test_suite_add_suite (_tmp2_, _tmp6_); + _g_object_unref0 (_tmp5_); + _tmp7_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp8_ = strict; + _tmp9_ = sorted_set_tests_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL, _tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = gee_test_case_get_suite ((GeeTestCase*) _tmp10_); + g_test_suite_add_suite (_tmp7_, _tmp11_); + _g_object_unref0 (_tmp10_); + _tmp12_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp13_ = strict; + _tmp14_ = sorted_set_tests_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB, _tmp13_); _tmp15_ = _tmp14_; _tmp16_ = gee_test_case_get_suite ((GeeTestCase*) _tmp15_); - g_test_suite_add_suite (_tmp13_, _tmp16_); + g_test_suite_add_suite (_tmp12_, _tmp16_); _g_object_unref0 (_tmp15_); + _tmp17_ = gee_test_case_get_suite ((GeeTestCase*) self); + _tmp18_ = strict; + _tmp19_ = sorted_set_tests_sub_set_tests_new (self, SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY, _tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = gee_test_case_get_suite ((GeeTestCase*) _tmp20_); + g_test_suite_add_suite (_tmp17_, _tmp21_); + _g_object_unref0 (_tmp20_); return self; } @@ -502,61 +496,65 @@ void sorted_set_tests_test_first (SortedSetTests* self) { GeeCollection* _tmp0_; GeeSortedSet* _tmp1_; GeeSortedSet* test_set; - gboolean _tmp2_ = FALSE; - GeeSortedSet* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeSortedSet* _tmp8_; - gboolean _tmp9_ = FALSE; - GeeSortedSet* _tmp10_; - gboolean _tmp11_ = FALSE; - GeeSortedSet* _tmp12_; - gboolean _tmp13_ = FALSE; - GeeSortedSet* _tmp14_; - gboolean _tmp15_ = FALSE; - GeeSortedSet* _tmp16_; - gboolean _tmp17_ = FALSE; - GeeSortedSet* _tmp18_; - gpointer _tmp19_ = NULL; - gchar* _tmp20_; + gboolean _tmp2_; + GeeSortedSet* _tmp7_; + gboolean _tmp8_ = FALSE; + GeeSortedSet* _tmp9_; + gboolean _tmp10_ = FALSE; + GeeSortedSet* _tmp11_; + gboolean _tmp12_ = FALSE; + GeeSortedSet* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeSortedSet* _tmp15_; + gboolean _tmp16_ = FALSE; + GeeSortedSet* _tmp17_; + gboolean _tmp18_ = FALSE; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); test_set = _tmp1_; - _tmp2_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + _tmp2_ = self->priv->strict; if (_tmp2_) { - GeeSortedSet* _tmp3_; - gpointer _tmp4_ = NULL; - gchar* _tmp5_; - _tmp3_ = test_set; - _tmp4_ = gee_sorted_set_first (_tmp3_); - _tmp5_ = (gchar*) _tmp4_; - _g_free0 (_tmp5_); - exit (0); + gboolean _tmp3_ = FALSE; + _tmp3_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp3_) { + GeeSortedSet* _tmp4_; + gpointer _tmp5_ = NULL; + gchar* _tmp6_; + _tmp4_ = test_set; + _tmp5_ = gee_sorted_set_first (_tmp4_); + _tmp6_ = (gchar*) _tmp5_; + _g_free0 (_tmp6_); + exit (0); + } + g_test_trap_assert_failed (); } - g_test_trap_assert_failed (); - _tmp6_ = test_set; - _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "one"); - _vala_assert (_tmp7_, "test_set.add (\"one\")"); - _tmp8_ = test_set; - _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "two"); - _vala_assert (_tmp9_, "test_set.add (\"two\")"); - _tmp10_ = test_set; - _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "three"); - _vala_assert (_tmp11_, "test_set.add (\"three\")"); - _tmp12_ = test_set; - _tmp13_ = gee_collection_add ((GeeCollection*) _tmp12_, "four"); - _vala_assert (_tmp13_, "test_set.add (\"four\")"); - _tmp14_ = test_set; - _tmp15_ = gee_collection_add ((GeeCollection*) _tmp14_, "five"); - _vala_assert (_tmp15_, "test_set.add (\"five\")"); - _tmp16_ = test_set; - _tmp17_ = gee_collection_add ((GeeCollection*) _tmp16_, "six"); - _vala_assert (_tmp17_, "test_set.add (\"six\")"); - _tmp18_ = test_set; - _tmp19_ = gee_sorted_set_first (_tmp18_); - _tmp20_ = (gchar*) _tmp19_; - _vala_assert (g_strcmp0 (_tmp20_, "five") == 0, "test_set.first () == \"five\""); - _g_free0 (_tmp20_); + _tmp7_ = test_set; + _tmp8_ = gee_collection_add ((GeeCollection*) _tmp7_, "one"); + _vala_assert (_tmp8_, "test_set.add (\"one\")"); + _tmp9_ = test_set; + _tmp10_ = gee_collection_add ((GeeCollection*) _tmp9_, "two"); + _vala_assert (_tmp10_, "test_set.add (\"two\")"); + _tmp11_ = test_set; + _tmp12_ = gee_collection_add ((GeeCollection*) _tmp11_, "three"); + _vala_assert (_tmp12_, "test_set.add (\"three\")"); + _tmp13_ = test_set; + _tmp14_ = gee_collection_add ((GeeCollection*) _tmp13_, "four"); + _vala_assert (_tmp14_, "test_set.add (\"four\")"); + _tmp15_ = test_set; + _tmp16_ = gee_collection_add ((GeeCollection*) _tmp15_, "five"); + _vala_assert (_tmp16_, "test_set.add (\"five\")"); + _tmp17_ = test_set; + _tmp18_ = gee_collection_add ((GeeCollection*) _tmp17_, "six"); + _vala_assert (_tmp18_, "test_set.add (\"six\")"); + _tmp19_ = test_set; + _tmp20_ = gee_sorted_set_first (_tmp19_); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "five") == 0, "test_set.first () == \"five\""); + _g_free0 (_tmp21_); _g_object_unref0 (test_set); } @@ -565,61 +563,65 @@ void sorted_set_tests_test_last (SortedSetTests* self) { GeeCollection* _tmp0_; GeeSortedSet* _tmp1_; GeeSortedSet* test_set; - gboolean _tmp2_ = FALSE; - GeeSortedSet* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeSortedSet* _tmp8_; - gboolean _tmp9_ = FALSE; - GeeSortedSet* _tmp10_; - gboolean _tmp11_ = FALSE; - GeeSortedSet* _tmp12_; - gboolean _tmp13_ = FALSE; - GeeSortedSet* _tmp14_; - gboolean _tmp15_ = FALSE; - GeeSortedSet* _tmp16_; - gboolean _tmp17_ = FALSE; - GeeSortedSet* _tmp18_; - gpointer _tmp19_ = NULL; - gchar* _tmp20_; + gboolean _tmp2_; + GeeSortedSet* _tmp7_; + gboolean _tmp8_ = FALSE; + GeeSortedSet* _tmp9_; + gboolean _tmp10_ = FALSE; + GeeSortedSet* _tmp11_; + gboolean _tmp12_ = FALSE; + GeeSortedSet* _tmp13_; + gboolean _tmp14_ = FALSE; + GeeSortedSet* _tmp15_; + gboolean _tmp16_ = FALSE; + GeeSortedSet* _tmp17_; + gboolean _tmp18_ = FALSE; + GeeSortedSet* _tmp19_; + gpointer _tmp20_ = NULL; + gchar* _tmp21_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); test_set = _tmp1_; - _tmp2_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + _tmp2_ = self->priv->strict; if (_tmp2_) { - GeeSortedSet* _tmp3_; - gpointer _tmp4_ = NULL; - gchar* _tmp5_; - _tmp3_ = test_set; - _tmp4_ = gee_sorted_set_last (_tmp3_); - _tmp5_ = (gchar*) _tmp4_; - _g_free0 (_tmp5_); - exit (0); + gboolean _tmp3_ = FALSE; + _tmp3_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp3_) { + GeeSortedSet* _tmp4_; + gpointer _tmp5_ = NULL; + gchar* _tmp6_; + _tmp4_ = test_set; + _tmp5_ = gee_sorted_set_last (_tmp4_); + _tmp6_ = (gchar*) _tmp5_; + _g_free0 (_tmp6_); + exit (0); + } + g_test_trap_assert_failed (); } - g_test_trap_assert_failed (); - _tmp6_ = test_set; - _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "one"); - _vala_assert (_tmp7_, "test_set.add (\"one\")"); - _tmp8_ = test_set; - _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "two"); - _vala_assert (_tmp9_, "test_set.add (\"two\")"); - _tmp10_ = test_set; - _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "three"); - _vala_assert (_tmp11_, "test_set.add (\"three\")"); - _tmp12_ = test_set; - _tmp13_ = gee_collection_add ((GeeCollection*) _tmp12_, "four"); - _vala_assert (_tmp13_, "test_set.add (\"four\")"); - _tmp14_ = test_set; - _tmp15_ = gee_collection_add ((GeeCollection*) _tmp14_, "five"); - _vala_assert (_tmp15_, "test_set.add (\"five\")"); - _tmp16_ = test_set; - _tmp17_ = gee_collection_add ((GeeCollection*) _tmp16_, "six"); - _vala_assert (_tmp17_, "test_set.add (\"six\")"); - _tmp18_ = test_set; - _tmp19_ = gee_sorted_set_last (_tmp18_); - _tmp20_ = (gchar*) _tmp19_; - _vala_assert (g_strcmp0 (_tmp20_, "two") == 0, "test_set.last () == \"two\""); - _g_free0 (_tmp20_); + _tmp7_ = test_set; + _tmp8_ = gee_collection_add ((GeeCollection*) _tmp7_, "one"); + _vala_assert (_tmp8_, "test_set.add (\"one\")"); + _tmp9_ = test_set; + _tmp10_ = gee_collection_add ((GeeCollection*) _tmp9_, "two"); + _vala_assert (_tmp10_, "test_set.add (\"two\")"); + _tmp11_ = test_set; + _tmp12_ = gee_collection_add ((GeeCollection*) _tmp11_, "three"); + _vala_assert (_tmp12_, "test_set.add (\"three\")"); + _tmp13_ = test_set; + _tmp14_ = gee_collection_add ((GeeCollection*) _tmp13_, "four"); + _vala_assert (_tmp14_, "test_set.add (\"four\")"); + _tmp15_ = test_set; + _tmp16_ = gee_collection_add ((GeeCollection*) _tmp15_, "five"); + _vala_assert (_tmp16_, "test_set.add (\"five\")"); + _tmp17_ = test_set; + _tmp18_ = gee_collection_add ((GeeCollection*) _tmp17_, "six"); + _vala_assert (_tmp18_, "test_set.add (\"six\")"); + _tmp19_ = test_set; + _tmp20_ = gee_sorted_set_last (_tmp19_); + _tmp21_ = (gchar*) _tmp20_; + _vala_assert (g_strcmp0 (_tmp21_, "two") == 0, "test_set.last () == \"two\""); + _g_free0 (_tmp21_); _g_object_unref0 (test_set); } @@ -631,24 +633,24 @@ void sorted_set_tests_test_iterator_at (SortedSetTests* self) { gboolean _tmp2_ = FALSE; gboolean _tmp3_ = FALSE; gboolean _tmp4_ = FALSE; - GeeBidirIterator* _tmp5_ = NULL; - GeeBidirIterator* iter; - GeeBidirIterator* _tmp6_; - GeeBidirIterator* _tmp7_; + GeeIterator* _tmp5_ = NULL; + GeeIterator* iter; + GeeIterator* _tmp6_; + GeeIterator* _tmp7_; gpointer _tmp8_ = NULL; gchar* _tmp9_; - GeeBidirIterator* _tmp10_ = NULL; - GeeBidirIterator* _tmp11_; - GeeBidirIterator* _tmp12_; + GeeIterator* _tmp10_ = NULL; + GeeIterator* _tmp11_; + GeeIterator* _tmp12_; gpointer _tmp13_ = NULL; gchar* _tmp14_; - GeeBidirIterator* _tmp15_ = NULL; - GeeBidirIterator* _tmp16_; - GeeBidirIterator* _tmp17_; + GeeIterator* _tmp15_ = NULL; + GeeIterator* _tmp16_; + GeeIterator* _tmp17_; gpointer _tmp18_ = NULL; gchar* _tmp19_; - GeeBidirIterator* _tmp20_ = NULL; - GeeBidirIterator* _tmp21_; + GeeIterator* _tmp20_ = NULL; + GeeIterator* _tmp21_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); @@ -664,7 +666,7 @@ void sorted_set_tests_test_iterator_at (SortedSetTests* self) { _tmp6_ = iter; _vala_assert (_tmp6_ != NULL, "iter != null"); _tmp7_ = iter; - _tmp8_ = gee_iterator_get ((GeeIterator*) _tmp7_); + _tmp8_ = gee_iterator_get (_tmp7_); _tmp9_ = (gchar*) _tmp8_; _vala_assert (g_strcmp0 (_tmp9_, "one") == 0, "iter.get () == \"one\""); _g_free0 (_tmp9_); @@ -674,7 +676,7 @@ void sorted_set_tests_test_iterator_at (SortedSetTests* self) { _tmp11_ = iter; _vala_assert (_tmp11_ != NULL, "iter != null"); _tmp12_ = iter; - _tmp13_ = gee_iterator_get ((GeeIterator*) _tmp12_); + _tmp13_ = gee_iterator_get (_tmp12_); _tmp14_ = (gchar*) _tmp13_; _vala_assert (g_strcmp0 (_tmp14_, "two") == 0, "iter.get () == \"two\""); _g_free0 (_tmp14_); @@ -684,7 +686,7 @@ void sorted_set_tests_test_iterator_at (SortedSetTests* self) { _tmp16_ = iter; _vala_assert (_tmp16_ != NULL, "iter != null"); _tmp17_ = iter; - _tmp18_ = gee_iterator_get ((GeeIterator*) _tmp17_); + _tmp18_ = gee_iterator_get (_tmp17_); _tmp19_ = (gchar*) _tmp18_; _vala_assert (g_strcmp0 (_tmp19_, "three") == 0, "iter.get () == \"three\""); _g_free0 (_tmp19_); @@ -1082,491 +1084,25 @@ void sorted_set_tests_test_ceil (SortedSetTests* self) { } -void sorted_set_tests_test_bidir_iterator_can_go_backward (SortedSetTests* self) { - GeeCollection* _tmp0_; - GeeSortedSet* _tmp1_; - GeeSortedSet* test_set; - GeeBidirIterator* _tmp2_ = NULL; - GeeBidirIterator* iterator; - GeeBidirIterator* _tmp3_; - gboolean _tmp4_ = FALSE; - gboolean _tmp5_ = FALSE; - gboolean _tmp6_ = FALSE; - gboolean _tmp7_ = FALSE; - gboolean _tmp8_ = FALSE; - gboolean _tmp9_ = FALSE; - gboolean _tmp10_ = FALSE; - GeeBidirIterator* _tmp11_ = NULL; - GeeBidirIterator* _tmp12_; - gboolean _tmp13_ = FALSE; - GeeBidirIterator* _tmp14_; - gpointer _tmp15_ = NULL; - gchar* _tmp16_; - GeeBidirIterator* _tmp17_; - gboolean _tmp18_ = FALSE; - GeeBidirIterator* _tmp19_; - gboolean _tmp20_ = FALSE; - GeeBidirIterator* _tmp21_; - gpointer _tmp22_ = NULL; - gchar* _tmp23_; - GeeBidirIterator* _tmp24_; - gboolean _tmp25_ = FALSE; - GeeBidirIterator* _tmp26_; - gboolean _tmp27_ = FALSE; - GeeBidirIterator* _tmp28_; - gpointer _tmp29_ = NULL; - gchar* _tmp30_; - GeeBidirIterator* _tmp31_; - gboolean _tmp32_ = FALSE; - GeeBidirIterator* _tmp33_; - gboolean _tmp34_ = FALSE; - GeeBidirIterator* _tmp35_; - gpointer _tmp36_ = NULL; - gchar* _tmp37_; - GeeBidirIterator* _tmp38_; - gboolean _tmp39_ = FALSE; - GeeBidirIterator* _tmp40_; - gboolean _tmp41_ = FALSE; - GeeBidirIterator* _tmp42_; - gpointer _tmp43_ = NULL; - gchar* _tmp44_; - GeeBidirIterator* _tmp45_; - gboolean _tmp46_ = FALSE; - GeeBidirIterator* _tmp47_; - gboolean _tmp48_ = FALSE; - GeeBidirIterator* _tmp49_; - gpointer _tmp50_ = NULL; - gchar* _tmp51_; - GeeBidirIterator* _tmp52_; - gboolean _tmp53_ = FALSE; - GeeBidirIterator* _tmp54_; - gboolean _tmp55_ = FALSE; - GeeBidirIterator* _tmp56_; - gboolean _tmp57_ = FALSE; - GeeBidirIterator* _tmp58_; - gpointer _tmp59_ = NULL; - gchar* _tmp60_; - GeeBidirIterator* _tmp61_; - gboolean _tmp62_ = FALSE; - GeeBidirIterator* _tmp63_; - gpointer _tmp64_ = NULL; - gchar* _tmp65_; - GeeBidirIterator* _tmp66_; - gboolean _tmp67_ = FALSE; - GeeBidirIterator* _tmp68_; - gpointer _tmp69_ = NULL; - gchar* _tmp70_; - GeeBidirIterator* _tmp71_; - gboolean _tmp72_ = FALSE; - GeeBidirIterator* _tmp73_; - gpointer _tmp74_ = NULL; - gchar* _tmp75_; - GeeBidirIterator* _tmp76_; - gboolean _tmp77_ = FALSE; - GeeBidirIterator* _tmp78_; - gpointer _tmp79_ = NULL; - gchar* _tmp80_; - GeeBidirIterator* _tmp81_; - gboolean _tmp82_ = FALSE; - GeeBidirIterator* _tmp83_; - gpointer _tmp84_ = NULL; - gchar* _tmp85_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _tmp2_ = gee_sorted_set_bidir_iterator (test_set); - iterator = _tmp2_; - _tmp3_ = iterator; - _tmp4_ = gee_bidir_iterator_has_previous (_tmp3_); - _vala_assert (!_tmp4_, "!iterator.has_previous ()"); - _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one"); - _vala_assert (_tmp5_, "test_set.add (\"one\")"); - _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two"); - _vala_assert (_tmp6_, "test_set.add (\"two\")"); - _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three"); - _vala_assert (_tmp7_, "test_set.add (\"three\")"); - _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four"); - _vala_assert (_tmp8_, "test_set.add (\"four\")"); - _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five"); - _vala_assert (_tmp9_, "test_set.add (\"five\")"); - _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six"); - _vala_assert (_tmp10_, "test_set.add (\"six\")"); - _tmp11_ = gee_sorted_set_bidir_iterator (test_set); - _g_object_unref0 (iterator); - iterator = _tmp11_; - _tmp12_ = iterator; - _tmp13_ = gee_iterator_next ((GeeIterator*) _tmp12_); - _vala_assert (_tmp13_, "iterator.next ()"); - _tmp14_ = iterator; - _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "five") == 0, "iterator.get () == \"five\""); - _g_free0 (_tmp16_); - _tmp17_ = iterator; - _tmp18_ = gee_bidir_iterator_has_previous (_tmp17_); - _vala_assert (!_tmp18_, "!iterator.has_previous ()"); - _tmp19_ = iterator; - _tmp20_ = gee_iterator_next ((GeeIterator*) _tmp19_); - _vala_assert (_tmp20_, "iterator.next ()"); - _tmp21_ = iterator; - _tmp22_ = gee_iterator_get ((GeeIterator*) _tmp21_); - _tmp23_ = (gchar*) _tmp22_; - _vala_assert (g_strcmp0 (_tmp23_, "four") == 0, "iterator.get () == \"four\""); - _g_free0 (_tmp23_); - _tmp24_ = iterator; - _tmp25_ = gee_bidir_iterator_has_previous (_tmp24_); - _vala_assert (_tmp25_, "iterator.has_previous ()"); - _tmp26_ = iterator; - _tmp27_ = gee_iterator_next ((GeeIterator*) _tmp26_); - _vala_assert (_tmp27_, "iterator.next ()"); - _tmp28_ = iterator; - _tmp29_ = gee_iterator_get ((GeeIterator*) _tmp28_); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp30_); - _tmp31_ = iterator; - _tmp32_ = gee_bidir_iterator_has_previous (_tmp31_); - _vala_assert (_tmp32_, "iterator.has_previous ()"); - _tmp33_ = iterator; - _tmp34_ = gee_iterator_next ((GeeIterator*) _tmp33_); - _vala_assert (_tmp34_, "iterator.next ()"); - _tmp35_ = iterator; - _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_); - _tmp37_ = (gchar*) _tmp36_; - _vala_assert (g_strcmp0 (_tmp37_, "six") == 0, "iterator.get () == \"six\""); - _g_free0 (_tmp37_); - _tmp38_ = iterator; - _tmp39_ = gee_bidir_iterator_has_previous (_tmp38_); - _vala_assert (_tmp39_, "iterator.has_previous ()"); - _tmp40_ = iterator; - _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_); - _vala_assert (_tmp41_, "iterator.next ()"); - _tmp42_ = iterator; - _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_); - _tmp44_ = (gchar*) _tmp43_; - _vala_assert (g_strcmp0 (_tmp44_, "three") == 0, "iterator.get () == \"three\""); - _g_free0 (_tmp44_); - _tmp45_ = iterator; - _tmp46_ = gee_bidir_iterator_has_previous (_tmp45_); - _vala_assert (_tmp46_, "iterator.has_previous ()"); - _tmp47_ = iterator; - _tmp48_ = gee_iterator_next ((GeeIterator*) _tmp47_); - _vala_assert (_tmp48_, "iterator.next ()"); - _tmp49_ = iterator; - _tmp50_ = gee_iterator_get ((GeeIterator*) _tmp49_); - _tmp51_ = (gchar*) _tmp50_; - _vala_assert (g_strcmp0 (_tmp51_, "two") == 0, "iterator.get () == \"two\""); - _g_free0 (_tmp51_); - _tmp52_ = iterator; - _tmp53_ = gee_bidir_iterator_has_previous (_tmp52_); - _vala_assert (_tmp53_, "iterator.has_previous ()"); - _tmp54_ = iterator; - _tmp55_ = gee_iterator_next ((GeeIterator*) _tmp54_); - _vala_assert (!_tmp55_, "!iterator.next ()"); - _tmp56_ = iterator; - _tmp57_ = gee_bidir_iterator_previous (_tmp56_); - _vala_assert (_tmp57_, "iterator.previous ()"); - _tmp58_ = iterator; - _tmp59_ = gee_iterator_get ((GeeIterator*) _tmp58_); - _tmp60_ = (gchar*) _tmp59_; - _vala_assert (g_strcmp0 (_tmp60_, "three") == 0, "iterator.get () == \"three\""); - _g_free0 (_tmp60_); - _tmp61_ = iterator; - _tmp62_ = gee_bidir_iterator_previous (_tmp61_); - _vala_assert (_tmp62_, "iterator.previous ()"); - _tmp63_ = iterator; - _tmp64_ = gee_iterator_get ((GeeIterator*) _tmp63_); - _tmp65_ = (gchar*) _tmp64_; - _vala_assert (g_strcmp0 (_tmp65_, "six") == 0, "iterator.get () == \"six\""); - _g_free0 (_tmp65_); - _tmp66_ = iterator; - _tmp67_ = gee_bidir_iterator_previous (_tmp66_); - _vala_assert (_tmp67_, "iterator.previous ()"); - _tmp68_ = iterator; - _tmp69_ = gee_iterator_get ((GeeIterator*) _tmp68_); - _tmp70_ = (gchar*) _tmp69_; - _vala_assert (g_strcmp0 (_tmp70_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp70_); - _tmp71_ = iterator; - _tmp72_ = gee_bidir_iterator_previous (_tmp71_); - _vala_assert (_tmp72_, "iterator.previous ()"); - _tmp73_ = iterator; - _tmp74_ = gee_iterator_get ((GeeIterator*) _tmp73_); - _tmp75_ = (gchar*) _tmp74_; - _vala_assert (g_strcmp0 (_tmp75_, "four") == 0, "iterator.get () == \"four\""); - _g_free0 (_tmp75_); - _tmp76_ = iterator; - _tmp77_ = gee_bidir_iterator_previous (_tmp76_); - _vala_assert (_tmp77_, "iterator.previous ()"); - _tmp78_ = iterator; - _tmp79_ = gee_iterator_get ((GeeIterator*) _tmp78_); - _tmp80_ = (gchar*) _tmp79_; - _vala_assert (g_strcmp0 (_tmp80_, "five") == 0, "iterator.get () == \"five\""); - _g_free0 (_tmp80_); - _tmp81_ = iterator; - _tmp82_ = gee_bidir_iterator_previous (_tmp81_); - _vala_assert (!_tmp82_, "!iterator.previous ()"); - _tmp83_ = iterator; - _tmp84_ = gee_iterator_get ((GeeIterator*) _tmp83_); - _tmp85_ = (gchar*) _tmp84_; - _vala_assert (g_strcmp0 (_tmp85_, "five") == 0, "iterator.get () == \"five\""); - _g_free0 (_tmp85_); - _g_object_unref0 (iterator); - _g_object_unref0 (test_set); -} - - -void sorted_set_tests_test_bidir_iterator_last (SortedSetTests* self) { - GeeCollection* _tmp0_; - GeeSortedSet* _tmp1_; - GeeSortedSet* test_set; - GeeBidirIterator* _tmp2_ = NULL; - GeeBidirIterator* iterator; - GeeBidirIterator* _tmp3_; - gboolean _tmp4_ = FALSE; - gboolean _tmp5_ = FALSE; - gboolean _tmp6_ = FALSE; - gboolean _tmp7_ = FALSE; - gboolean _tmp8_ = FALSE; - gboolean _tmp9_ = FALSE; - gboolean _tmp10_ = FALSE; - GeeBidirIterator* _tmp11_ = NULL; - GeeBidirIterator* _tmp12_; - gboolean _tmp13_ = FALSE; - GeeBidirIterator* _tmp14_; - gpointer _tmp15_ = NULL; - gchar* _tmp16_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _tmp2_ = gee_sorted_set_bidir_iterator (test_set); - iterator = _tmp2_; - _tmp3_ = iterator; - _tmp4_ = gee_bidir_iterator_last (_tmp3_); - _vala_assert (!_tmp4_, "!iterator.last ()"); - _tmp5_ = gee_collection_add ((GeeCollection*) test_set, "one"); - _vala_assert (_tmp5_, "test_set.add (\"one\")"); - _tmp6_ = gee_collection_add ((GeeCollection*) test_set, "two"); - _vala_assert (_tmp6_, "test_set.add (\"two\")"); - _tmp7_ = gee_collection_add ((GeeCollection*) test_set, "three"); - _vala_assert (_tmp7_, "test_set.add (\"three\")"); - _tmp8_ = gee_collection_add ((GeeCollection*) test_set, "four"); - _vala_assert (_tmp8_, "test_set.add (\"four\")"); - _tmp9_ = gee_collection_add ((GeeCollection*) test_set, "five"); - _vala_assert (_tmp9_, "test_set.add (\"five\")"); - _tmp10_ = gee_collection_add ((GeeCollection*) test_set, "six"); - _vala_assert (_tmp10_, "test_set.add (\"six\")"); - _tmp11_ = gee_sorted_set_bidir_iterator (test_set); - _g_object_unref0 (iterator); - iterator = _tmp11_; - _tmp12_ = iterator; - _tmp13_ = gee_bidir_iterator_last (_tmp12_); - _vala_assert (_tmp13_, "iterator.last ()"); - _tmp14_ = iterator; - _tmp15_ = gee_iterator_get ((GeeIterator*) _tmp14_); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "two") == 0, "iterator.get () == \"two\""); - _g_free0 (_tmp16_); - _g_object_unref0 (iterator); - _g_object_unref0 (test_set); -} - - -void sorted_set_tests_test_mutable_bidir_iterator (SortedSetTests* self) { - GeeCollection* _tmp0_; - GeeSortedSet* _tmp1_; - GeeSortedSet* test_set; - GeeSortedSet* _tmp2_; - GeeBidirIterator* _tmp3_ = NULL; - GeeBidirIterator* iterator; - GeeBidirIterator* _tmp4_; - gboolean _tmp5_ = FALSE; - GeeSortedSet* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeSortedSet* _tmp8_; - gboolean _tmp9_ = FALSE; - GeeSortedSet* _tmp10_; - gboolean _tmp11_ = FALSE; - GeeSortedSet* _tmp12_; - gboolean _tmp13_ = FALSE; - GeeSortedSet* _tmp14_; - gboolean _tmp15_ = FALSE; - GeeSortedSet* _tmp16_; - gboolean _tmp17_ = FALSE; - GeeSortedSet* _tmp18_; - GeeBidirIterator* _tmp19_ = NULL; - gboolean _tmp20_ = FALSE; - GeeBidirIterator* _tmp22_; - gboolean _tmp23_ = FALSE; - GeeBidirIterator* _tmp24_; - gpointer _tmp25_ = NULL; - gchar* _tmp26_; - GeeBidirIterator* _tmp27_; - GeeSortedSet* _tmp28_; - gboolean _tmp29_ = FALSE; - GeeBidirIterator* _tmp30_; - gboolean _tmp31_ = FALSE; - GeeBidirIterator* _tmp32_; - gboolean _tmp33_ = FALSE; - gboolean _tmp34_ = FALSE; - GeeBidirIterator* _tmp38_; - gboolean _tmp39_ = FALSE; - GeeBidirIterator* _tmp40_; - gboolean _tmp41_ = FALSE; - GeeBidirIterator* _tmp42_; - gpointer _tmp43_ = NULL; - gchar* _tmp44_; - GeeBidirIterator* _tmp45_; - gboolean _tmp46_ = FALSE; - GeeBidirIterator* _tmp47_; - gpointer _tmp48_ = NULL; - gchar* _tmp49_; - GeeBidirIterator* _tmp50_; - GeeSortedSet* _tmp51_; - gboolean _tmp52_ = FALSE; - GeeBidirIterator* _tmp53_; - gboolean _tmp54_ = FALSE; - GeeBidirIterator* _tmp55_; - gboolean _tmp56_ = FALSE; - GeeBidirIterator* _tmp57_; - gboolean _tmp58_ = FALSE; - GeeBidirIterator* _tmp59_; - gpointer _tmp60_ = NULL; - gchar* _tmp61_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _tmp2_ = test_set; - _tmp3_ = gee_sorted_set_bidir_iterator (_tmp2_); - iterator = _tmp3_; - _tmp4_ = iterator; - _tmp5_ = gee_bidir_iterator_has_previous (_tmp4_); - _vala_assert (!_tmp5_, "!iterator.has_previous ()"); - _tmp6_ = test_set; - _tmp7_ = gee_collection_add ((GeeCollection*) _tmp6_, "one"); - _vala_assert (_tmp7_, "test_set.add (\"one\")"); - _tmp8_ = test_set; - _tmp9_ = gee_collection_add ((GeeCollection*) _tmp8_, "two"); - _vala_assert (_tmp9_, "test_set.add (\"two\")"); - _tmp10_ = test_set; - _tmp11_ = gee_collection_add ((GeeCollection*) _tmp10_, "three"); - _vala_assert (_tmp11_, "test_set.add (\"three\")"); - _tmp12_ = test_set; - _tmp13_ = gee_collection_add ((GeeCollection*) _tmp12_, "four"); - _vala_assert (_tmp13_, "test_set.add (\"four\")"); - _tmp14_ = test_set; - _tmp15_ = gee_collection_add ((GeeCollection*) _tmp14_, "five"); - _vala_assert (_tmp15_, "test_set.add (\"five\")"); - _tmp16_ = test_set; - _tmp17_ = gee_collection_add ((GeeCollection*) _tmp16_, "six"); - _vala_assert (_tmp17_, "test_set.add (\"six\")"); - _tmp18_ = test_set; - _tmp19_ = gee_sorted_set_bidir_iterator (_tmp18_); - _g_object_unref0 (iterator); - iterator = _tmp19_; - _tmp20_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp20_) { - GeeBidirIterator* _tmp21_; - _tmp21_ = iterator; - gee_iterator_remove ((GeeIterator*) _tmp21_); - exit (0); - } - g_test_trap_assert_failed (); - _tmp22_ = iterator; - _tmp23_ = gee_iterator_next ((GeeIterator*) _tmp22_); - _vala_assert (_tmp23_, "iterator.next ()"); - _tmp24_ = iterator; - _tmp25_ = gee_iterator_get ((GeeIterator*) _tmp24_); - _tmp26_ = (gchar*) _tmp25_; - _vala_assert (g_strcmp0 (_tmp26_, "five") == 0, "iterator.get () == \"five\""); - _g_free0 (_tmp26_); - _tmp27_ = iterator; - gee_iterator_remove ((GeeIterator*) _tmp27_); - _tmp28_ = test_set; - _tmp29_ = gee_collection_contains ((GeeCollection*) _tmp28_, "five"); - _vala_assert (!_tmp29_, "!test_set.contains (\"five\")"); - _tmp30_ = iterator; - _tmp31_ = gee_iterator_has_next ((GeeIterator*) _tmp30_); - _vala_assert (_tmp31_, "iterator.has_next ()"); - _tmp32_ = iterator; - _tmp33_ = gee_bidir_iterator_has_previous (_tmp32_); - _vala_assert (!_tmp33_, "!iterator.has_previous ()"); - _tmp34_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp34_) { - GeeBidirIterator* _tmp35_; - gpointer _tmp36_ = NULL; - gchar* _tmp37_; - _tmp35_ = iterator; - _tmp36_ = gee_iterator_get ((GeeIterator*) _tmp35_); - _tmp37_ = (gchar*) _tmp36_; - _g_free0 (_tmp37_); - exit (0); - } - _tmp38_ = iterator; - _tmp39_ = gee_bidir_iterator_previous (_tmp38_); - _vala_assert (!_tmp39_, "!iterator.previous ()"); - _tmp40_ = iterator; - _tmp41_ = gee_iterator_next ((GeeIterator*) _tmp40_); - _vala_assert (_tmp41_, "iterator.next ()"); - _tmp42_ = iterator; - _tmp43_ = gee_iterator_get ((GeeIterator*) _tmp42_); - _tmp44_ = (gchar*) _tmp43_; - _vala_assert (g_strcmp0 (_tmp44_, "four") == 0, "iterator.get () == \"four\""); - _g_free0 (_tmp44_); - _tmp45_ = iterator; - _tmp46_ = gee_iterator_next ((GeeIterator*) _tmp45_); - _vala_assert (_tmp46_, "iterator.next ()"); - _tmp47_ = iterator; - _tmp48_ = gee_iterator_get ((GeeIterator*) _tmp47_); - _tmp49_ = (gchar*) _tmp48_; - _vala_assert (g_strcmp0 (_tmp49_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp49_); - _tmp50_ = iterator; - gee_iterator_remove ((GeeIterator*) _tmp50_); - _tmp51_ = test_set; - _tmp52_ = gee_collection_contains ((GeeCollection*) _tmp51_, "one"); - _vala_assert (!_tmp52_, "!test_set.contains (\"one\")"); - _tmp53_ = iterator; - _tmp54_ = gee_iterator_has_next ((GeeIterator*) _tmp53_); - _vala_assert (_tmp54_, "iterator.has_next ()"); - _tmp55_ = iterator; - _tmp56_ = gee_bidir_iterator_has_previous (_tmp55_); - _vala_assert (_tmp56_, "iterator.has_previous ()"); - _tmp57_ = iterator; - _tmp58_ = gee_bidir_iterator_previous (_tmp57_); - _vala_assert (_tmp58_, "iterator.previous ()"); - _tmp59_ = iterator; - _tmp60_ = gee_iterator_get ((GeeIterator*) _tmp59_); - _tmp61_ = (gchar*) _tmp60_; - _vala_assert (g_strcmp0 (_tmp61_, "four") == 0, "iterator.get () == \"four\""); - _g_free0 (_tmp61_); - _g_object_unref0 (iterator); - _g_object_unref0 (test_set); -} - - -const gchar* sorted_set_tests_sub_set_type_to_string (SortedSetTestsSubSetType self) { +const gchar* sorted_set_tests_sub_set_tests_type_to_string (SortedSetTestsSubSetTestsType self) { const gchar* result = NULL; switch (self) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { result = "Head"; return result; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { result = "Tail"; return result; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { result = "Range"; return result; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { result = "Empty"; return result; @@ -1579,98 +1115,99 @@ const gchar* sorted_set_tests_sub_set_type_to_string (SortedSetTestsSubSetType s } -GType sorted_set_tests_sub_set_type_get_type (void) { - static volatile gsize sorted_set_tests_sub_set_type_type_id__volatile = 0; - if (g_once_init_enter (&sorted_set_tests_sub_set_type_type_id__volatile)) { - static const GEnumValue values[] = {{SORTED_SET_TESTS_SUB_SET_TYPE_HEAD, "SORTED_SET_TESTS_SUB_SET_TYPE_HEAD", "head"}, {SORTED_SET_TESTS_SUB_SET_TYPE_TAIL, "SORTED_SET_TESTS_SUB_SET_TYPE_TAIL", "tail"}, {SORTED_SET_TESTS_SUB_SET_TYPE_SUB, "SORTED_SET_TESTS_SUB_SET_TYPE_SUB", "sub"}, {SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY, "SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY", "empty"}, {0, NULL, NULL}}; - GType sorted_set_tests_sub_set_type_type_id; - sorted_set_tests_sub_set_type_type_id = g_enum_register_static ("SortedSetTestsSubSetType", values); - g_once_init_leave (&sorted_set_tests_sub_set_type_type_id__volatile, sorted_set_tests_sub_set_type_type_id); +GType sorted_set_tests_sub_set_tests_type_get_type (void) { + static volatile gsize sorted_set_tests_sub_set_tests_type_type_id__volatile = 0; + if (g_once_init_enter (&sorted_set_tests_sub_set_tests_type_type_id__volatile)) { + static const GEnumValue values[] = {{SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD, "SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD", "head"}, {SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL, "SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL", "tail"}, {SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB, "SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB", "sub"}, {SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY, "SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY", "empty"}, {0, NULL, NULL}}; + GType sorted_set_tests_sub_set_tests_type_type_id; + sorted_set_tests_sub_set_tests_type_type_id = g_enum_register_static ("SortedSetTestsSubSetTestsType", values); + g_once_init_leave (&sorted_set_tests_sub_set_tests_type_type_id__volatile, sorted_set_tests_sub_set_tests_type_type_id); } - return sorted_set_tests_sub_set_type_type_id__volatile; + return sorted_set_tests_sub_set_tests_type_type_id__volatile; } -static void _sorted_set_tests_sub_set_test_size_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_size (self); +static void _sorted_set_tests_sub_set_tests_test_size_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_size (self); } -static void _sorted_set_tests_sub_set_test_contains_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_contains (self); +static void _sorted_set_tests_sub_set_tests_test_contains_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_contains (self); } -static void _sorted_set_tests_sub_set_test_add_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_add (self); +static void _sorted_set_tests_sub_set_tests_test_add_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_add (self); } -static void _sorted_set_tests_sub_set_test_remove_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_remove (self); +static void _sorted_set_tests_sub_set_tests_test_remove_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_remove (self); } -static void _sorted_set_tests_sub_set_test_iterator_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_iterator (self); +static void _sorted_set_tests_sub_set_tests_test_iterator_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_iterator (self); } -static void _sorted_set_tests_sub_set_test_clear_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_clear (self); +static void _sorted_set_tests_sub_set_tests_test_clear_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_clear (self); } -static void _sorted_set_tests_sub_set_test_iterator_at_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_iterator_at (self); +static void _sorted_set_tests_sub_set_tests_test_iterator_at_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_iterator_at (self); } -static void _sorted_set_tests_sub_set_test_lower_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_lower (self); +static void _sorted_set_tests_sub_set_tests_test_lower_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_lower (self); } -static void _sorted_set_tests_sub_set_test_higher_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_higher (self); +static void _sorted_set_tests_sub_set_tests_test_higher_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_higher (self); } -static void _sorted_set_tests_sub_set_test_ceil_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_ceil (self); +static void _sorted_set_tests_sub_set_tests_test_ceil_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_ceil (self); } -static void _sorted_set_tests_sub_set_test_floor_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_floor (self); +static void _sorted_set_tests_sub_set_tests_test_floor_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_floor (self); } -static void _sorted_set_tests_sub_set_test_subsets_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_subsets (self); +static void _sorted_set_tests_sub_set_tests_test_subsets_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_subsets (self); } -static void _sorted_set_tests_sub_set_test_boundaries_gee_test_case_test_method (gpointer self) { - sorted_set_tests_sub_set_test_boundaries (self); +static void _sorted_set_tests_sub_set_tests_test_boundaries_gee_test_case_test_method (gpointer self) { + sorted_set_tests_sub_set_tests_test_boundaries (self); } -SortedSetTestsSubSet* sorted_set_tests_sub_set_construct (GType object_type, SortedSetTests* test, SortedSetTestsSubSetType type) { - SortedSetTestsSubSet * self = NULL; - SortedSetTestsSubSetType _tmp0_; +SortedSetTestsSubSetTests* sorted_set_tests_sub_set_tests_construct (GType object_type, SortedSetTests* test, SortedSetTestsSubSetTestsType type, gboolean strict) { + SortedSetTestsSubSetTests * self = NULL; + SortedSetTestsSubSetTestsType _tmp0_; const gchar* _tmp1_ = NULL; gchar* _tmp2_ = NULL; gchar* _tmp3_; SortedSetTests* _tmp4_; SortedSetTests* _tmp5_; - SortedSetTestsSubSetType _tmp6_; + SortedSetTestsSubSetTestsType _tmp6_; + gboolean _tmp7_; g_return_val_if_fail (test != NULL, NULL); _tmp0_ = type; - _tmp1_ = sorted_set_tests_sub_set_type_to_string (_tmp0_); + _tmp1_ = sorted_set_tests_sub_set_tests_type_to_string (_tmp0_); _tmp2_ = g_strdup_printf ("%s Subset", _tmp1_); _tmp3_ = _tmp2_; - self = (SortedSetTestsSubSet*) gee_test_case_construct (object_type, _tmp3_); + self = (SortedSetTestsSubSetTests*) gee_test_case_construct (object_type, _tmp3_); _g_free0 (_tmp3_); _tmp4_ = test; _tmp5_ = _g_object_ref0 (_tmp4_); @@ -1678,36 +1215,38 @@ SortedSetTestsSubSet* sorted_set_tests_sub_set_construct (GType object_type, Sor self->priv->test = _tmp5_; _tmp6_ = type; self->priv->type = _tmp6_; - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] size", _sorted_set_tests_sub_set_test_size_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains", _sorted_set_tests_sub_set_test_contains_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add", _sorted_set_tests_sub_set_test_add_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] remove", _sorted_set_tests_sub_set_test_remove_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] iterator", _sorted_set_tests_sub_set_test_iterator_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Collection] clear", _sorted_set_tests_sub_set_test_clear_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] iterator at", _sorted_set_tests_sub_set_test_iterator_at_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] lower", _sorted_set_tests_sub_set_test_lower_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] higher", _sorted_set_tests_sub_set_test_higher_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ceil", _sorted_set_tests_sub_set_test_ceil_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] floor", _sorted_set_tests_sub_set_test_floor_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] subsets", _sorted_set_tests_sub_set_test_subsets_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] boundaries", _sorted_set_tests_sub_set_test_boundaries_gee_test_case_test_method, self); + _tmp7_ = strict; + self->priv->strict = _tmp7_; + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] size", _sorted_set_tests_sub_set_tests_test_size_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] contains", _sorted_set_tests_sub_set_tests_test_contains_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] add", _sorted_set_tests_sub_set_tests_test_add_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] remove", _sorted_set_tests_sub_set_tests_test_remove_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] iterator", _sorted_set_tests_sub_set_tests_test_iterator_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Collection] clear", _sorted_set_tests_sub_set_tests_test_clear_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] iterator at", _sorted_set_tests_sub_set_tests_test_iterator_at_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] lower", _sorted_set_tests_sub_set_tests_test_lower_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] higher", _sorted_set_tests_sub_set_tests_test_higher_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] ceil", _sorted_set_tests_sub_set_tests_test_ceil_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] floor", _sorted_set_tests_sub_set_tests_test_floor_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] subsets", _sorted_set_tests_sub_set_tests_test_subsets_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[SortedSet] boundaries", _sorted_set_tests_sub_set_tests_test_boundaries_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } -SortedSetTestsSubSet* sorted_set_tests_sub_set_new (SortedSetTests* test, SortedSetTestsSubSetType type) { - return sorted_set_tests_sub_set_construct (SORTED_SET_TESTS_TYPE_SUB_SET, test, type); +SortedSetTestsSubSetTests* sorted_set_tests_sub_set_tests_new (SortedSetTests* test, SortedSetTestsSubSetTestsType type, gboolean strict) { + return sorted_set_tests_sub_set_tests_construct (SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, test, type, strict); } -static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { - SortedSetTestsSubSet * self; +static void sorted_set_tests_sub_set_tests_real_set_up (GeeTestCase* base) { + SortedSetTestsSubSetTests * self; SortedSetTests* _tmp0_; SortedSetTests* _tmp1_; GeeCollection* _tmp2_; GeeSortedSet* _tmp3_; - SortedSetTestsSubSetType _tmp4_; - self = (SortedSetTestsSubSet*) base; + SortedSetTestsSubSetTestsType _tmp4_; + self = (SortedSetTestsSubSetTests*) base; _tmp0_ = self->priv->test; gee_test_case_set_up ((GeeTestCase*) _tmp0_); _tmp1_ = self->priv->test; @@ -1717,7 +1256,7 @@ static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { self->priv->master = _tmp3_; _tmp4_ = self->priv->type; switch (_tmp4_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp5_; GeeSortedSet* _tmp6_ = NULL; @@ -1727,7 +1266,7 @@ static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { self->priv->subset = _tmp6_; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp7_; GeeSortedSet* _tmp8_ = NULL; @@ -1737,7 +1276,7 @@ static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { self->priv->subset = _tmp8_; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp9_; GeeSortedSet* _tmp10_ = NULL; @@ -1747,7 +1286,7 @@ static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { self->priv->subset = _tmp10_; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp11_; GeeSortedSet* _tmp12_ = NULL; @@ -1765,16 +1304,16 @@ static void sorted_set_tests_sub_set_real_set_up (GeeTestCase* base) { } -static void sorted_set_tests_sub_set_real_tear_down (GeeTestCase* base) { - SortedSetTestsSubSet * self; +static void sorted_set_tests_sub_set_tests_real_tear_down (GeeTestCase* base) { + SortedSetTestsSubSetTests * self; SortedSetTests* _tmp0_; - self = (SortedSetTestsSubSet*) base; + self = (SortedSetTestsSubSetTests*) base; _tmp0_ = self->priv->test; gee_test_case_tear_down ((GeeTestCase*) _tmp0_); } -void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_size (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_; gboolean _tmp2_; @@ -1796,7 +1335,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp18_; gint _tmp19_; gint _tmp20_; - SortedSetTestsSubSetType _tmp21_; + SortedSetTestsSubSetTestsType _tmp21_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->subset; _tmp1_ = gee_collection_get_is_empty ((GeeCollection*) _tmp0_); @@ -1830,7 +1369,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { _vala_assert (_tmp20_ == 6, "master.size == 6"); _tmp21_ = self->priv->type; switch (_tmp21_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp22_; gboolean _tmp23_; @@ -1848,7 +1387,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { _vala_assert (_tmp27_ == 2, "subset.size == 2"); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp28_; gboolean _tmp29_; @@ -1866,7 +1405,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { _vala_assert (_tmp33_ == 3, "subset.size == 3"); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp34_; gboolean _tmp35_; @@ -1884,7 +1423,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { _vala_assert (_tmp39_ == 3, "subset.size == 3"); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp40_; gboolean _tmp41_; @@ -1910,7 +1449,7 @@ void sorted_set_tests_sub_set_test_size (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_contains (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -1932,7 +1471,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { gchar** not_contains = NULL; gint not_contains_length1 = 0; gint _not_contains_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; gchar** _tmp48_; gint _tmp48__length1; gchar** _tmp53_; @@ -1962,7 +1501,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -1996,7 +1535,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp24_; gchar* _tmp25_; @@ -2030,7 +1569,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp32_; gchar* _tmp33_; @@ -2064,7 +1603,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp40_ = NULL; gchar* _tmp41_; @@ -2160,7 +1699,7 @@ void sorted_set_tests_sub_set_test_contains (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_add (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -2182,7 +1721,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { gchar** fail = NULL; gint fail_length1 = 0; gint _fail_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; gchar** _tmp40_; gint _tmp40__length1; gchar** _tmp51_; @@ -2217,7 +1756,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -2245,7 +1784,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { _fail_size_ = fail_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp22_; gchar* _tmp23_; @@ -2273,7 +1812,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { _fail_size_ = fail_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp28_; gchar* _tmp29_; @@ -2301,7 +1840,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { _fail_size_ = fail_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp34_ = NULL; gchar* _tmp35_; @@ -2425,7 +1964,7 @@ void sorted_set_tests_sub_set_test_add (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_remove (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -2447,7 +1986,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { gchar** not_contains = NULL; gint not_contains_length1 = 0; gint _not_contains_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; gchar** _tmp48_; gint _tmp48__length1; gchar** _tmp56_; @@ -2482,7 +2021,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -2516,7 +2055,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp24_; gchar* _tmp25_; @@ -2550,7 +2089,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp32_; gchar* _tmp33_; @@ -2584,7 +2123,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp40_ = NULL; gchar* _tmp41_; @@ -2700,7 +2239,7 @@ void sorted_set_tests_sub_set_test_remove (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_iterator (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -2719,15 +2258,15 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { gchar** contains = NULL; gint contains_length1 = 0; gint _contains_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; guint i; guint _tmp38_; gchar** _tmp39_; gint _tmp39__length1; GeeSortedSet* _tmp40_; - GeeBidirIterator* _tmp41_ = NULL; - GeeBidirIterator* iter; - SortedSetTestsSubSetType _tmp42_; + GeeIterator* _tmp41_ = NULL; + GeeIterator* iter; + SortedSetTestsSubSetTestsType _tmp42_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -2753,7 +2292,7 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -2769,7 +2308,7 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { _contains_size_ = contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp19_; gchar* _tmp20_; @@ -2788,7 +2327,7 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { _contains_size_ = contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp23_; gchar* _tmp24_; @@ -2807,7 +2346,7 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { _contains_size_ = contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp27_ = NULL; _tmp27_ = g_new0 (gchar*, 0 + 1); @@ -2865,135 +2404,65 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { _tmp39__length1 = contains_length1; _vala_assert (_tmp38_ == ((guint) _tmp39__length1), "i == contains.length"); _tmp40_ = self->priv->subset; - _tmp41_ = gee_sorted_set_bidir_iterator (_tmp40_); + _tmp41_ = gee_iterable_iterator ((GeeIterable*) _tmp40_); iter = _tmp41_; _tmp42_ = self->priv->type; - if (_tmp42_ != SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY) { - GeeBidirIterator* _tmp43_; + if (_tmp42_ != SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY) { + GeeIterator* _tmp43_; gboolean _tmp44_ = FALSE; - GeeBidirIterator* _tmp45_; - gpointer _tmp46_ = NULL; - gchar* _tmp47_; - gchar** _tmp48_; - gint _tmp48__length1; - gchar** _tmp49_; - gint _tmp49__length1; - const gchar* _tmp50_; - GeeBidirIterator* _tmp51_; - gboolean _tmp52_ = FALSE; - GeeBidirIterator* _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gchar** _tmp56_; - gint _tmp56__length1; - const gchar* _tmp57_; - GeeBidirIterator* _tmp58_; - gboolean _tmp59_ = FALSE; - GeeBidirIterator* _tmp60_; - gboolean _tmp61_ = FALSE; - GeeBidirIterator* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gchar** _tmp65_; - gint _tmp65__length1; - const gchar* _tmp66_; - GeeBidirIterator* _tmp67_; - gboolean _tmp68_ = FALSE; - GeeBidirIterator* _tmp69_; - GeeBidirIterator* _tmp70_; - gboolean _tmp71_ = FALSE; - SortedSetTestsSubSetType _tmp72_; - GeeBidirIterator* _tmp77_; - gboolean _tmp78_ = FALSE; - GeeBidirIterator* _tmp79_; - gpointer _tmp80_ = NULL; - gchar* _tmp81_; - gchar** _tmp82_; - gint _tmp82__length1; - const gchar* _tmp83_; + GeeIterator* _tmp45_; + gboolean _tmp46_ = FALSE; + GeeIterator* _tmp47_; + gpointer _tmp48_ = NULL; + gchar* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + const gchar* _tmp51_; + GeeIterator* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeIterator* _tmp54_; + gboolean _tmp55_ = FALSE; + GeeIterator* _tmp56_; + gpointer _tmp57_ = NULL; + gchar* _tmp58_; + gchar** _tmp59_; + gint _tmp59__length1; + const gchar* _tmp60_; _tmp43_ = iter; - _tmp44_ = gee_bidir_iterator_last (_tmp43_); - _vala_assert (_tmp44_, "iter.last ()"); + _tmp44_ = gee_iterator_has_next (_tmp43_); + _vala_assert (_tmp44_, "iter.has_next ()"); _tmp45_ = iter; - _tmp46_ = gee_iterator_get ((GeeIterator*) _tmp45_); - _tmp47_ = (gchar*) _tmp46_; - _tmp48_ = contains; - _tmp48__length1 = contains_length1; - _tmp49_ = contains; - _tmp49__length1 = contains_length1; - _tmp50_ = _tmp48_[_tmp49__length1 - 1]; - _vala_assert (g_strcmp0 (_tmp47_, _tmp50_) == 0, "iter.get () == contains[contains.length - 1]"); - _g_free0 (_tmp47_); - _tmp51_ = iter; - _tmp52_ = gee_iterator_first ((GeeIterator*) _tmp51_); - _vala_assert (_tmp52_, "iter.first ()"); - _tmp53_ = iter; - _tmp54_ = gee_iterator_get ((GeeIterator*) _tmp53_); - _tmp55_ = (gchar*) _tmp54_; - _tmp56_ = contains; - _tmp56__length1 = contains_length1; - _tmp57_ = _tmp56_[0]; - _vala_assert (g_strcmp0 (_tmp55_, _tmp57_) == 0, "iter.get () == contains[0]"); - _g_free0 (_tmp55_); - _tmp58_ = iter; - _tmp59_ = gee_iterator_has_next ((GeeIterator*) _tmp58_); - _vala_assert (_tmp59_, "iter.has_next ()"); - _tmp60_ = iter; - _tmp61_ = gee_iterator_next ((GeeIterator*) _tmp60_); - _vala_assert (_tmp61_, "iter.next ()"); - _tmp62_ = iter; - _tmp63_ = gee_iterator_get ((GeeIterator*) _tmp62_); - _tmp64_ = (gchar*) _tmp63_; - _tmp65_ = contains; - _tmp65__length1 = contains_length1; - _tmp66_ = _tmp65_[1]; - _vala_assert (g_strcmp0 (_tmp64_, _tmp66_) == 0, "iter.get () == contains[1]"); - _g_free0 (_tmp64_); - _tmp67_ = iter; - _tmp68_ = gee_bidir_iterator_has_previous (_tmp67_); - _vala_assert (_tmp68_, "iter.has_previous ()"); - _tmp69_ = iter; - gee_iterator_remove ((GeeIterator*) _tmp69_); - _tmp70_ = iter; - _tmp71_ = gee_bidir_iterator_has_previous (_tmp70_); - _vala_assert (_tmp71_, "iter.has_previous ()"); - _tmp72_ = self->priv->type; - if (_tmp72_ != SORTED_SET_TESTS_SUB_SET_TYPE_HEAD) { - GeeBidirIterator* _tmp73_; - gboolean _tmp74_ = FALSE; - _tmp73_ = iter; - _tmp74_ = gee_iterator_has_next ((GeeIterator*) _tmp73_); - _vala_assert (_tmp74_, "iter.has_next ()"); - } else { - GeeBidirIterator* _tmp75_; - gboolean _tmp76_ = FALSE; - _tmp75_ = iter; - _tmp76_ = gee_iterator_has_next ((GeeIterator*) _tmp75_); - _vala_assert (!_tmp76_, "!iter.has_next ()"); - } - _tmp77_ = iter; - _tmp78_ = gee_bidir_iterator_previous (_tmp77_); - _vala_assert (_tmp78_, "iter.previous ()"); - _tmp79_ = iter; - _tmp80_ = gee_iterator_get ((GeeIterator*) _tmp79_); - _tmp81_ = (gchar*) _tmp80_; - _tmp82_ = contains; - _tmp82__length1 = contains_length1; - _tmp83_ = _tmp82_[0]; - _vala_assert (g_strcmp0 (_tmp81_, _tmp83_) == 0, "iter.get () == contains[0]"); - _g_free0 (_tmp81_); + _tmp46_ = gee_iterator_next (_tmp45_); + _vala_assert (_tmp46_, "iter.next ()"); + _tmp47_ = iter; + _tmp48_ = gee_iterator_get (_tmp47_); + _tmp49_ = (gchar*) _tmp48_; + _tmp50_ = contains; + _tmp50__length1 = contains_length1; + _tmp51_ = _tmp50_[0]; + _vala_assert (g_strcmp0 (_tmp49_, _tmp51_) == 0, "iter.get () == contains[0]"); + _g_free0 (_tmp49_); + _tmp52_ = iter; + _tmp53_ = gee_iterator_has_next (_tmp52_); + _vala_assert (_tmp53_, "iter.has_next ()"); + _tmp54_ = iter; + _tmp55_ = gee_iterator_next (_tmp54_); + _vala_assert (_tmp55_, "iter.next ()"); + _tmp56_ = iter; + _tmp57_ = gee_iterator_get (_tmp56_); + _tmp58_ = (gchar*) _tmp57_; + _tmp59_ = contains; + _tmp59__length1 = contains_length1; + _tmp60_ = _tmp59_[1]; + _vala_assert (g_strcmp0 (_tmp58_, _tmp60_) == 0, "iter.get () == contains[1]"); + _g_free0 (_tmp58_); } else { - GeeBidirIterator* _tmp84_; - gboolean _tmp85_ = FALSE; - gboolean _tmp86_ = FALSE; - _tmp84_ = iter; - _tmp85_ = gee_iterator_first ((GeeIterator*) _tmp84_); - _vala_assert (!_tmp85_, "!iter.first ()"); - _tmp86_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp86_) { - GeeBidirIterator* _tmp87_; - _tmp87_ = iter; - gee_iterator_remove ((GeeIterator*) _tmp87_); + gboolean _tmp61_ = FALSE; + _tmp61_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp61_) { + GeeIterator* _tmp62_; + _tmp62_ = iter; + gee_iterator_remove (_tmp62_); exit (0); } g_test_trap_assert_failed (); @@ -3003,7 +2472,7 @@ void sorted_set_tests_sub_set_test_iterator (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_clear (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -3025,7 +2494,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { gchar** not_contains = NULL; gint not_contains_length1 = 0; gint _not_contains_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; GeeSortedSet* _tmp48_; gchar** _tmp49_; gint _tmp49__length1; @@ -3056,7 +2525,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -3090,7 +2559,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp24_; gchar* _tmp25_; @@ -3124,7 +2593,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp32_; gchar* _tmp33_; @@ -3158,7 +2627,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp40_ = NULL; gchar* _tmp41_; @@ -3256,7 +2725,7 @@ void sorted_set_tests_sub_set_test_clear (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_boundaries (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -3272,7 +2741,7 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -3298,7 +2767,7 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; gpointer _tmp17_ = NULL; @@ -3318,7 +2787,7 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { _g_free0 (_tmp21_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp22_; gpointer _tmp23_ = NULL; @@ -3338,7 +2807,7 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { _g_free0 (_tmp27_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp28_; gpointer _tmp29_ = NULL; @@ -3358,34 +2827,38 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { _g_free0 (_tmp33_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { - gboolean _tmp34_ = FALSE; - gboolean _tmp38_ = FALSE; - _tmp34_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + gboolean _tmp34_; + _tmp34_ = self->priv->strict; if (_tmp34_) { - GeeSortedSet* _tmp35_; - gpointer _tmp36_ = NULL; - gchar* _tmp37_; - _tmp35_ = self->priv->subset; - _tmp36_ = gee_sorted_set_first (_tmp35_); - _tmp37_ = (gchar*) _tmp36_; - _g_free0 (_tmp37_); - exit (0); - } - g_test_trap_assert_failed (); - _tmp38_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); - if (_tmp38_) { - GeeSortedSet* _tmp39_; - gpointer _tmp40_ = NULL; - gchar* _tmp41_; - _tmp39_ = self->priv->subset; - _tmp40_ = gee_sorted_set_last (_tmp39_); - _tmp41_ = (gchar*) _tmp40_; - _g_free0 (_tmp41_); - exit (0); + gboolean _tmp35_ = FALSE; + gboolean _tmp39_ = FALSE; + _tmp35_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp35_) { + GeeSortedSet* _tmp36_; + gpointer _tmp37_ = NULL; + gchar* _tmp38_; + _tmp36_ = self->priv->subset; + _tmp37_ = gee_sorted_set_first (_tmp36_); + _tmp38_ = (gchar*) _tmp37_; + _g_free0 (_tmp38_); + exit (0); + } + g_test_trap_assert_failed (); + _tmp39_ = g_test_trap_fork ((guint64) 0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR); + if (_tmp39_) { + GeeSortedSet* _tmp40_; + gpointer _tmp41_ = NULL; + gchar* _tmp42_; + _tmp40_ = self->priv->subset; + _tmp41_ = gee_sorted_set_last (_tmp40_); + _tmp42_ = (gchar*) _tmp41_; + _g_free0 (_tmp42_); + exit (0); + } + g_test_trap_assert_failed (); } - g_test_trap_assert_failed (); break; } default: @@ -3396,7 +2869,7 @@ void sorted_set_tests_sub_set_test_boundaries (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_iterator_at (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -3418,7 +2891,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { gchar** not_contains = NULL; gint not_contains_length1 = 0; gint _not_contains_size_ = 0; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; gchar** _tmp48_; gint _tmp48__length1; gchar** _tmp58_; @@ -3448,7 +2921,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { gchar* _tmp16_; gchar* _tmp17_; @@ -3482,7 +2955,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { gchar* _tmp24_; gchar* _tmp25_; @@ -3516,7 +2989,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { gchar* _tmp32_; gchar* _tmp33_; @@ -3550,7 +3023,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { _not_contains_size_ = not_contains_length1; break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { gchar** _tmp40_ = NULL; gchar* _tmp41_; @@ -3606,10 +3079,10 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { { GeeSortedSet* _tmp50_; const gchar* _tmp51_; - GeeBidirIterator* _tmp52_ = NULL; - GeeBidirIterator* iter; - GeeBidirIterator* _tmp53_; - GeeBidirIterator* _tmp54_; + GeeIterator* _tmp52_ = NULL; + GeeIterator* iter; + GeeIterator* _tmp53_; + GeeIterator* _tmp54_; gpointer _tmp55_ = NULL; gchar* _tmp56_; const gchar* _tmp57_; @@ -3620,7 +3093,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { _tmp53_ = iter; _vala_assert (_tmp53_ != NULL, "iter != null"); _tmp54_ = iter; - _tmp55_ = gee_iterator_get ((GeeIterator*) _tmp54_); + _tmp55_ = gee_iterator_get (_tmp54_); _tmp56_ = (gchar*) _tmp55_; _tmp57_ = s; _vala_assert (g_strcmp0 (_tmp56_, _tmp57_) == 0, "iter.get () == s"); @@ -3647,9 +3120,9 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { { GeeSortedSet* _tmp60_; const gchar* _tmp61_; - GeeBidirIterator* _tmp62_ = NULL; - GeeBidirIterator* iter; - GeeBidirIterator* _tmp63_; + GeeIterator* _tmp62_ = NULL; + GeeIterator* iter; + GeeIterator* _tmp63_; _tmp60_ = self->priv->subset; _tmp61_ = s; _tmp62_ = gee_sorted_set_iterator_at (_tmp60_, _tmp61_); @@ -3666,7 +3139,7 @@ void sorted_set_tests_sub_set_test_iterator_at (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_lower (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -3682,7 +3155,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -3708,7 +3181,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; gpointer _tmp17_ = NULL; @@ -3744,7 +3217,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { _g_free0 (_tmp27_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp28_; gpointer _tmp29_ = NULL; @@ -3788,7 +3261,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { _g_free0 (_tmp42_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp43_; gpointer _tmp44_ = NULL; @@ -3832,7 +3305,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { _g_free0 (_tmp57_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp58_; gpointer _tmp59_ = NULL; @@ -3852,7 +3325,7 @@ void sorted_set_tests_sub_set_test_lower (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_higher (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -3868,7 +3341,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -3894,7 +3367,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; gpointer _tmp17_ = NULL; @@ -3930,7 +3403,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { _g_free0 (_tmp27_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp28_; gpointer _tmp29_ = NULL; @@ -3974,7 +3447,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { _g_free0 (_tmp42_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp43_; gpointer _tmp44_ = NULL; @@ -4018,7 +3491,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { _g_free0 (_tmp57_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp58_; gpointer _tmp59_ = NULL; @@ -4038,7 +3511,7 @@ void sorted_set_tests_sub_set_test_higher (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_floor (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -4054,7 +3527,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -4080,7 +3553,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; gpointer _tmp17_ = NULL; @@ -4116,7 +3589,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { _g_free0 (_tmp27_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp28_; gpointer _tmp29_ = NULL; @@ -4160,7 +3633,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { _g_free0 (_tmp42_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp43_; gpointer _tmp44_ = NULL; @@ -4204,7 +3677,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { _g_free0 (_tmp57_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp58_; gpointer _tmp59_ = NULL; @@ -4224,7 +3697,7 @@ void sorted_set_tests_sub_set_test_floor (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_ceil (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -4240,7 +3713,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -4266,7 +3739,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; gpointer _tmp17_ = NULL; @@ -4302,7 +3775,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { _g_free0 (_tmp27_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp28_; gpointer _tmp29_ = NULL; @@ -4346,7 +3819,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { _g_free0 (_tmp42_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp43_; gpointer _tmp44_ = NULL; @@ -4390,7 +3863,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { _g_free0 (_tmp57_); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp58_; gpointer _tmp59_ = NULL; @@ -4410,7 +3883,7 @@ void sorted_set_tests_sub_set_test_ceil (SortedSetTestsSubSet* self) { } -void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { +void sorted_set_tests_sub_set_tests_test_subsets (SortedSetTestsSubSetTests* self) { GeeSortedSet* _tmp0_; gboolean _tmp1_ = FALSE; GeeSortedSet* _tmp2_; @@ -4426,7 +3899,7 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { GeeSortedSet* _tmp12_; gint _tmp13_; gint _tmp14_; - SortedSetTestsSubSetType _tmp15_; + SortedSetTestsSubSetTestsType _tmp15_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->master; _tmp1_ = gee_collection_add ((GeeCollection*) _tmp0_, "one"); @@ -4452,7 +3925,7 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { _vala_assert (_tmp14_ == 6, "master.size == 6"); _tmp15_ = self->priv->type; switch (_tmp15_) { - case SORTED_SET_TESTS_SUB_SET_TYPE_HEAD: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_HEAD: { GeeSortedSet* _tmp16_; GeeSortedSet* _tmp17_ = NULL; @@ -4509,7 +3982,7 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { _g_object_unref0 (subsubset); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_TAIL: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_TAIL: { GeeSortedSet* _tmp36_; GeeSortedSet* _tmp37_ = NULL; @@ -4553,7 +4026,7 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { _g_object_unref0 (subsubset); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_SUB: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_SUB: { GeeSortedSet* _tmp51_; GeeSortedSet* _tmp52_ = NULL; @@ -4610,7 +4083,7 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { _g_object_unref0 (subsubset); break; } - case SORTED_SET_TESTS_SUB_SET_TYPE_EMPTY: + case SORTED_SET_TESTS_SUB_SET_TESTS_TYPE_EMPTY: { GeeSortedSet* _tmp71_; GeeSortedSet* _tmp72_ = NULL; @@ -4662,48 +4135,58 @@ void sorted_set_tests_sub_set_test_subsets (SortedSetTestsSubSet* self) { } -static void sorted_set_tests_sub_set_class_init (SortedSetTestsSubSetClass * klass) { - sorted_set_tests_sub_set_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (SortedSetTestsSubSetPrivate)); - GEE_TEST_CASE_CLASS (klass)->set_up = sorted_set_tests_sub_set_real_set_up; - GEE_TEST_CASE_CLASS (klass)->tear_down = sorted_set_tests_sub_set_real_tear_down; - G_OBJECT_CLASS (klass)->finalize = sorted_set_tests_sub_set_finalize; +static void sorted_set_tests_sub_set_tests_class_init (SortedSetTestsSubSetTestsClass * klass) { + sorted_set_tests_sub_set_tests_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (SortedSetTestsSubSetTestsPrivate)); + GEE_TEST_CASE_CLASS (klass)->set_up = sorted_set_tests_sub_set_tests_real_set_up; + GEE_TEST_CASE_CLASS (klass)->tear_down = sorted_set_tests_sub_set_tests_real_tear_down; + G_OBJECT_CLASS (klass)->finalize = sorted_set_tests_sub_set_tests_finalize; } -static void sorted_set_tests_sub_set_instance_init (SortedSetTestsSubSet * self) { - self->priv = SORTED_SET_TESTS_SUB_SET_GET_PRIVATE (self); +static void sorted_set_tests_sub_set_tests_instance_init (SortedSetTestsSubSetTests * self) { + self->priv = SORTED_SET_TESTS_SUB_SET_TESTS_GET_PRIVATE (self); } -static void sorted_set_tests_sub_set_finalize (GObject* obj) { - SortedSetTestsSubSet * self; - self = G_TYPE_CHECK_INSTANCE_CAST (obj, SORTED_SET_TESTS_TYPE_SUB_SET, SortedSetTestsSubSet); +static void sorted_set_tests_sub_set_tests_finalize (GObject* obj) { + SortedSetTestsSubSetTests * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, SORTED_SET_TESTS_TYPE_SUB_SET_TESTS, SortedSetTestsSubSetTests); _g_object_unref0 (self->priv->master); _g_object_unref0 (self->priv->subset); _g_object_unref0 (self->priv->test); - G_OBJECT_CLASS (sorted_set_tests_sub_set_parent_class)->finalize (obj); + G_OBJECT_CLASS (sorted_set_tests_sub_set_tests_parent_class)->finalize (obj); } -GType sorted_set_tests_sub_set_get_type (void) { - static volatile gsize sorted_set_tests_sub_set_type_id__volatile = 0; - if (g_once_init_enter (&sorted_set_tests_sub_set_type_id__volatile)) { - static const GTypeInfo g_define_type_info = { sizeof (SortedSetTestsSubSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sorted_set_tests_sub_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SortedSetTestsSubSet), 0, (GInstanceInitFunc) sorted_set_tests_sub_set_instance_init, NULL }; - GType sorted_set_tests_sub_set_type_id; - sorted_set_tests_sub_set_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "SortedSetTestsSubSet", &g_define_type_info, 0); - g_once_init_leave (&sorted_set_tests_sub_set_type_id__volatile, sorted_set_tests_sub_set_type_id); +GType sorted_set_tests_sub_set_tests_get_type (void) { + static volatile gsize sorted_set_tests_sub_set_tests_type_id__volatile = 0; + if (g_once_init_enter (&sorted_set_tests_sub_set_tests_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (SortedSetTestsSubSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sorted_set_tests_sub_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SortedSetTestsSubSetTests), 0, (GInstanceInitFunc) sorted_set_tests_sub_set_tests_instance_init, NULL }; + GType sorted_set_tests_sub_set_tests_type_id; + sorted_set_tests_sub_set_tests_type_id = g_type_register_static (GEE_TYPE_TEST_CASE, "SortedSetTestsSubSetTests", &g_define_type_info, 0); + g_once_init_leave (&sorted_set_tests_sub_set_tests_type_id__volatile, sorted_set_tests_sub_set_tests_type_id); } - return sorted_set_tests_sub_set_type_id__volatile; + return sorted_set_tests_sub_set_tests_type_id__volatile; } static void sorted_set_tests_class_init (SortedSetTestsClass * klass) { sorted_set_tests_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (SortedSetTestsPrivate)); + G_OBJECT_CLASS (klass)->finalize = sorted_set_tests_finalize; } static void sorted_set_tests_instance_init (SortedSetTests * self) { + self->priv = SORTED_SET_TESTS_GET_PRIVATE (self); +} + + +static void sorted_set_tests_finalize (GObject* obj) { + SortedSetTests * self; + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SORTED_SET_TESTS, SortedSetTests); + G_OBJECT_CLASS (sorted_set_tests_parent_class)->finalize (obj); } diff --git a/tests/testsortedset.vala b/tests/testsortedset.vala index a5172b4..00c9bd2 100644 --- a/tests/testsortedset.vala +++ b/tests/testsortedset.vala @@ -24,9 +24,9 @@ using GLib; using Gee; public abstract class SortedSetTests : SetTests { - - public SortedSetTests (string name) { + public SortedSetTests (string name, bool strict = true) { base (name); + this.strict = strict; add_test ("[SortedSet] first", test_first); add_test ("[SortedSet] last", test_last); add_test ("[SortedSet] ordering", test_ordering); @@ -35,16 +35,10 @@ public abstract class SortedSetTests : SetTests { add_test ("[SortedSet] higher", test_higher); add_test ("[SortedSet] floor", test_floor); add_test ("[SortedSet] ceil", test_ceil); - add_test ("[SortedSet] bi-directional iterators can go backward", - test_bidir_iterator_can_go_backward); - add_test ("[SortedSet] bi-directional iterators are mutable", - test_mutable_bidir_iterator); - add_test ("[SortedSet] bi-directional iterators can to end", - test_bidir_iterator_last); - get_suite ().add_suite (new SubSet (this, SubSet.Type.HEAD).get_suite ()); - get_suite ().add_suite (new SubSet (this, SubSet.Type.TAIL).get_suite ()); - get_suite ().add_suite (new SubSet (this, SubSet.Type.SUB).get_suite ()); - get_suite ().add_suite (new SubSet (this, SubSet.Type.EMPTY).get_suite ()); + get_suite ().add_suite (new SubSetTests (this, SubSetTests.Type.HEAD, strict).get_suite ()); + get_suite ().add_suite (new SubSetTests (this, SubSetTests.Type.TAIL, strict).get_suite ()); + get_suite ().add_suite (new SubSetTests (this, SubSetTests.Type.SUB, strict).get_suite ()); + get_suite ().add_suite (new SubSetTests (this, SubSetTests.Type.EMPTY, strict).get_suite ()); } public void test_ordering () { @@ -97,12 +91,14 @@ public abstract class SortedSetTests : SetTests { public void test_first () { var test_set = test_collection as SortedSet; - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - test_set.first (); - Posix.exit (0); + if (strict) { + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + test_set.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); } - Test.trap_assert_failed (); assert (test_set.add ("one")); assert (test_set.add ("two")); @@ -117,12 +113,14 @@ public abstract class SortedSetTests : SetTests { public void test_last () { var test_set = test_collection as SortedSet; - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - test_set.last (); - Posix.exit (0); + if (strict) { + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + test_set.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); } - Test.trap_assert_failed (); assert (test_set.add ("one")); assert (test_set.add ("two")); @@ -253,120 +251,7 @@ public abstract class SortedSetTests : SetTests { assert (test_set.ceil ("s") == "six"); } - public void test_bidir_iterator_can_go_backward () { - var test_set = test_collection as SortedSet; - - var iterator = test_set.bidir_iterator (); - assert (!iterator.has_previous ()); - - assert (test_set.add ("one")); - assert (test_set.add ("two")); - assert (test_set.add ("three")); - assert (test_set.add ("four")); - assert (test_set.add ("five")); - assert (test_set.add ("six")); - - iterator = test_set.bidir_iterator (); - assert (iterator.next ()); - assert (iterator.get () == "five"); - assert (!iterator.has_previous ()); - assert (iterator.next ()); - assert (iterator.get () == "four"); - assert (iterator.has_previous ()); - assert (iterator.next ()); - assert (iterator.get () == "one"); - assert (iterator.has_previous ()); - assert (iterator.next ()); - assert (iterator.get () == "six"); - assert (iterator.has_previous ()); - assert (iterator.next ()); - assert (iterator.get () == "three"); - assert (iterator.has_previous ()); - assert (iterator.next ()); - assert (iterator.get () == "two"); - assert (iterator.has_previous ()); - assert (!iterator.next ()); - assert (iterator.previous ()); - assert (iterator.get () == "three"); - assert (iterator.previous ()); - assert (iterator.get () == "six"); - assert (iterator.previous ()); - assert (iterator.get () == "one"); - assert (iterator.previous ()); - assert (iterator.get () == "four"); - assert (iterator.previous ()); - assert (iterator.get () == "five"); - assert (!iterator.previous ()); - assert (iterator.get () == "five"); - } - - public void test_bidir_iterator_last () { - var test_set = test_collection as SortedSet; - - var iterator = test_set.bidir_iterator (); - - assert (!iterator.last ()); - - assert (test_set.add ("one")); - assert (test_set.add ("two")); - assert (test_set.add ("three")); - assert (test_set.add ("four")); - assert (test_set.add ("five")); - assert (test_set.add ("six")); - - iterator = test_set.bidir_iterator (); - assert (iterator.last ()); - assert (iterator.get () == "two"); - } - - public void test_mutable_bidir_iterator () { - var test_set = test_collection as SortedSet; - - var iterator = test_set.bidir_iterator (); - assert (!iterator.has_previous ()); - - assert (test_set.add ("one")); - assert (test_set.add ("two")); - assert (test_set.add ("three")); - assert (test_set.add ("four")); - assert (test_set.add ("five")); - assert (test_set.add ("six")); - - iterator = test_set.bidir_iterator (); - - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - iterator.remove (); - Posix.exit (0); - } - Test.trap_assert_failed (); - - assert (iterator.next ()); - assert (iterator.get () == "five"); - iterator.remove (); - assert (!test_set.contains ("five")); - assert (iterator.has_next ()); - assert (!iterator.has_previous ()); - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - iterator.get (); - Posix.exit (0); - } - assert (!iterator.previous ()); - - assert (iterator.next ()); - assert (iterator.get () == "four"); - assert (iterator.next ()); - assert (iterator.get () == "one"); - iterator.remove (); - assert (!test_set.contains ("one")); - assert (iterator.has_next ()); - assert (iterator.has_previous ()); - assert (iterator.previous ()); - assert (iterator.get () == "four"); - } - - public class SubSet : Gee.TestCase { + protected class SubSetTests : Gee.TestCase { private SortedSet master; private SortedSet subset; private SortedSetTests test; @@ -387,10 +272,11 @@ public abstract class SortedSetTests : SetTests { } private Type type; - public SubSet (SortedSetTests test, Type type) { + public SubSetTests (SortedSetTests test, Type type, bool strict) { base ("%s Subset".printf (type.to_string ())); this.test = test; this.type = type; + this.strict = strict; add_test ("[Collection] size", test_size); add_test ("[Collection] contains", test_contains); add_test ("[Collection] add", test_add); @@ -621,27 +507,15 @@ public abstract class SortedSetTests : SetTests { assert (i == contains.length); - var iter = subset.bidir_iterator (); + var iter = subset.iterator (); if (type != Type.EMPTY) { - assert (iter.last ()); - assert (iter.get () == contains[contains.length - 1]); - assert (iter.first ()); - + assert (iter.has_next ()); + assert (iter.next ()); assert (iter.get () == contains[0]); assert (iter.has_next ()); assert (iter.next ()); assert (iter.get () == contains[1]); - assert (iter.has_previous ()); - iter.remove (); - assert (iter.has_previous ()); - if (type != Type.HEAD) - assert (iter.has_next ()); - else - assert (!iter.has_next ()); - assert (iter.previous ()); - assert (iter.get () == contains[0]); } else { - assert (!iter.first ()); if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | TestTrapFlags.SILENCE_STDERR)) { iter.remove (); @@ -712,18 +586,20 @@ public abstract class SortedSetTests : SetTests { assert (subset.last () == "six"); break; case Type.EMPTY: - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - subset.first (); - Posix.exit (0); - } - Test.trap_assert_failed (); - if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | - TestTrapFlags.SILENCE_STDERR)) { - subset.last (); - Posix.exit (0); + if (strict) { + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + subset.first (); + Posix.exit (0); + } + Test.trap_assert_failed (); + if (Test.trap_fork (0, TestTrapFlags.SILENCE_STDOUT | + TestTrapFlags.SILENCE_STDERR)) { + subset.last (); + Posix.exit (0); + } + Test.trap_assert_failed (); } - Test.trap_assert_failed (); break; default: assert_not_reached (); @@ -974,6 +850,10 @@ public abstract class SortedSetTests : SetTests { assert_not_reached (); } } + + private bool strict; } + + private bool strict; } diff --git a/tests/testtreemap.c b/tests/testtreemap.c index 6e5b107..534d6ca 100644 --- a/tests/testtreemap.c +++ b/tests/testtreemap.c @@ -53,6 +53,28 @@ typedef struct _MapTests MapTests; typedef struct _MapTestsClass MapTestsClass; typedef struct _MapTestsPrivate MapTestsPrivate; +#define GEE_TYPE_SORTED_MAP_TESTS (gee_sorted_map_tests_get_type ()) +#define GEE_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTests)) +#define GEE_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) +#define GEE_IS_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_IS_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_SORTED_MAP_TESTS)) +#define GEE_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_SORTED_MAP_TESTS, GeeSortedMapTestsClass)) + +typedef struct _GeeSortedMapTests GeeSortedMapTests; +typedef struct _GeeSortedMapTestsClass GeeSortedMapTestsClass; +typedef struct _GeeSortedMapTestsPrivate GeeSortedMapTestsPrivate; + +#define TYPE_BIDIR_SORTED_MAP_TESTS (bidir_sorted_map_tests_get_type ()) +#define BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTests)) +#define BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) +#define IS_BIDIR_SORTED_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define IS_BIDIR_SORTED_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_MAP_TESTS)) +#define BIDIR_SORTED_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_MAP_TESTS, BidirSortedMapTestsClass)) + +typedef struct _BidirSortedMapTests BidirSortedMapTests; +typedef struct _BidirSortedMapTestsClass BidirSortedMapTestsClass; +typedef struct _BidirSortedMapTestsPrivate BidirSortedMapTestsPrivate; + #define TYPE_TREE_MAP_TESTS (tree_map_tests_get_type ()) #define TREE_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TREE_MAP_TESTS, TreeMapTests)) #define TREE_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TREE_MAP_TESTS, TreeMapTestsClass)) @@ -64,8 +86,6 @@ typedef struct _TreeMapTests TreeMapTests; typedef struct _TreeMapTestsClass TreeMapTestsClass; typedef struct _TreeMapTestsPrivate TreeMapTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _g_free0(var) (var = (g_free (var), NULL)) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { GObject parent_instance; @@ -88,60 +108,54 @@ struct _MapTestsClass { GeeTestCaseClass parent_class; }; -struct _TreeMapTests { +struct _GeeSortedMapTests { MapTests parent_instance; + GeeSortedMapTestsPrivate * priv; +}; + +struct _GeeSortedMapTestsClass { + MapTestsClass parent_class; +}; + +struct _BidirSortedMapTests { + GeeSortedMapTests parent_instance; + BidirSortedMapTestsPrivate * priv; +}; + +struct _BidirSortedMapTestsClass { + GeeSortedMapTestsClass parent_class; +}; + +struct _TreeMapTests { + BidirSortedMapTests parent_instance; TreeMapTestsPrivate * priv; }; struct _TreeMapTestsClass { - MapTestsClass parent_class; + BidirSortedMapTestsClass parent_class; }; -typedef void (*GeeTestCaseTestMethod) (void* user_data); static gpointer tree_map_tests_parent_class = NULL; GType gee_test_case_get_type (void) G_GNUC_CONST; GType map_tests_get_type (void) G_GNUC_CONST; +GType gee_sorted_map_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_map_tests_get_type (void) G_GNUC_CONST; GType tree_map_tests_get_type (void) G_GNUC_CONST; enum { TREE_MAP_TESTS_DUMMY_PROPERTY }; TreeMapTests* tree_map_tests_new (void); TreeMapTests* tree_map_tests_construct (GType object_type); -MapTests* map_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -void tree_map_tests_test_selected_functions (TreeMapTests* self); -static void _tree_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void tree_map_tests_test_gobject_properties (TreeMapTests* self); -static void _tree_map_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); -void tree_map_tests_test_key_ordering (TreeMapTests* self); -static void _tree_map_tests_test_key_ordering_gee_test_case_test_method (gpointer self); +BidirSortedMapTests* bidir_sorted_map_tests_construct (GType object_type, const gchar* name); static void tree_map_tests_real_set_up (GeeTestCase* base); static void tree_map_tests_real_tear_down (GeeTestCase* base); -static void _tree_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - tree_map_tests_test_selected_functions (self); -} - - -static void _tree_map_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - tree_map_tests_test_gobject_properties (self); -} - - -static void _tree_map_tests_test_key_ordering_gee_test_case_test_method (gpointer self) { - tree_map_tests_test_key_ordering (self); -} - - TreeMapTests* tree_map_tests_construct (GType object_type) { TreeMapTests * self = NULL; - self = (TreeMapTests*) map_tests_construct (object_type, "TreeMap"); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeMap] selected functions", _tree_map_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeMap] GObject properties", _tree_map_tests_test_gobject_properties_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeMap] key ordering", _tree_map_tests_test_key_ordering_gee_test_case_test_method, self); + self = (TreeMapTests*) bidir_sorted_map_tests_construct (object_type, "TreeMap"); return self; } @@ -155,7 +169,7 @@ static void tree_map_tests_real_set_up (GeeTestCase* base) { TreeMapTests * self; GeeTreeMap* _tmp0_; self = (TreeMapTests*) base; - _tmp0_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((MapTests*) self)->test_map); ((MapTests*) self)->test_map = (GeeMap*) _tmp0_; } @@ -169,233 +183,6 @@ static void tree_map_tests_real_tear_down (GeeTestCase* base) { } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -void tree_map_tests_test_selected_functions (TreeMapTests* self) { - GeeMap* _tmp0_; - GeeTreeMap* _tmp1_; - GeeTreeMap* test_tree_map; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; - GEqualFunc _tmp5_; - GEqualFunc _tmp6_; - GEqualFunc _tmp7_; - g_return_if_fail (self != NULL); - _tmp0_ = ((MapTests*) self)->test_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_MAP) ? ((GeeTreeMap*) _tmp0_) : NULL); - test_tree_map = _tmp1_; - _vala_assert (test_tree_map != NULL, "test_tree_map != null"); - _tmp2_ = gee_tree_map_get_key_compare_func (test_tree_map); - _tmp3_ = _tmp2_; - _tmp4_ = g_strcmp0; - _vala_assert (_tmp3_ == ((GCompareFunc) _tmp4_), "test_tree_map.key_compare_func == (CompareFunc) strcmp"); - _tmp5_ = gee_tree_map_get_value_equal_func (test_tree_map); - _tmp6_ = _tmp5_; - _tmp7_ = g_str_equal; - _vala_assert (_tmp6_ == _tmp7_, "test_tree_map.value_equal_func == str_equal"); - _g_object_unref0 (test_tree_map); -} - - -void tree_map_tests_test_gobject_properties (TreeMapTests* self) { - GeeMap* _tmp0_; - GeeTreeMap* _tmp1_; - GeeTreeMap* test_tree_map; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; - GValue _tmp7_ = {0}; - GValue _tmp8_; - void* _tmp9_ = NULL; - GEqualFunc _tmp10_; - GEqualFunc _tmp11_; - g_return_if_fail (self != NULL); - _tmp0_ = ((MapTests*) self)->test_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_MAP) ? ((GeeTreeMap*) _tmp0_) : NULL); - test_tree_map = _tmp1_; - _vala_assert (test_tree_map != NULL, "test_tree_map != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_tree_map, "key-compare-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_tree_map_get_key_compare_func (test_tree_map); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_tree_map.key_compare_func"); - g_value_unset (&value); - g_value_init (&_tmp7_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp7_; - _tmp8_ = value; - g_object_get_property ((GObject*) test_tree_map, "value-equal-func", &value); - _tmp9_ = g_value_get_pointer (&value); - _tmp10_ = gee_tree_map_get_value_equal_func (test_tree_map); - _tmp11_ = _tmp10_; - _vala_assert (_tmp9_ == ((void*) _tmp11_), "value.get_pointer () == (void*) test_tree_map.value_equal_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_tree_map); -} - - -void tree_map_tests_test_key_ordering (TreeMapTests* self) { - GeeMap* _tmp0_; - GeeTreeMap* _tmp1_; - GeeTreeMap* test_tree_map; - GeeSet* _tmp2_; - GeeSet* _tmp3_; - GeeSet* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _tmp6_; - GeeIterator* iterator; - gboolean _tmp7_ = FALSE; - gpointer _tmp8_ = NULL; - gchar* _tmp9_; - gboolean _tmp10_ = FALSE; - gpointer _tmp11_ = NULL; - gchar* _tmp12_; - gboolean _tmp13_ = FALSE; - gpointer _tmp14_ = NULL; - gchar* _tmp15_; - gboolean _tmp16_ = FALSE; - gpointer _tmp17_ = NULL; - gchar* _tmp18_; - gboolean _tmp19_ = FALSE; - gpointer _tmp20_ = NULL; - gchar* _tmp21_; - gboolean _tmp22_ = FALSE; - gpointer _tmp23_ = NULL; - gchar* _tmp24_; - gboolean _tmp25_ = FALSE; - gpointer _tmp26_ = NULL; - gchar* _tmp27_; - gboolean _tmp28_ = FALSE; - gpointer _tmp29_ = NULL; - gchar* _tmp30_; - gboolean _tmp31_ = FALSE; - gpointer _tmp32_ = NULL; - gchar* _tmp33_; - gboolean _tmp34_ = FALSE; - gpointer _tmp35_ = NULL; - gchar* _tmp36_; - gboolean _tmp37_ = FALSE; - gpointer _tmp38_ = NULL; - gchar* _tmp39_; - gboolean _tmp40_ = FALSE; - gpointer _tmp41_ = NULL; - gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - g_return_if_fail (self != NULL); - _tmp0_ = ((MapTests*) self)->test_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_MAP) ? ((GeeTreeMap*) _tmp0_) : NULL); - test_tree_map = _tmp1_; - _vala_assert (test_tree_map != NULL, "test_tree_map != null"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "one", "one"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "two", "two"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "three", "three"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "four", "four"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "five", "five"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "six", "six"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "seven", "seven"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "eight", "eight"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "nine", "nine"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "ten", "ten"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "eleven", "eleven"); - gee_abstract_map_set ((GeeAbstractMap*) test_tree_map, "twelve", "twelve"); - _tmp2_ = gee_abstract_map_get_keys ((GeeMap*) test_tree_map); - _tmp3_ = _tmp2_; - _tmp4_ = _tmp3_; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _tmp6_ = _tmp5_; - _g_object_unref0 (_tmp4_); - iterator = _tmp6_; - _tmp7_ = gee_iterator_next (iterator); - _vala_assert (_tmp7_, "iterator.next ()"); - _tmp8_ = gee_iterator_get (iterator); - _tmp9_ = (gchar*) _tmp8_; - _vala_assert (g_strcmp0 (_tmp9_, "eight") == 0, "iterator.get () == \"eight\""); - _g_free0 (_tmp9_); - _tmp10_ = gee_iterator_next (iterator); - _vala_assert (_tmp10_, "iterator.next ()"); - _tmp11_ = gee_iterator_get (iterator); - _tmp12_ = (gchar*) _tmp11_; - _vala_assert (g_strcmp0 (_tmp12_, "eleven") == 0, "iterator.get () == \"eleven\""); - _g_free0 (_tmp12_); - _tmp13_ = gee_iterator_next (iterator); - _vala_assert (_tmp13_, "iterator.next ()"); - _tmp14_ = gee_iterator_get (iterator); - _tmp15_ = (gchar*) _tmp14_; - _vala_assert (g_strcmp0 (_tmp15_, "five") == 0, "iterator.get () == \"five\""); - _g_free0 (_tmp15_); - _tmp16_ = gee_iterator_next (iterator); - _vala_assert (_tmp16_, "iterator.next ()"); - _tmp17_ = gee_iterator_get (iterator); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "iterator.get () == \"four\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_iterator_next (iterator); - _vala_assert (_tmp19_, "iterator.next ()"); - _tmp20_ = gee_iterator_get (iterator); - _tmp21_ = (gchar*) _tmp20_; - _vala_assert (g_strcmp0 (_tmp21_, "nine") == 0, "iterator.get () == \"nine\""); - _g_free0 (_tmp21_); - _tmp22_ = gee_iterator_next (iterator); - _vala_assert (_tmp22_, "iterator.next ()"); - _tmp23_ = gee_iterator_get (iterator); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "one") == 0, "iterator.get () == \"one\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_iterator_next (iterator); - _vala_assert (_tmp25_, "iterator.next ()"); - _tmp26_ = gee_iterator_get (iterator); - _tmp27_ = (gchar*) _tmp26_; - _vala_assert (g_strcmp0 (_tmp27_, "seven") == 0, "iterator.get () == \"seven\""); - _g_free0 (_tmp27_); - _tmp28_ = gee_iterator_next (iterator); - _vala_assert (_tmp28_, "iterator.next ()"); - _tmp29_ = gee_iterator_get (iterator); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "six") == 0, "iterator.get () == \"six\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_iterator_next (iterator); - _vala_assert (_tmp31_, "iterator.next ()"); - _tmp32_ = gee_iterator_get (iterator); - _tmp33_ = (gchar*) _tmp32_; - _vala_assert (g_strcmp0 (_tmp33_, "ten") == 0, "iterator.get () == \"ten\""); - _g_free0 (_tmp33_); - _tmp34_ = gee_iterator_next (iterator); - _vala_assert (_tmp34_, "iterator.next ()"); - _tmp35_ = gee_iterator_get (iterator); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "three") == 0, "iterator.get () == \"three\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_iterator_next (iterator); - _vala_assert (_tmp37_, "iterator.next ()"); - _tmp38_ = gee_iterator_get (iterator); - _tmp39_ = (gchar*) _tmp38_; - _vala_assert (g_strcmp0 (_tmp39_, "twelve") == 0, "iterator.get () == \"twelve\""); - _g_free0 (_tmp39_); - _tmp40_ = gee_iterator_next (iterator); - _vala_assert (_tmp40_, "iterator.next ()"); - _tmp41_ = gee_iterator_get (iterator); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (g_strcmp0 (_tmp42_, "two") == 0, "iterator.get () == \"two\""); - _g_free0 (_tmp42_); - _tmp43_ = gee_iterator_next (iterator); - _vala_assert (_tmp43_ == FALSE, "iterator.next () == false"); - _g_object_unref0 (iterator); - _g_object_unref0 (test_tree_map); -} - - static void tree_map_tests_class_init (TreeMapTestsClass * klass) { tree_map_tests_parent_class = g_type_class_peek_parent (klass); GEE_TEST_CASE_CLASS (klass)->set_up = tree_map_tests_real_set_up; @@ -412,7 +199,7 @@ GType tree_map_tests_get_type (void) { if (g_once_init_enter (&tree_map_tests_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (TreeMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tree_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TreeMapTests), 0, (GInstanceInitFunc) tree_map_tests_instance_init, NULL }; GType tree_map_tests_type_id; - tree_map_tests_type_id = g_type_register_static (TYPE_MAP_TESTS, "TreeMapTests", &g_define_type_info, 0); + tree_map_tests_type_id = g_type_register_static (TYPE_BIDIR_SORTED_MAP_TESTS, "TreeMapTests", &g_define_type_info, 0); g_once_init_leave (&tree_map_tests_type_id__volatile, tree_map_tests_type_id); } return tree_map_tests_type_id__volatile; diff --git a/tests/testtreemap.vala b/tests/testtreemap.vala index 993c67e..6babece 100644 --- a/tests/testtreemap.vala +++ b/tests/testtreemap.vala @@ -23,13 +23,10 @@ using Gee; -public class TreeMapTests : MapTests { +public class TreeMapTests : BidirSortedMapTests { public TreeMapTests () { base ("TreeMap"); - add_test ("[TreeMap] selected functions", test_selected_functions); - add_test ("[TreeMap] GObject properties", test_gobject_properties); - add_test ("[TreeMap] key ordering", test_key_ordering); } public override void set_up () { @@ -39,80 +36,4 @@ public class TreeMapTests : MapTests { public override void tear_down () { test_map = null; } - - public void test_selected_functions () { - var test_tree_map = test_map as TreeMap; - - // Check the map exists - assert (test_tree_map != null); - - // Check the selected compare and equal functions - assert (test_tree_map.key_compare_func == (CompareFunc) strcmp); - assert (test_tree_map.value_equal_func == str_equal); - } - - public new void test_gobject_properties () { - var test_tree_map = test_map as TreeMap; - - // Check the list exists - assert (test_tree_map != null); - Value value; - - value = Value (typeof (CompareFunc)); - test_tree_map.get_property ("key-compare-func", ref value); - assert (value.get_pointer () == (void*) test_tree_map.key_compare_func); - value.unset (); - - value = Value (typeof (EqualFunc)); - test_tree_map.get_property ("value-equal-func", ref value); - assert (value.get_pointer () == (void*) test_tree_map.value_equal_func); - value.unset (); - } - - public void test_key_ordering () { - var test_tree_map = test_map as TreeMap; - - // Check the map exists - assert (test_tree_map != null); - - test_tree_map.set ("one", "one"); - test_tree_map.set ("two", "two"); - test_tree_map.set ("three", "three"); - test_tree_map.set ("four", "four"); - test_tree_map.set ("five", "five"); - test_tree_map.set ("six", "six"); - test_tree_map.set ("seven", "seven"); - test_tree_map.set ("eight", "eight"); - test_tree_map.set ("nine", "nine"); - test_tree_map.set ("ten", "ten"); - test_tree_map.set ("eleven", "eleven"); - test_tree_map.set ("twelve", "twelve"); - - Iterator iterator = test_tree_map.keys.iterator (); - assert (iterator.next ()); - assert (iterator.get () == "eight"); - assert (iterator.next ()); - assert (iterator.get () == "eleven"); - assert (iterator.next ()); - assert (iterator.get () == "five"); - assert (iterator.next ()); - assert (iterator.get () == "four"); - assert (iterator.next ()); - assert (iterator.get () == "nine"); - assert (iterator.next ()); - assert (iterator.get () == "one"); - assert (iterator.next ()); - assert (iterator.get () == "seven"); - assert (iterator.next ()); - assert (iterator.get () == "six"); - assert (iterator.next ()); - assert (iterator.get () == "ten"); - assert (iterator.next ()); - assert (iterator.get () == "three"); - assert (iterator.next ()); - assert (iterator.get () == "twelve"); - assert (iterator.next ()); - assert (iterator.get () == "two"); - assert (iterator.next () == false); - } } diff --git a/tests/testtreemultimap.c b/tests/testtreemultimap.c index 6959a1a..d283b18 100644 --- a/tests/testtreemultimap.c +++ b/tests/testtreemultimap.c @@ -66,7 +66,6 @@ typedef struct _TreeMultiMapTests TreeMultiMapTests; typedef struct _TreeMultiMapTestsClass TreeMultiMapTestsClass; typedef struct _TreeMultiMapTestsPrivate TreeMultiMapTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { GObject parent_instance; @@ -98,7 +97,6 @@ struct _TreeMultiMapTestsClass { MultiMapTestsClass parent_class; }; -typedef void (*GeeTestCaseTestMethod) (void* user_data); static gpointer tree_multi_map_tests_parent_class = NULL; @@ -111,22 +109,13 @@ enum { TreeMultiMapTests* tree_multi_map_tests_new (void); TreeMultiMapTests* tree_multi_map_tests_construct (GType object_type); MultiMapTests* multi_map_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -static void tree_multi_map_tests_test_selected_functions (TreeMultiMapTests* self); -static void _tree_multi_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self); static void tree_multi_map_tests_real_set_up (GeeTestCase* base); static void tree_multi_map_tests_real_tear_down (GeeTestCase* base); -static void _tree_multi_map_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - tree_multi_map_tests_test_selected_functions (self); -} - - TreeMultiMapTests* tree_multi_map_tests_construct (GType object_type) { TreeMultiMapTests * self = NULL; self = (TreeMultiMapTests*) multi_map_tests_construct (object_type, "TreeMultiMap"); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeMultiMap] selected functions", _tree_multi_map_tests_test_selected_functions_gee_test_case_test_method, self); return self; } @@ -140,7 +129,7 @@ static void tree_multi_map_tests_real_set_up (GeeTestCase* base) { TreeMultiMapTests * self; GeeTreeMultiMap* _tmp0_; self = (TreeMultiMapTests*) base; - _tmp0_ = gee_tree_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL); + _tmp0_ = gee_tree_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); _g_object_unref0 (((MultiMapTests*) self)->test_multi_map); ((MultiMapTests*) self)->test_multi_map = (GeeMultiMap*) _tmp0_; } @@ -154,38 +143,6 @@ static void tree_multi_map_tests_real_tear_down (GeeTestCase* base) { } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -static void tree_multi_map_tests_test_selected_functions (TreeMultiMapTests* self) { - GeeMultiMap* _tmp0_; - GeeTreeMultiMap* _tmp1_; - GeeTreeMultiMap* test_tree_multi_map; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; - GCompareFunc _tmp7_; - g_return_if_fail (self != NULL); - _tmp0_ = ((MultiMapTests*) self)->test_multi_map; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_MULTI_MAP) ? ((GeeTreeMultiMap*) _tmp0_) : NULL); - test_tree_multi_map = _tmp1_; - _vala_assert (test_tree_multi_map != NULL, "test_tree_multi_map != null"); - _tmp2_ = gee_tree_multi_map_get_key_compare_func (test_tree_multi_map); - _tmp3_ = _tmp2_; - _tmp4_ = g_strcmp0; - _vala_assert (_tmp3_ == ((GCompareFunc) _tmp4_), "test_tree_multi_map.key_compare_func == (CompareFunc) strcmp"); - _tmp5_ = gee_tree_multi_map_get_value_compare_func (test_tree_multi_map); - _tmp6_ = _tmp5_; - _tmp7_ = g_strcmp0; - _vala_assert (_tmp6_ == ((GCompareFunc) _tmp7_), "test_tree_multi_map.value_compare_func == (CompareFunc) strcmp"); - _g_object_unref0 (test_tree_multi_map); -} - - static void tree_multi_map_tests_class_init (TreeMultiMapTestsClass * klass) { tree_multi_map_tests_parent_class = g_type_class_peek_parent (klass); GEE_TEST_CASE_CLASS (klass)->set_up = tree_multi_map_tests_real_set_up; diff --git a/tests/testtreemultimap.vala b/tests/testtreemultimap.vala index 34374a9..773eef9 100644 --- a/tests/testtreemultimap.vala +++ b/tests/testtreemultimap.vala @@ -29,7 +29,6 @@ public class TreeMultiMapTests : MultiMapTests { public TreeMultiMapTests () { base ("TreeMultiMap"); - add_test ("[TreeMultiMap] selected functions", test_selected_functions); } public override void set_up () { @@ -39,15 +38,4 @@ public class TreeMultiMapTests : MultiMapTests { public override void tear_down () { test_multi_map = null; } - - private void test_selected_functions () { - var test_tree_multi_map = test_multi_map as TreeMultiMap; - - // Check the map exists - assert (test_tree_multi_map != null); - - // Check the selected compare functions - assert (test_tree_multi_map.key_compare_func == (CompareFunc) strcmp); - assert (test_tree_multi_map.value_compare_func == (CompareFunc) strcmp); - } } diff --git a/tests/testtreemultiset.c b/tests/testtreemultiset.c index 212111f..333ca84 100644 --- a/tests/testtreemultiset.c +++ b/tests/testtreemultiset.c @@ -74,7 +74,6 @@ typedef struct _TreeMultiSetTests TreeMultiSetTests; typedef struct _TreeMultiSetTestsClass TreeMultiSetTestsClass; typedef struct _TreeMultiSetTestsPrivate TreeMultiSetTestsPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _GeeTestCase { GObject parent_instance; @@ -115,7 +114,6 @@ struct _TreeMultiSetTestsClass { MultiSetTestsClass parent_class; }; -typedef void (*GeeTestCaseTestMethod) (void* user_data); static gpointer tree_multi_set_tests_parent_class = NULL; @@ -129,22 +127,13 @@ enum { TreeMultiSetTests* tree_multi_set_tests_new (void); TreeMultiSetTests* tree_multi_set_tests_construct (GType object_type); MultiSetTests* multi_set_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -static void tree_multi_set_tests_test_selected_functions (TreeMultiSetTests* self); -static void _tree_multi_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self); static void tree_multi_set_tests_real_set_up (GeeTestCase* base); static void tree_multi_set_tests_real_tear_down (GeeTestCase* base); -static void _tree_multi_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - tree_multi_set_tests_test_selected_functions (self); -} - - TreeMultiSetTests* tree_multi_set_tests_construct (GType object_type) { TreeMultiSetTests * self = NULL; self = (TreeMultiSetTests*) multi_set_tests_construct (object_type, "TreeMultiSet"); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeMultiSet] selected functions", _tree_multi_set_tests_test_selected_functions_gee_test_case_test_method, self); return self; } @@ -158,7 +147,7 @@ static void tree_multi_set_tests_real_set_up (GeeTestCase* base) { TreeMultiSetTests * self; GeeTreeMultiSet* _tmp0_; self = (TreeMultiSetTests*) base; - _tmp0_ = gee_tree_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_tree_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -172,31 +161,6 @@ static void tree_multi_set_tests_real_tear_down (GeeTestCase* base) { } -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; -} - - -static void tree_multi_set_tests_test_selected_functions (TreeMultiSetTests* self) { - GeeCollection* _tmp0_; - GeeTreeMultiSet* _tmp1_; - GeeTreeMultiSet* test_multi_set; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_MULTI_SET) ? ((GeeTreeMultiSet*) _tmp0_) : NULL); - test_multi_set = _tmp1_; - _vala_assert (test_multi_set != NULL, "test_multi_set != null"); - _tmp2_ = gee_tree_multi_set_get_compare_func (test_multi_set); - _tmp3_ = _tmp2_; - _tmp4_ = g_strcmp0; - _vala_assert (_tmp3_ == ((GCompareFunc) _tmp4_), "test_multi_set.compare_func == (CompareFunc) strcmp"); - _g_object_unref0 (test_multi_set); -} - - static void tree_multi_set_tests_class_init (TreeMultiSetTestsClass * klass) { tree_multi_set_tests_parent_class = g_type_class_peek_parent (klass); GEE_TEST_CASE_CLASS (klass)->set_up = tree_multi_set_tests_real_set_up; diff --git a/tests/testtreemultiset.vala b/tests/testtreemultiset.vala index da86ca2..711c110 100644 --- a/tests/testtreemultiset.vala +++ b/tests/testtreemultiset.vala @@ -26,7 +26,6 @@ public class TreeMultiSetTests : MultiSetTests { public TreeMultiSetTests () { base ("TreeMultiSet"); - add_test ("[TreeMultiSet] selected functions", test_selected_functions); } public override void set_up () { @@ -36,14 +35,4 @@ public class TreeMultiSetTests : MultiSetTests { public override void tear_down () { test_collection = null; } - - private void test_selected_functions () { - var test_multi_set = test_collection as TreeMultiSet; - - // Check the collection exists - assert (test_multi_set != null); - - // Check the selected compare functions - assert (test_multi_set.compare_func == (CompareFunc) strcmp); - } } diff --git a/tests/testtreeset.c b/tests/testtreeset.c index 81d757b..b9f9e90 100644 --- a/tests/testtreeset.c +++ b/tests/testtreeset.c @@ -75,6 +75,17 @@ typedef struct _SortedSetTests SortedSetTests; typedef struct _SortedSetTestsClass SortedSetTestsClass; typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate; +#define TYPE_BIDIR_SORTED_SET_TESTS (bidir_sorted_set_tests_get_type ()) +#define BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests)) +#define BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) +#define IS_BIDIR_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BIDIR_SORTED_SET_TESTS)) +#define IS_BIDIR_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BIDIR_SORTED_SET_TESTS)) +#define BIDIR_SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTestsClass)) + +typedef struct _BidirSortedSetTests BidirSortedSetTests; +typedef struct _BidirSortedSetTestsClass BidirSortedSetTestsClass; +typedef struct _BidirSortedSetTestsPrivate BidirSortedSetTestsPrivate; + #define TYPE_TREE_SET_TESTS (tree_set_tests_get_type ()) #define TREE_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TREE_SET_TESTS, TreeSetTests)) #define TREE_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TREE_SET_TESTS, TreeSetTestsClass)) @@ -129,13 +140,22 @@ struct _SortedSetTestsClass { SetTestsClass parent_class; }; -struct _TreeSetTests { +struct _BidirSortedSetTests { SortedSetTests parent_instance; + BidirSortedSetTestsPrivate * priv; +}; + +struct _BidirSortedSetTestsClass { + SortedSetTestsClass parent_class; +}; + +struct _TreeSetTests { + BidirSortedSetTests parent_instance; TreeSetTestsPrivate * priv; }; struct _TreeSetTestsClass { - SortedSetTestsClass parent_class; + BidirSortedSetTestsClass parent_class; }; typedef void (*GeeTestCaseTestMethod) (void* user_data); @@ -146,18 +166,15 @@ GType gee_test_case_get_type (void) G_GNUC_CONST; GType collection_tests_get_type (void) G_GNUC_CONST; GType set_tests_get_type (void) G_GNUC_CONST; GType sorted_set_tests_get_type (void) G_GNUC_CONST; +GType bidir_sorted_set_tests_get_type (void) G_GNUC_CONST; GType tree_set_tests_get_type (void) G_GNUC_CONST; enum { TREE_SET_TESTS_DUMMY_PROPERTY }; TreeSetTests* tree_set_tests_new (void); TreeSetTests* tree_set_tests_construct (GType object_type); -SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); -void tree_set_tests_test_selected_functions (TreeSetTests* self); -static void _tree_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self); -void tree_set_tests_test_gobject_properties (TreeSetTests* self); -static void _tree_set_tests_test_gobject_properties_gee_test_case_test_method (gpointer self); +BidirSortedSetTests* bidir_sorted_set_tests_construct (GType object_type, const gchar* name); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void tree_set_tests_test_add_remove (TreeSetTests* self); static void _tree_set_tests_test_add_remove_gee_test_case_test_method (gpointer self); static void tree_set_tests_real_set_up (GeeTestCase* base); @@ -167,16 +184,6 @@ static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNoti static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); -static void _tree_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self) { - tree_set_tests_test_selected_functions (self); -} - - -static void _tree_set_tests_test_gobject_properties_gee_test_case_test_method (gpointer self) { - tree_set_tests_test_gobject_properties (self); -} - - static void _tree_set_tests_test_add_remove_gee_test_case_test_method (gpointer self) { tree_set_tests_test_add_remove (self); } @@ -184,10 +191,8 @@ static void _tree_set_tests_test_add_remove_gee_test_case_test_method (gpointer TreeSetTests* tree_set_tests_construct (GType object_type) { TreeSetTests * self = NULL; - self = (TreeSetTests*) sorted_set_tests_construct (object_type, "TreeSet"); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeSet] selected functions", _tree_set_tests_test_selected_functions_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeSet] GObject properties", _tree_set_tests_test_gobject_properties_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[TreeSet] add and remove", _tree_set_tests_test_add_remove_gee_test_case_test_method, self); + self = (TreeSetTests*) bidir_sorted_set_tests_construct (object_type, "TreeSet"); + gee_test_case_add_test ((GeeTestCase*) self, "[TreeSet] add and remove", _tree_set_tests_test_add_remove_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -201,7 +206,7 @@ static void tree_set_tests_real_set_up (GeeTestCase* base) { TreeSetTests * self; GeeTreeSet* _tmp0_; self = (TreeSetTests*) base; - _tmp0_ = gee_tree_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp0_ = gee_tree_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); _g_object_unref0 (((CollectionTests*) self)->test_collection); ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_; } @@ -220,56 +225,6 @@ static gpointer _g_object_ref0 (gpointer self) { } -void tree_set_tests_test_selected_functions (TreeSetTests* self) { - GeeCollection* _tmp0_; - GeeTreeSet* _tmp1_; - GeeTreeSet* test_set; - GCompareFunc _tmp2_; - GCompareFunc _tmp3_; - GCompareFunc _tmp4_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_SET) ? ((GeeTreeSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _vala_assert (test_set != NULL, "test_set != null"); - _tmp2_ = gee_tree_set_get_compare_func (test_set); - _tmp3_ = _tmp2_; - _tmp4_ = g_strcmp0; - _vala_assert (_tmp3_ == ((GCompareFunc) _tmp4_), "test_set.compare_func == (CompareFunc) strcmp"); - _g_object_unref0 (test_set); -} - - -void tree_set_tests_test_gobject_properties (TreeSetTests* self) { - GeeCollection* _tmp0_; - GeeTreeSet* _tmp1_; - GeeTreeSet* test_set; - GValue value = {0}; - GValue _tmp2_ = {0}; - GValue _tmp3_; - void* _tmp4_ = NULL; - GCompareFunc _tmp5_; - GCompareFunc _tmp6_; - g_return_if_fail (self != NULL); - _tmp0_ = ((CollectionTests*) self)->test_collection; - _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_TREE_SET) ? ((GeeTreeSet*) _tmp0_) : NULL); - test_set = _tmp1_; - _vala_assert (test_set != NULL, "test_set != null"); - g_value_init (&_tmp2_, G_TYPE_POINTER); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - value = _tmp2_; - _tmp3_ = value; - g_object_get_property ((GObject*) test_set, "compare-func", &value); - _tmp4_ = g_value_get_pointer (&value); - _tmp5_ = gee_tree_set_get_compare_func (test_set); - _tmp6_ = _tmp5_; - _vala_assert (_tmp4_ == ((void*) _tmp6_), "value.get_pointer () == (void*) test_set.compare_func"); - g_value_unset (&value); - G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL; - _g_object_unref0 (test_set); -} - - void tree_set_tests_test_add_remove (TreeSetTests* self) { GeeCollection* _tmp0_; GeeTreeSet* _tmp1_; @@ -363,7 +318,7 @@ void tree_set_tests_test_add_remove (TreeSetTests* self) { test_set = _tmp1_; _tmp2_ = test_set; _vala_assert (_tmp2_ != NULL, "test_set != null"); - collection_tests_test_remove_all ((CollectionTests*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SORTED_SET_TESTS, SortedSetTests)); + collection_tests_test_remove_all ((CollectionTests*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_BIDIR_SORTED_SET_TESTS, BidirSortedSetTests)); _tmp3_ = g_strdup ("3"); _tmp4_ = g_strdup ("10"); _tmp5_ = g_strdup ("5"); @@ -692,7 +647,7 @@ GType tree_set_tests_get_type (void) { if (g_once_init_enter (&tree_set_tests_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (TreeSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tree_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TreeSetTests), 0, (GInstanceInitFunc) tree_set_tests_instance_init, NULL }; GType tree_set_tests_type_id; - tree_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "TreeSetTests", &g_define_type_info, 0); + tree_set_tests_type_id = g_type_register_static (TYPE_BIDIR_SORTED_SET_TESTS, "TreeSetTests", &g_define_type_info, 0); g_once_init_leave (&tree_set_tests_type_id__volatile, tree_set_tests_type_id); } return tree_set_tests_type_id__volatile; diff --git a/tests/testtreeset.vala b/tests/testtreeset.vala index 6d754bc..e407945 100644 --- a/tests/testtreeset.vala +++ b/tests/testtreeset.vala @@ -23,12 +23,10 @@ using Gee; -public class TreeSetTests : SortedSetTests { +public class TreeSetTests : BidirSortedSetTests { public TreeSetTests () { base ("TreeSet"); - add_test ("[TreeSet] selected functions", test_selected_functions); - add_test ("[TreeSet] GObject properties", test_gobject_properties); add_test ("[TreeSet] add and remove", test_add_remove); } @@ -40,29 +38,6 @@ public class TreeSetTests : SortedSetTests { test_collection = null; } - public void test_selected_functions () { - var test_set = test_collection as TreeSet; - - // Check the set exists - assert (test_set != null); - - // Check the selected compare function - assert (test_set.compare_func == (CompareFunc) strcmp); - } - - public new void test_gobject_properties () { - var test_set = test_collection as TreeSet; - - // Check the set exists - assert (test_set != null); - Value value; - - value = Value (typeof (CompareFunc)); - test_set.get_property ("compare-func", ref value); - assert (value.get_pointer () == (void*) test_set.compare_func); - value.unset (); - } - public new void test_add_remove () { var test_set = test_collection as TreeSet; -- cgit v1.2.3