src/sortlist_type.h
author smatz
Tue, 27 May 2008 00:13:51 +0000
changeset 10730 40906a6f031e
parent 10729 d2adc1c2e5c0
child 10736 e3111a03f9c2
permissions -rw-r--r--
(svn r13280) -Fix (r13276): MSVC compilation was broken
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     2
10596
0ee9eba64c9c (svn r13140) -Codechange: move the gui-list-sorting out of window_gui.h so window_gui.h only needs to be included in *_gui.cpp.
rubidium
parents: 10595
diff changeset
     3
/** @file sortlist_type.h Base types for having sorted lists in GUIs. */
10595
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
     4
10596
0ee9eba64c9c (svn r13140) -Codechange: move the gui-list-sorting out of window_gui.h so window_gui.h only needs to be included in *_gui.cpp.
rubidium
parents: 10595
diff changeset
     5
#ifndef SORTLIST_TYPE_H
0ee9eba64c9c (svn r13140) -Codechange: move the gui-list-sorting out of window_gui.h so window_gui.h only needs to be included in *_gui.cpp.
rubidium
parents: 10595
diff changeset
     6
#define SORTLIST_TYPE_H
10589
2998e6072c03 (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 10586
diff changeset
     7
10716
2406d1520245 (svn r13266) -Codechange: Use SmallVector in GUIList
peter1138
parents: 10596
diff changeset
     8
#include "misc/smallvec.h"
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
     9
#include "date_type.h"
10716
2406d1520245 (svn r13266) -Codechange: Use SmallVector in GUIList
peter1138
parents: 10596
diff changeset
    10
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    11
enum SortListFlags {
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    12
	VL_NONE       = 0,      ///< no sort
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    13
	VL_DESC       = 1 << 0, ///< sort descending or ascending
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    14
	VL_RESORT     = 1 << 1, ///< instruct the code to resort the list in the next loop
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    15
	VL_REBUILD    = 1 << 2, ///< rebuild the sort list
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    16
	VL_FIRST_SORT = 1 << 3, ///< sort with qsort first
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    17
	VL_END        = 1 << 4,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    18
};
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    19
DECLARE_ENUM_AS_BIT_SET(SortListFlags);
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    20
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    21
struct Listing {
6443
b8f06d8eb7be (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6350
diff changeset
    22
	bool order;    ///< Ascending/descending
b8f06d8eb7be (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6350
diff changeset
    23
	byte criteria; ///< Sorting criteria
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    24
};
588
1b60458bdc29 (svn r1009) -Feature: per-station vehicle lists
tron
parents: 543
diff changeset
    25
10502
996d9308d650 (svn r13045) -Codechange: make list_d (now GUIList) more generic and uniform.
rubidium
parents: 10498
diff changeset
    26
template <typename T>
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    27
class GUIList : public SmallVector<T, 32> {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    28
public:
10730
40906a6f031e (svn r13280) -Fix (r13276): MSVC compilation was broken
smatz
parents: 10729
diff changeset
    29
	typedef int CDECL SortFunction(const T*, const T*);
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    30
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    31
public: // Temporary: public for conversion only
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    32
	SortFunction* const *func_list; ///< The sort criteria functions
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    33
	SortListFlags flags;            ///< used to control sorting/resorting/etc.
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    34
	uint8 sort_type;                ///< what criteria to sort on
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    35
	uint16 resort_timer;            ///< resort list after a given amount of ticks if set
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    36
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    37
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    38
	 * Check if the list is sortable
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    39
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    40
	 * @return true if we can sort the list
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    41
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    42
	bool IsSortable() const
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    43
	{
10725
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
    44
		return (this->data != NULL && this->items >= 2);
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    45
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    46
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    47
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    48
	 * Reset the resort timer
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    49
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    50
	void ResetResortTimer()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    51
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    52
		/* Resort every 10 days */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    53
		this->resort_timer = DAY_TICKS * 10;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    54
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    55
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    56
	/**
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    57
	 * Reverse the list
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    58
	 */
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    59
	void Reverse()
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    60
	{
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    61
		assert(this->IsSortable());
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    62
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    63
		T *a = this->data;
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    64
		T *b = a + (this->items - 1);
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    65
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    66
		do {
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    67
			Swap(*a, *b);
10729
d2adc1c2e5c0 (svn r13279) -Codechange: simplify condition for terminating loop when reversing list order
smatz
parents: 10726
diff changeset
    68
		} while (++a < --b);
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    69
	}
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    70
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    71
public:
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    72
	GUIList() :
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    73
		func_list(NULL),
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    74
		flags(VL_FIRST_SORT),
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    75
		sort_type(0),
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    76
		resort_timer(1)
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    77
	{};
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    78
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    79
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    80
	 * Get the sorttype of the list
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    81
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    82
	 * @return The current sorttype
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    83
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    84
	uint8 SortType() const
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    85
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    86
		return this->sort_type;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    87
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    88
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    89
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    90
	 * Set the sorttype of the list
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    91
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    92
	 * @param n_type the new sort type
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    93
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    94
	void SetSortType(uint8 n_type)
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    95
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    96
		if (this->sort_type != n_type) {
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
    97
			SETBITS(this->flags, VL_RESORT | VL_FIRST_SORT);
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    98
			this->sort_type = n_type;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
    99
		}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   100
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   101
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   102
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   103
	 * Export current sort conditions
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   104
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   105
	 * @return the current sort conditions
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   106
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   107
	Listing GetListing() const
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   108
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   109
		Listing l;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   110
		l.order = HASBITS(this->flags, VL_DESC);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   111
		l.criteria = this->sort_type;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   112
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   113
		return l;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   114
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   115
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   116
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   117
	 * Import sort conditions
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   118
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   119
	 * @param l The sport conditions we want to use
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   120
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   121
	void SetListing(Listing l)
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   122
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   123
		if (l.order) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   124
			SETBITS(this->flags, VL_DESC);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   125
		} else {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   126
			CLRBITS(this->flags, VL_DESC);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   127
		}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   128
		this->sort_type = l.criteria;
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   129
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   130
		SETBITS(this->flags, VL_FIRST_SORT);
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   131
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   132
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   133
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   134
	 * Check if a resort is needed next loop
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   135
	 *  If used the resort timer will decrease every call
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   136
	 *  till 0. If 0 reached the resort bit will be set and
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   137
	 *  the timer will be reset.
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   138
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   139
	 * @return true if resort bit is set for next loop
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   140
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   141
	bool NeedResort()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   142
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   143
		if (--this->resort_timer == 0) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   144
			SETBITS(this->flags, VL_RESORT);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   145
			this->ResetResortTimer();
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   146
			return true;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   147
		}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   148
		return false;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   149
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   150
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   151
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   152
	 * Force a resort next Sort call
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   153
	 *  Reset the resort timer if used too.
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   154
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   155
	void ForceResort()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   156
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   157
		SETBITS(this->flags, VL_RESORT);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   158
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   159
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   160
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   161
	 * Check if the sort order is descending
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   162
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   163
	 * @return true if the sort order is descending
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   164
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   165
	bool IsDescSortOrder() const
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   166
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   167
		return HASBITS(this->flags, VL_DESC);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   168
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   169
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   170
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   171
	 * Toogle the sort order
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   172
	 *  Since that is the worst condition for the sort function
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   173
	 *  reverse the list here.
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   174
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   175
	FORCEINLINE void ToggleSortOrder()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   176
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   177
		this->flags ^= VL_DESC;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   178
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   179
		if (this->IsSortable()) this->Reverse();
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   180
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   181
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   182
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   183
	 * GnomeSort algorithm
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   184
	 *  This sorting uses a slightly modifyied Gnome search.
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   185
	 *  The basic Gnome search trys to sort already sorted
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   186
	 *  list parts. The modification skips these. For the first
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   187
	 *  sorting we use qsort since it is faster for irregular
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   188
	 *  sorted data.
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   189
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   190
	 * @param compare The function to compare two list items
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   191
	 * */
10730
40906a6f031e (svn r13280) -Fix (r13276): MSVC compilation was broken
smatz
parents: 10729
diff changeset
   192
	FORCEINLINE void Sort(SortFunction *compare)
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   193
	{
10725
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   194
		/* Do not sort if the resort bit is not set */
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   195
		if (!HASBITS(this->flags, VL_RESORT)) return;
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   196
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   197
		CLRBITS(this->flags, VL_RESORT);
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   198
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   199
		this->ResetResortTimer();
73a2e153ff13 (svn r13275) -Fix: sort lists with 2 items, too
smatz
parents: 10717
diff changeset
   200
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   201
		/* Do not sort when the list is not sortable */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   202
		if (!this->IsSortable()) return;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   203
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   204
		const bool desc = HASBITS(this->flags, VL_DESC);
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   205
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   206
		if (HASBITS(this->flags, VL_FIRST_SORT)) {
10730
40906a6f031e (svn r13280) -Fix (r13276): MSVC compilation was broken
smatz
parents: 10729
diff changeset
   207
			qsort(this->data, this->items, sizeof(T), (int (CDECL *)(const void *, const void *))compare);
10726
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   208
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   209
			if (desc) this->Reverse();
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   210
			return;
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   211
		}
55b2fac285ca (svn r13276) -Codechange: use qsort() for initial sorting of a list for better performance (credits go to skidd13 and peter1138)
smatz
parents: 10725
diff changeset
   212
10717
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   213
		T *a = this->data;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   214
		T *b = a + 1;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   215
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   216
		uint length = this->items;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   217
		uint offset = 0; // Jump variable
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   218
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   219
		while (length > 1) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   220
			const int diff = compare(a, b);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   221
			if ((!desc && diff <= 0) || (desc && diff >= 0)) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   222
				if (offset != 0) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   223
					/* Jump back to the last direction switch point */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   224
					a += offset;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   225
					b += offset;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   226
					offset = 0;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   227
					continue;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   228
				}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   229
				a++;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   230
				b++;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   231
				length--;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   232
			} else {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   233
				Swap(*a, *b);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   234
				if (a != this->data) {
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   235
					offset++;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   236
					a--;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   237
					b--;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   238
				}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   239
			}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   240
		}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   241
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   242
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   243
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   244
	 * Hand the array of sort function pointers to the sort list
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   245
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   246
	 * @param n_funcs The pointer to the first sort func
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   247
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   248
	void SetSortFuncs(SortFunction* const* n_funcs)
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   249
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   250
		this->func_list = n_funcs;
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   251
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   252
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   253
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   254
	 * Overload of Sort()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   255
	 * Overloaded to reduce external code
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   256
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   257
	void Sort()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   258
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   259
		assert(this->func_list != NULL);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   260
		this->Sort(this->func_list[this->sort_type]);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   261
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   262
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   263
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   264
	 * Check if a rebuild is needed
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   265
	 * @return true if a rebuild is needed
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   266
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   267
	bool NeedRebuild() const
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   268
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   269
		return HASBITS(this->flags, VL_REBUILD);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   270
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   271
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   272
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   273
	 * Force that a rebuild is needed
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   274
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   275
	void ForceRebuild()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   276
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   277
		SETBITS(this->flags, VL_REBUILD);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   278
	}
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   279
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   280
	/**
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   281
	 * Notify the sortlist that the rebuild is done
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   282
	 *
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   283
	 * @note This forces a resort
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   284
	 */
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   285
	void RebuildDone()
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   286
	{
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   287
		CLRBITS(this->flags, VL_REBUILD);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   288
		SETBITS(this->flags, VL_RESORT);
996d586844d9 (svn r13267) -Codechange: extend GUIList with a GnomeSort
skidd13
parents: 10716
diff changeset
   289
	}
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   290
};
7139
4ae3ab180d05 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13.
rubidium
parents: 7134
diff changeset
   291
10596
0ee9eba64c9c (svn r13140) -Codechange: move the gui-list-sorting out of window_gui.h so window_gui.h only needs to be included in *_gui.cpp.
rubidium
parents: 10595
diff changeset
   292
#endif /* SORTLIST_TYPE_H */