FSharedReferencer

[FSharedReferencer](API\Runtime\Core\Templates\FSharedReferencer) is a wrapper around a pointer to a reference controller that is used by either a [TSharedRef](API\Runtime\Core\Templates\TSharedRef) or a [TSharedPtr](API\Runtime\Core\Templates\TSharedPtr) to keep track of a referenced object's lifetime

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Templates/SharedPointerInternals.h

Include

#include "Templates/SharedPointerInternals.h"

Syntax

template<ESPMode Mode>
class FSharedReferencer

Remarks

FSharedReferencer is a wrapper around a pointer to a reference controller that is used by either a TSharedRef or a TSharedPtr to keep track of a referenced object's lifetime

Constructors

Name Description

Public function

FSharedReferencer()

Constructor for an empty shared referencer object

Public function

FSharedReferencer

(
    FReferenceControllerBase* InRe...
)

Constructor that counts a single reference to the specified object

Public function

FSharedReferencer

(
    FSharedReferencer const& InSharedR...
)

Copy constructor creates a new reference to the existing object

Public function

FSharedReferencer

(
    FSharedReferencer&& InSharedRefere...
)

Move constructor creates no new references

Public function

FSharedReferencer

(
    FWeakReferencer< Mode > const& InW...
)

Creates a shared referencer object from a weak referencer object.

Public function

FSharedReferencer

(
    FWeakReferencer< Mode >&& InWeakRe...
)

Creates a shared referencer object from a weak referencer object.

Destructors

Name Description

Public function

~FSharedReferencer()

Destructor.

Functions

Name Description

Public function Const

const int32

 

GetSharedReferenceCount()

Returns the number of shared references to this object (including this reference.)

Public function Const

const bool

 

IsUnique()

Returns true if this is the only shared reference to this object.

Public function Const

const bool

 

IsValid()

Tests to see whether or not this shared counter contains a valid reference

Operators

Name Description

Public function

FSharedRefer...

 

operator=

(
    FSharedReferencer const& InSharedR...
)

Assignment operator adds a reference to the assigned object.

Public function

FSharedRefer...

 

operator=

(
    FSharedReferencer&& InSharedRefere...
)

Move assignment operator adds no references to the assigned object.

Typedefs

Name

Description

TOps

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss