Class SBCReferenceToTarget#
ClassList > SBCReferenceToTarget
Inherits the following classes: SBCReference
Inherited by the following classes: SBCGraphArc
Public Functions#
| Type | Name |
|---|---|
| SBCReferenceTarget * | getReferenceTarget () noexcept const Returns the referenced target. |
Protected Attributes#
| Type | Name |
|---|---|
| SBCContainerListLink< SBCReferenceToOwner * > * | containerListLinkInTarget Pointer to the link back-referencing the owner in the target. |
| SBCReferenceTarget * | referenceTarget Pointer to the reference target. |
Protected Functions#
| Type | Name |
|---|---|
| SBCReferenceToTarget (SBCReferenceTarget * referenceTarget, SBCContainerListLink< SBCReferenceToOwner * > * containerListLinkInTarget) Constructs a reference to a target object. |
|
| unsigned int | getMemoryFootprint () const Returns the memory footprint of this reference object. |
| virtual void | print (std::ostream & os) override const Prints debugging information. |
| virtual void | print () override const Prints debugging information. |
| virtual void | stopReferencing () override Stops referencing the target object. |
| virtual | ~SBCReferenceToTarget () Destructor. |
Public Functions Documentation#
function getReferenceTarget#
Returns the referenced target.
Provides access to the target object referenced by this reference, or nullptr if none.
Returns:
Pointer to the SBCReferenceTarget, or nullptr if no target is referenced.
Protected Attributes Documentation#
variable containerListLinkInTarget#
Pointer to the link back-referencing the owner in the target.
variable referenceTarget#
Pointer to the reference target.
Protected Functions Documentation#
function SBCReferenceToTarget#
Constructs a reference to a target object.
SBCReferenceToTarget::SBCReferenceToTarget (
SBCReferenceTarget * referenceTarget,
SBCContainerListLink < SBCReferenceToOwner * > * containerListLinkInTarget
)
Creates a SBCReferenceToTarget that holds a pointer to the given reference target and a link back to the owning reference in the target.
Parameters:
tPointer to the reference target object.cPointer to the container list link that references the owner in the target.
function getMemoryFootprint#
Returns the memory footprint of this reference object.
Calculates the size in bytes of the internal data stored by this reference.
Returns:
Size in bytes of the reference object's memory footprint.
function print [1/2]#
Prints debugging information.
Prints debugging information to the specified output stream.
Outputs details about this reference and its target to the provided stream.
Parameters:
osOutput stream to which the debugging information is written.
function print [2/2]#
Prints debugging information.
Prints debugging information to standard output.
Calls the overload that prints to a given output stream with std::cout as the stream.
function stopReferencing#
Stops referencing the target object.
Disconnects this reference from its target. If the target has no remaining owners, the target is deleted. After this call, the reference no longer points to any target.
function ~SBCReferenceToTarget#
Destructor.
Destroys the SBCReferenceToTarget. Does not automatically delete the referenced target.