Headers object.
More...
#include <rdkafkacpp.h>
◆ create() [1/2]
static Headers* RdKafka::Headers::create |
( |
| ) |
|
|
static |
Create a new instance of the Headers object.
- Returns
- an empty Headers list
◆ create() [2/2]
static Headers* RdKafka::Headers::create |
( |
const std::vector< Header > & |
headers | ) |
|
|
static |
Create a new instance of the Headers object from a std::vector.
- Parameters
-
- Returns
- a Headers list from std::vector set to the size of the std::vector
◆ add() [1/3]
virtual ErrorCode RdKafka::Headers::add |
( |
const std::string & |
key, |
|
|
const void * |
value, |
|
|
size_t |
value_size |
|
) |
| |
|
pure virtual |
Adds a Header to the end of the list.
- Parameters
-
key | header key/name |
value | binary value, or NULL |
value_size | size of the value |
- Returns
- an ErrorCode signalling success or failure to add the header.
◆ add() [2/3]
virtual ErrorCode RdKafka::Headers::add |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
pure virtual |
Adds a Header to the end of the list.
Convenience method for adding a std::string as a value for the header.
- Parameters
-
key | header key/name |
value | value string |
- Returns
- an ErrorCode signalling success or failure to add the header.
◆ add() [3/3]
Adds a Header to the end of the list.
This method makes a copy of the passed header.
- Parameters
-
header | Existing header to copy |
- Returns
- an ErrorCode signalling success or failure to add the header.
◆ remove()
virtual ErrorCode RdKafka::Headers::remove |
( |
const std::string & |
key | ) |
|
|
pure virtual |
Removes all the Headers of a given key.
- Parameters
-
key | header key/name to remove |
- Returns
- An ErrorCode signalling a success or failure to remove the Header.
◆ get()
virtual std::vector<Header> RdKafka::Headers::get |
( |
const std::string & |
key | ) |
const |
|
pure virtual |
Gets all of the Headers of a given key.
- Parameters
-
- Returns
- a std::vector containing all the Headers of the given key.
◆ get_last()
virtual Header RdKafka::Headers::get_last |
( |
const std::string & |
key | ) |
const |
|
pure virtual |
Gets the last occurrence of a Header of a given key.
- Parameters
-
- Returns
- the Header if found, otherwise a Header with an err set to ERR__NOENT.
◆ get_all()
virtual std::vector<Header> RdKafka::Headers::get_all |
( |
| ) |
const |
|
pure virtual |
Returns all Headers.
- Returns
- a std::vector containing all of the Headers
◆ size()
virtual size_t RdKafka::Headers::size |
( |
| ) |
const |
|
pure virtual |
- Returns
- the number of headers.
The documentation for this class was generated from the following file: