1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859
|
/* hashset.c generated by valac 0.56.17, the Vala compiler
* generated from hashset.vala, do not modify */
/* hashset.vala
*
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1997-2000 GLib Team and others
* Copyright (C) 2007-2009 Jürg Billeter
* Copyright (C) 2009-2014 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:
* Jürg Billeter <j@bitron.ch>
*/
#include "gee.h"
#include <glib.h>
#include <glib-object.h>
#define GEE_HASH_SET_MIN_SIZE 11
#define GEE_HASH_SET_MAX_SIZE 13845163
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
typedef struct _GeeHashSetNode GeeHashSetNode;
#define GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE (gee_functions_hash_data_func_closure_get_type ())
#define GEE_FUNCTIONS_HASH_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE, GeeFunctionsHashDataFuncClosure))
#define GEE_FUNCTIONS_HASH_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE, GeeFunctionsHashDataFuncClosureClass))
#define GEE_FUNCTIONS_IS_HASH_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_IS_HASH_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_HASH_DATA_FUNC_CLOSURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_FUNCTIONS_TYPE_HASH_DATA_FUNC_CLOSURE, GeeFunctionsHashDataFuncClosureClass))
typedef struct _GeeFunctionsHashDataFuncClosure GeeFunctionsHashDataFuncClosure;
typedef struct _GeeFunctionsHashDataFuncClosureClass GeeFunctionsHashDataFuncClosureClass;
#define GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE (gee_functions_equal_data_func_closure_get_type ())
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosure))
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosureClass))
#define GEE_FUNCTIONS_IS_EQUAL_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_IS_EQUAL_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosureClass))
typedef struct _GeeFunctionsEqualDataFuncClosure GeeFunctionsEqualDataFuncClosure;
typedef struct _GeeFunctionsEqualDataFuncClosureClass GeeFunctionsEqualDataFuncClosureClass;
enum {
GEE_HASH_SET_0_PROPERTY,
GEE_HASH_SET_G_TYPE,
GEE_HASH_SET_G_DUP_FUNC,
GEE_HASH_SET_G_DESTROY_FUNC,
GEE_HASH_SET_SIZE_PROPERTY,
GEE_HASH_SET_READ_ONLY_PROPERTY,
GEE_HASH_SET_NUM_PROPERTIES
};
static GParamSpec* gee_hash_set_properties[GEE_HASH_SET_NUM_PROPERTIES];
#define _gee_functions_hash_data_func_closure_unref0(var) ((var == NULL) ? NULL : (var = (gee_functions_hash_data_func_closure_unref (var), NULL)))
#define _gee_functions_equal_data_func_closure_unref0(var) ((var == NULL) ? NULL : (var = (gee_functions_equal_data_func_closure_unref (var), NULL)))
#define GEE_HASH_SET_TYPE_ITERATOR (gee_hash_set_iterator_get_type ())
#define GEE_HASH_SET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator))
#define GEE_HASH_SET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIteratorClass))
#define GEE_HASH_SET_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_HASH_SET_TYPE_ITERATOR))
#define GEE_HASH_SET_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_HASH_SET_TYPE_ITERATOR))
#define GEE_HASH_SET_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIteratorClass))
typedef struct _GeeHashSetIterator GeeHashSetIterator;
typedef struct _GeeHashSetIteratorClass GeeHashSetIteratorClass;
#define _gee_hash_set_node_free0(var) ((var == NULL) ? NULL : (var = (gee_hash_set_node_free (var), NULL)))
typedef struct _GeeFunctionsHashDataFuncClosurePrivate GeeFunctionsHashDataFuncClosurePrivate;
typedef struct _GeeFunctionsEqualDataFuncClosurePrivate GeeFunctionsEqualDataFuncClosurePrivate;
typedef struct _GeeHashSetIteratorPrivate GeeHashSetIteratorPrivate;
enum {
GEE_HASH_SET_ITERATOR_0_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_READ_ONLY_PROPERTY,
GEE_HASH_SET_ITERATOR_VALID_PROPERTY,
GEE_HASH_SET_ITERATOR_NUM_PROPERTIES
};
static GParamSpec* gee_hash_set_iterator_properties[GEE_HASH_SET_ITERATOR_NUM_PROPERTIES];
#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);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _GeeHashSetPrivate {
GType g_type;
GBoxedCopyFunc g_dup_func;
GDestroyNotify g_destroy_func;
gint _array_size;
gint _nnodes;
GeeHashSetNode** _nodes;
gint _nodes_length1;
gint __nodes_size_;
GeeFunctionsHashDataFuncClosure* _hash_func;
GeeFunctionsEqualDataFuncClosure* _equal_func;
gint _stamp;
};
struct _GeeHashSetNode {
gpointer key;
GeeHashSetNode* next;
guint key_hash;
};
struct _GeeFunctionsHashDataFuncClosure {
GTypeInstance parent_instance;
volatile int ref_count;
GeeFunctionsHashDataFuncClosurePrivate * priv;
GeeHashDataFunc func;
gpointer func_target;
GDestroyNotify func_target_destroy_notify;
};
struct _GeeFunctionsHashDataFuncClosureClass {
GTypeClass parent_class;
void (*finalize) (GeeFunctionsHashDataFuncClosure *self);
};
struct _GeeFunctionsEqualDataFuncClosure {
GTypeInstance parent_instance;
volatile int ref_count;
GeeFunctionsEqualDataFuncClosurePrivate * priv;
GeeEqualDataFunc func;
gpointer func_target;
GDestroyNotify func_target_destroy_notify;
};
struct _GeeFunctionsEqualDataFuncClosureClass {
GTypeClass parent_class;
void (*finalize) (GeeFunctionsEqualDataFuncClosure *self);
};
struct _GeeHashSetIterator {
GObject parent_instance;
GeeHashSetIteratorPrivate * priv;
GeeHashSet* _set;
gint _index;
GeeHashSetNode* _node;
GeeHashSetNode* _next;
gint _stamp;
};
struct _GeeHashSetIteratorClass {
GObjectClass parent_class;
};
struct _GeeHashSetIteratorPrivate {
GType g_type;
GBoxedCopyFunc g_dup_func;
GDestroyNotify g_destroy_func;
};
static gint GeeHashSet_private_offset;
static gpointer gee_hash_set_parent_class = NULL;
static gint GeeHashSetIterator_private_offset;
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;
static void gee_hash_set_node_free (GeeHashSetNode * self);
G_GNUC_INTERNAL gpointer gee_functions_hash_data_func_closure_ref (gpointer instance);
G_GNUC_INTERNAL void gee_functions_hash_data_func_closure_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_functions_param_spec_hash_data_func_closure (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags);
G_GNUC_INTERNAL void gee_functions_value_set_hash_data_func_closure (GValue* value,
gpointer v_object) G_GNUC_UNUSED ;
G_GNUC_INTERNAL void gee_functions_value_take_hash_data_func_closure (GValue* value,
gpointer v_object);
G_GNUC_INTERNAL gpointer gee_functions_value_get_hash_data_func_closure (const GValue* value) G_GNUC_UNUSED ;
G_GNUC_INTERNAL GType gee_functions_hash_data_func_closure_get_type (void) G_GNUC_CONST G_GNUC_UNUSED ;
G_GNUC_INTERNAL gpointer gee_functions_equal_data_func_closure_ref (gpointer instance);
G_GNUC_INTERNAL void gee_functions_equal_data_func_closure_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_functions_param_spec_equal_data_func_closure (const gchar* name,
const gchar* nick,
const gchar* blurb,
GType object_type,
GParamFlags flags);
G_GNUC_INTERNAL void gee_functions_value_set_equal_data_func_closure (GValue* value,
gpointer v_object) G_GNUC_UNUSED ;
G_GNUC_INTERNAL void gee_functions_value_take_equal_data_func_closure (GValue* value,
gpointer v_object);
G_GNUC_INTERNAL gpointer gee_functions_value_get_equal_data_func_closure (const GValue* value) G_GNUC_UNUSED ;
G_GNUC_INTERNAL GType gee_functions_equal_data_func_closure_get_type (void) G_GNUC_CONST G_GNUC_UNUSED ;
G_GNUC_INTERNAL GeeFunctionsHashDataFuncClosure* gee_functions_hash_data_func_closure_new (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashDataFunc func,
gpointer func_target,
GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeFunctionsHashDataFuncClosure* gee_functions_hash_data_func_closure_construct (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashDataFunc func,
gpointer func_target,
GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeFunctionsEqualDataFuncClosure* gee_functions_equal_data_func_closure_new (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeEqualDataFunc func,
gpointer func_target,
GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeFunctionsEqualDataFuncClosure* gee_functions_equal_data_func_closure_construct (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeEqualDataFunc func,
gpointer func_target,
GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeHashSet* gee_hash_set_new_with_closures (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeFunctionsHashDataFuncClosure* hash_func,
GeeFunctionsEqualDataFuncClosure* equal_func);
G_GNUC_INTERNAL GeeHashSet* gee_hash_set_construct_with_closures (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeFunctionsHashDataFuncClosure* hash_func,
GeeFunctionsEqualDataFuncClosure* equal_func);
static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self,
gconstpointer key);
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);
static GeeHashSetIterator* gee_hash_set_iterator_construct (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSet* set);
static GType gee_hash_set_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED ;
static gboolean gee_hash_set_real_add (GeeAbstractCollection* base,
gconstpointer key);
static GeeHashSetNode* gee_hash_set_node_new (gpointer k,
guint hash);
static void gee_hash_set_resize (GeeHashSet* self);
static gboolean gee_hash_set_real_remove (GeeAbstractCollection* base,
gconstpointer key);
static inline gboolean gee_hash_set_remove_helper (GeeHashSet* self,
gconstpointer key);
static void gee_hash_set_real_clear (GeeAbstractCollection* base);
static gboolean gee_hash_set_real_foreach (GeeAbstractCollection* base,
GeeForallFunc f,
gpointer f_target);
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 void gee_hash_set_node_instance_init (GeeHashSetNode * self);
static GeeHashSetIterator* gee_hash_set_iterator_new_from_iterator (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSetIterator* iter);
static GeeHashSetIterator* gee_hash_set_iterator_construct_from_iterator (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSetIterator* iter);
static gboolean gee_hash_set_iterator_real_next (GeeIterator* base);
static gboolean gee_hash_set_iterator_real_has_next (GeeIterator* base);
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,
gpointer f_target);
static GeeIterator** gee_hash_set_iterator_real_tee (GeeTraversable* base,
guint forks,
gint* result_length1);
static void gee_hash_set_iterator_finalize (GObject * obj);
static GType gee_hash_set_iterator_get_type_once (void);
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);
static GType gee_hash_set_get_type_once (void);
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,
gssize array_length,
GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
gssize array_length,
GDestroyNotify destroy_func);
static inline gpointer
gee_hash_set_get_instance_private (GeeHashSet* self)
{
return G_STRUCT_MEMBER_P (self, GeeHashSet_private_offset);
}
/**
* Constructs a new, empty hash set.
*
* If not provided, the functions parameters are requested to the
* {@link Functions} function factory methods.
*
* @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,
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)
{
GeeHashSet * self = NULL;
GeeHashDataFunc _tmp6_;
gpointer _tmp6__target;
GDestroyNotify _tmp6__target_destroy_notify;
GeeFunctionsHashDataFuncClosure* _tmp7_;
GeeEqualDataFunc _tmp8_;
gpointer _tmp8__target;
GDestroyNotify _tmp8__target_destroy_notify;
GeeFunctionsEqualDataFuncClosure* _tmp9_;
GeeHashSetNode** _tmp10_;
self = (GeeHashSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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;
if (hash_func == NULL) {
gpointer _tmp0_ = NULL;
GDestroyNotify _tmp1_ = NULL;
GeeHashDataFunc _tmp2_;
_tmp2_ = gee_functions_get_hash_func_for (g_type, &_tmp0_, &_tmp1_);
(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 = _tmp2_;
hash_func_target = _tmp0_;
hash_func_target_destroy_notify = _tmp1_;
}
if (equal_func == NULL) {
gpointer _tmp3_ = NULL;
GDestroyNotify _tmp4_ = NULL;
GeeEqualDataFunc _tmp5_;
_tmp5_ = gee_functions_get_equal_func_for (g_type, &_tmp3_, &_tmp4_);
(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 = _tmp5_;
equal_func_target = _tmp3_;
equal_func_target_destroy_notify = _tmp4_;
}
_tmp6_ = hash_func;
_tmp6__target = hash_func_target;
_tmp6__target_destroy_notify = hash_func_target_destroy_notify;
hash_func = NULL;
hash_func_target = NULL;
hash_func_target_destroy_notify = NULL;
_tmp7_ = gee_functions_hash_data_func_closure_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp6_, _tmp6__target, _tmp6__target_destroy_notify);
_gee_functions_hash_data_func_closure_unref0 (self->priv->_hash_func);
self->priv->_hash_func = _tmp7_;
_tmp8_ = equal_func;
_tmp8__target = equal_func_target;
_tmp8__target_destroy_notify = equal_func_target_destroy_notify;
equal_func = NULL;
equal_func_target = NULL;
equal_func_target_destroy_notify = NULL;
_tmp9_ = gee_functions_equal_data_func_closure_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp8_, _tmp8__target, _tmp8__target_destroy_notify);
_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
self->priv->_equal_func = _tmp9_;
self->priv->_array_size = GEE_HASH_SET_MIN_SIZE;
_tmp10_ = g_new0 (GeeHashSetNode*, self->priv->_array_size + 1);
self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
self->priv->_nodes = _tmp10_;
self->priv->_nodes_length1 = self->priv->_array_size;
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,
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)
{
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 gpointer
_gee_functions_hash_data_func_closure_ref0 (gpointer self)
{
return self ? gee_functions_hash_data_func_closure_ref (self) : NULL;
}
static gpointer
_gee_functions_equal_data_func_closure_ref0 (gpointer self)
{
return self ? gee_functions_equal_data_func_closure_ref (self) : NULL;
}
G_GNUC_INTERNAL GeeHashSet*
gee_hash_set_construct_with_closures (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeFunctionsHashDataFuncClosure* hash_func,
GeeFunctionsEqualDataFuncClosure* equal_func)
{
GeeHashSet * self = NULL;
GeeFunctionsHashDataFuncClosure* _tmp0_;
GeeFunctionsEqualDataFuncClosure* _tmp1_;
GeeHashSetNode** _tmp2_;
g_return_val_if_fail (hash_func != NULL, NULL);
g_return_val_if_fail (equal_func != NULL, NULL);
self = (GeeHashSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) 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_ = _gee_functions_hash_data_func_closure_ref0 (hash_func);
_gee_functions_hash_data_func_closure_unref0 (self->priv->_hash_func);
self->priv->_hash_func = _tmp0_;
_tmp1_ = _gee_functions_equal_data_func_closure_ref0 (equal_func);
_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
self->priv->_equal_func = _tmp1_;
self->priv->_array_size = GEE_HASH_SET_MIN_SIZE;
_tmp2_ = g_new0 (GeeHashSetNode*, self->priv->_array_size + 1);
self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
self->priv->_nodes = _tmp2_;
self->priv->_nodes_length1 = self->priv->_array_size;
self->priv->__nodes_size_ = self->priv->_nodes_length1;
_gee_functions_hash_data_func_closure_unref0 (hash_func);
_gee_functions_equal_data_func_closure_unref0 (equal_func);
return self;
}
G_GNUC_INTERNAL GeeHashSet*
gee_hash_set_new_with_closures (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeFunctionsHashDataFuncClosure* hash_func,
GeeFunctionsEqualDataFuncClosure* equal_func)
{
return gee_hash_set_construct_with_closures (GEE_TYPE_HASH_SET, g_type, g_dup_func, g_destroy_func, hash_func, equal_func);
}
static GeeHashSetNode**
gee_hash_set_lookup_node (GeeHashSet* self,
gconstpointer key)
{
guint hash_value = 0U;
GeeHashDataFunc _tmp0_ = NULL;
gpointer _tmp0__target = NULL;
GeeHashDataFunc _tmp1_;
gpointer _tmp1__target;
GeeHashSetNode** node = NULL;
GeeHashSetNode** _tmp2_;
gint _tmp2__length1;
GeeHashSetNode** _tmp12_;
GeeHashSetNode** result;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = gee_hash_set_get_hash_func (self, &_tmp0__target);
_tmp1_ = _tmp0_;
_tmp1__target = _tmp0__target;
hash_value = _tmp1_ (key, _tmp1__target);
_tmp2_ = self->priv->_nodes;
_tmp2__length1 = self->priv->_nodes_length1;
node = &_tmp2_[hash_value % self->priv->_array_size];
while (TRUE) {
gboolean _tmp3_ = FALSE;
GeeHashSetNode** _tmp4_;
GeeHashSetNode** _tmp11_;
_tmp4_ = node;
if ((*_tmp4_) != NULL) {
gboolean _tmp5_ = FALSE;
GeeHashSetNode** _tmp6_;
_tmp6_ = node;
if (hash_value != (*_tmp6_)->key_hash) {
_tmp5_ = TRUE;
} else {
GeeEqualDataFunc _tmp7_ = NULL;
gpointer _tmp7__target = NULL;
GeeEqualDataFunc _tmp8_;
gpointer _tmp8__target;
GeeHashSetNode** _tmp9_;
gconstpointer _tmp10_;
_tmp7_ = gee_hash_set_get_equal_func (self, &_tmp7__target);
_tmp8_ = _tmp7_;
_tmp8__target = _tmp7__target;
_tmp9_ = node;
_tmp10_ = (*_tmp9_)->key;
_tmp5_ = !_tmp8_ (_tmp10_, key, _tmp8__target);
}
_tmp3_ = _tmp5_;
} else {
_tmp3_ = FALSE;
}
if (!_tmp3_) {
break;
}
_tmp11_ = node;
node = &(*_tmp11_)->next;
}
_tmp12_ = node;
result = _tmp12_;
return result;
}
/**
* {@inheritDoc}
*/
static gboolean
gee_hash_set_real_contains (GeeAbstractCollection* base,
gconstpointer key)
{
GeeHashSet * self;
GeeHashSetNode** node = NULL;
GeeHashSetNode** _tmp0_;
gboolean result;
self = (GeeHashSet*) base;
_tmp0_ = gee_hash_set_lookup_node (self, key);
node = _tmp0_;
result = (*node) != NULL;
return result;
}
/**
* {@inheritDoc}
*/
static GeeIterator*
gee_hash_set_real_iterator (GeeAbstractCollection* base)
{
GeeHashSet * self;
GeeHashSetIterator* _tmp0_;
GeeIterator* result;
self = (GeeHashSet*) base;
_tmp0_ = gee_hash_set_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self);
result = (GeeIterator*) _tmp0_;
return result;
}
/**
* {@inheritDoc}
*/
static gboolean
gee_hash_set_real_add (GeeAbstractCollection* base,
gconstpointer key)
{
GeeHashSet * self;
GeeHashSetNode** node = NULL;
GeeHashSetNode** _tmp0_;
GeeHashSetNode** _tmp1_;
gboolean result;
self = (GeeHashSet*) base;
_tmp0_ = gee_hash_set_lookup_node (self, key);
node = _tmp0_;
_tmp1_ = node;
if ((*_tmp1_) != NULL) {
result = FALSE;
return result;
} else {
guint hash_value = 0U;
GeeHashDataFunc _tmp2_ = NULL;
gpointer _tmp2__target = NULL;
GeeHashDataFunc _tmp3_;
gpointer _tmp3__target;
GeeHashSetNode** _tmp4_;
gpointer _tmp5_;
GeeHashSetNode* _tmp6_;
gint _tmp7_;
gint _tmp8_;
_tmp2_ = gee_hash_set_get_hash_func (self, &_tmp2__target);
_tmp3_ = _tmp2_;
_tmp3__target = _tmp2__target;
hash_value = _tmp3_ (key, _tmp3__target);
_tmp4_ = node;
_tmp5_ = ((key != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) key) : ((gpointer) key);
_tmp6_ = gee_hash_set_node_new (_tmp5_, hash_value);
*_tmp4_ = _tmp6_;
_tmp7_ = self->priv->_nnodes;
self->priv->_nnodes = _tmp7_ + 1;
gee_hash_set_resize (self);
_tmp8_ = self->priv->_stamp;
self->priv->_stamp = _tmp8_ + 1;
result = TRUE;
return result;
}
}
/**
* {@inheritDoc}
*/
static gboolean
gee_hash_set_real_remove (GeeAbstractCollection* base,
gconstpointer key)
{
GeeHashSet * self;
gboolean b = FALSE;
gboolean result;
self = (GeeHashSet*) base;
b = gee_hash_set_remove_helper (self, key);
if (b) {
gee_hash_set_resize (self);
}
result = b;
return result;
}
/**
* {@inheritDoc}
*/
static void
gee_hash_set_real_clear (GeeAbstractCollection* base)
{
GeeHashSet * self;
self = (GeeHashSet*) base;
{
gint i = 0;
i = 0;
{
gboolean _tmp0_ = FALSE;
_tmp0_ = TRUE;
while (TRUE) {
GeeHashSetNode* node = NULL;
GeeHashSetNode** _tmp2_;
gint _tmp2__length1;
GeeHashSetNode* _tmp3_;
if (!_tmp0_) {
gint _tmp1_;
_tmp1_ = i;
i = _tmp1_ + 1;
}
_tmp0_ = FALSE;
if (!(i < self->priv->_array_size)) {
break;
}
_tmp2_ = self->priv->_nodes;
_tmp2__length1 = self->priv->_nodes_length1;
_tmp3_ = _tmp2_[i];
_tmp2_[i] = NULL;
node = _tmp3_;
while (TRUE) {
GeeHashSetNode* _tmp4_;
GeeHashSetNode* next = NULL;
GeeHashSetNode* _tmp5_;
GeeHashSetNode* _tmp6_;
GeeHashSetNode* _tmp7_;
GeeHashSetNode* _tmp8_;
_tmp4_ = node;
if (!(_tmp4_ != NULL)) {
break;
}
_tmp5_ = node;
_tmp6_ = _tmp5_->next;
_tmp5_->next = NULL;
next = _tmp6_;
_tmp7_ = node;
((_tmp7_->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp7_->key = (self->priv->g_destroy_func (_tmp7_->key), NULL));
_tmp7_->key = NULL;
_tmp8_ = next;
next = NULL;
_gee_hash_set_node_free0 (node);
node = _tmp8_;
_gee_hash_set_node_free0 (next);
}
_gee_hash_set_node_free0 (node);
}
}
}
self->priv->_nnodes = 0;
gee_hash_set_resize (self);
}
/**
* {@inheritDoc}
*/
static gboolean
gee_hash_set_real_foreach (GeeAbstractCollection* base,
GeeForallFunc f,
gpointer f_target)
{
GeeHashSet * self;
gboolean result;
self = (GeeHashSet*) base;
{
gint i = 0;
i = 0;
{
gboolean _tmp0_ = FALSE;
_tmp0_ = TRUE;
while (TRUE) {
if (!_tmp0_) {
gint _tmp1_;
_tmp1_ = i;
i = _tmp1_ + 1;
}
_tmp0_ = FALSE;
if (!(i < self->priv->_array_size)) {
break;
}
{
GeeHashSetNode* current = NULL;
GeeHashSetNode** _tmp2_;
gint _tmp2__length1;
GeeHashSetNode* _tmp3_;
_tmp2_ = self->priv->_nodes;
_tmp2__length1 = self->priv->_nodes_length1;
_tmp3_ = _tmp2_[i];
current = _tmp3_;
{
gboolean _tmp4_ = FALSE;
_tmp4_ = TRUE;
while (TRUE) {
GeeHashSetNode* _tmp7_;
GeeHashSetNode* _tmp8_;
gconstpointer _tmp9_;
gpointer _tmp10_;
if (!_tmp4_) {
GeeHashSetNode* _tmp5_;
GeeHashSetNode* _tmp6_;
_tmp5_ = current;
_tmp6_ = _tmp5_->next;
current = _tmp6_;
}
_tmp4_ = FALSE;
_tmp7_ = current;
if (!(_tmp7_ != NULL)) {
break;
}
_tmp8_ = current;
_tmp9_ = _tmp8_->key;
_tmp10_ = ((_tmp9_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp9_) : ((gpointer) _tmp9_);
if (!f (_tmp10_, f_target)) {
result = FALSE;
return result;
}
}
}
}
}
}
}
result = TRUE;
return result;
}
static inline gboolean
gee_hash_set_remove_helper (GeeHashSet* self,
gconstpointer key)
{
GeeHashSetNode** node = NULL;
GeeHashSetNode** _tmp0_;
GeeHashSetNode** _tmp1_;
gboolean result;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = gee_hash_set_lookup_node (self, key);
node = _tmp0_;
_tmp1_ = node;
if ((*_tmp1_) != NULL) {
GeeHashSetNode** _tmp2_;
GeeHashSetNode* next = NULL;
GeeHashSetNode** _tmp3_;
GeeHashSetNode* _tmp4_;
GeeHashSetNode** _tmp5_;
GeeHashSetNode** _tmp6_;
GeeHashSetNode** _tmp7_;
GeeHashSetNode* _tmp8_;
gint _tmp9_;
gint _tmp10_;
_tmp2_ = node;
_vala_assert ((*_tmp2_) != NULL, "*node != null");
_tmp3_ = node;
_tmp4_ = (*_tmp3_)->next;
(*_tmp3_)->next = NULL;
next = _tmp4_;
_tmp5_ = node;
(((*_tmp5_)->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : ((*_tmp5_)->key = (self->priv->g_destroy_func ((*_tmp5_)->key), NULL));
(*_tmp5_)->key = NULL;
_tmp6_ = node;
_gee_hash_set_node_free0 (*_tmp6_);
_tmp7_ = node;
_tmp8_ = next;
next = NULL;
*_tmp7_ = _tmp8_;
_tmp9_ = self->priv->_nnodes;
self->priv->_nnodes = _tmp9_ - 1;
_tmp10_ = self->priv->_stamp;
self->priv->_stamp = _tmp10_ + 1;
result = TRUE;
_gee_hash_set_node_free0 (next);
return result;
}
result = FALSE;
return result;
}
static void
gee_hash_set_resize (GeeHashSet* self)
{
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
if (self->priv->_array_size >= (3 * self->priv->_nnodes)) {
_tmp1_ = self->priv->_array_size >= GEE_HASH_SET_MIN_SIZE;
} else {
_tmp1_ = FALSE;
}
if (_tmp1_) {
_tmp0_ = TRUE;
} else {
gboolean _tmp2_ = FALSE;
if ((3 * self->priv->_array_size) <= self->priv->_nnodes) {
_tmp2_ = self->priv->_array_size < GEE_HASH_SET_MAX_SIZE;
} else {
_tmp2_ = FALSE;
}
_tmp0_ = _tmp2_;
}
if (_tmp0_) {
gint new_array_size = 0;
GeeHashSetNode** new_nodes = NULL;
GeeHashSetNode** _tmp3_;
gint new_nodes_length1;
gint _new_nodes_size_;
GeeHashSetNode** _tmp19_;
gint _tmp19__length1;
new_array_size = (gint) g_spaced_primes_closest ((guint) self->priv->_nnodes);
new_array_size = CLAMP (new_array_size, GEE_HASH_SET_MIN_SIZE, GEE_HASH_SET_MAX_SIZE);
_tmp3_ = g_new0 (GeeHashSetNode*, new_array_size + 1);
new_nodes = _tmp3_;
new_nodes_length1 = new_array_size;
_new_nodes_size_ = new_nodes_length1;
{
gint i = 0;
i = 0;
{
gboolean _tmp4_ = FALSE;
_tmp4_ = TRUE;
while (TRUE) {
GeeHashSetNode* node = NULL;
GeeHashSetNode* next = NULL;
if (!_tmp4_) {
gint _tmp5_;
_tmp5_ = i;
i = _tmp5_ + 1;
}
_tmp4_ = FALSE;
if (!(i < self->priv->_array_size)) {
break;
}
next = NULL;
{
GeeHashSetNode** _tmp6_;
gint _tmp6__length1;
GeeHashSetNode* _tmp7_;
gboolean _tmp8_ = FALSE;
_tmp6_ = self->priv->_nodes;
_tmp6__length1 = self->priv->_nodes_length1;
_tmp7_ = _tmp6_[i];
_tmp6_[i] = NULL;
_gee_hash_set_node_free0 (node);
node = _tmp7_;
_tmp8_ = TRUE;
while (TRUE) {
GeeHashSetNode* _tmp10_;
GeeHashSetNode* _tmp11_;
GeeHashSetNode* _tmp12_;
guint hash_val = 0U;
GeeHashSetNode* _tmp13_;
GeeHashSetNode* _tmp14_;
GeeHashSetNode** _tmp15_;
gint _tmp15__length1;
GeeHashSetNode* _tmp16_;
GeeHashSetNode** _tmp17_;
gint _tmp17__length1;
GeeHashSetNode* _tmp18_;
if (!_tmp8_) {
GeeHashSetNode* _tmp9_;
_tmp9_ = next;
next = NULL;
_gee_hash_set_node_free0 (node);
node = _tmp9_;
}
_tmp8_ = FALSE;
_tmp10_ = node;
if (!(_tmp10_ != NULL)) {
break;
}
_tmp11_ = node;
_tmp12_ = _tmp11_->next;
_tmp11_->next = NULL;
_gee_hash_set_node_free0 (next);
next = _tmp12_;
_tmp13_ = node;
hash_val = _tmp13_->key_hash % new_array_size;
_tmp14_ = node;
_tmp15_ = new_nodes;
_tmp15__length1 = new_nodes_length1;
_tmp16_ = _tmp15_[hash_val];
_tmp15_[hash_val] = NULL;
_gee_hash_set_node_free0 (_tmp14_->next);
_tmp14_->next = _tmp16_;
_tmp17_ = new_nodes;
_tmp17__length1 = new_nodes_length1;
_tmp18_ = node;
node = NULL;
_gee_hash_set_node_free0 (_tmp17_[hash_val]);
_tmp17_[hash_val] = _tmp18_;
}
}
_gee_hash_set_node_free0 (next);
_gee_hash_set_node_free0 (node);
}
}
}
_tmp19_ = new_nodes;
_tmp19__length1 = new_nodes_length1;
new_nodes = NULL;
new_nodes_length1 = 0;
self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
self->priv->_nodes = _tmp19_;
self->priv->_nodes_length1 = _tmp19__length1;
self->priv->__nodes_size_ = self->priv->_nodes_length1;
self->priv->_array_size = new_array_size;
new_nodes = (_vala_array_free (new_nodes, new_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
}
}
static gint
gee_hash_set_real_get_size (GeeAbstractCollection* base)
{
gint result;
GeeHashSet* self;
self = (GeeHashSet*) base;
result = self->priv->_nnodes;
return result;
}
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;
GeeFunctionsHashDataFuncClosure* _tmp0_;
GeeHashDataFunc _tmp1_;
gpointer _tmp1__target;
GeeHashDataFunc _tmp2_;
gpointer _tmp2__target;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_hash_func;
_tmp1_ = _tmp0_->func;
_tmp1__target = _tmp0_->func_target;
_tmp2_ = _tmp1_;
_tmp2__target = _tmp1__target;
*result_target = _tmp2__target;
result = _tmp2_;
return result;
}
static void
gee_hash_set_set_hash_func (GeeHashSet* self,
GeeHashDataFunc value,
gpointer value_target)
{
g_return_if_fail (self != NULL);
}
GeeEqualDataFunc
gee_hash_set_get_equal_func (GeeHashSet* self,
gpointer* result_target)
{
GeeEqualDataFunc result;
GeeFunctionsEqualDataFuncClosure* _tmp0_;
GeeEqualDataFunc _tmp1_;
gpointer _tmp1__target;
GeeEqualDataFunc _tmp2_;
gpointer _tmp2__target;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_equal_func;
_tmp1_ = _tmp0_->func;
_tmp1__target = _tmp0_->func_target;
_tmp2_ = _tmp1_;
_tmp2__target = _tmp1__target;
*result_target = _tmp2__target;
result = _tmp2_;
return result;
}
static void
gee_hash_set_set_equal_func (GeeHashSet* self,
GeeEqualDataFunc value,
gpointer value_target)
{
g_return_if_fail (self != NULL);
}
static GeeHashSetNode*
gee_hash_set_node_new (gpointer k,
guint hash)
{
GeeHashSetNode* self;
gpointer _tmp0_;
self = g_slice_new0 (GeeHashSetNode);
gee_hash_set_node_instance_init (self);
_tmp0_ = k;
k = NULL;
self->key = _tmp0_;
self->key_hash = hash;
return self;
}
static void
gee_hash_set_node_instance_init (GeeHashSetNode * self)
{
}
static void
gee_hash_set_node_free (GeeHashSetNode * self)
{
_gee_hash_set_node_free0 (self->next);
g_slice_free (GeeHashSetNode, self);
}
static inline gpointer
gee_hash_set_iterator_get_instance_private (GeeHashSetIterator* self)
{
return G_STRUCT_MEMBER_P (self, GeeHashSetIterator_private_offset);
}
static gpointer
_g_object_ref0 (gpointer self)
{
return self ? g_object_ref (self) : NULL;
}
static GeeHashSetIterator*
gee_hash_set_iterator_construct (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSet* set)
{
GeeHashSetIterator * self = NULL;
GeeHashSet* _tmp0_;
GeeHashSet* _tmp1_;
g_return_val_if_fail (set != NULL, NULL);
self = (GeeHashSetIterator*) g_object_new (object_type, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, NULL);
self->priv->g_type = g_type;
self->priv->g_dup_func = g_dup_func;
self->priv->g_destroy_func = g_destroy_func;
_tmp0_ = _g_object_ref0 (set);
_g_object_unref0 (self->_set);
self->_set = _tmp0_;
_tmp1_ = self->_set;
self->_stamp = _tmp1_->priv->_stamp;
return self;
}
static GeeHashSetIterator*
gee_hash_set_iterator_new (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSet* set)
{
return gee_hash_set_iterator_construct (GEE_HASH_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, set);
}
static GeeHashSetIterator*
gee_hash_set_iterator_construct_from_iterator (GType object_type,
GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSetIterator* iter)
{
GeeHashSetIterator * self = NULL;
GeeHashSet* _tmp0_;
GeeHashSet* _tmp1_;
GeeHashSetNode* _tmp2_;
GeeHashSetNode* _tmp3_;
g_return_val_if_fail (iter != NULL, NULL);
self = (GeeHashSetIterator*) g_object_new (object_type, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, NULL);
self->priv->g_type = g_type;
self->priv->g_dup_func = g_dup_func;
self->priv->g_destroy_func = g_destroy_func;
_tmp0_ = iter->_set;
_tmp1_ = _g_object_ref0 (_tmp0_);
_g_object_unref0 (self->_set);
self->_set = _tmp1_;
self->_index = iter->_index;
_tmp2_ = iter->_node;
self->_node = _tmp2_;
_tmp3_ = iter->_next;
self->_next = _tmp3_;
return self;
}
static GeeHashSetIterator*
gee_hash_set_iterator_new_from_iterator (GType g_type,
GBoxedCopyFunc g_dup_func,
GDestroyNotify g_destroy_func,
GeeHashSetIterator* iter)
{
return gee_hash_set_iterator_construct_from_iterator (GEE_HASH_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iter);
}
static gboolean
gee_hash_set_iterator_real_next (GeeIterator* base)
{
GeeHashSetIterator * self;
GeeHashSet* _tmp0_;
GeeHashSetNode* _tmp1_;
GeeHashSetNode* _tmp2_;
gboolean result;
self = (GeeHashSetIterator*) base;
_tmp0_ = self->_set;
_vala_assert (self->_stamp == _tmp0_->priv->_stamp, "_stamp == _set._stamp");
if (!gee_iterator_has_next ((GeeIterator*) self)) {
result = FALSE;
return result;
}
_tmp1_ = self->_next;
self->_node = _tmp1_;
self->_next = NULL;
_tmp2_ = self->_node;
result = _tmp2_ != NULL;
return result;
}
static gboolean
gee_hash_set_iterator_real_has_next (GeeIterator* base)
{
GeeHashSetIterator * self;
GeeHashSet* _tmp0_;
GeeHashSetNode* _tmp1_;
GeeHashSetNode* _tmp13_;
gboolean result;
self = (GeeHashSetIterator*) base;
_tmp0_ = self->_set;
_vala_assert (self->_stamp == _tmp0_->priv->_stamp, "_stamp == _set._stamp");
_tmp1_ = self->_next;
if (_tmp1_ == NULL) {
GeeHashSetNode* _tmp2_;
GeeHashSetNode* _tmp3_;
_tmp2_ = self->_node;
self->_next = _tmp2_;
_tmp3_ = self->_next;
if (_tmp3_ != NULL) {
GeeHashSetNode* _tmp4_;
GeeHashSetNode* _tmp5_;
_tmp4_ = self->_next;
_tmp5_ = _tmp4_->next;
self->_next = _tmp5_;
}
while (TRUE) {
gboolean _tmp6_ = FALSE;
GeeHashSetNode* _tmp7_;
gint _tmp9_;
GeeHashSet* _tmp10_;
GeeHashSetNode** _tmp11_;
gint _tmp11__length1;
GeeHashSetNode* _tmp12_;
_tmp7_ = self->_next;
if (_tmp7_ == NULL) {
GeeHashSet* _tmp8_;
_tmp8_ = self->_set;
_tmp6_ = (self->_index + 1) < _tmp8_->priv->_array_size;
} else {
_tmp6_ = FALSE;
}
if (!_tmp6_) {
break;
}
_tmp9_ = self->_index;
self->_index = _tmp9_ + 1;
_tmp10_ = self->_set;
_tmp11_ = _tmp10_->priv->_nodes;
_tmp11__length1 = _tmp10_->priv->_nodes_length1;
_tmp12_ = _tmp11_[self->_index];
self->_next = _tmp12_;
}
}
_tmp13_ = self->_next;
result = _tmp13_ != NULL;
return result;
}
static gpointer
gee_hash_set_iterator_real_get (GeeIterator* base)
{
GeeHashSetIterator * self;
GeeHashSet* _tmp0_;
GeeHashSetNode* _tmp1_;
GeeHashSetNode* _tmp2_;
gconstpointer _tmp3_;
gpointer _tmp4_;
gpointer result;
self = (GeeHashSetIterator*) base;
_tmp0_ = self->_set;
_vala_assert (self->_stamp == _tmp0_->priv->_stamp, "_stamp == _set._stamp");
_tmp1_ = self->_node;
_vala_assert (_tmp1_ != NULL, "_node != null");
_tmp2_ = self->_node;
_tmp3_ = _tmp2_->key;
_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_hash_set_iterator_real_remove (GeeIterator* base)
{
GeeHashSetIterator * self;
GeeHashSet* _tmp0_;
GeeHashSetNode* _tmp1_;
GeeHashSet* _tmp2_;
GeeHashSetNode* _tmp3_;
gconstpointer _tmp4_;
GeeHashSet* _tmp5_;
self = (GeeHashSetIterator*) base;
_tmp0_ = self->_set;
_vala_assert (self->_stamp == _tmp0_->priv->_stamp, "_stamp == _set._stamp");
_tmp1_ = self->_node;
_vala_assert (_tmp1_ != NULL, "_node != null");
gee_iterator_has_next ((GeeIterator*) self);
_tmp2_ = self->_set;
_tmp3_ = self->_node;
_tmp4_ = _tmp3_->key;
gee_hash_set_remove_helper (_tmp2_, _tmp4_);
self->_node = NULL;
_tmp5_ = self->_set;
self->_stamp = _tmp5_->priv->_stamp;
}
static gboolean
gee_hash_set_iterator_real_foreach (GeeTraversable* base,
GeeForallFunc f,
gpointer f_target)
{
GeeHashSetIterator * self;
GeeHashSet* _tmp0_;
GeeHashSetNode* node = NULL;
GeeHashSetNode* _tmp1_;
GeeHashSetNode* next = NULL;
GeeHashSetNode* _tmp2_;
GeeHashSetNode* current = NULL;
GeeHashSetNode* prev = NULL;
GeeHashSetNode* _tmp3_;
GeeHashSetNode* _tmp10_;
GeeHashSetNode* _tmp35_;
gboolean result;
self = (GeeHashSetIterator*) base;
_tmp0_ = self->_set;
_vala_assert (self->_stamp == _tmp0_->priv->_stamp, "_stamp == _set._stamp");
_tmp1_ = self->_node;
node = _tmp1_;
_tmp2_ = self->_next;
next = _tmp2_;
current = NULL;
prev = NULL;
_tmp3_ = node;
if (_tmp3_ != NULL) {
GeeHashSetNode* _tmp4_;
gconstpointer _tmp5_;
gpointer _tmp6_;
GeeHashSetNode* _tmp7_;
GeeHashSetNode* _tmp8_;
GeeHashSetNode* _tmp9_;
_tmp4_ = node;
_tmp5_ = _tmp4_->key;
_tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
if (!f (_tmp6_, f_target)) {
result = FALSE;
return result;
}
_tmp7_ = node;
prev = _tmp7_;
_tmp8_ = node;
_tmp9_ = _tmp8_->next;
current = _tmp9_;
}
_tmp10_ = next;
if (_tmp10_ != NULL) {
GeeHashSetNode* _tmp11_;
gconstpointer _tmp12_;
gpointer _tmp13_;
GeeHashSetNode* _tmp15_;
GeeHashSetNode* _tmp16_;
GeeHashSetNode* _tmp17_;
_tmp11_ = next;
_tmp12_ = _tmp11_->key;
_tmp13_ = ((_tmp12_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp12_) : ((gpointer) _tmp12_);
if (!f (_tmp13_, f_target)) {
GeeHashSetNode* _tmp14_;
_tmp14_ = next;
self->_node = _tmp14_;
self->_next = NULL;
result = FALSE;
return result;
}
_tmp15_ = next;
prev = _tmp15_;
_tmp16_ = next;
_tmp17_ = _tmp16_->next;
current = _tmp17_;
}
{
gboolean _tmp18_ = FALSE;
_tmp18_ = TRUE;
while (TRUE) {
if (!_tmp18_) {
GeeHashSetNode* _tmp19_;
_tmp19_ = current;
if (!(_tmp19_ != NULL)) {
break;
}
}
_tmp18_ = FALSE;
while (TRUE) {
GeeHashSetNode* _tmp20_;
GeeHashSetNode* _tmp21_;
gconstpointer _tmp22_;
gpointer _tmp23_;
GeeHashSetNode* _tmp25_;
GeeHashSetNode* _tmp26_;
GeeHashSetNode* _tmp27_;
_tmp20_ = current;
if (!(_tmp20_ != NULL)) {
break;
}
_tmp21_ = current;
_tmp22_ = _tmp21_->key;
_tmp23_ = ((_tmp22_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp22_) : ((gpointer) _tmp22_);
if (!f (_tmp23_, f_target)) {
GeeHashSetNode* _tmp24_;
_tmp24_ = current;
self->_node = _tmp24_;
self->_next = NULL;
result = FALSE;
return result;
}
_tmp25_ = current;
prev = _tmp25_;
_tmp26_ = current;
_tmp27_ = _tmp26_->next;
current = _tmp27_;
}
while (TRUE) {
gboolean _tmp28_ = FALSE;
GeeHashSetNode* _tmp29_;
gint _tmp31_;
GeeHashSet* _tmp32_;
GeeHashSetNode** _tmp33_;
gint _tmp33__length1;
GeeHashSetNode* _tmp34_;
_tmp29_ = current;
if (_tmp29_ == NULL) {
GeeHashSet* _tmp30_;
_tmp30_ = self->_set;
_tmp28_ = (self->_index + 1) < _tmp30_->priv->_array_size;
} else {
_tmp28_ = FALSE;
}
if (!_tmp28_) {
break;
}
_tmp31_ = self->_index;
self->_index = _tmp31_ + 1;
_tmp32_ = self->_set;
_tmp33_ = _tmp32_->priv->_nodes;
_tmp33__length1 = _tmp32_->priv->_nodes_length1;
_tmp34_ = _tmp33_[self->_index];
current = _tmp34_;
}
}
}
_tmp35_ = prev;
self->_node = _tmp35_;
self->_next = NULL;
result = TRUE;
return result;
}
static GeeIterator**
gee_hash_set_iterator_real_tee (GeeTraversable* base,
guint forks,
gint* result_length1)
{
GeeHashSetIterator * self;
GeeIterator** result;
self = (GeeHashSetIterator*) base;
if (forks == ((guint) 0)) {
GeeIterator** _tmp0_;
GeeIterator** _tmp1_;
gint _tmp1__length1;
_tmp0_ = g_new0 (GeeIterator*, 0 + 1);
_tmp1_ = _tmp0_;
_tmp1__length1 = 0;
if (result_length1) {
*result_length1 = _tmp1__length1;
}
result = _tmp1_;
return result;
} else {
GeeIterator** _result_ = NULL;
GeeIterator** _tmp2_;
gint _result__length1;
gint __result__size_;
GeeIterator** _tmp3_;
gint _tmp3__length1;
GeeIterator* _tmp4_;
GeeIterator** _tmp9_;
gint _tmp9__length1;
_tmp2_ = g_new0 (GeeIterator*, forks + 1);
_result_ = _tmp2_;
_result__length1 = forks;
__result__size_ = _result__length1;
_tmp3_ = _result_;
_tmp3__length1 = _result__length1;
_tmp4_ = _g_object_ref0 ((GeeIterator*) self);
_g_object_unref0 (_tmp3_[0]);
_tmp3_[0] = _tmp4_;
{
guint i = 0U;
i = (guint) 1;
{
gboolean _tmp5_ = FALSE;
_tmp5_ = TRUE;
while (TRUE) {
GeeIterator** _tmp7_;
gint _tmp7__length1;
GeeHashSetIterator* _tmp8_;
if (!_tmp5_) {
guint _tmp6_;
_tmp6_ = i;
i = _tmp6_ + 1;
}
_tmp5_ = FALSE;
if (!(i < forks)) {
break;
}
_tmp7_ = _result_;
_tmp7__length1 = _result__length1;
_tmp8_ = gee_hash_set_iterator_new_from_iterator (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self);
_g_object_unref0 (_tmp7_[0]);
_tmp7_[0] = (GeeIterator*) _tmp8_;
}
}
}
_tmp9_ = _result_;
_tmp9__length1 = _result__length1;
if (result_length1) {
*result_length1 = _tmp9__length1;
}
result = _tmp9_;
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->_node;
result = _tmp0_ != NULL;
return result;
}
static void
gee_hash_set_iterator_class_init (GeeHashSetIteratorClass * klass,
gpointer klass_data)
{
gee_hash_set_iterator_parent_class = g_type_class_peek_parent (klass);
g_type_class_adjust_private_offset (klass, &GeeHashSetIterator_private_offset);
G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_set_iterator_get_property;
G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_set_iterator_set_property;
G_OBJECT_CLASS (klass)->finalize = gee_hash_set_iterator_finalize;
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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_READ_ONLY_PROPERTY, gee_hash_set_iterator_properties[GEE_HASH_SET_ITERATOR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_VALID_PROPERTY, gee_hash_set_iterator_properties[GEE_HASH_SET_ITERATOR_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}
static GType
gee_hash_set_iterator_gee_traversable_get_g_type (GeeHashSetIterator* self)
{
return (GType) self->priv->g_type;
}
static GBoxedCopyFunc
gee_hash_set_iterator_gee_traversable_get_g_dup_func (GeeHashSetIterator* self)
{
return (GBoxedCopyFunc) self->priv->g_dup_func;
}
static GDestroyNotify
gee_hash_set_iterator_gee_traversable_get_g_destroy_func (GeeHashSetIterator* self)
{
return (GDestroyNotify) self->priv->g_destroy_func;
}
static void
gee_hash_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface,
gpointer iface_data)
{
gee_hash_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
iface->foreach = (gboolean (*) (GeeTraversable*, GeeForallFunc, gpointer)) gee_hash_set_iterator_real_foreach;
iface->tee = (GeeIterator** (*) (GeeTraversable*, guint, gint*)) gee_hash_set_iterator_real_tee;
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;
}
static void
gee_hash_set_iterator_gee_iterator_interface_init (GeeIteratorIface * iface,
gpointer iface_data)
{
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->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;
}
static void
gee_hash_set_iterator_instance_init (GeeHashSetIterator * self,
gpointer klass)
{
self->priv = gee_hash_set_iterator_get_instance_private (self);
self->_index = -1;
self->_stamp = 0;
}
static void
gee_hash_set_iterator_finalize (GObject * obj)
{
GeeHashSetIterator * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator);
_g_object_unref0 (self->_set);
G_OBJECT_CLASS (gee_hash_set_iterator_parent_class)->finalize (obj);
}
static GType
gee_hash_set_iterator_get_type_once (void)
{
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);
GeeHashSetIterator_private_offset = g_type_add_instance_private (gee_hash_set_iterator_type_id, sizeof (GeeHashSetIteratorPrivate));
return gee_hash_set_iterator_type_id;
}
static GType
gee_hash_set_iterator_get_type (void)
{
static volatile gsize gee_hash_set_iterator_type_id__once = 0;
if (g_once_init_enter (&gee_hash_set_iterator_type_id__once)) {
GType gee_hash_set_iterator_type_id;
gee_hash_set_iterator_type_id = gee_hash_set_iterator_get_type_once ();
g_once_init_leave (&gee_hash_set_iterator_type_id__once, gee_hash_set_iterator_type_id);
}
return gee_hash_set_iterator_type_id__once;
}
static void
_vala_gee_hash_set_iterator_get_property (GObject * object,
guint property_id,
GValue * value,
GParamSpec * pspec)
{
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_PROPERTY:
g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
break;
case GEE_HASH_SET_ITERATOR_VALID_PROPERTY:
g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
break;
case GEE_HASH_SET_ITERATOR_G_TYPE:
g_value_set_gtype (value, self->priv->g_type);
break;
case GEE_HASH_SET_ITERATOR_G_DUP_FUNC:
g_value_set_pointer (value, self->priv->g_dup_func);
break;
case GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC:
g_value_set_pointer (value, self->priv->g_destroy_func);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
_vala_gee_hash_set_iterator_set_property (GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec)
{
GeeHashSetIterator * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator);
switch (property_id) {
case GEE_HASH_SET_ITERATOR_G_TYPE:
self->priv->g_type = g_value_get_gtype (value);
break;
case GEE_HASH_SET_ITERATOR_G_DUP_FUNC:
self->priv->g_dup_func = g_value_get_pointer (value);
break;
case GEE_HASH_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 void
gee_hash_set_class_init (GeeHashSetClass * klass,
gpointer klass_data)
{
gee_hash_set_parent_class = g_type_class_peek_parent (klass);
g_type_class_adjust_private_offset (klass, &GeeHashSet_private_offset);
((GeeAbstractCollectionClass *) klass)->contains = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_hash_set_real_contains;
((GeeAbstractCollectionClass *) klass)->iterator = (GeeIterator* (*) (GeeAbstractCollection*)) gee_hash_set_real_iterator;
((GeeAbstractCollectionClass *) klass)->add = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_hash_set_real_add;
((GeeAbstractCollectionClass *) klass)->remove = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_hash_set_real_remove;
((GeeAbstractCollectionClass *) klass)->clear = (void (*) (GeeAbstractCollection*)) gee_hash_set_real_clear;
((GeeAbstractCollectionClass *) klass)->foreach = (gboolean (*) (GeeAbstractCollection*, GeeForallFunc, gpointer)) gee_hash_set_real_foreach;
GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = (gint (*) (GeeAbstractCollection*)) gee_hash_set_real_get_size;
GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = (gboolean (*) (GeeAbstractCollection*)) 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;
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/**
* {@inheritDoc}
*/
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_SIZE_PROPERTY, gee_hash_set_properties[GEE_HASH_SET_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
/**
* {@inheritDoc}
*/
g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_READ_ONLY_PROPERTY, gee_hash_set_properties[GEE_HASH_SET_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}
static void
gee_hash_set_instance_init (GeeHashSet * self,
gpointer klass)
{
self->priv = gee_hash_set_get_instance_private (self);
self->priv->_stamp = 0;
}
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->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
_gee_functions_hash_data_func_closure_unref0 (self->priv->_hash_func);
_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
G_OBJECT_CLASS (gee_hash_set_parent_class)->finalize (obj);
}
/**
* Hash table implementation of the {@link Set} interface.
*
* This implementation is better fit for highly heterogeneous values.
* In case of high value hashes redundancy or higher amount of data prefer using
* tree implementation like {@link TreeSet}.
*
* @see TreeSet
*/
static GType
gee_hash_set_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (GeeHashSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashSet), 0, (GInstanceInitFunc) gee_hash_set_instance_init, NULL };
GType gee_hash_set_type_id;
gee_hash_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeHashSet", &g_define_type_info, 0);
GeeHashSet_private_offset = g_type_add_instance_private (gee_hash_set_type_id, sizeof (GeeHashSetPrivate));
return gee_hash_set_type_id;
}
GType
gee_hash_set_get_type (void)
{
static volatile gsize gee_hash_set_type_id__once = 0;
if (g_once_init_enter (&gee_hash_set_type_id__once)) {
GType gee_hash_set_type_id;
gee_hash_set_type_id = gee_hash_set_get_type_once ();
g_once_init_leave (&gee_hash_set_type_id__once, gee_hash_set_type_id);
}
return gee_hash_set_type_id__once;
}
static void
_vala_gee_hash_set_get_property (GObject * object,
guint property_id,
GValue * value,
GParamSpec * pspec)
{
GeeHashSet * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_SET, GeeHashSet);
switch (property_id) {
case GEE_HASH_SET_SIZE_PROPERTY:
g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
break;
case GEE_HASH_SET_READ_ONLY_PROPERTY:
g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
break;
case GEE_HASH_SET_G_TYPE:
g_value_set_gtype (value, self->priv->g_type);
break;
case GEE_HASH_SET_G_DUP_FUNC:
g_value_set_pointer (value, self->priv->g_dup_func);
break;
case GEE_HASH_SET_G_DESTROY_FUNC:
g_value_set_pointer (value, self->priv->g_destroy_func);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
_vala_gee_hash_set_set_property (GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec)
{
GeeHashSet * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_SET, GeeHashSet);
switch (property_id) {
case GEE_HASH_SET_G_TYPE:
self->priv->g_type = g_value_get_gtype (value);
break;
case GEE_HASH_SET_G_DUP_FUNC:
self->priv->g_dup_func = g_value_get_pointer (value);
break;
case GEE_HASH_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,
gssize array_length,
GDestroyNotify destroy_func)
{
if ((array != NULL) && (destroy_func != NULL)) {
gssize 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,
gssize array_length,
GDestroyNotify destroy_func)
{
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
|