morphology_registry (macula_tweann v0.18.1)
View SourceRegistry for morphology modules.
Provides runtime registration of morphology implementations. Applications can register custom morphologies without modifying the macula-tweann library.
Usage:
Start registry (done automatically by application): morphology_registry:start_link().
Register a morphology: ok = morphology_registry:register(my_problem, my_morphology_module).
Get registered module: {ok, my_morphology_module} = morphology_registry:get(my_problem).
List all registered: [my_problem, xor_mimic] = morphology_registry:list_all().
Summary
Functions
Get the module for a registered morphology.
Check if a morphology is registered.
List all registered morphologies.
Register a morphology module.
Start the morphology registry server.
Unregister a morphology.
Functions
Get the module for a registered morphology.
Check if a morphology is registered.
-spec list_all() -> [atom()].
List all registered morphologies.
Register a morphology module.
Verifies that the module implements morphology_behaviour before registering.
Example:
ok = morphology_registry:register(xor_mimic, morphology_xor).
Start the morphology registry server.
Creates ETS table for storing morphology registrations.
-spec unregister(atom()) -> ok.
Unregister a morphology.