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

@ -87,17 +87,26 @@ typedef struct mxs_monitor_object
*
* @param monitor The monitor object
*/
void (*stopMonitor)(MXS_MONITOR *monitor);
void (*diagnostics)(DCB *, const MXS_MONITOR *);
void (*stopMonitor)(MXS_SPECIFIC_MONITOR *monitor);
/**
* @brief Write diagnostic information to a DCB.
*
* @param monitor The monitor object.
* @param dcb The dcb to write to.
*/
void (*diagnostics)(const MXS_SPECIFIC_MONITOR* monitor, DCB* dcb);
/**
* @brief Return diagnostic information about the monitor
*
* @param monitor The monitor object.
*
* @return A JSON object representing the state of the monitor
*
* @see jansson.h
*/
json_t* (*diagnostics_json)(const MXS_MONITOR *monitor);
json_t* (*diagnostics_json)(const MXS_SPECIFIC_MONITOR *monitor);
} MXS_MONITOR_OBJECT;
/**