RefCountReleaseStatus Release() const override { constauto status = ref_count_.DecRef();
if (status == RefCountReleaseStatus::kDroppedLastRef) { deletethis;
} return status;
}
// Return whether the reference count is one. If the reference count is used // in the conventional way, a reference count of 1 implies that the current // thread owns the reference and no other thread shares it. This call // performs the test for a reference count of one, and performs the memory // barrier needed for the owning thread to act on the object, knowing that it // has exclusive access to the object. virtualbool HasOneRef() const { return ref_count_.HasOneRef(); }
protected:
~RefCountedObject() override {}
mutable webrtc_impl::RefCounter ref_count_{0};
};
template <class T> class FinalRefCountedObject final : public T { public: using T::T; // Above using declaration propagates a default move constructor // FinalRefCountedObject(FinalRefCountedObject&& other), but we also need // move construction from T.
explicit FinalRefCountedObject(T&& other) : T(std::move(other)) {}
FinalRefCountedObject(const FinalRefCountedObject&) = delete;
FinalRefCountedObject& operator=(const FinalRefCountedObject&) = delete;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.