29 void reset_hard() { _obj =
nullptr; }
33 struct List :
H_list_t<Weak_ref_base>
45 explicit operator bool ()
const
46 {
return _obj ? true :
false; }
71 {
return reinterpret_cast<T*
>(
const_cast<void *
>(_obj)); }
77 r->remove_weak_ref(
this);
81 n->add_weak_ref(
this);
89 s->add_weak_ref(
this);
94 void operator = (T *n)
100 x->add_weak_ref(
this);
112 T &operator * ()
const {
return get(); }
113 T *operator -> ()
const {
return get(); }
119 template <
typename T>
friend class Weak_ref;
120 mutable Weak_ref_base::List weak_references;
123 { weak_references.push_front(ref); }
125 void remove_weak_ref(Weak_ref_base *ref)
const
126 { weak_references.remove(ref); }
bool empty() const
Check if the list is empty.
Basic element type for a double-linked H_list.
T * pop_front()
Remove and return the head element of the list.
Generic (base) weak reference to some object.
Typed weak reference to an object of type T.
Double-linked list of typed H_list_item_t elements.