From 994b76ff792c426db0e184eafbb1f5b9aa0462ee Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 10 Jan 2019 11:23:33 +0200 Subject: [PATCH] MXS-2219 Provide STL iterator for MXS_MONITORED_SERVER --- include/maxscale/monitor.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/maxscale/monitor.hh b/include/maxscale/monitor.hh index 30a6b9750..c3faacb10 100644 --- a/include/maxscale/monitor.hh +++ b/include/maxscale/monitor.hh @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -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 begin(MXS_MONITORED_SERVER& monitored_server) +{ + return mxb::intrusive_slist_iterator(monitored_server); +} + +inline mxb::intrusive_slist_iterator end(MXS_MONITORED_SERVER& monitored_server) +{ + return mxb::intrusive_slist_iterator(); +} + +} + #define MAX_MONITOR_USER_LEN 512 #define MAX_MONITOR_PASSWORD_LEN 512