Class SBCReferenceList#
Protected Attributes#
| Type | Name |
|---|---|
| SBCReferenceListLinkPointerForward | beginLink |
| SBCReferenceListLinkPointerBackward | endLink |
Protected Functions#
| Type | Name |
|---|---|
| SBCReferenceList () Constructs an empty SBCReferenceList. |
|
| iterator | begin () Returns an iterator to the first element of the list. |
| const_iterator | begin () const Returns a const iterator to the first element of the list. |
| void | clear () Clears the reference list. |
| bool | empty () const Checks whether the reference list is empty. |
| iterator | end () Returns an iterator representing the end of the list. |
| const_iterator | end () const Returns a const iterator representing the end of the list. |
| iterator | erase (iterator position) Erases the element at the specified iterator position. |
| iterator | erase (iterator first, iterator last) Erases a range of elements from the list. |
| iterator | find (SBCReferenceTarget * referenceTarget) Finds the first occurrence of the specified reference target. |
| const_iterator | find (SBCReferenceTarget * referenceTarget) const Finds the first occurrence of the specified reference target (const version). |
| SBCReferenceListLink * | getBeginLink () const Retrieves the pointer to the first link in the list. |
| SBCReferenceListLink * | getEndLink () const Retrieves the pointer to the last link in the list. |
| unsigned int | getMemoryFootprint () const Calculates the memory footprint of the list. |
| bool | hasLink (SBCReferenceListLink * referenceListLink) const Determines whether the specified link is present in the list. |
| SBCReferenceListLink * | insert (SBCReferenceToTarget * referenceToTarget, SBCReferenceListLink * nextLink=0) Inserts a new reference link before the specified next link. |
| void | pop_back () Removes the last element from the list. |
| void | pop_front () Removes the first element from the list. |
| void | printReferencesToTargets () const Prints the reference list to the standard output. |
| void | push_back (SBCReferenceToTarget * referenceToTarget) Appends a reference to the end of the list. |
| void | push_back (SBCReferenceListLink * referenceListLink) Appends the specified link to the end of the list. |
| void | push_front (SBCReferenceToTarget * referenceToTarget) Inserts a reference at the beginning of the list. |
| void | push_front (SBCReferenceListLink * referenceListLink) Inserts the specified link at the beginning of the list. |
| reverse_iterator | rbegin () Returns a reverse iterator to the last element of the list. |
| const_reverse_iterator | rbegin () const Returns a const reverse iterator to the last element of the list. |
| reverse_iterator | rend () Returns a reverse iterator representing the reverse end of the list. |
| const_reverse_iterator | rend () const Returns a const reverse iterator representing the reverse end of the list. |
| void | setBeginLink (SBCReferenceListLink * referenceListLink) Sets the begin link of the list. |
| void | setEndLink (SBCReferenceListLink * referenceListLink) Sets the end link of the list. |
| unsigned int | size () const Returns the number of elements in the list. |
| virtual | ~SBCReferenceList () Destroys the SBCReferenceList. |
Protected Attributes Documentation#
variable beginLink#
variable endLink#
Protected Functions Documentation#
function SBCReferenceList#
Constructs an empty SBCReferenceList.
Initializes the begin and end links to null.
function begin [1/2]#
Returns an iterator to the first element of the list.
The iterator points to the beginning link, or is invalid if the list is empty.
Returns:
Iterator to the first element.
function begin [2/2]#
Returns a const iterator to the first element of the list.
Returns:
Const iterator to the first element.
function clear#
Clears the reference list.
Deletes each reference target in the list, leaving the list empty.
function empty#
Checks whether the reference list is empty.
Returns true if there are no links in the list.
Returns:
true if the list is empty; otherwise false.
function end [1/2]#
Returns an iterator representing the end of the list.
This iterator does not refer to a valid element and can be used as a sentinel.
Returns:
Iterator to the end of the list.
function end [2/2]#
Returns a const iterator representing the end of the list.
Returns:
Const iterator to the end of the list.
function erase [1/2]#
Erases the element at the specified iterator position.
The element is removed from the list and its reference target is deleted.
Parameters:
positionIterator pointing to the element to erase.
Returns:
Iterator to the element following the erased element, or end if the erased element was the last.
function erase [2/2]#
Erases a range of elements from the list.
Elements in the half-open range [first, last) are removed and their reference targets are deleted.
Parameters:
firstIterator to the first element to erase.lastIterator to the element following the last element to erase.
Returns:
Iterator to the element that was originally last.
function find [1/2]#
Finds the first occurrence of the specified reference target.
Searches the list for a link whose reference target matches the given pointer.
Parameters:
referenceTargetPointer to the SBCReferenceTarget to locate.
Returns:
Iterator to the matching element, or end if not found.
function find [2/2]#
Finds the first occurrence of the specified reference target (const version).
Parameters:
referenceTargetPointer to the SBCReferenceTarget to locate.
Returns:
Const iterator to the matching element, or end if not found.
function getBeginLink#
Retrieves the pointer to the first link in the list.
Returns:
Pointer to the begin link, or null if the list is empty.
function getEndLink#
Retrieves the pointer to the last link in the list.
Returns:
Pointer to the end link, or null if the list is empty.
function getMemoryFootprint#
Calculates the memory footprint of the list.
The footprint includes the memory used by the begin and end link pointers and all links in the list.
Returns:
The total memory consumption in bytes.
function hasLink#
Determines whether the specified link is present in the list.
Parameters:
linkPointer to the SBCReferenceListLink to check.
Returns:
true if the link is found in the list; otherwise false.
function insert#
Inserts a new reference link before the specified next link.
SBCReferenceListLink * SBCReferenceList::insert (
SBCReferenceToTarget * referenceToTarget,
SBCReferenceListLink * nextLink=0
)
If nextLink is null, the new link is appended to the end of the list.
Parameters:
tPointer to the SBCReferenceToTarget to be inserted.nextLinkPointer to the link that should follow the new link; null to insert at the end.
Returns:
Pointer to the newly inserted SBCReferenceListLink.
function pop_back#
Removes the last element from the list.
Deletes the reference target associated with the end link.
function pop_front#
Removes the first element from the list.
Deletes the reference target associated with the begin link.
function printReferencesToTargets#
Prints the reference list to the standard output.
The method outputs the list address, begin and end links, and each reference target's information.
function push_back [1/2]#
Appends a reference to the end of the list.
Creates a new link containing the given reference-to-target and adds it after the current end link.
Parameters:
tPointer to the SBCReferenceToTarget to be added.
function push_back [2/2]#
Appends the specified link to the end of the list.
The link's previous pointer is set to the current end link.
Parameters:
tPointer to the SBCReferenceListLink to be appended.
function push_front [1/2]#
Inserts a reference at the beginning of the list.
Creates a new link containing the given reference-to-target and adds it before the current begin link.
Parameters:
tPointer to the SBCReferenceToTarget to be added.
function push_front [2/2]#
Inserts the specified link at the beginning of the list.
The link's next pointer is set to the current begin link.
Parameters:
tPointer to the SBCReferenceListLink to be inserted.
function rbegin [1/2]#
Returns a reverse iterator to the last element of the list.
The reverse iterator points to the end link, or is invalid if the list is empty.
Returns:
Reverse iterator to the last element.
function rbegin [2/2]#
Returns a const reverse iterator to the last element of the list.
Returns:
Const reverse iterator to the last element.
function rend [1/2]#
Returns a reverse iterator representing the reverse end of the list.
This iterator does not refer to a valid element and can be used as a sentinel for reverse iteration.
Returns:
Reverse iterator to the reverse end of the list.
function rend [2/2]#
Returns a const reverse iterator representing the reverse end of the list.
Returns:
Const reverse iterator to the reverse end of the list.
function setBeginLink#
Sets the begin link of the list.
Parameters:
linkPointer to the new begin link.
function setEndLink#
Sets the end link of the list.
Parameters:
linkPointer to the new end link.
function size#
Returns the number of elements in the list.
Returns:
The count of links in the reference list.
function ~SBCReferenceList#
Destroys the SBCReferenceList.
Performs any necessary cleanup of the list.