summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Lloyd Pique <lpique@google.com> 2024-10-30 12:47:43 -0700
committer Lloyd Pique <lpique@google.com> 2025-01-06 14:19:56 -0800
commitb7ce156dc7e9d703c5b9f1d629a37291df4ca142 (patch)
treeb802657b78b1d2d389652dac6f945c854f1fd3e9 /libs/gui/SurfaceComposerClient.cpp
parent9bf3e87d645649bc7f29a3e46d9cad090a6d2ce2 (diff)
Introduce ftl::Finalizer{<F>,Std,Ftl,Ftl1,Ftl2,Ftl3}
A Finalizer ensures a final cleanup function is executed when it is destroyed. The cleanup can also be explicitly invoked before destruction, or canceled so it is not executed. As they are meant for one-time cleanup, Finalizers are moveable but not copyable. The templated `Finalizer<F>` can be constructed from any function object that can be invoked with no arguments and that returns void. If `F` can be default constructed, then `Finalizer<F>` can be default constructed. `ftl::FinalizerStd` is an alias that uses `std::function` as the function object type. `ftl::FinalizerFtl`, `ftl::FinalizerFtl1`, `ftl::FinalizerFtl2` and `ftl::FinalizerFtl3` are aliases that use `ftl::Function` as the type, with increasing amounts of fixed-size internal storage for captured values. These are useful when specifying a return type or a storage type, and are all default-construcible. Bug: 185536303 Flag: EXEMPT New library code Test: atest ftl_test Change-Id: If4a130873ae38727e5bafd634344ae341640e742
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
0 files changed, 0 insertions, 0 deletions