MXS-2219 Provide STL iterator for MXS_MONITORED_SERVER

This commit is contained in:
Johan Wikman 2019-01-10 11:23:33 +02:00
parent a9fd9c92e2
commit 994b76ff79

View File

@ -22,6 +22,7 @@
#include <openssl/sha.h>
#include <maxbase/semaphore.hh>
#include <maxbase/worker.hh>
#include <maxbase/iterator.hh>
#include <maxbase/jansson.h>
#include <maxscale/config.hh>
#include <maxscale/dcb.hh>
@ -215,6 +216,21 @@ struct MXS_MONITORED_SERVER
struct MXS_MONITORED_SERVER* next; /**< The next server in the list */
};
namespace std
{
inline mxb::intrusive_slist_iterator<MXS_MONITORED_SERVER> begin(MXS_MONITORED_SERVER& monitored_server)
{
return mxb::intrusive_slist_iterator<MXS_MONITORED_SERVER>(monitored_server);
}
inline mxb::intrusive_slist_iterator<MXS_MONITORED_SERVER> end(MXS_MONITORED_SERVER& monitored_server)
{
return mxb::intrusive_slist_iterator<MXS_MONITORED_SERVER>();
}
}
#define MAX_MONITOR_USER_LEN 512
#define MAX_MONITOR_PASSWORD_LEN 512