summaryrefslogtreecommitdiff
path: root/src/core/DataSet.c
blob: 75c2ca289734f066c03ca2a180da7e3502e3047e (plain)
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
/* DataSet.c generated by valac 0.32.1, the Vala compiler
 * generated from DataSet.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */
/**/
/* DataSet*/
/**/
/* A DataSet is a collection class used for internal implementations of DataCollection*/
/* and its children.  It may be of use to other classes, however.*/
/**/
/* The general purpose of DataSet is to provide low-cost implementations of various collection*/
/* operations at a cost of internally maintaining its objects in more than one simple collection.*/
/* contains(), for example, can return a result with hash-table performance while notions of*/
/* ordering are maintained by a SortedList.  The cost is in adding and removing objects (in general,*/
/* there are others).*/
/**/
/* Because this class has no signalling mechanisms and does not manipulate DataObjects in ways*/
/* they expect to be manipulated (these features are performed by DataCollection), it's probably*/
/* best not to use this class.  Even in cases of building a list of DataObjects for some quick*/
/* operation is probably best done by a Gee.ArrayList.*/
/**/
/* ComparatorPredicate is used to determine if a re-sort operation is necessary; it has no*/
/* effect on adding a DataObject to a DataSet in sorted order.*/

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>


#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define TYPE_DATA_SET (data_set_get_type ())
#define DATA_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SET, DataSet))
#define DATA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SET, DataSetClass))
#define IS_DATA_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SET))
#define IS_DATA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SET))
#define DATA_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SET, DataSetClass))

typedef struct _DataSet DataSet;
typedef struct _DataSetClass DataSetClass;
typedef struct _DataSetPrivate DataSetPrivate;

#define TYPE_SORTED_LIST (sorted_list_get_type ())
#define SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_LIST, SortedList))
#define SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_LIST, SortedListClass))
#define IS_SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_LIST))
#define IS_SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_LIST))
#define SORTED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_LIST, SortedListClass))

typedef struct _SortedList SortedList;
typedef struct _SortedListClass SortedListClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _data_set_unref0(var) ((var == NULL) ? NULL : (var = (data_set_unref (var), NULL)))
typedef struct _ParamSpecDataSet ParamSpecDataSet;
#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);

typedef gboolean (*ComparatorPredicate) (DataObject* object, Alteration* alteration, void* user_data);
struct _DataSet {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DataSetPrivate * priv;
};

struct _DataSetClass {
	GTypeClass parent_class;
	void (*finalize) (DataSet *self);
};

typedef gint64 (*Comparator) (void* a, void* b, void* user_data);
struct _DataSetPrivate {
	SortedList* list;
	GeeHashSet* hash_set;
	Comparator user_comparator;
	gpointer user_comparator_target;
	ComparatorPredicate comparator_predicate;
	gpointer comparator_predicate_target;
};

struct _ParamSpecDataSet {
	GParamSpec parent_instance;
};


static gpointer data_set_parent_class = NULL;

