mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 11:07:56 +00:00
Allow building a configuration from an option list
This commit is contained in:
@@ -32,7 +32,9 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "exceptions.h"
|
||||
#include "configuration_option.h"
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
@@ -65,6 +67,16 @@ public:
|
||||
return proxy_set(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a list of options
|
||||
*/
|
||||
Concrete& set(const std::vector<ConfigurationOption>& options) {
|
||||
for (const auto& option : options) {
|
||||
proxy_set(option.get_key(), option.get_value());
|
||||
}
|
||||
return static_cast<Concrete&>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Gets a value, converting it to the given type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user