mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
				synced 2025-11-04 04:27:48 +00:00 
			
		
		
		
	Add enum for TopicPartition offsets
This commit is contained in:
		@@ -40,6 +40,16 @@ namespace cppkafka {
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class TopicPartition {
 | 
					class TopicPartition {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Special offsets enum
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    enum Offset {
 | 
				
			||||||
 | 
					        OFFSET_BEGINNING = -2,
 | 
				
			||||||
 | 
					        OFFSET_END = -1,
 | 
				
			||||||
 | 
					        OFFSET_STORED = -1000,
 | 
				
			||||||
 | 
					        OFFSET_INVALID = -1001
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Default constructs a topic/partition
 | 
					     * Default constructs a topic/partition
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@ TEST_F(TopicPartitionListTest, Conversion) {
 | 
				
			|||||||
    TopicPartitionList list1;
 | 
					    TopicPartitionList list1;
 | 
				
			||||||
    list1.push_back("foo");
 | 
					    list1.push_back("foo");
 | 
				
			||||||
    list1.push_back({ "bar", 2 });
 | 
					    list1.push_back({ "bar", 2 });
 | 
				
			||||||
 | 
					    list1.push_back({ "asd", 2, TopicPartition::OFFSET_BEGINNING });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TopicPartitionList list2 = convert(convert(list1));
 | 
					    TopicPartitionList list2 = convert(convert(list1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user