MXS-1775 Introduce maxscale::MonitorInstance

- All monitors (but MariaDBMon for the time being) inherit
  from that.
- All common member variables moved to that class. Still
  manipulated in derived classes.

In subsequent commits common functionality will be moved to
that class.
This commit is contained in:
Johan Wikman
2018-05-16 10:58:17 +03:00
parent 787a0b50ef
commit 3c277f4e5e
12 changed files with 56 additions and 73 deletions

View File

@ -14,7 +14,7 @@
/**
* @file monitor.c - The monitor module management routines
*/
#include <maxscale/monitor.h>
#include <maxscale/monitor.hh>
#include <fcntl.h>
#include <stdio.h>
@ -2502,3 +2502,24 @@ int mon_config_get_servers(const MXS_CONFIG_PARAMETER* params, const char* key,
}
return found;
}
namespace maxscale
{
MonitorInstance::MonitorInstance(MXS_MONITOR* pMonitor)
: m_status(0)
, m_thread(0)
, m_monitor(pMonitor)
, m_shutdown(0)
, m_script(NULL)
, m_events(0)
{
}
MonitorInstance::~MonitorInstance()
{
ss_dassert(!m_thread);
ss_dassert(!m_script);
}
}