![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SharedPointer.h>
Public Types | |
| using | ElementType = ObjectType |
| using | IntrusiveUnsetOptionalStateType = TSharedRef |
Static Public Attributes | |
| static constexpr ESPMode | Mode = InMode |
| static constexpr bool | bHasIntrusiveUnsetOptionalState = true |
Friends | |
| template<class OtherType , ESPMode OtherMode> | |
| class | TSharedRef |
| template<class OtherType , ESPMode OtherMode> | |
| class | TSharedPtr |
| template<class OtherType , ESPMode OtherMode> | |
| class | TWeakPtr |
| TSharedRef | UE::Core::Private::MakeSharedRef (ObjectType *InObject, SharedPointerInternals::TReferenceControllerBase< Mode > *InSharedReferenceCount) |
TSharedRef is a non-nullable, non-intrusive reference-counted authoritative object reference.
This shared reference will be conditionally thread-safe when the optional Mode template argument is set to ThreadSafe.
| using TSharedRef< ObjectType, InMode >::ElementType = ObjectType |
| using TSharedRef< ObjectType, InMode >::IntrusiveUnsetOptionalStateType = TSharedRef |
|
inlineexplicit |
Constructs a shared reference that owns the specified object. Must not be nullptr.
| InObject | Object this shared reference to retain a reference to |
|
inline |
Constructs a shared reference that owns the specified object. Must not be nullptr.
| InObject | Object this shared pointer to retain a reference to |
| InDeleter | Deleter object used to destroy the object when it is no longer referenced. |
|
inline |
Constructs default shared reference that owns the default object for specified type.
Used internally only. Please do not use!
|
inline |
Constructs a shared reference using a proxy reference to a raw pointer. (See MakeShareable()) Must not be nullptr.
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared reference will reference |
|
inline |
Constructs a shared reference using a proxy reference to a raw pointer. (See MakeShareable()) Must not be nullptr.
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared reference will reference |
|
inline |
Constructs a shared reference using a proxy reference to a raw pointer. (See MakeShareable()) Must not be nullptr.
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared reference will reference |
|
inline |
Constructs a shared reference as a reference to an existing shared reference's object. This constructor is needed so that we can implicitly upcast to base classes.
| InSharedRef | The shared reference whose object we should create an additional reference to |
|
inline |
Special constructor used internally to statically cast one shared reference type to another. You should never call this constructor directly. Instead, use the StaticCastSharedRef() function. This constructor creates a shared reference as a shared reference to an existing shared reference after statically casting that reference's object. This constructor is needed for static casts.
| InSharedRef | The shared reference whose object we should create an additional reference to |
|
inline |
Special constructor used internally to cast a 'const' shared reference a 'mutable' reference. You should never call this constructor directly. Instead, use the ConstCastSharedRef() function. This constructor creates a shared reference as a shared reference to an existing shared reference after const casting that reference's object. This constructor is needed for const casts.
| InSharedRef | The shared reference whose object we should create an additional reference to |
|
inline |
Aliasing constructor used to create a shared reference which shares its reference count with another shared object, but pointing to a different object, typically a subobject.
| OtherSharedRef | The shared reference whose reference count should be shared. |
| InObject | The object pointer to use (instead of the incoming shared pointer's object) |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
Returns a C++ reference to the object this shared reference is referencing
|
inline |
Returns the number of shared references to this object (including this reference.) IMPORTANT: Not necessarily fast! Should only be used for debugging purposes!
|
inline |
Returns true if this is the only shared reference to this object. Note that there may be outstanding weak references left.
IMPORTANT: This has different behavior to GetSharedReferenceCount() == 1 in a multithreaded context. The expectation is that this will be used when a user wants exclusive write-access to an otherwise-immutable object. Care still needs to be taken when pinning TWeakPtrs to make new shared references.
|
inline |
Dereference operator returns a reference to the object this shared pointer points to
|
inline |
Arrow operator returns a pointer to this shared reference's object
|
inline |
Assignment operator replaces this shared reference with the specified shared reference. The object currently referenced by this shared reference will no longer be referenced and will be deleted if there are no other referencers. Must not be nullptr.
| InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
|
inline |
Assignment operator replaces this shared reference with the specified shared reference. The object currently referenced by this shared reference will no longer be referenced and will be deleted if there are no other referencers. Must not be nullptr.
| InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
|
inline |
Assignment operator replaces this shared reference with the specified shared reference. The object currently referenced by this shared reference will no longer be referenced and will be deleted if there are no other referencers. Must not be nullptr.
| InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
|
inline |
|
inline |
Assignment operator replaces this shared reference with the specified shared reference. The object currently referenced by this shared reference will no longer be referenced and will be deleted if there are no other referencers.
| InSharedRef | Shared reference to replace with |
|
inline |
Converts a shared reference to a shared pointer.
|
inline |
Converts a shared reference to a weak ptr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
staticconstexpr |
|
staticconstexpr |