GType data_object_get_type (void) G_GNUC_CONST;
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
gpointer data_set_ref (gpointer instance);
void data_set_unref (gpointer instance);
GParamSpec* param_spec_data_set (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_set (GValue* value, gpointer v_object);
void value_take_data_set (GValue* value, gpointer v_object);
gpointer value_get_data_set (const GValue* value);
GType data_set_get_type (void) G_GNUC_CONST;
GType sorted_list_get_type (void) G_GNUC_CONST;
#define DATA_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DATA_SET, DataSetPrivate))
enum  {
	DATA_SET_DUMMY_PROPERTY
};
SortedList* sorted_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, Comparator cmp, void* cmp_target);
SortedList* sorted_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, Comparator cmp, void* cmp_target);
DataSet* data_set_new (void);
DataSet* data_set_construct (GType object_type);
void data_set_reset_comparator (DataSet* self);
static gint64 data_set_order_added_comparator (DataSet* self, void* a, void* b);
gint64 data_object_internal_get_ordinal (DataObject* self);
static gboolean data_set_order_added_predicate (DataSet* self, DataObject* object, Alteration* alteration);
static gint64 data_set_comparator_wrapper (DataSet* self, void* a, void* b);
gboolean data_set_contains (DataSet* self, DataObject* object);
gint data_set_get_count (DataSet* self);
gint sorted_list_get_count (SortedList* self);
static gboolean _data_set_order_added_predicate_comparator_predicate (DataObject* object, Alteration* alteration, gpointer self);
void sorted_list_resort (SortedList* self, Comparator new_cmp, void* new_cmp_target);
static gint64 _data_set_order_added_comparator_comparator (void* a, void* b, gpointer self);
Comparator data_set_get_comparator (DataSet* self, void** result_target);
ComparatorPredicate data_set_get_comparator_predicate (DataSet* self, void** result_target);
void data_set_set_comparator (DataSet* self, Comparator user_comparator, void* user_comparator_target, ComparatorPredicate comparator_predicate, void* comparator_predicate_target);
static gint64 _data_set_comparator_wrapper_comparator (void* a, void* b, gpointer self);
GeeList* data_set_get_all (DataSet* self);
GeeList* sorted_list_get_read_only_view_as_list (SortedList* self);
DataSet* data_set_copy (DataSet* self);
SortedList* sorted_list_copy (SortedList* self);
DataObject* data_set_get_at (DataSet* self, gint index);
gpointer sorted_list_get_at (SortedList* self, gint index);
gint data_set_index_of (DataSet* self, DataObject* object);
gint sorted_list_locate (SortedList* self, gconstpointer search, gboolean altered, GEqualFunc equal_func);
gboolean data_set_add (DataSet* self, DataObject* object);
gboolean data_set_add_many (DataSet* self, GeeCollection* objects);
gboolean data_set_remove (DataSet* self, DataObject* object);
gboolean data_set_remove_many (DataSet* self, GeeCollection* objects);
gboolean data_set_resort_object (DataSet* self, DataObject* object, Alteration* alteration);
gboolean sorted_list_resort_item (SortedList* self, gconstpointer item);
static void data_set_finalize (DataSet* obj);


DataSet* data_set_construct (GType object_type) {
	DataSet* self = NULL;
#line 35 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self = (DataSet*) g_type_create_instance (object_type);
#line 36 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	data_set_reset_comparator (self);
#line 35 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return self;
#line 177 "DataSet.c"
}


DataSet* data_set_new (void) {
#line 35 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return data_set_construct (TYPE_DATA_SET);
#line 184 "DataSet.c"
}


static gint64 data_set_order_added_comparator (DataSet* self, void* a, void* b) {
	gint64 result = 0LL;
	void* _tmp0_ = NULL;
	gint64 _tmp1_ = 0LL;
	void* _tmp2_ = NULL;
	gint64 _tmp3_ = 0LL;
#line 39 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), 0LL);
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = a;
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = data_object_internal_get_ordinal (G_TYPE_CHECK_INSTANCE_CAST ((DataObject*) _tmp0_, TYPE_DATA_OBJECT, DataObject));
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = b;
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = data_object_internal_get_ordinal (G_TYPE_CHECK_INSTANCE_CAST ((DataObject*) _tmp2_, TYPE_DATA_OBJECT, DataObject));
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp1_ - _tmp3_;
#line 40 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 208 "DataSet.c"
}


static gboolean data_set_order_added_predicate (DataSet* self, DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
#line 43 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 43 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 43 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 45 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = FALSE;
#line 45 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 224 "DataSet.c"
}


static gint64 data_set_comparator_wrapper (DataSet* self, void* a, void* b) {
	gint64 result = 0LL;
	void* _tmp0_ = NULL;
	void* _tmp1_ = NULL;
	gint64 _result_ = 0LL;
	Comparator _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	gint64 _tmp7_ = 0LL;
	gint64 _tmp11_ = 0LL;
#line 48 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), 0LL);
#line 49 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = a;
#line 49 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = b;
#line 49 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp0_ == _tmp1_) {
#line 50 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = (gint64) 0;
#line 50 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 249 "DataSet.c"
	}
#line 54 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_result_ = (gint64) 0;
#line 56 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = self->priv->user_comparator;
#line 56 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2__target = self->priv->user_comparator_target;
#line 56 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp2_ != NULL) {
#line 259 "DataSet.c"
		Comparator _tmp3_ = NULL;
		void* _tmp3__target = NULL;
		void* _tmp4_ = NULL;
		void* _tmp5_ = NULL;
		gint64 _tmp6_ = 0LL;
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp3_ = self->priv->user_comparator;
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp3__target = self->priv->user_comparator_target;
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp4_ = a;
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp5_ = b;
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp6_ = _tmp3_ (_tmp4_, _tmp5_, _tmp3__target);
#line 57 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_result_ = _tmp6_;
#line 277 "DataSet.c"
	}
#line 59 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp7_ = _result_;
#line 59 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp7_ == ((gint64) 0)) {
#line 283 "DataSet.c"
		void* _tmp8_ = NULL;
		void* _tmp9_ = NULL;
		gint64 _tmp10_ = 0LL;
#line 60 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp8_ = a;
#line 60 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp9_ = b;
#line 60 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp10_ = data_set_order_added_comparator (self, _tmp8_, _tmp9_);
#line 60 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_result_ = _tmp10_;
#line 295 "DataSet.c"
	}
#line 62 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp11_ = _result_;
#line 62 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_vala_assert (_tmp11_ != ((gint64) 0), "result != 0");
#line 64 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _result_;
#line 64 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 305 "DataSet.c"
}


gboolean data_set_contains (DataSet* self, DataObject* object) {
	gboolean result = FALSE;
	GeeHashSet* _tmp0_ = NULL;
	DataObject* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
#line 67 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 67 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 68 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->hash_set;
#line 68 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = object;
#line 68 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp1_);
#line 68 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp2_;
#line 68 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 328 "DataSet.c"
}


inline gint data_set_get_count (DataSet* self) {
	gint result = 0;
	SortedList* _tmp0_ = NULL;
	gint _tmp1_ = 0;
#line 71 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), 0);
#line 72 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 72 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = sorted_list_get_count (_tmp0_);
#line 72 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp1_;
#line 72 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 346 "DataSet.c"
}


static gboolean _data_set_order_added_predicate_comparator_predicate (DataObject* object, Alteration* alteration, gpointer self) {
	gboolean result;
	result = data_set_order_added_predicate ((DataSet*) self, object, alteration);
#line 77 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 355 "DataSet.c"
}


static gint64 _data_set_order_added_comparator_comparator (void* a, void* b, gpointer self) {
	gint64 result;
	result = data_set_order_added_comparator ((DataSet*) self, a, b);
#line 78 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 364 "DataSet.c"
}


void data_set_reset_comparator (DataSet* self) {
	SortedList* _tmp0_ = NULL;
#line 75 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_if_fail (IS_DATA_SET (self));
#line 76 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->user_comparator = NULL;
#line 76 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->user_comparator_target = NULL;
#line 77 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->comparator_predicate = _data_set_order_added_predicate_comparator_predicate;
#line 77 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->comparator_predicate_target = self;
#line 78 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 78 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	sorted_list_resort (_tmp0_, _data_set_order_added_comparator_comparator, self);
#line 384 "DataSet.c"
}


Comparator data_set_get_comparator (DataSet* self, void** result_target) {
	Comparator result = NULL;
	Comparator _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	Comparator _tmp1_ = NULL;
	void* _tmp1__target = NULL;
#line 81 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), NULL);
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->user_comparator;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0__target = self->priv->user_comparator_target;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = _tmp0_;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1__target = _tmp0__target;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	*result_target = _tmp1__target;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp1_;
#line 82 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 410 "DataSet.c"
}


