| TSharedRef
|
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
Include |
#include "Templates/SharedPointer.h" |
template<class ObjectType, ESPMode InMode>
class TSharedRef
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.
Forward declarations. By default, thread safety features are turned on. (Mode = ESPMode::ThreadSafe). If you need more concerned with performance of ref-counting, you should use ESPMode::NotThreadSafe.
Name | Description | |
---|---|---|
|
TSharedRef() |
Constructs default shared reference that owns the default object for specified type. |
|
TSharedRef ( |
Constructs a shared reference that owns the specified object. Must not be nullptr. |
|
TSharedRef ( |
Special constructor used internally to statically cast one shared reference type to another. |
|
TSharedRef ( |
Special constructor used internally to cast a 'const' shared reference a 'mutable' reference. |
|
TSharedRef ( |
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. |
|
TSharedRef ( |
NOTE: TSharedRef has no default constructor as it does not support empty references. |
|
TSharedRef |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
TSharedRef |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
TSharedRef |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
TSharedRef ( |
Constructs a shared reference as a reference to an existing shared reference's object. |
|
TSharedRef ( |
|
|
TSharedRef ( |
Name | Description | ||
---|---|---|---|
|
ObjectType & |
Get() |
Returns a C++ reference to the object this shared reference is referencing |
|
int32 |
GetSharedReferenceCount() |
Returns the number of shared references to this object (including this reference.) IMPORTANT: Not necessarily fast! Should only be used for debugging purposes! |
|
bool |
IsUnique() |
Returns true if this is the only shared reference to this object. |
|
TSharedPtr< ... |
ToSharedPtr() |
Converts a shared reference to a shared pointer. |
|
TWeakPtr< Ob... |
ToWeakPtr() |
Converts a shared reference to a weak ptr. |
Name | Description | ||
---|---|---|---|
|
ObjectType & |
operator*() |
Dereference operator returns a reference to the object this shared pointer points to |
|
operator= |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
|
operator= |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
|
operator= ( |
||
|
operator= |
NOTE: The following is an Unreal extension to standard shared_ptr behavior. |
|
|
operator= ( |
Assignment operator replaces this shared reference with the specified shared reference. |
|
|
ObjectType &... |
operator->() |
Arrow operator returns a pointer to this shared reference's object |
Name |
Description |
---|---|
ElementType |
Name |
Description |
---|---|
Mode |