Web Analytics Made Easy - Statcounter
Skip to content

Class SBCReferenceList#

ClassList > 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#

SBCReferenceListLinkPointerForward SBCReferenceList::beginLink;

SBCReferenceListLinkPointerBackward SBCReferenceList::endLink;

Protected Functions Documentation#

function SBCReferenceList#

Constructs an empty SBCReferenceList.

SBCReferenceList::SBCReferenceList () 

Initializes the begin and end links to null.


function begin [1/2]#

Returns an iterator to the first element of the list.

iterator SBCReferenceList::begin () 

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.

const_iterator SBCReferenceList::begin () const

Returns:

Const iterator to the first element.


function clear#

Clears the reference list.

void SBCReferenceList::clear () 

Deletes each reference target in the list, leaving the list empty.


function empty#

Checks whether the reference list is empty.

bool SBCReferenceList::empty () const

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.

iterator SBCReferenceList::end () 

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.

const_iterator SBCReferenceList::end () const

Returns:

Const iterator to the end of the list.


function erase [1/2]#

Erases the element at the specified iterator position.

iterator SBCReferenceList::erase (
    iterator position
) 

The element is removed from the list and its reference target is deleted.

Parameters:

  • position Iterator 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.

iterator SBCReferenceList::erase (
    iterator first,
    iterator last
) 

Elements in the half-open range [first, last) are removed and their reference targets are deleted.

Parameters:

  • first Iterator to the first element to erase.
  • last Iterator 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.

iterator SBCReferenceList::find (
    SBCReferenceTarget * referenceTarget
) 

Searches the list for a link whose reference target matches the given pointer.

Parameters:

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).

const_iterator SBCReferenceList::find (
    SBCReferenceTarget * referenceTarget
) const

Parameters:

Returns:

Const iterator to the matching element, or end if not found.


Retrieves the pointer to the first link in the list.

SBCReferenceListLink * SBCReferenceList::getBeginLink () const

Returns:

Pointer to the begin link, or null if the list is empty.


Retrieves the pointer to the last link in the list.

SBCReferenceListLink * SBCReferenceList::getEndLink () const

Returns:

Pointer to the end link, or null if the list is empty.


function getMemoryFootprint#

Calculates the memory footprint of the list.

unsigned int SBCReferenceList::getMemoryFootprint () const

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.


Determines whether the specified link is present in the list.

bool SBCReferenceList::hasLink (
    SBCReferenceListLink * referenceListLink
) const

Parameters:

  • link Pointer 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:

  • t Pointer to the SBCReferenceToTarget to be inserted.
  • nextLink Pointer 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.

void SBCReferenceList::pop_back () 

Deletes the reference target associated with the end link.


function pop_front#

Removes the first element from the list.

void SBCReferenceList::pop_front () 

Deletes the reference target associated with the begin link.


function printReferencesToTargets#

Prints the reference list to the standard output.

void SBCReferenceList::printReferencesToTargets () const

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.

void SBCReferenceList::push_back (
    SBCReferenceToTarget * referenceToTarget
) 

Creates a new link containing the given reference-to-target and adds it after the current end link.

Parameters:

  • t Pointer to the SBCReferenceToTarget to be added.

function push_back [2/2]#

Appends the specified link to the end of the list.

void SBCReferenceList::push_back (
    SBCReferenceListLink * referenceListLink
) 

The link's previous pointer is set to the current end link.

Parameters:

  • t Pointer to the SBCReferenceListLink to be appended.

function push_front [1/2]#

Inserts a reference at the beginning of the list.

void SBCReferenceList::push_front (
    SBCReferenceToTarget * referenceToTarget
) 

Creates a new link containing the given reference-to-target and adds it before the current begin link.

Parameters:

  • t Pointer to the SBCReferenceToTarget to be added.

function push_front [2/2]#

Inserts the specified link at the beginning of the list.

void SBCReferenceList::push_front (
    SBCReferenceListLink * referenceListLink
) 

The link's next pointer is set to the current begin link.

Parameters:

  • t Pointer to the SBCReferenceListLink to be inserted.

function rbegin [1/2]#

Returns a reverse iterator to the last element of the list.

reverse_iterator SBCReferenceList::rbegin () 

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.

const_reverse_iterator SBCReferenceList::rbegin () const

Returns:

Const reverse iterator to the last element.


function rend [1/2]#

Returns a reverse iterator representing the reverse end of the list.

reverse_iterator SBCReferenceList::rend () 

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.

const_reverse_iterator SBCReferenceList::rend () const

Returns:

Const reverse iterator to the reverse end of the list.


Sets the begin link of the list.

void SBCReferenceList::setBeginLink (
    SBCReferenceListLink * referenceListLink
) 

Parameters:

  • link Pointer to the new begin link.

Sets the end link of the list.

void SBCReferenceList::setEndLink (
    SBCReferenceListLink * referenceListLink
) 

Parameters:

  • link Pointer to the new end link.

function size#

Returns the number of elements in the list.

unsigned int SBCReferenceList::size () const

Returns:

The count of links in the reference list.


function ~SBCReferenceList#

Destroys the SBCReferenceList.

virtual SBCReferenceList::~SBCReferenceList () 

Performs any necessary cleanup of the list.