ComparatorPredicate data_set_get_comparator_predicate (DataSet* self, void** result_target) {
	ComparatorPredicate result = NULL;
	ComparatorPredicate _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	ComparatorPredicate _tmp1_ = NULL;
	void* _tmp1__target = NULL;
#line 85 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), NULL);
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->comparator_predicate;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0__target = self->priv->comparator_predicate_target;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = _tmp0_;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1__target = _tmp0__target;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	*result_target = _tmp1__target;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp1_;
#line 86 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 436 "DataSet.c"
}


static gint64 _data_set_comparator_wrapper_comparator (void* a, void* b, gpointer self) {
	gint64 result;
	result = data_set_comparator_wrapper ((DataSet*) self, a, b);
#line 92 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 445 "DataSet.c"
}


void data_set_set_comparator (DataSet* self, Comparator user_comparator, void* user_comparator_target, ComparatorPredicate comparator_predicate, void* comparator_predicate_target) {
	Comparator _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	ComparatorPredicate _tmp1_ = NULL;
	void* _tmp1__target = NULL;
	SortedList* _tmp2_ = NULL;
#line 89 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_if_fail (IS_DATA_SET (self));
#line 90 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = user_comparator;
#line 90 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0__target = user_comparator_target;
#line 90 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->user_comparator = _tmp0_;
#line 90 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->user_comparator_target = _tmp0__target;
#line 91 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = comparator_predicate;
#line 91 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1__target = comparator_predicate_target;
#line 91 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->comparator_predicate = _tmp1_;
#line 91 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->comparator_predicate_target = _tmp1__target;
#line 92 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = self->priv->list;
#line 92 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	sorted_list_resort (_tmp2_, _data_set_comparator_wrapper_comparator, self);
#line 477 "DataSet.c"
}


GeeList* data_set_get_all (DataSet* self) {
	GeeList* result = NULL;
	SortedList* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	GeeList* _tmp2_ = NULL;
#line 95 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), NULL);
#line 96 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 96 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = sorted_list_get_read_only_view_as_list (_tmp0_);
#line 96 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = _tmp1_;
#line 96 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp2_;
#line 96 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 498 "DataSet.c"
}


DataSet* data_set_copy (DataSet* self) {
	DataSet* result = NULL;
	DataSet* clone = NULL;
	DataSet* _tmp0_ = NULL;
	SortedList* _tmp1_ = NULL;
	SortedList* _tmp2_ = NULL;
	GeeHashSet* _tmp3_ = NULL;
	GeeHashSet* _tmp4_ = NULL;
#line 99 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), NULL);
#line 100 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = data_set_new ();
#line 100 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	clone = _tmp0_;
#line 101 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = self->priv->list;
#line 101 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = sorted_list_copy (_tmp1_);
#line 101 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_g_object_unref0 (clone->priv->list);
#line 101 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	clone->priv->list = _tmp2_;
#line 102 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = clone->priv->hash_set;
#line 102 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp4_ = self->priv->hash_set;
#line 102 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
#line 104 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = clone;
#line 104 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 534 "DataSet.c"
}


DataObject* data_set_get_at (DataSet* self, gint index) {
	DataObject* result = NULL;
	SortedList* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gpointer _tmp2_ = NULL;
#line 107 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), NULL);
#line 108 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 108 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = index;
#line 108 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = sorted_list_get_at (_tmp0_, _tmp1_);
#line 108 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = (DataObject*) _tmp2_;
#line 108 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 555 "DataSet.c"
}


gint data_set_index_of (DataSet* self, DataObject* object) {
	gint result = 0;
	SortedList* _tmp0_ = NULL;
	DataObject* _tmp1_ = NULL;
	GEqualFunc _tmp2_ = NULL;
	gint _tmp3_ = 0;
#line 111 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), 0);
#line 111 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), 0);
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = object;
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = g_direct_equal;
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = sorted_list_locate (_tmp0_, _tmp1_, FALSE, _tmp2_);
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp3_;
#line 112 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 581 "DataSet.c"
}


