From 88baaf9e68efd9824b906a69320053734d408e14 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 15 Feb 2014 13:51:35 +0100 Subject: Add ModeHandler::IsParameterMode() and MC_PARAM --- include/mode.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/mode.h') diff --git a/include/mode.h b/include/mode.h index 568c55038..dd5334c66 100644 --- a/include/mode.h +++ b/include/mode.h @@ -86,6 +86,7 @@ enum ParamSpec class PrefixMode; class ListModeBase; +class ParamModeBase; /** Each mode is implemented by ONE ModeHandler class. * You must derive ModeHandler and add the child class to @@ -108,6 +109,7 @@ class CoreExport ModeHandler : public ServiceProvider { MC_PREFIX, MC_LIST, + MC_PARAM, MC_OTHER }; @@ -191,6 +193,12 @@ class CoreExport ModeHandler : public ServiceProvider */ ListModeBase* IsListModeBase(); + /** + * Check whether this mode handler inherits from ListModeBase + * @return non-NULL if this mode handler inherits from ParamModeBase, NULL otherwise + */ + ParamModeBase* IsParameterMode(); + /** * Returns the mode's type */ @@ -716,3 +724,8 @@ inline ListModeBase* ModeHandler::IsListModeBase() { return (this->type_id == MC_LIST ? reinterpret_cast(this) : NULL); } + +inline ParamModeBase* ModeHandler::IsParameterMode() +{ + return (this->type_id == MC_PARAM ? reinterpret_cast(this) : NULL); +} -- cgit v1.2.3