Allow checking if an Event is valid

This commit is contained in:
Matias Fontanini
2018-10-21 11:36:16 -07:00
parent e73c997a0c
commit c7e1dcb60a
2 changed files with 11 additions and 0 deletions

View File

@@ -143,6 +143,13 @@ public:
* * RD_KAFKA_EVENT_OFFSET_COMMIT
*/
TopicPartitionList get_topic_partition_list() const;
/**
* Check whether this event is valid
*
* /return true iff this event has a valid (non-null) handle inside
*/
operator bool() const;
private:
using HandlePtr = std::unique_ptr<rd_kafka_event_t, decltype(&rd_kafka_event_destroy)>;