diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-04 22:16:52 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-08 23:13:24 +0200 |
commit | 9eeae941959511957abd770ed8e11f3ecdcd739e (patch) | |
tree | d5e0c12c7762cd904c81ef8b841bb681d32e47c0 /include | |
parent | 927937d6105d17fbcd8c85bbf185477d87264bc4 (diff) |
Allow dynamic references to reference ServiceProviders, introduce ModeReference
Mode handlers can be referenced using mode/<modename>
Diffstat (limited to 'include')
-rw-r--r-- | include/modules.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/modules.h b/include/modules.h index ac90d60e7..3e5ace3f4 100644 --- a/include/modules.h +++ b/include/modules.h @@ -288,7 +288,7 @@ class CoreExport dynamic_reference_base : public interfacebase std::string name; void resolve(); protected: - DataProvider* value; + ServiceProvider* value; public: ModuleRef creator; dynamic_reference_base(Module* Creator, const std::string& Name); @@ -343,6 +343,13 @@ class dynamic_reference_nocheck : public dynamic_reference_base } }; +class ModeReference : public dynamic_reference_nocheck<ModeHandler> +{ + public: + ModeReference(Module* mod, const std::string& modename) + : dynamic_reference_nocheck<ModeHandler>(mod, "mode/" + modename) {} +}; + /** Priority types which can be used by Module::Prioritize() */ enum Priority { PRIORITY_FIRST, PRIORITY_LAST, PRIORITY_BEFORE, PRIORITY_AFTER }; |