gboolean data_set_add (DataSet* self, DataObject* object) {
	gboolean result = FALSE;
	SortedList* _tmp0_ = NULL;
	DataObject* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GeeHashSet* _tmp3_ = NULL;
	DataObject* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
#line 116 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 116 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 117 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 117 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = object;
#line 117 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), _tmp1_);
#line 117 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp2_) {
#line 118 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = FALSE;
#line 118 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 609 "DataSet.c"
	}
#line 120 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = self->priv->hash_set;
#line 120 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp4_ = object;
#line 120 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp5_ = gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp4_);
#line 120 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp5_) {
#line 619 "DataSet.c"
		SortedList* _tmp6_ = NULL;
		DataObject* _tmp7_ = NULL;
#line 122 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp6_ = self->priv->list;
#line 122 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp7_ = object;
#line 122 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection), _tmp7_);
#line 124 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = FALSE;
#line 124 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 632 "DataSet.c"
	}
#line 127 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = TRUE;
#line 127 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 638 "DataSet.c"
}


gboolean data_set_add_many (DataSet* self, GeeCollection* objects) {
	gboolean result = FALSE;
	gint count = 0;
	GeeCollection* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	SortedList* _tmp4_ = NULL;
	GeeCollection* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	GeeHashSet* _tmp7_ = NULL;
	GeeCollection* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
#line 131 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 131 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (GEE_IS_COLLECTION (objects), FALSE);
#line 132 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = objects;
#line 132 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = gee_collection_get_size (_tmp0_);
#line 132 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = _tmp1_;
#line 132 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	count = _tmp2_;
#line 133 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = count;
#line 133 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp3_ == 0) {
#line 134 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = TRUE;
#line 134 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 675 "DataSet.c"
	}
#line 136 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp4_ = self->priv->list;
#line 136 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp5_ = objects;
#line 136 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp6_ = gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection), _tmp5_);
#line 136 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp6_) {
#line 137 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = FALSE;
#line 137 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 689 "DataSet.c"
	}
#line 139 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp7_ = self->priv->hash_set;
#line 139 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp8_ = objects;
#line 139 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp9_ = gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection), _tmp8_);
#line 139 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp9_) {
#line 699 "DataSet.c"
		SortedList* _tmp10_ = NULL;
		GeeCollection* _tmp11_ = NULL;
#line 141 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp10_ = self->priv->list;
#line 141 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp11_ = objects;
#line 141 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		gee_collection_remove_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_COLLECTION, GeeCollection), _tmp11_);
#line 143 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = FALSE;
#line 143 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 712 "DataSet.c"
	}
#line 146 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = TRUE;
#line 146 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 718 "DataSet.c"
}


gboolean data_set_remove (DataSet* self, DataObject* object) {
	gboolean result = FALSE;
	gboolean success = FALSE;
	SortedList* _tmp0_ = NULL;
	DataObject* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GeeHashSet* _tmp3_ = NULL;
	DataObject* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
#line 149 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 149 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 150 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	success = TRUE;
#line 152 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 152 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = object;
#line 152 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), _tmp1_);
#line 152 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp2_) {
#line 153 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		success = FALSE;
#line 747 "DataSet.c"
	}
#line 155 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = self->priv->hash_set;
#line 155 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp4_ = object;
#line 155 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp5_ = gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp4_);
#line 155 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp5_) {
#line 156 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		success = FALSE;
#line 759 "DataSet.c"
	}
#line 158 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = success;
#line 158 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 765 "DataSet.c"
}


gboolean data_set_remove_many (DataSet* self, GeeCollection* objects) {
	gboolean result = FALSE;
	gboolean success = FALSE;
	SortedList* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GeeHashSet* _tmp3_ = NULL;
	GeeCollection* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
#line 161 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 161 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (GEE_IS_COLLECTION (objects), FALSE);
#line 162 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	success = TRUE;
#line 164 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = self->priv->list;
#line 164 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = objects;
#line 164 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = gee_collection_remove_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), _tmp1_);
#line 164 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp2_) {
#line 165 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		success = FALSE;
#line 794 "DataSet.c"
	}
