1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +03:00

Change provider_options callback to take a const reference

This commit is contained in:
Daniele Sciascia
2025-05-20 08:41:18 +02:00
parent adf464474d
commit 450851a176
5 changed files with 15 additions and 13 deletions

View File

@ -526,12 +526,13 @@ namespace wsrep
* @param provider_options Initial options to provider
* @param thread_service Optional thread service implementation.
*/
static std::unique_ptr<provider> make_provider(
wsrep::server_state&,
const std::string& provider_spec,
const std::function<std::string(provider_options&)>& provider_options_cb,
const wsrep::provider::services& services
= wsrep::provider::services());
static std::unique_ptr<provider>
make_provider(wsrep::server_state&, const std::string& provider_spec,
const std::function<std::string(const provider_options&)>&
provider_options_cb,
const wsrep::provider::services& services
= wsrep::provider::services());
protected:
wsrep::server_state& server_state_;
};

View File

@ -297,7 +297,7 @@ namespace wsrep
* @return Zero on success, non-zero on error.
*/
int load_provider(const std::string& provider,
const std::function<std::string(provider_options&)>&,
const std::function<std::string(const provider_options&)>&,
const wsrep::provider::services& services
= wsrep::provider::services());
@ -320,7 +320,7 @@ namespace wsrep
= wsrep::provider::services())
{
return load_provider(
provider, [options](provider_options&) { return options; },
provider, [options](const provider_options&) { return options; },
services);
}

View File

@ -28,9 +28,9 @@
#include <memory>
std::unique_ptr<wsrep::provider> wsrep::provider::make_provider(
wsrep::server_state& server_state,
const std::string& provider_spec,
const std::function<std::string(provider_options&)>& provider_options_cb,
wsrep::server_state& server_state, const std::string& provider_spec,
const std::function<std::string(const provider_options&)>&
provider_options_cb,
const wsrep::provider::services& services)
{
try

View File

@ -500,7 +500,8 @@ static int apply_toi(wsrep::provider& provider,
int wsrep::server_state::load_provider(
const std::string& provider_spec,
const std::function<std::string(provider_options&)>& provider_options_cb,
const std::function<std::string(const provider_options&)>&
provider_options_cb,
const wsrep::provider::services& services)
{
wsrep::log_info() << "Loading provider " << provider_spec

View File

@ -263,7 +263,7 @@ namespace wsrep
{
set_provider_factory(
[&](wsrep::server_state&, const std::string&,
const std::function<std::string(wsrep::provider_options&)>&,
const std::function<std::string(const wsrep::provider_options&)>&,
const wsrep::provider::services&)
{
// The provider object is destroyed upon server state