Allow chaining set calls on Configuration and TopicConfiguration

This commit is contained in:
Matias Fontanini
2016-06-22 20:03:28 -07:00
parent bba9043faf
commit c300a9bf35
6 changed files with 49 additions and 34 deletions

View File

@@ -77,14 +77,14 @@ public:
* \param name The name of the option
* \param value The value of the option
*/
void set(const std::string& name, const std::string& value);
TopicConfiguration& set(const std::string& name, const std::string& value);
/**
* \brief Sets the partitioner callback
*
* This translates into a call to rd_kafka_topic_conf_set_partitioner_cb
*/
void set_partitioner_callback(PartitionerCallback callback);
TopicConfiguration& set_partitioner_callback(PartitionerCallback callback);
/**
* \brief Sets the "this" pointer as the opaque pointer for this handle
@@ -92,7 +92,7 @@ public:
* This method will be called by consumers/producers when the topic configuration object
* has been put in a persistent memory location. Users of cppkafka do not need to use this.
*/
void set_as_opaque();
TopicConfiguration& set_as_opaque();
/**
* Gets the partitioner callback