#line 167 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp3_ = self->priv->hash_set;
#line 167 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp4_ = objects;
#line 167 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp5_ = gee_collection_remove_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection), _tmp4_);
#line 167 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!_tmp5_) {
#line 168 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		success = FALSE;
#line 806 "DataSet.c"
	}
#line 170 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = success;
#line 170 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 812 "DataSet.c"
}


gboolean data_set_resort_object (DataSet* self, DataObject* object, Alteration* alteration) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ComparatorPredicate _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	SortedList* _tmp8_ = NULL;
	DataObject* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
#line 174 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_SET (self), FALSE);
#line 174 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
#line 174 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail ((alteration == NULL) || IS_ALTERATION (alteration), FALSE);
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2_ = self->priv->comparator_predicate;
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp2__target = self->priv->comparator_predicate_target;
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp2_ != NULL) {
#line 837 "DataSet.c"
		Alteration* _tmp3_ = NULL;
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp3_ = alteration;
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp1_ = _tmp3_ != NULL;
#line 843 "DataSet.c"
	} else {
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp1_ = FALSE;
#line 847 "DataSet.c"
	}
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp1_) {
#line 851 "DataSet.c"
		ComparatorPredicate _tmp4_ = NULL;
		void* _tmp4__target = NULL;
		DataObject* _tmp5_ = NULL;
		Alteration* _tmp6_ = NULL;
		gboolean _tmp7_ = FALSE;
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp4_ = self->priv->comparator_predicate;
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp4__target = self->priv->comparator_predicate_target;
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp5_ = object;
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp6_ = alteration;
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp7_ = _tmp4_ (_tmp5_, _tmp6_, _tmp4__target);
#line 176 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp0_ = !_tmp7_;
#line 869 "DataSet.c"
	} else {
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		_tmp0_ = FALSE;
#line 873 "DataSet.c"
	}
#line 175 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (_tmp0_) {
#line 177 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		result = FALSE;
#line 177 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return result;
#line 881 "DataSet.c"
	}
#line 180 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp8_ = self->priv->list;
#line 180 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp9_ = object;
#line 180 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp10_ = sorted_list_resort_item (_tmp8_, _tmp9_);
#line 180 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	result = _tmp10_;
#line 180 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return result;
#line 893 "DataSet.c"
}


static void value_data_set_init (GValue* value) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	value->data[0].v_pointer = NULL;
#line 900 "DataSet.c"
}


static void value_data_set_free_value (GValue* value) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (value->data[0].v_pointer) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		data_set_unref (value->data[0].v_pointer);
#line 909 "DataSet.c"
	}
}


static void value_data_set_copy_value (const GValue* src_value, GValue* dest_value) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (src_value->data[0].v_pointer) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		dest_value->data[0].v_pointer = data_set_ref (src_value->data[0].v_pointer);
#line 919 "DataSet.c"
	} else {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		dest_value->data[0].v_pointer = NULL;
#line 923 "DataSet.c"
	}
}


static gpointer value_data_set_peek_pointer (const GValue* value) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return value->data[0].v_pointer;
#line 931 "DataSet.c"
}


static gchar* value_data_set_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (collect_values[0].v_pointer) {
#line 938 "DataSet.c"
		DataSet* object;
		object = collect_values[0].v_pointer;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		if (object->parent_instance.g_class == NULL) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 945 "DataSet.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 949 "DataSet.c"
		}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = data_set_ref (object);
#line 953 "DataSet.c"
	} else {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = NULL;
#line 957 "DataSet.c"
	}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return NULL;
#line 961 "DataSet.c"
}


