#include <list.h>
Public Member Functions | |
SListQueue (void) | |
Default constructor. | |
~SListQueue (void) | |
Default destructor -- asserts that queue is empty. | |
bool | Empty (void) const |
Is queue empty? | |
void | Reinitialize (void) |
Reinitialize queue head. | |
void | PrependItem (SListItem &item) |
Insert a single item at the front of the queue. | |
void | AppendItem (SListItem &item) |
Insert a single item at the back of the queue. | |
void | SpliceAfter (SListItem &before_first, SListItem &last) |
Insert a sublist at the head of the queue. | |
void | SpliceBefore (SListItem &before_first, SListItem &last) |
Insert a sublist at the tail of the queue. | |
void | PrependItemsFrom (SListQueue &source) |
Prepends all elements of a list into this. | |
void | AppendItemsFrom (SListQueue &source) |
Appends all elements of a list into this. | |
SListItem * | UnlinkNext (void) |
Unlink and reinitialize successor. | |
SListItem * | UnlinkNextOnly (void) |
Unlink successor without reinitialization. | |
void | Push (SListItem &item) |
Alias for PrependItem(). | |
SListItem * | Pop (void) |
Alias for UnlinkNext(). | |
void | Enqueue (SListItem &item) |
Alias for AppendItem(). | |
SListItem * | Dequeue (void) |
Alias for UnlinkNext(). |
Offers the efficiency tradeoff of having a double-pointer list head, but single-pointer elements. This can be used as a memory- saving alternative to ListItem for cases where the following functionality is not needed:
bool Empty | ( | void | ) | const [inline] |
Is queue empty?
Checks whether the queue is an empty circular loop.
true | next points to this and prev points to this | |
false | The list is linked with other ListItems. |
void Reinitialize | ( | void | ) | [inline] |
Reinitialize queue head.
Reinitializes the SListQueue as a singleton circular list.
void PrependItem | ( | SListItem & | item | ) | [inline] |
Insert a single item at the front of the queue.
Links an SListItem to this SListQueue's circular list, such that item becomes the first item on the queue, or the immediate successor of the queue head element.
item | SListItem to be inserted. |
void AppendItem | ( | SListItem & | item | ) | [inline] |
Insert a single item at the back of the queue.
Links an SListItem to this SListQueue's circular list, such that item becomes the last item on the queue, or the immediate predecessor of the queue head element.
item | SListItem to be inserted. |
Insert a sublist at the head of the queue.
Unlinks a chain of SListItem structures from whatever list they might be linked onto, and prepends them to the beginning of the queue.
Insert a sublist at the tail of the queue.
Unlinks a chain of SListItem structures from whatever list they might be linked onto, and appends them to the end of the queue.
void PrependItemsFrom | ( | SListQueue & | source | ) | [inline] |
Prepends all elements of a list into this.
Splices all items of source onto the beginning of the subject queue. The parameter source is reinitialized as part of the operation. Upon return, source will be empty.
source | List from which items should be transferred. |
void AppendItemsFrom | ( | SListQueue & | source | ) | [inline] |
Appends all elements of a list into this.
Splices all items of source onto the end of the subject queue. The parameter source is reinitialized as part of this operation. Upon return, source will be empty.
source | List from which items should be transferred. |
SListItem* UnlinkNext | ( | void | ) | [inline] |
Unlink and reinitialize successor.
Unlinks and reinitializes the successor of this entry in the list.
SListItem* UnlinkNextOnly | ( | void | ) | [inline] |
Unlink successor without reinitialization.
Unlinks the successor of this entry in the list. Marginally more efficient than UnlinkNext().