|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
Header-only typed wrapper around DekiProviderRegistryBase. More...
#include <DekiProviderRegistry.h>
Static Public Member Functions | |
| template<typename T> | |
| static T * | GetProvider () |
| Typed access. | |
| static Interface * | GetDefault () |
| First-registered provider, or nullptr if the registry is empty. | |
| static int | GetProviderCount () |
| static Interface * | GetProviderAt (int idx) |
| static void | RegisterPlugin (Interface *provider) |
| Register a provider owned by a plugin DLL. | |
| static void | Register (Interface *provider) |
| Register a provider owned by engine-core (rare; typically packages use the plugin variant). | |
| static void | Unregister (Interface *provider) |
Header-only typed wrapper around DekiProviderRegistryBase.
Each multi-provider package aliases this template to expose its registry with two access methods only:
namespace Deki { using Location = DekiProviderRegistry<IDekiLocationProvider>; }
auto* p = Deki::Location::GetProvider<BeaconDBLocationProvider>(); // typed auto* d = Deki::Location::GetDefault(); // first registered
No GetProviderById(const char*) is exposed — selection is always either compile-time-checked (typed) or convention-driven (default). String-keyed runtime lookups invite the "if A fails, try B" fallback pattern that the project's NEVER USE FALLBACKS rule forbids.
Interface contract:
RTTI: not used. Lookups go through string comparison on ProviderId, and the static_cast to T* is safe because the (category, ProviderId) pair is owned by exactly one type. Builds cleanly under -fno-rtti.
|
inlinestatic |
Typed access.
T must derive from Interface and define ProviderId. Returns nullptr if no provider with T::ProviderId has registered.
|
inlinestatic |
First-registered provider, or nullptr if the registry is empty.
Registration order is the order of calls to Register() at DekiPlugin_RegisterComponents time — i.e. source-code order in the package that registers them. This is the only "default" knob.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Register a provider owned by a plugin DLL.
The registry takes ownership and will delete the pointer during ClearPluginProviders() (called by PackageLoader before FreeLibrary).
|
inlinestatic |
Register a provider owned by engine-core (rare; typically packages use the plugin variant).
The registry never deletes these.
|
inlinestatic |