Ark Server API (ASA) - Wiki
|
#include <SharedPointer.h>
Public Types | |
using | ElementType = ObjectType |
Static Public Attributes | |
static constexpr ESPMode | Mode = InMode |
Private Member Functions | |
template<class OtherType > | |
void | Init (OtherType *InObject) |
template<typename OtherType , typename = decltype(ImplicitConv<ObjectType*>((OtherType*)nullptr))> | |
FORCEINLINE | TSharedRef (TSharedPtr< OtherType, Mode > const &InSharedPtr) |
template<typename OtherType , typename = decltype(ImplicitConv<ObjectType*>((OtherType*)nullptr))> | |
FORCEINLINE | TSharedRef (TSharedPtr< OtherType, Mode > &&InSharedPtr) |
FORCEINLINE bool | IsValid () const |
FORCEINLINE | TSharedRef (ObjectType *InObject, SharedPointerInternals::TReferenceControllerBase< Mode > *InSharedReferenceCount) |
Private Attributes | |
ObjectType * | Object |
SharedPointerInternals::FSharedReferencer< Mode > | SharedReferenceCount |
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.
Definition at line 162 of file SharedPointer.h.
using TSharedRef< ObjectType, InMode >::ElementType = ObjectType |
Definition at line 165 of file SharedPointer.h.
|
inlineexplicit |
Constructs a shared reference that owns the specified object. Must not be nullptr.
InObject | Object this shared reference to retain a reference to |
Definition at line 180 of file SharedPointer.h.
|
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. |
Definition at line 200 of file SharedPointer.h.
|
inline |
Constructs default shared reference that owns the default object for specified type.
Used internally only. Please do not use!
Definition at line 214 of file SharedPointer.h.
|
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 |
Definition at line 233 of file SharedPointer.h.
|
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 |
Definition at line 260 of file SharedPointer.h.
|
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 |
Definition at line 287 of file SharedPointer.h.
|
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 |
Definition at line 312 of file SharedPointer.h.
|
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 |
Definition at line 327 of file SharedPointer.h.
|
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 |
Definition at line 342 of file SharedPointer.h.
|
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) |
Definition at line 356 of file SharedPointer.h.
|
inline |
Definition at line 365 of file SharedPointer.h.
|
inline |
Definition at line 370 of file SharedPointer.h.
|
inlineexplicitprivate |
Converts a shared pointer to a shared reference. The pointer must be valid or an assertion will trigger. NOTE: This explicit conversion constructor is intentionally private. Use 'ToSharedRef()' instead.
Definition at line 573 of file SharedPointer.h.
|
inlineexplicitprivate |
Definition at line 586 of file SharedPointer.h.
|
inlineexplicitprivate |
Definition at line 636 of file SharedPointer.h.
|
inline |
Returns a C++ reference to the object this shared reference is referencing
Definition at line 492 of file SharedPointer.h.
|
inline |
Returns the number of shared references to this object (including this reference.) IMPORTANT: Not necessarily fast! Should only be used for debugging purposes!
Definition at line 529 of file SharedPointer.h.
|
inlineprivate |
Definition at line 552 of file SharedPointer.h.
|
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.
Definition at line 545 of file SharedPointer.h.
|
inlineprivate |
Checks to see if this shared reference is actually pointing to an object. NOTE: This validity test is intentionally private because shared references must always be valid.
Definition at line 603 of file SharedPointer.h.
|
inline |
Dereference operator returns a reference to the object this shared pointer points to
Definition at line 504 of file SharedPointer.h.
|
inline |
Arrow operator returns a pointer to this shared reference's object
Definition at line 516 of file SharedPointer.h.
|
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) |
Definition at line 411 of file SharedPointer.h.
|
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) |
Definition at line 457 of file SharedPointer.h.
|
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) |
Definition at line 434 of file SharedPointer.h.
|
inline |
Definition at line 393 of file SharedPointer.h.
|
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 |
Definition at line 386 of file SharedPointer.h.
|
inline |
Converts a shared reference to a shared pointer.
Definition at line 472 of file SharedPointer.h.
|
inline |
Converts a shared reference to a weak ptr.
Definition at line 482 of file SharedPointer.h.
|
friend |
Definition at line 612 of file SharedPointer.h.
|
friend |
Definition at line 609 of file SharedPointer.h.
Definition at line 613 of file SharedPointer.h.
|
friend |
|
staticconstexpr |
Definition at line 166 of file SharedPointer.h.
|
private |
The object we're holding a reference to. Can be nullptr.
Definition at line 618 of file SharedPointer.h.
|
private |
Interface to the reference counter for this object. Note that the actual reference controller object is shared by all shared and weak pointers that refer to the object
Definition at line 622 of file SharedPointer.h.