Lines Matching defs:linked_ptr

9004 // - References are only tracked as long as linked_ptr<> objects are copied.
9005 // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9009 // You can safely put linked_ptr<> in a vector<>.
9012 // Note: If you use an incomplete type with linked_ptr<>, the class
9013 // *containing* linked_ptr<> must have a constructor and destructor (even
9019 // Unlike other linked_ptr implementations, in this implementation
9020 // a linked_ptr object is thread-safe in the sense that:
9021 // - it's safe to copy linked_ptr objects concurrently,
9022 // - it's safe to copy *from* a linked_ptr and read its underlying
9027 // confusion with normal linked_ptr.
9039 // Protects copying of all linked_ptr objects.
9042 // This is used internally by all instances of linked_ptr<>. It needs to be
9043 // a non-template class because different types of linked_ptr<> can refer to
9044 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9045 // So, it needs to be possible for different types of linked_ptr to participate
9048 // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
9056 // Many linked_ptr operations may change p.link_ for some linked_ptr
9060 // Note that different types of linked_ptr objects can coexist in a
9061 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9062 // linked_ptr<Derived2>). Therefore we must use a single mutex to
9063 // protect all linked_ptr objects. This can create serious
9096 class linked_ptr {
9102 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9103 ~linked_ptr() { depart(); }
9105 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9106 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9107 linked_ptr(linked_ptr const& ptr) { // NOLINT
9113 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9119 linked_ptr& operator=(linked_ptr const& ptr) {
9139 bool operator==(linked_ptr<U> const& ptr) const {
9143 bool operator!=(linked_ptr<U> const& ptr) const {
9149 friend class linked_ptr;
9163 template <typename U> void copy(linked_ptr<U> const* ptr) {
9173 bool operator==(T* ptr, const linked_ptr<T>& x) {
9178 bool operator!=(T* ptr, const linked_ptr<T>& x) {
9182 // A function to convert T* into linked_ptr<T>
9184 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9186 linked_ptr<T> make_linked_ptr(T* ptr) {
9187 return linked_ptr<T>(ptr);
10174 linked_ptr<const ParamGeneratorInterface<T> > impl_;
10468 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10489 linked_ptr<TestInfo> test_info = *test_it;
10536 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;