folly::ReadMostlyWeakPtr

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

NameDescription
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

NameDescription
folly::ReadMostlySharedPtrShared reader handle to a read-mostly managed object.
folly::ReadMostlyWeakPtrNon-owning weak reference to a read-mostly managed object.

Template Parameters

NameDescription
TThe pointed-to object type.
RefCountThe reference-count implementation to use.