RAII gate held across any call into overridable View code. More...
#include <view_lifecycle.hpp>
Public Types | |
| enum class | Drain { at_exit , deferred } |
| When the outermost lease on a tree is released, is it safe to destroy what was retired during the pass? More... | |
Public Member Functions | |
| DispatchLease (View &view, Drain drain=Drain::at_exit) noexcept | |
| ~DispatchLease () | |
| DispatchLease (const DispatchLease &)=delete | |
| DispatchLease & | operator= (const DispatchLease &)=delete |
| DispatchLease (DispatchLease &&)=delete | |
| DispatchLease & | operator= (DispatchLease &&)=delete |
| View * | root () const noexcept |
| The root whose gate this lease raised. | |
RAII gate held across any call into overridable View code.
Construction walks to the tree root and raises that root's lease depth plus the leased view's own dispatch depth; destruction lowers both and, when the root's depth returns to zero, destroys everything retired during the pass.
Take one at the call site inside the member that invokes the hook:
A lease keeps the view's storage alive; it does not keep it attached. A hook may still detach or replace the view, so re-validate identity (address and import_binding_instance_id(), or a ViewCapture) after every hook returns.
|
strong |
When the outermost lease on a tree is released, is it safe to destroy what was retired during the pass?
|
explicitnoexcept |
| pulp::view::DispatchLease::~DispatchLease | ( | ) |
|
delete |
|
delete |
|
delete |
|
delete |
|
inlinenoexcept |
The root whose gate this lease raised.
Stored at construction so a lease released after its view was detached still lowers the depth it raised.