diff --git a/include/wsrep/provider_options.hpp b/include/wsrep/provider_options.hpp index 69c838d..7882a39 100644 --- a/include/wsrep/provider_options.hpp +++ b/include/wsrep/provider_options.hpp @@ -253,7 +253,13 @@ namespace wsrep std::unique_ptr value, std::unique_ptr default_value, int flags); - void for_each(const std::function& fn); + /** + * Invoke the given function with each provider option + * as argument. + * + * @param fn Function to call for each option + */ + void for_each(const std::function& fn) const; private: using options_map = std::map>; diff --git a/src/provider_options.cpp b/src/provider_options.cpp index f5cc904..e22ba0d 100644 --- a/src/provider_options.cpp +++ b/src/provider_options.cpp @@ -161,9 +161,10 @@ enum wsrep::provider::status wsrep::provider_options::set_default( return wsrep::provider::success; } -void wsrep::provider_options::for_each(const std::function& fn) +void wsrep::provider_options::for_each( + const std::function& fn) const { - std::for_each( - options_.begin(), options_.end(), - [&fn](const options_map::value_type& opt) { fn(opt.second.get()); }); + std::for_each(options_.begin(), options_.end(), + [&fn](const options_map::value_type& opt) + { fn(opt.second.get()); }); }