mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 19:18:04 +00:00
Allow making no key/payload copies in BufferedProducer
This commit is contained in:
@@ -108,11 +108,21 @@ public:
|
||||
*/
|
||||
const BufferType& key() const;
|
||||
|
||||
/**
|
||||
* Gets the message's key
|
||||
*/
|
||||
BufferType& key();
|
||||
|
||||
/**
|
||||
* Gets the message's payload
|
||||
*/
|
||||
const BufferType& payload() const;
|
||||
|
||||
/**
|
||||
* Gets the message's payload
|
||||
*/
|
||||
BufferType& payload();
|
||||
|
||||
/**
|
||||
* Gets the message's user data pointer
|
||||
*/
|
||||
@@ -183,11 +193,21 @@ const T& BasicMessageBuilder<T, C>::key() const {
|
||||
return key_;
|
||||
}
|
||||
|
||||
template <typename T, typename C>
|
||||
T& BasicMessageBuilder<T, C>::key() {
|
||||
return key_;
|
||||
}
|
||||
|
||||
template <typename T, typename C>
|
||||
const T& BasicMessageBuilder<T, C>::payload() const {
|
||||
return payload_;
|
||||
}
|
||||
|
||||
template <typename T, typename C>
|
||||
T& BasicMessageBuilder<T, C>::payload() {
|
||||
return payload_;
|
||||
}
|
||||
|
||||
template <typename T, typename C>
|
||||
void* BasicMessageBuilder<T, C>::user_data() const {
|
||||
return user_data_;
|
||||
|
||||
Reference in New Issue
Block a user