Add iterators to Buffer

This commit is contained in:
Matias Fontanini
2016-06-16 07:46:55 -07:00
parent 8db1df0998
commit e1c2ee34fe
3 changed files with 41 additions and 7 deletions

View File

@@ -49,8 +49,16 @@ namespace cppkafka {
*/
class Buffer {
public:
/**
* The type of data this buffer points to
*/
using DataType = unsigned char;
/**
* The const iterator type
*/
using const_iterator = const DataType*;
/**
* Constructs an empty buffer
*/
@@ -94,6 +102,16 @@ public:
*/
size_t get_size() const;
/**
* Gets an iterator to the beginning of this buffer
*/
const_iterator begin() const;
/**
* Gets an iterator to the end of this buffer
*/
const_iterator end() const;
/**
* Checks whether this is a non empty buffer
*/