class
TShared
template<typename Type, ThreadSafetyPolicy ThreadSafety = ThreadSafe>
Inherits:
TSharedCommon<Type, ThreadSafety>
Reference counted object pointer that will keep the underlying object alive as long as the reference count is above 0.
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
void Reset()
Clears the strong reference and the pointed object.
GetReferenceCount
u32 GetReferenceCount() const
Returns the number of strong references held by the pointer.
Operators
Protected
Methods
IncrementStrongReferenceCount
void IncrementStrongReferenceCount() const
Increments the strong reference count.
DecrementStrongReferenceCount
void DecrementStrongReferenceCount() const
Decrements the strong reference count, and releases the object if count is zero.
IncrementWeakReferenceCount
void IncrementWeakReferenceCount() const
Increments the weak reference count.
DecrementWeakReferenceCount
void DecrementWeakReferenceCount() const
Decrements the weak reference count, and releases the control block if the count is zero.
Fields
mOwnedObject
Type * mOwnedObject
mControlBlock
TSharedControlBlock<ThreadSafety> * mControlBlock