L4Re - L4 Runtime Environment
cxx::Weak_ref< T > Class Template Reference

Typed weak reference to an object of type T. More...

+ Inheritance diagram for cxx::Weak_ref< T >:
+ Collaboration diagram for cxx::Weak_ref< T >:

Additional Inherited Members

- Public Member Functions inherited from cxx::H_list_item_t< Weak_ref_base >
 H_list_item_t ()
 Constructor. More...
 ~H_list_item_t () noexcept
 Destructor. More...

Detailed Description

template<typename T>
class cxx::Weak_ref< T >

Typed weak reference to an object of type T.

Template Parameters
TThe type of the referenced object.

A weak reference is a reference that is invalidated when the referenced object is about to be deleted. All weak references to an object are kept in a linked list and all the weak references are iterated and reset by the Weak_ref_base::List destructor or Weak_ref_base::reset().

The type T must provide two methods that handle the housekeeping of weak references: remove_weak_ref(Weak_ref_base *) and add_weak_ref(Weak_ref_base *). These functions must handle the insertion and removal of the weak reference into the respective Weak_ref_base::List object. For convenience one can use the cxx::Weak_ref_obj as a base class that handles weak references for you.

Definition at line 67 of file weak_ref.

The documentation for this class was generated from the following file: