Replace raw GWBUF pointers with mxs::Buffer

Now that the query queue is stored in an actual container, it is only
logical to use mxs::Buffer instead of GWBUF as the stored type.
This commit is contained in:
Markus Mäkelä
2019-03-16 10:51:05 +02:00
parent 5e3198f831
commit 6042a53cb3
5 changed files with 31 additions and 11 deletions

View File

@ -24,6 +24,11 @@
class SERVER;
namespace maxscale
{
class Buffer;
}
/**
* Buffer properties - used to store properties related to the buffer
* contents. This may be added at any point during the processing of the
@ -404,6 +409,7 @@ extern void dprintAllBuffers(void* pdcb);
* @param log_level Log priority where the message is written
*/
void gwbuf_hexdump(GWBUF* buffer, int log_level);
void gwbuf_hexdump(const mxs::Buffer& buffer, int log_level);
/**
* Return pointer of the byte at offset from start of chained buffer
@ -1043,6 +1049,16 @@ public:
return gwbuf_length(m_pBuffer);
}
/**
* Whether the buffer is empty.
*
* @return True if the buffer is empty
*/
bool empty() const
{
return m_pBuffer == nullptr;
}
/**
* Whether the buffer is contiguous.
*