29 void reset_hard() { _obj =
nullptr; }
51 explicit operator bool ()
const
52 {
return _obj ? true :
false; }
100 {
return reinterpret_cast<T*
>(
const_cast<void *
>(_obj)); }
106 r->remove_weak_ref(
this);
110 n->add_weak_ref(
this);
118 s->add_weak_ref(
this);
123 void operator = (T *n)
129 x->add_weak_ref(
this);
141 T &operator * ()
const {
return get(); }
142 T *operator -> ()
const {
return get(); }
148 template <
typename T>
friend class Weak_ref;
154 void remove_weak_ref(Weak_ref_base *ref)
const
155 { 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.