Add default constructor to Topic

This commit is contained in:
Matias Fontanini
2016-06-13 20:31:26 -07:00
parent a055768f5a
commit 0f5660710a
2 changed files with 13 additions and 0 deletions

View File

@@ -51,6 +51,14 @@ public:
*/
static Topic make_non_owning(rd_kafka_topic_t* handle);
/**
* \brief Constructs an empty topic
*
* Note that using any methods except Topic::get_handle on an empty topic is undefined
* behavior
*/
Topic();
/**
* \brief Constructs a topic using a handle
*

View File

@@ -42,6 +42,11 @@ Topic Topic::make_non_owning(rd_kafka_topic_t* handle) {
return Topic(handle, NonOwningTag{});
}
Topic::Topic()
: handle_(nullptr, nullptr) {
}
Topic::Topic(rd_kafka_topic_t* handle)
: handle_(handle, &rd_kafka_topic_destroy) {