summaryrefslogtreecommitdiff
path: root/include/mode.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-30 16:01:47 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-30 16:01:47 +0200
commitf899ea2786e2ccf1b5765efd68c99273c9c056a9 (patch)
treea1aa6a689176b5cf96e0f8234a1f940fb39e4369 /include/mode.h
parent5a5dcfa4f90f4235621b87d93c227566caa0fce1 (diff)
Add const versions of ModeHandler::IsPrefixMode(), IsListModeBase() and IsParameterMode()
Diffstat (limited to 'include/mode.h')
-rw-r--r--include/mode.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/mode.h b/include/mode.h
index 093822372..35af68685 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -185,6 +185,12 @@ class CoreExport ModeHandler : public ServiceProvider
PrefixMode* IsPrefixMode();
/**
+ * Check whether this mode is a prefix mode
+ * @return non-NULL if this mode is a prefix mode, NULL otherwise
+ */
+ const PrefixMode* IsPrefixMode() const;
+
+ /**
* Check whether this mode handler inherits from ListModeBase
* @return non-NULL if this mode handler inherits from ListModeBase, NULL otherwise
*/
@@ -192,11 +198,23 @@ class CoreExport ModeHandler : public ServiceProvider
/**
* Check whether this mode handler inherits from ListModeBase
+ * @return non-NULL if this mode handler inherits from ListModeBase, NULL otherwise
+ */
+ const ListModeBase* IsListModeBase() const;
+
+ /**
+ * Check whether this mode handler inherits from ParamModeBase
* @return non-NULL if this mode handler inherits from ParamModeBase, NULL otherwise
*/
ParamModeBase* IsParameterMode();
/**
+ * Check whether this mode handler inherits from ParamModeBase
+ * @return non-NULL if this mode handler inherits from ParamModeBase, NULL otherwise
+ */
+ const ParamModeBase* IsParameterMode() const;
+
+ /**
* Returns the mode's type
*/
inline ModeType GetModeType() const { return m_type; }
@@ -790,12 +808,27 @@ inline PrefixMode* ModeHandler::IsPrefixMode()
return (this->type_id == MC_PREFIX ? static_cast<PrefixMode*>(this) : NULL);
}
+inline const PrefixMode* ModeHandler::IsPrefixMode() const
+{
+ return (this->type_id == MC_PREFIX ? static_cast<const PrefixMode*>(this) : NULL);
+}
+
inline ListModeBase* ModeHandler::IsListModeBase()
{
return (this->type_id == MC_LIST ? reinterpret_cast<ListModeBase*>(this) : NULL);
}
+inline const ListModeBase* ModeHandler::IsListModeBase() const
+{
+ return (this->type_id == MC_LIST ? reinterpret_cast<const ListModeBase*>(this) : NULL);
+}
+
inline ParamModeBase* ModeHandler::IsParameterMode()
{
return (this->type_id == MC_PARAM ? reinterpret_cast<ParamModeBase*>(this) : NULL);
}
+
+inline const ParamModeBase* ModeHandler::IsParameterMode() const
+{
+ return (this->type_id == MC_PARAM ? reinterpret_cast<const ParamModeBase*>(this) : NULL);
+}