28 void reset_hard() { _obj =
nullptr; }
50 explicit operator bool ()
const
51 {
return _obj ? true :
false; }
99 {
return reinterpret_cast<T*
>(
const_cast<void *
>(_obj)); }
105 r->remove_weak_ref(
this);
109 n->add_weak_ref(
this);
117 s->add_weak_ref(
this);
122 void operator = (T *n)
128 x->add_weak_ref(
this);
140 T &operator * ()
const {
return get(); }
141 T *operator -> ()
const {
return get(); }
147 template <
typename T>
friend class Weak_ref;
153 void remove_weak_ref(Weak_ref_base *ref)
const
154 { 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.
static void remove(T *e)
Remove the given element from its list.
void push_front(T *e)
Add element to the front 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.
The list type for keeping all weak references to an object.