From a85a87bb9bab97a4ccaf6d658d7c8a6d875856a2 Mon Sep 17 00:00:00 2001 From: Alexander Damian Date: Fri, 26 Jul 2019 10:35:20 -0400 Subject: [PATCH] Added method to set the partition --- include/cppkafka/topic_partition.h | 5 +++++ src/topic_partition.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/cppkafka/topic_partition.h b/include/cppkafka/topic_partition.h index 97ddc91..3176d4d 100644 --- a/include/cppkafka/topic_partition.h +++ b/include/cppkafka/topic_partition.h @@ -106,6 +106,11 @@ public: * Gets the offset */ int64_t get_offset() const; + + /** + * @brief Sets the partition + */ + void set_partition(int partition); /** * Sets the offset diff --git a/src/topic_partition.cpp b/src/topic_partition.cpp index 8ded9ee..35cab42 100644 --- a/src/topic_partition.cpp +++ b/src/topic_partition.cpp @@ -76,6 +76,10 @@ int64_t TopicPartition::get_offset() const { return offset_; } +void TopicPartition::set_partition(int partition) { + partition_ = partition; +} + void TopicPartition::set_offset(int64_t offset) { offset_ = offset; }