2 * Copyright 2001-2009 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
9 #include <SupportDefs.h>
14 BList(int32 count
= 20);
15 BList(const BList
& other
);
18 BList
& operator=(const BList
& other
);
19 bool operator==(const BList
& other
) const;
20 bool operator!=(const BList
& other
) const;
22 // Adding and removing items
23 bool AddItem(void* item
, int32 index
);
24 bool AddItem(void* item
);
25 bool AddList(const BList
* list
, int32 index
);
26 bool AddList(const BList
* list
);
28 bool RemoveItem(void* item
);
29 void* RemoveItem(int32 index
);
30 bool RemoveItems(int32 index
, int32 count
);
31 bool ReplaceItem(int32 index
, void* item
);
36 void SortItems(int (*compareFunc
)(const void*,
38 bool SwapItems(int32 indexA
, int32 indexB
);
39 bool MoveItem(int32 from
, int32 to
);
42 void* ItemAt(int32 index
) const;
43 void* FirstItem() const;
44 void* ItemAtFast(int32 index
) const;
45 // does not check the array bounds!
47 void* LastItem() const;
51 bool HasItem(void* item
) const;
52 bool HasItem(const void* item
) const;
53 int32
IndexOf(void* item
) const;
54 int32
IndexOf(const void* item
) const;
55 int32
CountItems() const;
59 void DoForEach(bool (*func
)(void* item
));
60 void DoForEach(bool (*func
)(void* item
,
61 void* arg2
), void* arg2
);
64 virtual void _ReservedList1();
65 virtual void _ReservedList2();
67 bool _ResizeArray(int32 count
);
74 int32 fResizeThreshold
;