Static-init self-registration helper for provider libraries. More...
#include <phosphor-layout-api/include/PhosphorLayoutApi/LayoutSourceProviderRegistry.h>
Public Member Functions | |
| LayoutSourceProviderRegistrar (QString name, int priority, std::function< std::unique_ptr< ILayoutSourceFactory >(const FactoryContext &)> builder) | |
Static-init self-registration helper for provider libraries.
Each provider library declares an instance in an anonymous namespace inside its factory .cpp file. The constructor appends to pendingLayoutSourceProviders() at process startup, before any composition root constructs its LayoutSourceBundle.
Usage (in e.g. zoneslayoutsourcefactory.cpp):
Adding a new layout-source family (the planned scrolling engine) is one new library + one of these registrars inside it. No edits to phosphor-layout-api, no edits to other provider libraries, and — as long as the engine pulls only services the composition root already surfaces — no edits to daemon / editor / settings either.
| PhosphorLayout::LayoutSourceProviderRegistrar::LayoutSourceProviderRegistrar | ( | QString | name, |
| int | priority, | ||
| std::function< std::unique_ptr< ILayoutSourceFactory >(const FactoryContext &)> | builder | ||
| ) |