SharedPtr<T> Class

Represents a shared ownership smart pointer. Keeps count of references to the underlying pointer and deletes it when the last shared pointer goes out of scope.

Template Parameters

T

Constructors & Destructor

public nothrow SharedPtr()
public nothrow SharedPtr(SharedPtr&& that)
public explicit nothrow SharedPtr(T* ptr_)
public nothrow SharedPtr(T* ptr_, const SharedCount<T>& count_)
public nothrow SharedPtr(const SharedPtr& that)
public nothrow SharedPtr(const WeakPtr<T>& that)

Member Functions

public inline nothrow T* Get() const
public inline nothrow const SharedCount<T>& GetCount() const
public inline nothrow T* GetPtr() const
public nothrow int GetUseCount() const
public inline nothrow bool IsNull() const
public nothrow bool IsUnique() const
public nothrow void Reset()
public nothrow void Reset(T* ptr_)
public nothrow void Swap(SharedPtr& that)
public inline T& operator*() const
public inline T* operator->() const
public nothrow void operator=(SharedPtr&& that)
public nothrow void operator=(const SharedPtr& that)

Typedefs

private typedef CountType SharedCount<T>
private typedef Self SharedPtr

Member Variables

private SharedCount<T> count
private T* ptr

Constructor& Destructor Details

SharedPtr Constructor

public nothrow SharedPtr()

Definition
Line 284 of System.Base/SharedPtr.cm


SharedPtr Constructor

public nothrow SharedPtr(SharedPtr&& that)

Definition
Line 297 of System.Base/SharedPtr.cm


SharedPtr Constructor

public explicit nothrow SharedPtr(T* ptr_)

Definition
Line 287 of System.Base/SharedPtr.cm


SharedPtr Constructor

public nothrow SharedPtr(T* ptr_, const SharedCount<T>& count_)

Definition
Line 291 of System.Base/SharedPtr.cm


SharedPtr Constructor

public nothrow SharedPtr(const SharedPtr& that)

Definition
Line 294 of System.Base/SharedPtr.cm


SharedPtr Constructor

public nothrow SharedPtr(const WeakPtr<T>& that)

Definition
Line 301 of System.Base/SharedPtr.cm


Member Function Details

Get Member Function

public inline nothrow T* Get()

Definition
Line 343 of System.Base/SharedPtr.cm


GetCount Member Function

public inline nothrow const SharedCount<T>& GetCount()

Definition
Line 347 of System.Base/SharedPtr.cm


GetPtr Member Function

public inline nothrow T* GetPtr()

Definition
Line 339 of System.Base/SharedPtr.cm


GetUseCount Member Function

public nothrow int GetUseCount()

Definition
Line 364 of System.Base/SharedPtr.cm


IsNull Member Function

public inline nothrow bool IsNull()

Definition
Line 351 of System.Base/SharedPtr.cm


IsUnique Member Function

public nothrow bool IsUnique()

Definition
Line 360 of System.Base/SharedPtr.cm


Reset Member Function

public nothrow void Reset()

Definition
Line 305 of System.Base/SharedPtr.cm


Reset Member Function

public nothrow void Reset(T* ptr_)

Definition
Line 309 of System.Base/SharedPtr.cm


Swap Member Function

public nothrow void Swap(SharedPtr& that)

Definition
Line 355 of System.Base/SharedPtr.cm


operator* Member Function

public inline T& operator*()

Definition
Line 331 of System.Base/SharedPtr.cm


operator-> Member Function

public inline T* operator->()

Definition
Line 323 of System.Base/SharedPtr.cm


operator= Member Function

public nothrow void operator=(SharedPtr&& that)

Definition
Line 318 of System.Base/SharedPtr.cm


operator= Member Function

public nothrow void operator=(const SharedPtr& that)

Definition
Line 313 of System.Base/SharedPtr.cm