#include <lestes/common.hh>
Go to the source code of this file.
Namespaces | |
| namespace | lestes |
| namespace | lestes::std |
Classes | |
| class | lestes::std::weak< T > |
The idea behind weak pointers is simple. The weak pointers will be linked together in a double circular list. Their gc_mark() method will do nothing, so as to support for the use of pointer.gc_mark(), in order to retain coherence of pointer interface. After the gc_mark phase the list of live weak pointers will be updated by mapping a function (gc_base's friend) that will clear the internal pointer of each weak pointer that points to an unmarked object. The objects themselves will be reclaimed only after this weak pointer update phase was completed.
The generator could be extended to handle weak pointers by means of specifying the pointer class for each field:
As the template weak would have the same interface as ordinary srp or ptr, it will not be necessary to modify other parts of the generator, namely neither factory method, nor marking routine generation needs to be modified.
Definition in file weak.hh.
1.5.1-20070107