#include <list.h>
Public Member Functions | |
SListItem () | |
Regular Constructor. | |
bool | Empty () const |
Is list empty? | |
void | Reinitialize (void) |
Reinitialize list item. | |
SListItem * | UnlinkNext () |
Unlink and reinitialize successor. | |
SListItem * | UnlinkNextOnly () |
Unlink successor without reinitialization. | |
void | PrependItem (SListItem &item) |
Insert a single item immediately after this element. | |
void | SpliceAfter (SListItem &before_first, SListItem &last) |
Insert a sublist immediately after this element. | |
int | Length () const |
Compute the length of a list. | |
void | Push (SListItem &item) |
Alias for PrependItem(). | |
SListItem * | Pop (void) |
Alias for UnlinkNext(). | |
Public Attributes | |
SListItem * | next |
List member pointer. |
Low-overhead embedded singly-linked-list. Enforces strict LIFO insertion/removal semantics, and is less powerful and capable than ListItem, its doubly-linked counterpart.
Like the ListItem, SListItem can be used as both a list head and a list item, although lists utilizing SListItem as the head structure are restricted to LIFO operations.
SListQueue can also be used as the list head structure. This structure includes a tail pointer, and is capable of all splice and insert operations.
Supports sort functors.
SListItem | ( | ) | [inline] |
Regular Constructor.
Initializes the list as a circular loop of one.
bool Empty | ( | void | ) | const [inline] |
Is list empty?
Checks whether the list is an empty circular loop.
true | next points to this | |
false | The link is linked with other SListItems. |
void Reinitialize | ( | void | ) | [inline] |
Reinitialize list item.
Reinitializes the ListItem as a singleton circular list.
SListItem* UnlinkNext | ( | void | ) | [inline] |
Unlink and reinitialize successor.
Unlinks and reinitializes the successor of this entry in the list.
SListItem* UnlinkNextOnly | ( | ) | [inline] |
Unlink successor without reinitialization.
Unlinks the successor of this entry in the list. Marginally more efficient than UnlinkNext().
void PrependItem | ( | SListItem & | item | ) | [inline] |
Insert a single item immediately after this element.
Links another SListItem to this SListItem's circular list, such that the new SListItem becomes this element's immediate successor. If this element is considered to be the head of a list, and item is considered to be an item, then the item is prepended to the list headed by this.
item | SListItem to be inserted. |
int Length | ( | ) | const [inline] |
Compute the length of a list.
Determines how many items are linked into a list, not including the ListItem it is called on.