MXS-1848 Use MXS_SPECIFIC_MONITOR type in monitor APIs

Now, all monitor functions but startMonitor takes a
MXS_SPECIFIC_MONITOR instead of MXS_MONITOR. That is, startMonitor
is now like a static factory member returning a new specific
monitor instance and the other functions are like member functions
of that instance.
This commit is contained in:
Johan Wikman
2018-05-04 10:22:13 +03:00
parent d4008f7b28
commit ec8b9c773a
8 changed files with 55 additions and 47 deletions

View File

@ -111,12 +111,11 @@ startMonitor(MXS_MONITOR *mon, const MXS_CONFIG_PARAMETER *params)
* @param arg Handle on thr running monior
*/
static void
stopMonitor(MXS_MONITOR *mon)
stopMonitor(MXS_SPECIFIC_MONITOR *mon)
{
GRMon *handle = (GRMon *) mon->handle;
GRMon *handle = static_cast<GRMon*>(mon);
handle->stop();
delete handle;
mon->handle = NULL;
}
/**
@ -126,7 +125,7 @@ stopMonitor(MXS_MONITOR *mon)
* @param arg The monitor handle
*/
static void
diagnostics(DCB *dcb, const MXS_MONITOR *mon)
diagnostics(const MXS_SPECIFIC_MONITOR *mon, DCB *dcb)
{
}
@ -135,7 +134,7 @@ diagnostics(DCB *dcb, const MXS_MONITOR *mon)
*
* @param arg The monitor handle
*/
static json_t* diagnostics_json(const MXS_MONITOR *mon)
static json_t* diagnostics_json(const MXS_SPECIFIC_MONITOR *mon)
{
return NULL;
}