class
TWeak
template<typename Type, ThreadSafetyPolicy ThreadSafety = ThreadSafe>References an object owned by a TShared.
Unlike TShared, this type of pointer will not keep the object alive, and the referenced object may or may not still be live. Weak pointer must be converted to a strong pointer (TShared) before use.
Template parameters
Type | Object type to reference by the pointer. |
|---|---|
ThreadSafety | If ThreadSafe, shared pointer can be safely accessed from multiple threads, otherwise it is only safe to access from a single thread. Non-thread safe version is faster. |
Public
Constructors
Methods
Reset
Clears the strong reference and the pointed object.
IsExpired
Returns true if the underlying object is still valid.
GetReferenceCount
Returns the number of strong references held by the pointer.
Operators
Protected
Methods
IncrementStrongReferenceCount
Increments the strong reference count.
DecrementStrongReferenceCount
Decrements the strong reference count, and releases the object if count is zero.
IncrementWeakReferenceCount
Increments the weak reference count.
DecrementWeakReferenceCount
Decrements the weak reference count, and releases the control block if the count is zero.