Class SBCReferenceOwnerIndexer#
ClassList > SBCReferenceOwnerIndexer
Inherits the following classes: SBCReferenceOwner
Inherited by the following classes: SBCReferencePointerIndexer
Public Functions#
| Type | Name |
|---|---|
| SBCReferenceOwnerIndexer () Creates an indexer. |
|
| SBCReferenceOwnerIndexer (unsigned int initialSize) Creates an indexer. |
|
| SBCReferenceOwnerIndexer (const SBCReferenceOwnerIndexer & ownerIndexer) Creates a copy of ownerIndexer . |
|
| unsigned int | addReferenceTarget (SBCReferenceTarget * referenceTarget) Adds a reference target in the indexer, if possible, and returns the index of the reference target. |
| unsigned int | addReferenceToTarget (SBCReferenceToTarget * referenceToTarget, SBCReferenceToOwnerIndexer * referenceToOwnerIndex=0) Adds a reference to a target and returns its index. |
| void | clear () Clears the owner indexer by removing all reference targets. |
| bool | empty () const Checks whether the owner indexer contains any reference targets. |
| unsigned int | getIndex (SBCReferenceTarget * referenceTarget) const Returns the index associated to the reference . |
| bool | getIndex (SBCReferenceTarget * referenceTarget, unsigned int & referenceTargetIndex) const Returns the index associated to the reference . |
| unsigned int | getIndex (SBCReferenceToTarget * referenceToTarget) const Returns the index associated to the reference . |
| bool | getIndex (SBCReferenceToTarget * referenceToTarget, unsigned int & referenceToTargetIndex) const Returns the index associated to the reference . |
| unsigned int | getNumberOfReferenceTargets () const Returns the number of reference targets managed by the owner indexer. |
| SBCReferenceTarget * | getReferenceTarget (unsigned int referenceTargetIndex) const Returns the reference associated to the index . |
| SBCReferenceToTarget * | getReferenceToTarget (unsigned int referenceToTargetIndex) const Returns the reference associated to the index . |
| bool | hasIndex (SBCReferenceTarget * referenceTarget) const Returns true if the__reference has an index. |
| bool | hasIndex (SBCReferenceToTarget * referenceToTarget) const Returns true if the__reference has an index. |
| unsigned int | insertReferenceTarget (unsigned int i, SBCReferenceTarget * referenceTarget) Adds a reference target in the indexer at position i , if possible, and returns the index of the reference target. |
| unsigned int | insertReferenceToTarget (unsigned int i, SBCReferenceToTarget * referenceToTarget, SBCReferenceToOwnerIndexer * referenceToOwnerIndex=0) Inserts a reference to a target at a specified position and returns its index. |
| SBCReferenceOwnerIndexer & | operator= (const SBCReferenceOwnerIndexer & ownerIndexer) Assigns a copy of ownerIndexer to this. |
| SBCReferenceTarget * | operator[] (unsigned int referenceTargetIndex) const Returns the reference associated to the index . |
| void | printReferencesToTargets () Prints information about the owner indexer and its references to targets to standard output. |
| void | removeAllReferenceTargets () Removes all reference targets from the owner indexer. |
| unsigned int | removeReferenceTarget (unsigned int referenceTargetIndex) Erases reference referenceIndex from the indexer. |
| unsigned int | removeReferenceTarget (SBCReferenceTarget * referenceTarget) Erases the reference from the indexer. |
| unsigned int | removeReferenceToTarget (unsigned int referenceToTargetIndex) Erases reference referenceIndex from the indexer. |
| unsigned int | removeReferenceToTarget (SBCReferenceToTarget * referenceToTarget) Erases the reference from the indexer. |
| unsigned int | size () const Returns the number of reference targets in the owner indexer. |
| virtual | ~SBCReferenceOwnerIndexer () Destroys the SBCReferenceOwnerIndexer and releases all owned references. |
Protected Attributes#
| Type | Name |
|---|---|
| SBCReferenceIndexer * | referenceIndexer |
Protected Functions inherited from SBCReferenceOwner#
| Type | Name |
|---|---|
| SBCReferenceOwner () noexcept Constructs a reference owner. |
|
| virtual | ~SBCReferenceOwner () Destructs the reference owner. |
Public Functions Documentation#
function SBCReferenceOwnerIndexer [1/3]#
Creates an indexer.
Constructs an empty SBCReferenceOwnerIndexer.
Initializes the indexer with no references.
function SBCReferenceOwnerIndexer [2/3]#
Creates an indexer.
Constructs a SBCReferenceOwnerIndexer with a preallocated capacity.
Parameters:
initialSizeThe initial capacity for the reference indexer.
function SBCReferenceOwnerIndexer [3/3]#
Creates a copy of ownerIndexer .
SBCReferenceOwnerIndexer::SBCReferenceOwnerIndexer (
const SBCReferenceOwnerIndexer & ownerIndexer
)
Constructs a SBCReferenceOwnerIndexer as a copy of another owner indexer.
Parameters:
ownerIndexThe source SBCReferenceOwnerIndexer to copy from.
function addReferenceTarget#
Adds a reference target in the indexer, if possible, and returns the index of the reference target.
Adds a reference target to the owner indexer and returns its index.
Parameters:
referenceTargetThe target to be added.
Returns:
The index of the added reference target, or (unsigned int)-1 if the target could not be added.
function addReferenceToTarget#
Adds a reference to a target and returns its index.
unsigned int SBCReferenceOwnerIndexer::addReferenceToTarget (
SBCReferenceToTarget * referenceToTarget,
SBCReferenceToOwnerIndexer * referenceToOwnerIndex=0
)
Creates a new reference if it does not already exist, and registers cross-references as needed.
Parameters:
referenceToTargetThe reference to the target to be added.referenceToOwnerIndexerOptional pointer to a SBCReferenceToOwnerIndexer used for cross-referencing; may be null.
Returns:
The index of the added reference, or (unsigned int)-1 if the reference could not be added.
function clear#
Clears the owner indexer by removing all reference targets.
function empty#
Checks whether the owner indexer contains any reference targets.
Returns:
true if there are no reference targets, false otherwise.
function getIndex [1/4]#
Returns the index associated to the reference .
Retrieves the index of a given reference target.
Parameters:
referenceTargetThe target to query.
Returns:
The index of the target, or (unsigned int)-1 if not found.
function getIndex [2/4]#
Returns the index associated to the reference .
bool SBCReferenceOwnerIndexer::getIndex (
SBCReferenceTarget * referenceTarget,
unsigned int & referenceTargetIndex
) const
Retrieves the index of a given reference target.
Parameters:
referenceTargetThe target to query.referenceTargetIndexOutput parameter that receives the index if found.
Returns:
true if the target has an index and the output parameter is set, false otherwise.
function getIndex [3/4]#
Returns the index associated to the reference .
Retrieves the index of a given reference to a target.
Parameters:
referenceToTargetThe reference to query.
Returns:
The index of the reference, or (unsigned int)-1 if not found.
function getIndex [4/4]#
Returns the index associated to the reference .
bool SBCReferenceOwnerIndexer::getIndex (
SBCReferenceToTarget * referenceToTarget,
unsigned int & referenceToTargetIndex
) const
Retrieves the index of a given reference to a target.
Parameters:
referenceToTargetThe reference to query.referenceToTargetIndexOutput parameter that receives the index if found.
Returns:
true if the reference has an index and the output parameter is set, false otherwise.
function getNumberOfReferenceTargets#
Returns the number of reference targets managed by the owner indexer.
Returns:
The number of reference targets.
function getReferenceTarget#
Returns the reference associated to the index .
SBCReferenceTarget * SBCReferenceOwnerIndexer::getReferenceTarget (
unsigned int referenceTargetIndex
) const
Returns the reference target at the specified index.
Parameters:
referenceTargetIndexThe index of the target to retrieve.
Returns:
A pointer to the reference target, or nullptr if the index is invalid.
function getReferenceToTarget#
Returns the reference associated to the index .
SBCReferenceToTarget * SBCReferenceOwnerIndexer::getReferenceToTarget (
unsigned int referenceToTargetIndex
) const
Returns the reference to a target at the specified index.
Parameters:
referenceToTargetIndexThe index of the reference to retrieve.
Returns:
A pointer to the reference, or nullptr if the index is invalid.
function hasIndex [1/2]#
Returns true if the__reference has an index.
Checks whether a given reference target has an assigned index.
Parameters:
referenceTargetThe target to query.
Returns:
true if the target has an index, false otherwise.
function hasIndex [2/2]#
Returns true if the__reference has an index.
Checks whether a given reference to a target has an assigned index.
Parameters:
referenceToTargetThe reference to query.
Returns:
true if the reference has an index, false otherwise.
function insertReferenceTarget#
Adds a reference target in the indexer at position i , if possible, and returns the index of the reference target.
unsigned int SBCReferenceOwnerIndexer::insertReferenceTarget (
unsigned int i,
SBCReferenceTarget * referenceTarget
)
Inserts a reference target at the specified position and returns its index.
Parameters:
iThe position at which to insert the target.referenceTargetThe target to be inserted.
Returns:
The index of the inserted reference target, or (unsigned int)-1 if insertion fails.
function insertReferenceToTarget#
Inserts a reference to a target at a specified position and returns its index.
unsigned int SBCReferenceOwnerIndexer::insertReferenceToTarget (
unsigned int i,
SBCReferenceToTarget * referenceToTarget,
SBCReferenceToOwnerIndexer * referenceToOwnerIndex=0
)
Inserts a new reference at the specified position, creating cross-references if necessary.
Parameters:
iThe position at which to insert the reference.referenceToTargetThe reference to the target to be inserted.referenceToOwnerIndexerOptional pointer to a SBCReferenceToOwnerIndexer used for cross-referencing; may be null.
Returns:
The index of the inserted reference, or (unsigned int)-1 if insertion fails.
function operator=#
Assigns a copy of ownerIndexer to this.
SBCReferenceOwnerIndexer & SBCReferenceOwnerIndexer::operator= (
const SBCReferenceOwnerIndexer & ownerIndexer
)
Assigns the contents of another SBCReferenceOwnerIndexer to this one.
Parameters:
ownerIndexThe source SBCReferenceOwnerIndexer to assign from.
Returns:
A reference to this SBCReferenceOwnerIndexer after assignment.
function operator[]#
Returns the reference associated to the index .
SBCReferenceTarget * SBCReferenceOwnerIndexer::operator[] (
unsigned int referenceTargetIndex
) const
Provides array-like access to a reference target by index.
Parameters:
referenceTargetIndexThe index of the target to retrieve.
Returns:
A pointer to the reference target, or nullptr if the index is invalid.
function printReferencesToTargets#
Prints information about the owner indexer and its references to targets to standard output.
function removeAllReferenceTargets#
Removes all reference targets from the owner indexer.
function removeReferenceTarget [1/2]#
Erases reference referenceIndex from the indexer.
Removes the reference target at the given index.
Parameters:
referenceTargetIndexThe index of the reference target to remove.
Returns:
The index of the removed reference target, or (unsigned int)-1 if removal fails.
function removeReferenceTarget [2/2]#
Erases the reference from the indexer.
unsigned int SBCReferenceOwnerIndexer::removeReferenceTarget (
SBCReferenceTarget * referenceTarget
)
Removes the specified reference target.
Parameters:
referenceTargetThe reference target to be removed.
Returns:
The index of the removed reference target, or (unsigned int)-1 if the target was not found.
function removeReferenceToTarget [1/2]#
Erases reference referenceIndex from the indexer.
unsigned int SBCReferenceOwnerIndexer::removeReferenceToTarget (
unsigned int referenceToTargetIndex
)
Removes the reference to a target at the given index.
Removes the reference at the specified index and releases its resources.
Parameters:
referenceToTargetIndexThe index of the reference to remove.
Returns:
The index of the removed reference, or (unsigned int)-1 if removal fails.
function removeReferenceToTarget [2/2]#
Erases the reference from the indexer.
unsigned int SBCReferenceOwnerIndexer::removeReferenceToTarget (
SBCReferenceToTarget * referenceToTarget
)
Removes the specified reference to a target.
Removes the given reference from the indexer and releases its resources.
Parameters:
referenceToTargetThe reference to the target to be removed.
Returns:
The index of the removed reference, or (unsigned int)-1 if the reference was not found.
function size#
Returns the number of reference targets in the owner indexer.
Returns:
The number of reference targets.
function ~SBCReferenceOwnerIndexer#
Destroys the SBCReferenceOwnerIndexer and releases all owned references.