Non‐owning weak reference to a read‐mostly managed object.

Synopsis

Declared in <folly/concurrency/memory/ReadMostlySharedPtr.h>

template<
    typename U,
    typename RefCount2 = DefaultRefCount>
class ReadMostlyWeakPtr;

Description

Keeps the control block alive without keeping the object alive, and can be promoted to a ReadMostlySharedPtr via lock() while the object exists.

Member Functions

Name

Description

ReadMostlyWeakPtr [constructor]

Constructors

~ReadMostlyWeakPtr [destructor]

Destroys the weak pointer and releases its weak reference.

operator=

Assignment operators

lock

Promotes the weak reference to a shared pointer.

Friends

Name

Description

folly::ReadMostlySharedPtr

Shared reader handle to a read‐mostly managed object.

folly::ReadMostlyWeakPtr

Non‐owning weak reference to a read‐mostly managed object.

Template Parameters

Name

Description

T

The pointed‐to object type.

RefCount

The reference‐count implementation to use.

Created with MrDocs