Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TSharedPtr
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| NOTE: FNullTag parameter is an Unreal extension to standard shared_ptr behavior. | Templates/SharedPointer.h | ||
TSharedPtr
(
OtherType* InObject |
Constructs a shared pointer that owns the specified object. | Templates/SharedPointer.h | |
TSharedPtr
(
SharedPointerInternals::TRawPtrProxy< OtherType > const& InRawPtrProxy |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. | Templates/SharedPointer.h | |
TSharedPtr
(
SharedPointerInternals::TRawPtrProxyWithDeleter< OtherType, DeleterType > const& InRawPtrProxy |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. | Templates/SharedPointer.h | |
TSharedPtr
(
SharedPointerInternals::TRawPtrProxyWithDeleter< OtherType, DeleterType >&& InRawPtrProxy |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr< OtherType, Mode > const& InSharedPtr |
Constructs a shared pointer as a shared reference to an existing shared pointer's object. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr const& InSharedPtr |
Templates/SharedPointer.h | ||
TSharedPtr
(
TSharedPtr&& InSharedPtr |
Templates/SharedPointer.h | ||
TSharedPtr
(
TSharedRef< OtherType, Mode > const& InSharedRef |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. | Templates/SharedPointer.h | |
| Templates/SharedPointer.h | |||
TSharedPtr
(
TWeakPtr< OtherType, Mode > const& InWeakPtr |
Constructs a shared pointer from a weak pointer, allowing you to access the object (if it hasn't expired yet.) Remember, if there are no more shared references to the object, the shared pointer will not be valid. | Templates/SharedPointer.h | |
TSharedPtr
(
TWeakPtr< OtherType, Mode >&& InWeakPtr |
Constructs a shared pointer from a weak pointer, allowing you to access the object (if it hasn't expired yet.) Remember, if there are no more shared references to the object, the shared pointer will not be valid. | Templates/SharedPointer.h | |
TSharedPtr
(
OtherType* InObject, |
Constructs a shared pointer that owns the specified object. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr< OtherType, Mode > const& InSharedPtr, |
Special constructor used internally to statically cast one shared pointer type to another. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr< OtherType, Mode > const& InSharedPtr, |
Special constructor used internally to cast a 'const' shared pointer a 'mutable' pointer. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr< OtherType, Mode > const& OtherSharedPtr, |
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedPtr< OtherType, Mode >&& OtherSharedPtr, |
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject. | Templates/SharedPointer.h | |
TSharedPtr
(
TSharedRef< OtherType, Mode > const& OtherSharedRef, |
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject. | Templates/SharedPointer.h |
TSharedPtr(SharedPointerInternals::FNullTag *)
Description
Constructs an empty shared pointer
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
TSharedPtr
(
SharedPointerInternals::FNullTag *
)
TSharedPtr(OtherType *)
Description
Constructs a shared pointer that owns the specified object. Note that passing nullptr here will still create a tracked reference to a nullptr pointer. (Consistent with std::shared_ptr)
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
OtherType * InObject
)
Parameters
| Name | Remarks |
|---|---|
| InObject | Object this shared pointer to retain a reference to |
TSharedPtr(SharedPointerInternals::TRawPtrProxy< OtherType > const &)
Description
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
SharedPointerInternals::TRawPtrProxy < OtherType > const & InRawPtrProxy
)
Parameters
| Name | Remarks |
|---|---|
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
TSharedPtr(SharedPointerInternals::TRawPtrProxyWithDeleter< OtherType, DeleterType > const &)
Description
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, typename DeleterType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
SharedPointerInternals::TRawPtrProxyWithDeleter < OtherType, DeleterType > const & InRawPtrProxy
)
Parameters
| Name | Remarks |
|---|---|
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
TSharedPtr(SharedPointerInternals::TRawPtrProxyWithDeleter< OtherType, DeleterType > &&)
Description
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, typename DeleterType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
SharedPointerInternals::TRawPtrProxyWithDeleter < OtherType, DeleterType > && InRawPtrProxy
)
Parameters
| Name | Remarks |
|---|---|
| InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
TSharedPtr(TSharedPtr< OtherType, Mode > const &)
Description
Constructs a shared pointer as a shared reference to an existing shared pointer's object. This constructor is needed so that we can implicitly upcast to base classes.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
TSharedPtr < OtherType, Mode > const & InSharedPtr
)
Parameters
| Name | Remarks |
|---|---|
| InSharedPtr | The shared pointer whose object we should create an additional reference to |
TSharedPtr(TSharedPtr const &)
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
TSharedPtr
(
TSharedPtr const & InSharedPtr
)
TSharedPtr(TSharedPtr &&)
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
TSharedPtr
(
TSharedPtr && InSharedPtr
)
TSharedPtr(TSharedRef< OtherType, Mode > const &)
Description
Implicitly converts a shared reference to a shared pointer, adding a reference to the object. NOTE: We allow an implicit conversion from TSharedRef to TSharedPtr because it's always a safe conversion.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
TSharedRef < OtherType, Mode > const & InSharedRef
)
Parameters
| Name | Remarks |
|---|---|
| InSharedRef | The shared reference that will be converted to a shared pointer |
TSharedPtr(FIntrusiveUnsetOptionalState)
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
TSharedPtr
(
FIntrusiveUnsetOptionalState
)
TSharedPtr(TWeakPtr< OtherType, Mode > const &)
Description
Constructs a shared pointer from a weak pointer, allowing you to access the object (if it hasn't expired yet.) Remember, if there are no more shared references to the object, the shared pointer will not be valid. You should always check to make sure this shared pointer is valid before trying to dereference the shared pointer!
NOTE: This constructor is private to force users to be explicit when converting a weak pointer to a shared pointer. Use the weak pointer's Pin() method instead!
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
TWeakPtr < OtherType, Mode > const & InWeakPtr
)
TSharedPtr(TWeakPtr< OtherType, Mode > &&)
Description
Constructs a shared pointer from a weak pointer, allowing you to access the object (if it hasn't expired yet.) Remember, if there are no more shared references to the object, the shared pointer will not be valid. You should always check to make sure this shared pointer is valid before trying to dereference the shared pointer!
NOTE: This constructor is private to force users to be explicit when converting a weak pointer to a shared pointer. Use the weak pointer's Pin() method instead!
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
TWeakPtr < OtherType, Mode > && InWeakPtr
)
TSharedPtr(OtherType *, DeleterType &&)
Description
Constructs a shared pointer that owns the specified object. Note that passing nullptr here will still create a tracked reference to a nullptr pointer. (Consistent with std::shared_ptr)
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType, typename DeleterType, std::enable_if_t<(std::is_convertible_v< OtherType *, ObjectType * >), int >>
TSharedPtr
(
OtherType * InObject,
DeleterType && InDeleter
)
Parameters
| Name | Remarks |
|---|---|
| InObject | Object this shared pointer to retain a reference to |
| InDeleter | Deleter object used to destroy the object when it is no longer referenced. |
TSharedPtr(TSharedPtr< OtherType, Mode > const &, SharedPointerInternals::FStaticCastTag)
Description
Special constructor used internally to statically cast one shared pointer type to another. You should never call this constructor directly. Instead, use the StaticCastSharedPtr() function. This constructor creates a shared pointer as a shared reference to an existing shared pointer after statically casting that pointer's object. This constructor is needed for static casts.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType>
TSharedPtr
(
TSharedPtr < OtherType, Mode > const & InSharedPtr,
SharedPointerInternals::FStaticCastTag
)
Parameters
| Name | Remarks |
|---|---|
| InSharedPtr | The shared pointer whose object we should create an additional reference to |
TSharedPtr(TSharedPtr< OtherType, Mode > const &, SharedPointerInternals::FConstCastTag)
Description
Special constructor used internally to cast a 'const' shared pointer a 'mutable' pointer. You should never call this constructor directly. Instead, use the ConstCastSharedPtr() function. This constructor creates a shared pointer as a shared reference to an existing shared pointer after const casting that pointer's object. This constructor is needed for const casts.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType>
TSharedPtr
(
TSharedPtr < OtherType, Mode > const & InSharedPtr,
SharedPointerInternals::FConstCastTag
)
Parameters
| Name | Remarks |
|---|---|
| InSharedPtr | The shared pointer whose object we should create an additional reference to |
TSharedPtr(TSharedPtr< OtherType, Mode > const &, ObjectType *)
Description
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType>
TSharedPtr
(
TSharedPtr < OtherType, Mode > const & OtherSharedPtr,
ObjectType * InObject
)
Parameters
| Name | Remarks |
|---|---|
| OtherSharedPtr | The shared pointer whose reference count should be shared. |
| InObject | The object pointer to use (instead of the incoming shared pointer's object) |
TSharedPtr(TSharedPtr< OtherType, Mode > &&, ObjectType *)
Description
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType>
TSharedPtr
(
TSharedPtr < OtherType, Mode > && OtherSharedPtr,
ObjectType * InObject
)
Parameters
| Name | Remarks |
|---|---|
| OtherSharedPtr | The shared pointer whose reference count should be shared. |
| InObject | The object pointer to use (instead of the incoming shared pointer's object) |
TSharedPtr(TSharedRef< OtherType, Mode > const &, ObjectType *)
Description
Aliasing constructor used to create a shared pointer which shares its reference count with another shared object, but pointing to a different object, typically a subobject.
| Name | TSharedPtr |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
| Include Path | #include "Templates/SharedPointer.h" |
template<typename OtherType>
TSharedPtr
(
TSharedRef < OtherType, Mode > const & OtherSharedRef,
ObjectType * InObject
)
Parameters
| Name | Remarks |
|---|---|
| OtherSharedRef | The shared reference whose reference count should be shared. |
| InObject | The object pointer to use (instead of the incoming shared pointer's object) |