getCapabilities now get the instance as argument

Allows the capabilities to be different depending on how the
filter/router has been configured.
This commit is contained in:
Johan Wikman
2017-02-14 13:17:56 +02:00
parent 7e23789364
commit 2a49cd6451
31 changed files with 58 additions and 56 deletions

View File

@ -183,7 +183,7 @@ protected:
* MyFilterSession* newSession(MXS_SESSION* pSession);
*
* void diagnostics(DCB* pDcb);
* static uint64_t getCapabilities();
* uint64_t getCapabilities();
* };
* @endcode
*
@ -290,11 +290,13 @@ public:
}
}
static uint64_t getCapabilities(void)
static uint64_t getCapabilities(MXS_FILTER* pInstance)
{
uint64_t rv = 0;
MXS_EXCEPTION_GUARD(rv = FilterType::getCapabilities());
FilterType* pFilter = reinterpret_cast<FilterType*>(pInstance);
MXS_EXCEPTION_GUARD(rv = pFilter->getCapabilities());
return rv;
}