Web Analytics Made Easy - Statcounter
Skip to content

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#

See SBCReferenceOwner

Type Name
SBCReferenceOwner () noexcept
Constructs a reference owner.
virtual ~SBCReferenceOwner ()
Destructs the reference owner.

Public Functions Documentation#

function SBCReferenceOwnerList [1/2]#

Default constructor.

SBCReferenceOwnerList::SBCReferenceOwnerList () 

Creates an empty owner list with no references.


function SBCReferenceOwnerList [2/2]#

Copy constructor.

SBCReferenceOwnerList::SBCReferenceOwnerList (
    const SBCReferenceOwnerList & ownerList
) 

Constructs a new owner list as a copy of the given list, duplicating all references.

Parameters:

  • ownerList Source 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:

  • target Pointer to the target to reference. Must not be null.
  • nextLink Optional 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:

  • referenceToTarget Pointer to the SBCReferenceToTarget object representing the reference. Must not be null.
  • referenceInReference Optional pointer to an existing SBCReferenceToOwnerList; if nullptr, a new one is created.
  • nextLink Optional 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.

iterator SBCReferenceOwnerList::begin () 

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.

const_iterator SBCReferenceOwnerList::begin () const

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.

void SBCReferenceOwnerList::clear () 

If the reference list does not exist, no action is taken.


function empty#

Checks whether the list contains any references.

bool SBCReferenceOwnerList::empty () const

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

iterator SBCReferenceOwnerList::end () 

Returns:

Iterator equal to end().


function end [2/2]#

Returns a const iterator representing the end of the list (past-the-last element).

const_iterator SBCReferenceOwnerList::end () const

Returns:

Const iterator equal to end().


function erase [1/2]#

Erases the reference at the specified position.

iterator SBCReferenceOwnerList::erase (
    iterator position
) 

Removes the reference and returns an iterator to the element following the erased one.

Parameters:

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

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

Removes all references from first up to, but not including, last, and returns an iterator to last.

Parameters:

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

iterator SBCReferenceOwnerList::find (
    SBCReferenceTarget * referenceTarget
) 

Searches the list for a reference to the given target.

Parameters:

  • referenceTarget Pointer 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).

const_iterator SBCReferenceOwnerList::find (
    SBCReferenceTarget * referenceTarget
) const

Searches the list for a reference to the given target.

Parameters:

  • referenceTarget Pointer to the target to find.

Returns:

Const iterator to the matching reference, or end() if not found.


Returns a pointer to the first link in the reference list.

SBCReferenceListLink * SBCReferenceOwnerList::getBeginLink () const

Returns:

Pointer to the first link, or nullptr if the list is empty.


Returns a pointer to the last link in the reference list.

SBCReferenceListLink * SBCReferenceOwnerList::getEndLink () const

Returns:

Pointer to the last link, or nullptr if the list is empty.


function getMemoryFootprint#

Returns the memory footprint of this owner list.

unsigned int SBCReferenceOwnerList::getMemoryFootprint () const

Includes the size of the internal reference list if it exists.

Returns:

Memory usage in bytes.


function getNumberOfReferenceTargets#

Returns the number of reference targets.

unsigned int SBCReferenceOwnerList::getNumberOfReferenceTargets () const

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:

  • ownerList Source owner list to assign from.

Returns:

Reference to this object.


function printReferencesToTargets#

Prints information about this owner and its target references.

void SBCReferenceOwnerList::printReferencesToTargets () const

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.

reverse_iterator SBCReferenceOwnerList::rbegin () 

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.

const_reverse_iterator SBCReferenceOwnerList::rbegin () const

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.

void SBCReferenceOwnerList::removeAllReferenceTargets () 

Deletes all references and clears the reference list.


Removes a reference list link and its associated reference.

void SBCReferenceOwnerList::removeReferenceListLink (
    SBCReferenceListLink * referenceListLink
) 

Deletes the reference and the list link, effectively removing the reference from the owner.

Parameters:

  • referenceLink Pointer to the list link to remove. If nullptr, no action is taken.

function removeReferenceTarget#

Removes all references to the specified target.

void SBCReferenceOwnerList::removeReferenceTarget (
    SBCReferenceTarget * referenceTarget
) 

Searches the reference list for references to the given target and removes them.

Parameters:

  • target Pointer to the target whose references should be removed.

function removeReferenceToTarget#

Removes a specific reference to a target.

void SBCReferenceOwnerList::removeReferenceToTarget (
    SBCReferenceToTarget * referenceToTarget
) 

Searches the reference list for the given reference and removes it.

Parameters:

  • reference Pointer to the SBCReferenceToTarget to remove.

function rend [1/2]#

Returns a reverse iterator representing the past-the-first element.

reverse_iterator SBCReferenceOwnerList::rend () 

Returns:

Reverse iterator equal to rend().


function rend [2/2]#

Returns a const reverse iterator representing the past-the-first element.

const_reverse_iterator SBCReferenceOwnerList::rend () const

Returns:

Const reverse iterator equal to rend().


function size#

Returns the number of references in the list.

unsigned int SBCReferenceOwnerList::size () const

Returns:

Number of reference targets.


function ~SBCReferenceOwnerList#

Destructor.

virtual SBCReferenceOwnerList::~SBCReferenceOwnerList () 

Destroys the owner list and releases all referenced targets.


Protected Attributes Documentation#

variable referenceList#

SBCReferenceList* SBCReferenceOwnerList::referenceList;