tree: 84aed2fedecfbf1245e307c08913973abc4f3ba2 [path history] [tgz]
  1. BUILD.gn
  2. make.h
  3. ownable.h
  4. owner.h
  5. README.md
  6. reffable.cc
  7. reffable.h
  8. trait.h
  9. type_info.h
  10. typed_reffable.h
src/ui/lib/escher/base/README.md

escher/base/

Lifecycle Management

Provides base classes which are used for lifecycle management, working with fxl::RefPtr to provide customizable behavior when the object's ref-count becomes zero.

Reffable adds a virtual OnZeroRefCount() method which is invoked when the ref-count becomes zero.

Ownable and Owner build upon this, so that when an Ownable object is no longer referenced, it is passed to the Owner to decide what to do with it. This is useful e.g. for disposing of Vulkan resources which cannot be destroyed immediately because they may still be in use by the GPU.

Ownable also makes use of the simple RTTI (run-time type information) system described below.

Simple RTTI

Fuchsia policy doesn‘t allow the use of standard C++ RTTI functionality. Escher provides a very limited opt-in RTTI mechanism, tailored to Escher’s specific needs requirements.

Misc

  • make.h
    • defines Make() function, a more concise synonym for fxl::internal::MakeRefCountedHelper<T>().