From 25ae15444eb22c7cff0fd619fd3857ab0e239d02 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Sun, 26 Jun 2016 09:06:09 -0700 Subject: [PATCH] Add TopicPartition::set_offset --- 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 2db8bac..a3874db 100644 --- a/include/cppkafka/topic_partition.h +++ b/include/cppkafka/topic_partition.h @@ -107,6 +107,11 @@ public: */ int64_t get_offset() const; + /** + * Sets the offset + */ + void set_offset(int64_t offset); + /** * Print to a stream */ diff --git a/src/topic_partition.cpp b/src/topic_partition.cpp index 3259319..f6ba410 100644 --- a/src/topic_partition.cpp +++ b/src/topic_partition.cpp @@ -73,6 +73,10 @@ int64_t TopicPartition::get_offset() const { return offset_; } +void TopicPartition::set_offset(int64_t offset) { + offset_ = offset; +} + ostream& operator<<(ostream& output, const TopicPartition& rhs) { return output << rhs.get_topic() << "[" << rhs.get_partition() << "]"; }