Class SBCReferenceOwnerList#
ClassList > SBCReferenceOwnerList
Inherits the following classes: SBCReferenceOwner
Inherited by the following classes: SBCReferencePointerList, SBCReferencePointerList
Classes#
| Type | Name |
|---|---|
| class | const_iterator |
| class | const_reverse_iterator |
| class | iterator |
| class | reverse_iterator |
Public Functions#
| Type | Name |
|---|---|
| SBCReferenceOwnerList () Default constructor. |
|
| SBCReferenceOwnerList (const SBCReferenceOwnerList & ownerList) Copy constructor. |
|
| SBCReferenceListLink * | addReferenceTarget (SBCReferenceTarget * referenceTarget, SBCReferenceListLink * nextLink=0) Adds a reference to the specified target. |
| SBCReferenceListLink * | addReferenceToTarget (SBCReferenceToTarget * referenceToTarget, SBCReferenceToOwnerList * referenceToOwnerList=0, SBCReferenceListLink * nextLink=0) Adds a reference to a target using an existing reference object. |
| iterator | begin () Returns an iterator to the first reference in the list. |
| const_iterator | begin () const Returns a const iterator to the first reference in the list. |
| void | clear () Clears the reference list, removing all references. |
| bool | empty () const Checks whether the list contains any references. |
| iterator | end () Returns an iterator representing the end of the list (past-the-last element). |
| const_iterator | end () const Returns a const iterator representing the end of the list (past-the-last element). |
| iterator | erase (iterator position) Erases the reference at the specified position. |
| iterator | erase (iterator first, iterator last) Erases references in the range [first, last). |
| iterator | find (SBCReferenceTarget * referenceTarget) Finds a reference to the specified target. |
| const_iterator | find (SBCReferenceTarget * referenceTarget) const Finds a reference to the specified target (const version). |
| SBCReferenceListLink * | getBeginLink () const Returns a pointer to the first link in the reference list. |
| SBCReferenceListLink * | getEndLink () const Returns a pointer to the last link in the reference list. |
| unsigned int | getMemoryFootprint () const Returns the memory footprint of this owner list. |
| unsigned int | getNumberOfReferenceTargets () const Returns the number of reference targets. |
| SBCReferenceOwnerList & | operator= (const SBCReferenceOwnerList & ownerList) Assignment operator. |
| void | printReferencesToTargets () const Prints information about this owner and its target references. |
| reverse_iterator | rbegin () Returns a reverse iterator to the last reference in the list. |
| const_reverse_iterator | rbegin () const Returns a const reverse iterator to the last reference in the list. |
| void | removeAllReferenceTargets () Removes all reference targets. |
| void | removeReferenceListLink (SBCReferenceListLink * referenceListLink) Removes a reference list link and its associated reference. |
| void | removeReferenceTarget (SBCReferenceTarget * referenceTarget) Removes all references to the specified target. |
| void | removeReferenceToTarget (SBCReferenceToTarget * referenceToTarget) Removes a specific reference to a target. |
| reverse_iterator | rend () Returns a reverse iterator representing the past-the-first element. |
| const_reverse_iterator | rend () const Returns a const reverse iterator representing the past-the-first element. |
| unsigned int | size () const Returns the number of references in the list. |
| virtual | ~SBCReferenceOwnerList () Destructor. |
Protected Attributes#
| Type | Name |
|---|---|
| SBCReferenceList * | referenceList |
Protected Functions inherited from SBCReferenceOwner#
| Type | Name |
|---|---|
| SBCReferenceOwner () noexcept Constructs a reference owner. |
|
| virtual | ~SBCReferenceOwner () Destructs the reference owner. |
Public Functions Documentation#
function SBCReferenceOwnerList [1/2]#
Default constructor.
Creates an empty owner list with no references.
function SBCReferenceOwnerList [2/2]#
Copy constructor.
Constructs a new owner list as a copy of the given list, duplicating all references.
Parameters:
ownerListSource owner list to copy.
function addReferenceTarget#
Adds a reference to the specified target.
SBCReferenceListLink * SBCReferenceOwnerList::addReferenceTarget (
SBCReferenceTarget * referenceTarget,
SBCReferenceListLink * nextLink=0
)
Creates a new reference to the given target and inserts it into the reference list.
Parameters:
targetPointer to the target to reference. Must not be null.nextLinkOptional pointer to the link after which the new reference will be inserted; if nullptr, the reference is appended to the end.
Returns:
Pointer to the newly created list link, or nullptr if the target is null.
function addReferenceToTarget#
Adds a reference to a target using an existing reference object.
SBCReferenceListLink * SBCReferenceOwnerList::addReferenceToTarget (
SBCReferenceToTarget * referenceToTarget,
SBCReferenceToOwnerList * referenceToOwnerList=0,
SBCReferenceListLink * nextLink=0
)
Inserts the given SBCReferenceToTarget into the reference list, optionally creating a reference in the owner list.
Parameters:
referenceToTargetPointer to the SBCReferenceToTarget object representing the reference. Must not be null.referenceInReferenceOptional pointer to an existing SBCReferenceToOwnerList; if nullptr, a new one is created.nextLinkOptional pointer to the link after which the new reference will be inserted; if nullptr, the reference is appended to the end.
Returns:
Pointer to the newly created list link, or nullptr if referenceToTarget is null.
function begin [1/2]#
Returns an iterator to the first reference in the list.
Returns:
Iterator pointing to the first reference, or a default iterator if the list is empty.
function begin [2/2]#
Returns a const iterator to the first reference in the list.
Returns:
Const iterator pointing to the first reference, or a default const iterator if the list is empty.
function clear#
Clears the reference list, removing all references.
If the reference list does not exist, no action is taken.
function empty#
Checks whether the list contains any references.
Returns:
true if the list is empty, false otherwise.
function end [1/2]#
Returns an iterator representing the end of the list (past-the-last element).
Returns:
Iterator equal to end().
function end [2/2]#
Returns a const iterator representing the end of the list (past-the-last element).
Returns:
Const iterator equal to end().
function erase [1/2]#
Erases the reference at the specified position.
Removes the reference and returns an iterator to the element following the erased one.
Parameters:
positionIterator pointing to the reference to erase.
Returns:
Iterator to the element following the erased reference, or end() if none.
function erase [2/2]#
Erases references in the range [first, last).
Removes all references from first up to, but not including, last, and returns an iterator to last.
Parameters:
firstIterator pointing to the first reference to erase.lastIterator pointing to the element after the last reference to erase.
Returns:
Iterator equal to last.
function find [1/2]#
Finds a reference to the specified target.
Searches the list for a reference to the given target.
Parameters:
referenceTargetPointer to the target to find.
Returns:
Iterator to the matching reference, or end() if not found.
function find [2/2]#
Finds a reference to the specified target (const version).
Searches the list for a reference to the given target.
Parameters:
referenceTargetPointer to the target to find.
Returns:
Const iterator to the matching reference, or end() if not found.
function getBeginLink#
Returns a pointer to the first link in the reference list.
Returns:
Pointer to the first link, or nullptr if the list is empty.
function getEndLink#
Returns a pointer to the last link in the reference list.
Returns:
Pointer to the last link, or nullptr if the list is empty.
function getMemoryFootprint#
Returns the memory footprint of this owner list.
Includes the size of the internal reference list if it exists.
Returns:
Memory usage in bytes.
function getNumberOfReferenceTargets#
Returns the number of reference targets.
Returns:
Number of reference targets currently stored in the list.
function operator=#
Assignment operator.
SBCReferenceOwnerList & SBCReferenceOwnerList::operator= (
const SBCReferenceOwnerList & ownerList
)
Replaces the contents of this owner list with those of another list.
Parameters:
ownerListSource owner list to assign from.
Returns:
Reference to this object.
function printReferencesToTargets#
Prints information about this owner and its target references.
The output includes the owner's address and a list of its target references. This function writes to standard output.
function rbegin [1/2]#
Returns a reverse iterator to the last reference in the list.
Returns:
Reverse iterator pointing to the last reference, or a default reverse iterator if the list is empty.
function rbegin [2/2]#
Returns a const reverse iterator to the last reference in the list.
Returns:
Const reverse iterator pointing to the last reference, or a default const reverse iterator if the list is empty.
function removeAllReferenceTargets#
Removes all reference targets.
Deletes all references and clears the reference list.
function removeReferenceListLink#
Removes a reference list link and its associated reference.
Deletes the reference and the list link, effectively removing the reference from the owner.
Parameters:
referenceLinkPointer to the list link to remove. If nullptr, no action is taken.
function removeReferenceTarget#
Removes all references to the specified target.
Searches the reference list for references to the given target and removes them.
Parameters:
targetPointer to the target whose references should be removed.
function removeReferenceToTarget#
Removes a specific reference to a target.
Searches the reference list for the given reference and removes it.
Parameters:
referencePointer to the SBCReferenceToTarget to remove.
function rend [1/2]#
Returns a reverse iterator representing the past-the-first element.
Returns:
Reverse iterator equal to rend().
function rend [2/2]#
Returns a const reverse iterator representing the past-the-first element.
Returns:
Const reverse iterator equal to rend().
function size#
Returns the number of references in the list.
Returns:
Number of reference targets.
function ~SBCReferenceOwnerList#
Destructor.
Destroys the owner list and releases all referenced targets.