25 template <
typename T,
typename RefCount>
27 template <
typename T,
typename RefCount>
29 template <
typename T,
typename RefCount>
31 template <
typename RefCount>
38 template <
typename T,
typename RefCount = DefaultRefCount>
97 template <
typename T,
typename RefCount = DefaultRefCount>
120 return get() == other.
get();
124 return get() == other;
128 return get() == other.
get();
137 impl_->count_.useGlobal();
138 impl_->weakCount_.useGlobal();
153 return impl_->ptrRaw_;
161 return impl_->getShared();
179 explicit operator bool()
const {
180 return impl_ !=
nullptr;
191 template <
typename T,
typename RefCount = DefaultRefCount>
197 reset(mainPtr.
impl_);
214 reset(mainPtr.
impl_);
251 template <
typename T,
typename RefCount = DefaultRefCount>
257 reset(weakPtr.
impl_);
262 reset(mainPtr.
impl_);
299 return get() == other.
get();
303 return get() == other;
307 return get() == other.
get();
320 return impl_->getShared();
335 return impl_->useCount();
339 return use_count() == 1;
342 explicit operator bool()
const {
343 return impl_ !=
nullptr;
356 if (impl && impl->
incref()) {
369 template <
typename RefCount = DefaultRefCount>
373 RefCount::useGlobal(refCounts_);
374 for (
auto&
decref : decrefs_) {
379 template <
typename T>
385 refCounts_.push_back(&
ptr.impl_->count_);
386 refCounts_.push_back(&
ptr.impl_->weakCount_);
387 decrefs_.push_back([impl =
ptr.impl_] { impl->decref(); });
396 template <
typename T,
typename RefCount>
400 return ptr.
get() ==
nullptr;
403 template <
typename T,
typename RefCount>
407 return ptr.
get() ==
nullptr;
410 template <
typename T,
typename RefCount>
414 return ptr.
get() ==
nullptr;
417 template <
typename T,
typename RefCount>
421 return ptr.
get() ==
nullptr;
424 template <
typename T,
typename RefCount>
428 return !(ptr ==
nullptr);
431 template <
typename T,
typename RefCount>
435 return !(ptr ==
nullptr);
438 template <
typename T,
typename RefCount>
442 return !(ptr ==
nullptr);
445 template <
typename T,
typename RefCount>
449 return !(ptr ==
nullptr);
std::shared_ptr< T > getStdShared() const
void reset(std::shared_ptr< T > ptr)
ReadMostlySharedPtr< T, RefCount > getShared() const
ReadMostlyMainPtr(ReadMostlyMainPtr &&other) noexcept
bool operator==(const ReadMostlyMainPtr< T, RefCount > &other) const
ReadMostlySharedPtr & operator=(const ReadMostlyWeakPtr< T, RefCount > &other)
ReadMostlySharedPtr & operator=(const ReadMostlySharedPtr &other)
bool operator==(T *other) const
constexpr detail::Map< Move > move
ReadMostlyWeakPtr & operator=(const ReadMostlyWeakPtr &other)
ReadMostlyWeakPtr(const ReadMostlySharedPtr< T, RefCount > &ptr)
std::shared_ptr< T > getStdShared() const
ReadMostlySharedPtr & operator=(ReadMostlySharedPtr &&other) noexcept
ReadMostlyWeakPtr(ReadMostlyWeakPtr &&other) noexcept
~ReadMostlySharedPtr() noexcept
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
~ReadMostlyWeakPtr() noexcept
std::vector< folly::Function< void()> > decrefs_
ReadMostlyWeakPtr & operator=(ReadMostlyWeakPtr &&other) noexcept
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
ReadMostlySharedPtr & operator=(const ReadMostlyMainPtr< T, RefCount > &other)
bool operator!=(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
ReadMostlyWeakPtr & operator=(const ReadMostlyMainPtr< T, RefCount > &mainPtr)
ReadMostlyWeakPtr(const ReadMostlyMainPtr< T, RefCount > &mainPtr)
std::vector< RefCount * > refCounts_
ReadMostlyMainPtr(std::shared_ptr< T > ptr)
detail::ReadMostlySharedPtrCore< T, RefCount > * impl_
ReadMostlySharedPtr(ReadMostlySharedPtr &&other) noexcept
void add(ReadMostlyMainPtr< T, RefCount > ptr) noexcept
detail::ReadMostlySharedPtrCore< T, RefCount > * impl_
~ReadMostlyMainPtrDeleter() noexcept
ReadMostlySharedPtrCore(std::shared_ptr< T > ptr)
bool operator==(const ReadMostlySharedPtr< T, RefCount > &other) const
std::shared_ptr< T > getShared()
ReadMostlySharedPtr(const ReadMostlyMainPtr< T, RefCount > &mainPtr)
bool operator==(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
ReadMostlySharedPtr< T, RefCount > lock()
ReadMostlySharedPtr(const ReadMostlyWeakPtr< T, RefCount > &weakPtr)
detail::ReadMostlySharedPtrCore< T, RefCount > * impl_
std::shared_ptr< T > ptr_
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
~ReadMostlySharedPtrCore() noexcept
ReadMostlySharedPtr(const ReadMostlySharedPtr &other)
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
bool operator==(T *other) const
~ReadMostlyMainPtr() noexcept
bool operator==(const ReadMostlyMainPtr< T, RefCount > &other) const
ReadMostlyWeakPtr(const ReadMostlyWeakPtr &other)
bool operator==(const ReadMostlySharedPtr< T, RefCount > &other) const
void reset(detail::ReadMostlySharedPtrCore< T, RefCount > *impl)
ReadMostlyMainPtr & operator=(ReadMostlyMainPtr &&other) noexcept