#include <LinkedList.h>
Inheritance diagram for PointeredList:
This makes enumeration, enqueueing and dequeueing fast, but looking up items by their position slow.
Definition at line 408 of file LinkedList.h.
Public Member Functions | |
void | Append (PointeredListItem *Item) |
Appends an item to the list. | |
virtual int | Compare (const PointeredListItem *Item1, const PointeredListItem *Item2) const |
Compares two items and returns -1, if the first is less than the second, 0, if both items are equal and 1, if the first is more than the second. | |
bool | Delete (PointeredListItem *Item, int(*compare)(const PointeredListItem *Item1, const PointeredListItem *Item2)) |
Deletes an item that is equal to a given item from the list. | |
bool | Delete (PointeredListItem *Item) |
Deletes an item that is equal to a given item from the list. | |
bool | Delete (long nr) |
Deletes an given item from the list. | |
void | DeleteAll () |
Deletes all items from the list. | |
void | DeleteDirectly (PointeredListItem *Item) |
Deletes a given item from the list without looking it up. | |
bool | DeleteFirst () |
Deletes the first item from the list. | |
bool | DeleteLast () |
Deletes the last item from the list. | |
PointeredListItem * | Get (const PointeredListItem *SearchItem, int(*compare)(const PointeredListItem *Item1, const PointeredListItem *Item2)) const |
Returns an item that is equal to a given item. | |
PointeredListItem * | Get (const PointeredListItem *SearchItem) const |
Returns an item that is equal to a given item. | |
PointeredListItem * | Get (long nr) const |
Returns the item at a given position. | |
long | GetCount () const |
Returns the number of items in the list. | |
PointeredListItem * | GetFirst () const |
Returns the first item of the list. | |
PointeredListItem * | GetLast () const |
Returns the last item of the list. | |
void | Insert (PointeredListItem *Item, long nr) |
Inserts an item before a given position. | |
bool | IsEmpty () const |
Returns, if there are no items in the list. | |
PointeredList () | |
Creates a new PointeredList. | |
void | Prepend (PointeredListItem *Item) |
Prepends an item to the list. | |
void | Reverse () |
Turns around the order of all items in the list. | |
void | Sort (int(*compare)(const PointeredListItem *Item1, const PointeredListItem *Item2)) |
Sorts the items in the list according to a given comparison function. | |
void | Sort () |
Sorts the items in the list according to the Compare method. | |
PointeredListItem * | Unlink (PointeredListItem *Item, int(*compare)(const PointeredListItem *Item1, const PointeredListItem *Item2)) |
Removes an item that is equal to a given item from the list. | |
PointeredListItem * | Unlink (PointeredListItem *Item) |
Removes an item that is equal to a given item from the list. | |
PointeredListItem * | Unlink (long nr) |
Removes an item at a given position. | |
void | UnlinkAll () |
Removes all items from the list without freeing them or returning them. | |
PointeredListItem * | UnlinkDirectly (PointeredListItem *Item) |
Removes a given item from the list without looking it up. | |
PointeredListItem * | UnlinkFirst () |
Removes the first item of the list. | |
PointeredListItem * | UnlinkLast () |
Removes the last item of the list. | |
virtual | ~PointeredList () |
Destroys the PointeredList. | |
Static Public Member Functions | |
int | CaseInsensitiveStringCompare (const PointeredListItem *Item1, const PointeredListItem *Item2) |
Works as compare function, if the data in the PointeredListItems is a pointer to a string. | |
int | CaseSensitiveStringCompare (const PointeredListItem *Item1, const PointeredListItem *Item2) |
Works as compare function, if the data in the PointeredListItems is a pointer to a string. |
|
Creates a new PointeredList.
|
|
Destroys the PointeredList. When deleting the list, all contained items are also freed. Since the data is only pointered to and not held in the items, this has no effect to the data in the items. |
|
Appends an item to the list.
|
|
Works as compare function, if the data in the PointeredListItems is a pointer to a string. This method compared case insensitive.
|
|
Works as compare function, if the data in the PointeredListItems is a pointer to a string. This method compared case sensitive.
|
|
Compares two items and returns -1, if the first is less than the second, 0, if both items are equal and 1, if the first is more than the second. This method is used for comparison method like Delete and Get, if you specify an item to look up. Override this method to provide your own comparison.
|
|
Deletes an item that is equal to a given item from the list. The item is searched, removed from the list and freed.
|
|
Deletes an item that is equal to a given item from the list. The item is searched using the class's compare method, so override it to set your own comparison. After that, the item is removed from the list and freed.
|
|
Deletes an given item from the list. The item is removed from the list and freed.
|
|
Deletes all items from the list. All items are removed from the list and freed. |
|
Deletes a given item from the list without looking it up. Use this method to increase performance, but only, if you are sure that the item is in the list. If not, that list will remain inconsistent. The item is removed from the list an freed.
|
|
Deletes the first item from the list. The item is removed from the list and freed.
|
|
Deletes the last item from the list. The item is removed from the list and freed.
|
|
Returns an item that is equal to a given item.
|
|
Returns an item that is equal to a given item. The item is searched using the class's compare method, so override it to set your own comparison. After that, the item is removed from the list and freed.
|
|
Returns the item at a given position.
|
|
Returns the number of items in the list.
|
|
Returns the first item of the list.
|
|
Returns the last item of the list.
|
|
Inserts an item before a given position.
|
|
Returns, if there are no items in the list.
|
|
Prepends an item to the list.
|
|
Turns around the order of all items in the list. The whole list has the reverse order afterwards, but is not harmed at all in any other way. All items remain the same. |
|
Sorts the items in the list according to a given comparison function. The whole list has a sorted order afterwards, but is not harmed at all in any other way. All items remain the same.
|
|
Sorts the items in the list according to the Compare method. The whole list has a sorted order afterwards, but is not harmed at all in any other way. All items remain the same. |
|
Removes an item that is equal to a given item from the list. The item is not freed, but returned.
|
|
Removes an item that is equal to a given item from the list. The item is searched using the class's compare method, so override it to set your own comparison. Afterwards, the item is not freed, but returned.
|
|
Removes an item at a given position. The item is not freed, but returned.
|
|
Removes all items from the list without freeing them or returning them.
|
|
Removes a given item from the list without looking it up. Use this method to increase performance, but only, if you are sure that the item is in the list. If not, that list will become inconsistent. Afterwards, the item is not freed, but returned.
|
|
Removes the first item of the list. The item is not freed, but returned.
|
|
Removes the last item of the list. The item is not freed, but returned.
|