Add initial producer code

This commit is contained in:
Matias Fontanini
2016-05-16 20:46:08 -07:00
parent f86c9c1f57
commit 1cc8f027c9
18 changed files with 359 additions and 13 deletions

26
include/cppkafka/topic.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef CPPKAFKA_TOPIC_H
#define CPPKAFKA_TOPIC_H
#include <string>
#include <memory>
#include <boost/optional.hpp>
#include <librdkafka/rdkafka.h>
namespace cppkafka {
class Topic {
public:
Topic(rd_kafka_topic_t* handle);
std::string get_name() const;
rd_kafka_topic_t* get_handle() const;
private:
using HandlePtr = std::unique_ptr<rd_kafka_topic_t, decltype(&rd_kafka_topic_destroy)>;
HandlePtr handle_;
};
} // cppkafka
#endif // CPPKAFKA_TOPIC_H