mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Make method provider_options::for_each()
const
Also, add a comment for the method and fix formatting
This commit is contained in:
@ -253,7 +253,13 @@ namespace wsrep
|
|||||||
std::unique_ptr<option_value> value,
|
std::unique_ptr<option_value> value,
|
||||||
std::unique_ptr<option_value> default_value, int flags);
|
std::unique_ptr<option_value> default_value, int flags);
|
||||||
|
|
||||||
void for_each(const std::function<void(option*)>& 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<void(option*)>& fn) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using options_map = std::map<std::string, std::unique_ptr<option>>;
|
using options_map = std::map<std::string, std::unique_ptr<option>>;
|
||||||
|
@ -161,9 +161,10 @@ enum wsrep::provider::status wsrep::provider_options::set_default(
|
|||||||
return wsrep::provider::success;
|
return wsrep::provider::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wsrep::provider_options::for_each(const std::function<void(option*)>& fn)
|
void wsrep::provider_options::for_each(
|
||||||
|
const std::function<void(option*)>& fn) const
|
||||||
{
|
{
|
||||||
std::for_each(
|
std::for_each(options_.begin(), options_.end(),
|
||||||
options_.begin(), options_.end(),
|
[&fn](const options_map::value_type& opt)
|
||||||
[&fn](const options_map::value_type& opt) { fn(opt.second.get()); });
|
{ fn(opt.second.get()); });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user