static gchar* value_data_set_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	DataSet** object_p;
	object_p = collect_values[0].v_pointer;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!object_p) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 972 "DataSet.c"
	}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (!value->data[0].v_pointer) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		*object_p = NULL;
#line 978 "DataSet.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		*object_p = value->data[0].v_pointer;
#line 982 "DataSet.c"
	} else {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		*object_p = data_set_ref (value->data[0].v_pointer);
#line 986 "DataSet.c"
	}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return NULL;
#line 990 "DataSet.c"
}


GParamSpec* param_spec_data_set (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecDataSet* spec;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_DATA_SET), NULL);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return G_PARAM_SPEC (spec);
#line 1004 "DataSet.c"
}


gpointer value_get_data_set (const GValue* value) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DATA_SET), NULL);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return value->data[0].v_pointer;
#line 1013 "DataSet.c"
}


void value_set_data_set (GValue* value, gpointer v_object) {
	DataSet* old;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DATA_SET));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	old = value->data[0].v_pointer;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (v_object) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DATA_SET));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = v_object;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		data_set_ref (value->data[0].v_pointer);
#line 1033 "DataSet.c"
	} else {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = NULL;
#line 1037 "DataSet.c"
	}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (old) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		data_set_unref (old);
#line 1043 "DataSet.c"
	}
}


void value_take_data_set (GValue* value, gpointer v_object) {
	DataSet* old;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DATA_SET));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	old = value->data[0].v_pointer;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (v_object) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DATA_SET));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = v_object;
#line 1062 "DataSet.c"
	} else {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		value->data[0].v_pointer = NULL;
#line 1066 "DataSet.c"
	}
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (old) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		data_set_unref (old);
#line 1072 "DataSet.c"
	}
}


static void data_set_class_init (DataSetClass * klass) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	data_set_parent_class = g_type_class_peek_parent (klass);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	((DataSetClass *) klass)->finalize = data_set_finalize;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_type_class_add_private (klass, sizeof (DataSetPrivate));
#line 1084 "DataSet.c"
}


static void data_set_instance_init (DataSet * self) {
	SortedList* _tmp0_ = NULL;
	GeeHashSet* _tmp1_ = NULL;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv = DATA_SET_GET_PRIVATE (self);
#line 30 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp0_ = sorted_list_new (TYPE_DATA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
#line 30 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->list = _tmp0_;
#line 31 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_tmp1_ = gee_hash_set_new (TYPE_DATA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 31 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->hash_set = _tmp1_;
#line 32 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->user_comparator = NULL;
#line 33 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->priv->comparator_predicate = NULL;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self->ref_count = 1;
#line 1107 "DataSet.c"
}


static void data_set_finalize (DataSet* obj) {
	DataSet * self;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DATA_SET, DataSet);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_signal_handlers_destroy (self);
#line 30 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_g_object_unref0 (self->priv->list);
#line 31 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	_g_object_unref0 (self->priv->hash_set);
#line 1121 "DataSet.c"
}


GType data_set_get_type (void) {
	static volatile gsize data_set_type_id__volatile = 0;
	if (g_once_init_enter (&data_set_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_data_set_init, value_data_set_free_value, value_data_set_copy_value, value_data_set_peek_pointer, "p", value_data_set_collect_value, "p", value_data_set_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (DataSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) data_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DataSet), 0, (GInstanceInitFunc) data_set_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 data_set_type_id;
		data_set_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DataSet", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&data_set_type_id__volatile, data_set_type_id);
	}
	return data_set_type_id__volatile;
}


gpointer data_set_ref (gpointer instance) {
	DataSet* self;
	self = instance;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	g_atomic_int_inc (&self->ref_count);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	return instance;
#line 1146 "DataSet.c"
}


void data_set_unref (gpointer instance) {
	DataSet* self;
	self = instance;
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		DATA_SET_GET_CLASS (self)->finalize (self);
#line 29 "/home/jens/Source/shotwell/src/core/DataSet.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 1159 "DataSet.c"
	}
}