68 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
69 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
113 while (p->next_ != ptr) p = p->next_;
124 if (next_ ==
this)
return true;
126 while (p->next_ !=
this) p = p->next_;
135 template <
typename T>
148 assert(&ptr !=
this);
172 T*
get()
const {
return value_; }
178 template <
typename U>
180 return value_ == ptr.
get();
182 template <
typename U>
184 return value_ != ptr.
get();
188 template <
typename U>
195 if (link_.
depart())
delete value_;
198 void capture(
T* ptr) {
203 template <
typename U>
void copy(linked_ptr<U>
const* ptr) {
206 link_.
join(&ptr->link_);
212 template<
typename T>
inline
214 return ptr == x.
get();
217 template<
typename T>
inline
219 return ptr != x.
get();
225 template <
typename T>
233 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
bool operator==(linked_ptr< U > const &ptr) const
Definition: gtest-linked_ptr.h:179
Definition: gtest-death-test.h:43
linked_ptr(linked_ptr< U > const &ptr)
Definition: gtest-linked_ptr.h:146
bool operator==(T *p) const
Definition: gtest-linked_ptr.h:176
linked_ptr(linked_ptr const &ptr)
Definition: gtest-linked_ptr.h:147
bool operator==(T *ptr, const linked_ptr< T > &x)
Definition: gtest-linked_ptr.h:213
bool operator!=(T *p) const
Definition: gtest-linked_ptr.h:177
T * operator->() const
Definition: gtest-linked_ptr.h:173
#define GTEST_API_
Definition: gtest-port.h:768
#define GTEST_LOCK_EXCLUDED_(locks)
Definition: gtest-port.h:1928
void reset(T *ptr=NULL)
Definition: gtest-linked_ptr.h:168
~linked_ptr()
Definition: gtest-linked_ptr.h:143
void join(linked_ptr_internal const *ptr) GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
Definition: gtest-linked_ptr.h:108
Definition: gtest-linked_ptr.h:136
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
bool operator!=(linked_ptr< U > const &ptr) const
Definition: gtest-linked_ptr.h:183
Definition: gtest-port.h:1558
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence. ...
Definition: mra.h:1835
linked_ptr & operator=(linked_ptr< U > const &ptr)
Definition: gtest-linked_ptr.h:153
T * get() const
Definition: gtest-linked_ptr.h:172
bool depart() GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
Definition: gtest-linked_ptr.h:120
Definition: gtest-linked_ptr.h:89
linked_ptr< T > make_linked_ptr(T *ptr)
Definition: gtest-linked_ptr.h:226
linked_ptr(T *ptr=NULL)
Definition: gtest-linked_ptr.h:142
GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex)
void join_new()
Definition: gtest-linked_ptr.h:92
bool operator!=(T *ptr, const linked_ptr< T > &x)
Definition: gtest-linked_ptr.h:218
T & operator*() const
Definition: gtest-linked_ptr.h:174
linked_ptr & operator=(linked_ptr const &ptr)
Definition: gtest-linked_ptr.h:159
T element_type
Definition: gtest-linked_ptr.h:138