Allow building a configuration from an option list

This commit is contained in:
Matias Fontanini
2016-06-25 09:24:18 -07:00
parent a2e7f6db0d
commit c878049253
14 changed files with 256 additions and 16 deletions

View File

@@ -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.
*