mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-20 19:54:51 +00:00
Add operator<< for TopicPartition
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#define CPPKAFKA_TOPIC_PARTITION_H
|
||||
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <cstdint>
|
||||
|
||||
namespace cppkafka {
|
||||
@@ -104,6 +105,11 @@ public:
|
||||
* Gets the offset
|
||||
*/
|
||||
int64_t get_offset() const;
|
||||
|
||||
/**
|
||||
* Print to a stream
|
||||
*/
|
||||
friend std::ostream& operator<<(std::ostream& output, const TopicPartition& rhs);
|
||||
private:
|
||||
std::string topic_;
|
||||
int partition_;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define CPPKAFKA_TOPIC_PARTITION_LIST_H
|
||||
|
||||
#include <memory>
|
||||
#include <iosfwd>
|
||||
#include <algorithm>
|
||||
#include <librdkafka/rdkafka.h>
|
||||
|
||||
@@ -51,6 +52,8 @@ std::vector<TopicPartition> convert(const TopicPartitionsListPtr& topic_partitio
|
||||
std::vector<TopicPartition> convert(rd_kafka_topic_partition_list_t* topic_partitions);
|
||||
TopicPartitionsListPtr make_handle(rd_kafka_topic_partition_list_t* handle);
|
||||
|
||||
std::ostream& operator<<(std::ostream& output, const TopicPartitionList& rhs);
|
||||
|
||||
} // cppkafka
|
||||
|
||||
#endif // CPPKAFKA_TOPIC_PARTITION_LIST_H
|
||||
|
||||
Reference in New Issue
Block a user