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<typename OtherType , typename = decltype(ImplicitConv<ObjectType*>((OtherType*)nullptr))> | |
FORCEINLINE | TSharedPtr (TWeakPtr< OtherType, Mode > const &InWeakPtr) |
template<typename OtherType , typename = typename TEnableIf<TPointerIsConvertibleFromTo<OtherType, ObjectType>::Value>::Type> | |
FORCEINLINE | TSharedPtr (TWeakPtr< OtherType, Mode > &&InWeakPtr) |
Private Attributes | |
ObjectType * | Object |
SharedPointerInternals::FSharedReferencer< Mode > | SharedReferenceCount |
Friends | |
template<class OtherType , ESPMode OtherMode> | |
class | TSharedPtr |
template<class OtherType , ESPMode OtherMode> | |
class | TSharedRef |
template<class OtherType , ESPMode OtherMode> | |
class | TWeakPtr |
template<class OtherType , ESPMode OtherMode> | |
class | TSharedFromThis |
TSharedPtr is a non-intrusive reference-counted authoritative object pointer. This shared pointer will be conditionally thread-safe when the optional Mode template argument is set to ThreadSafe.
Definition at line 685 of file SharedPointer.h.
using TSharedPtr< ObjectType, InMode >::ElementType = ObjectType |
Definition at line 688 of file SharedPointer.h.
|
inline |
Constructs an empty shared pointer
Definition at line 695 of file SharedPointer.h.
|
inlineexplicit |
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)
InObject | Object this shared pointer to retain a reference to |
Definition at line 711 of file SharedPointer.h.
|
inline |
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)
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 734 of file SharedPointer.h.
|
inline |
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
Definition at line 755 of file SharedPointer.h.
|
inline |
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
Definition at line 777 of file SharedPointer.h.
|
inline |
Constructs a shared pointer using a proxy reference to a raw pointer. (See MakeShareable())
InRawPtrProxy | Proxy raw pointer that contains the object that the new shared pointer will reference |
Definition at line 799 of file SharedPointer.h.
|
inline |
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.
InSharedPtr | The shared pointer whose object we should create an additional reference to |
Definition at line 820 of file SharedPointer.h.
|
inline |
Definition at line 826 of file SharedPointer.h.
|
inline |
Definition at line 832 of file SharedPointer.h.
|
inline |
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.
InSharedRef | The shared reference that will be converted to a shared pointer |
Definition at line 850 of file SharedPointer.h.
|
inline |
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.
InSharedPtr | The shared pointer whose object we should create an additional reference to |
Definition at line 867 of file SharedPointer.h.
|
inline |
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.
InSharedPtr | The shared pointer whose object we should create an additional reference to |
Definition at line 882 of file SharedPointer.h.
|
inline |
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.
OtherSharedPtr | The shared pointer whose reference count should be shared. |
InObject | The object pointer to use (instead of the incoming shared pointer's object) |
Definition at line 896 of file SharedPointer.h.
|
inline |
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.
OtherSharedPtr | The shared pointer whose reference count should be shared. |
InObject | The object pointer to use (instead of the incoming shared pointer's object) |
Definition at line 910 of file SharedPointer.h.
|
inline |
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.
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 925 of file SharedPointer.h.
|
inlineexplicitprivate |
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!
Definition at line 1160 of file SharedPointer.h.
|
inlineexplicitprivate |
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!
Definition at line 1185 of file SharedPointer.h.
|
inline |
Returns the object referenced by this pointer, or nullptr if no object is reference
Definition at line 1066 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 1128 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: Not necessarily fast! Should only be used for debugging purposes!
Definition at line 1140 of file SharedPointer.h.
|
inline |
Checks to see if this shared pointer is actually pointing to an object
Definition at line 1086 of file SharedPointer.h.
|
inlineexplicit |
Checks to see if this shared pointer is actually pointing to an object
Definition at line 1076 of file SharedPointer.h.
|
inline |
Dereference operator returns a reference to the object this shared pointer points to
Definition at line 1096 of file SharedPointer.h.
|
inline |
Arrow operator returns a pointer to the object this shared pointer references
Definition at line 1107 of file SharedPointer.h.
|
inline |
Assignment to a nullptr pointer. The object currently referenced by this shared pointer will no longer be referenced and will be deleted if there are no other referencers.
Definition at line 936 of file SharedPointer.h.
|
inline |
Assignment operator replaces this shared pointer with the specified shared pointer. The object currently referenced by this shared pointer will no longer be referenced and will be deleted if there are no other referencers.
InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
Definition at line 979 of file SharedPointer.h.
|
inline |
Assignment operator replaces this shared pointer with the specified shared pointer. The object currently referenced by this shared pointer will no longer be referenced and will be deleted if there are no other referencers.
InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
Definition at line 1017 of file SharedPointer.h.
|
inline |
Assignment operator replaces this shared pointer with the specified shared pointer. The object currently referenced by this shared pointer will no longer be referenced and will be deleted if there are no other referencers.
InRawPtrProxy | Proxy object used to assign the object (see MakeShareable helper function) |
Definition at line 998 of file SharedPointer.h.
|
inline |
Definition at line 956 of file SharedPointer.h.
|
inline |
Assignment operator replaces this shared pointer with the specified shared pointer. The object currently referenced by this shared pointer will no longer be referenced and will be deleted if there are no other referencers.
InSharedPtr | Shared pointer to replace with |
Definition at line 949 of file SharedPointer.h.
|
inline |
Resets this shared pointer, removing a reference to the object. If there are no other shared references to the object then it will be destroyed.
Definition at line 1117 of file SharedPointer.h.
|
inline |
Converts a shared pointer to a shared reference. The pointer must be valid or an assertion will trigger.
Definition at line 1043 of file SharedPointer.h.
|
inline |
Converts a shared pointer to a shared reference. The pointer must be valid or an assertion will trigger.
Definition at line 1029 of file SharedPointer.h.
|
inline |
Converts a shared pointer to a weak ptr.
Definition at line 1056 of file SharedPointer.h.
|
friend |
Definition at line 1204 of file SharedPointer.h.
|
friend |
Definition at line 1199 of file SharedPointer.h.
|
friend |
Definition at line 1202 of file SharedPointer.h.
Definition at line 1203 of file SharedPointer.h.
|
staticconstexpr |
Definition at line 689 of file SharedPointer.h.
|
private |
The object we're holding a reference to. Can be nullptr.
Definition at line 1209 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 1213 of file SharedPointer.h.