Owning pointer that gives cheap, lock-free reads to shared objects.
Declared in <folly/concurrency/memory/ReadMostlySharedPtr.h>
template<
typename T,
typename RefCount = DefaultRefCount>
class ReadMostlyMainPtr;
Holds the single main reference to an object while allowing many readers to obtain a ReadMostlySharedPtr without contending on a shared atomic counter.
| Name | Description |
|---|---|
ReadMostlyMainPtr [constructor] | Constructors |
~ReadMostlyMainPtr [destructor] | Destroys the main pointer and releases its object. |
operator= | Assignment operators |
get | Returns the raw pointer to the managed object. |
getShared | Obtains a read-mostly shared pointer to the managed object. |
getStdShared | Returns a standard shared pointer aliasing the managed object. |
operator* | Dereferences the managed object. |
operator-> | Accesses members of the managed object. |
reset | reset overloads |
operator bool | Tests whether the pointer manages an object. |
operator== | Equality operators |
| Name | Description |
|---|---|
folly::ReadMostlyMainPtrDeleter | This can be used to destroy multiple ReadMostlyMainPtrs at once. |
folly::ReadMostlySharedPtr | Shared reader handle to a read-mostly managed object. |
folly::ReadMostlyWeakPtr | Non-owning weak reference to a read-mostly managed object. |
| Name | Description |
|---|---|
operator!= | Tests whether a main pointer is non-empty. |
operator== | Tests whether a main pointer is empty. |
| Name | Description |
|---|---|
| T | The pointed-to object type. |
| RefCount | The reference-count implementation to use. |