#include <buffernodelist.h>
Public Member Functions | |
BufferNodeList () | |
Constructor. | |
virtual | ~BufferNodeList () |
void | push_back (BufferNode *node) |
Appends another BufferNode to the list. | |
BufferNode * | operator[] (unsigned index) |
Retrieves the BufferNode at position index. | |
void | print (OutputStream &dos) |
Prints the complete BufferNodeList. | |
BufferNode * | getFront () |
Retrieves the first element of the BufferNodeList. | |
bool | isEmpty () |
Checks for emptyness. | |
void | removeElem (BufferNode *to_remove, BufferNode *prev) |
Removes a node from the BufferNodeList. | |
Private Attributes | |
BufferNode * | front |
The front element of the list. | |
BufferNode * | back |
The last element of the list. |
An (ordered) list of BufferNode elements. The BufferNode objects are linked via the BufferNode::r_sibling member variable.
Definition at line 53 of file buffernodelist.h.
BufferNodeList::BufferNodeList | ( | ) |
BufferNodeList::~BufferNodeList | ( | ) | [virtual] |
Destructor.
Definition at line 43 of file buffernodelist.cpp.
References front, and BufferNode::r_sibling.
BufferNode * BufferNodeList::getFront | ( | ) | [inline] |
Retrieves the first element of the BufferNodeList.
May return NULL if the list is empty.
BufferNode* | Pointer to the first BufferNode in the list. |
Definition at line 97 of file buffernodelist.h.
References front.
Referenced by BufferNode::clearSubtreeIfPossible(), BufferNode::getPCDataRepresentation(), and BufferNode::hasNoMarkedAndNoLockedDos().
bool BufferNodeList::isEmpty | ( | ) | [inline] |
Checks for emptyness.
Checks for emptyness, i.e. returns true if this is the empty list.
bool | Returns true if the BufferNodeList object is empty, false otherwise. |
Definition at line 104 of file buffernodelist.h.
BufferNode * BufferNodeList::operator[] | ( | unsigned | index | ) |
Retrieves the BufferNode at position index.
The first node in the list has index zero. For efficiency reasons, this method does not check for out-of-bound violation, so the caller is responsible to make sure to access buffer nodes in the valid range.
[in] | index | The position of the BufferNode in the list. |
BufferNode* | Pointer to the retrieved BufferNode. |
Definition at line 63 of file buffernodelist.cpp.
References front, and BufferNode::r_sibling.
void BufferNodeList::print | ( | OutputStream & | dos | ) |
Prints the complete BufferNodeList.
This is a debug print method: the output comprises role information.
[in] | dos | Reference to the (debug) OutputStream. |
void |
Definition at line 73 of file buffernodelist.cpp.
References front, and BufferNode::r_sibling.
void BufferNodeList::push_back | ( | BufferNode * | node | ) |
Appends another BufferNode to the list.
The passed BufferNode is appended to the end of the list.
[in] | node | Pointer to the BufferNode to be appended to the list. |
void |
Definition at line 52 of file buffernodelist.cpp.
References back, front, and BufferNode::r_sibling.
Referenced by BufferNode::addChild().
void BufferNodeList::removeElem | ( | BufferNode * | to_remove, | |
BufferNode * | prev | |||
) |
Removes a node from the BufferNodeList.
The node to_remove is removed from the list; node prev is required to adjust the linked list after node removal.
[in] | to_remove | The BufferNode object to be removed. |
[in] | prev | The predecessor of the object to be removed. May be in case the first removed node is the first one in the list. |
void |
Definition at line 79 of file buffernodelist.cpp.
References back, front, and BufferNode::r_sibling.
Referenced by BufferNode::clearSubtreeIfPossible().
BufferNode * BufferNodeList::back [private] |
The last element of the list.
May be NULL (if the list is empty).
Definition at line 130 of file buffernodelist.h.
Referenced by push_back(), and removeElem().
BufferNode * BufferNodeList::front [private] |
The front element of the list.
May be NULL (if the list is empty).
Definition at line 124 of file buffernodelist.h.
Referenced by getFront(), operator[](), print(), push_back(), removeElem(), and ~BufferNodeList().