An IOBufQueue encapsulates a chain of IOBufs and provides convenience functions to append data to the back of the chain and remove data from the front.
Synopsis
Declared in <folly/io/IOBufQueue.h>
class IOBufQueue;
Description
You may also prepend data into the headroom of the first buffer in the chain, if any.
Types
Name |
Description |
Configuration options for an IOBufQueue. |
|
WritableRangeCache represents a cache of current writable tail and provides cheap and simple interface to append to it that avoids paying the cost of preallocate/postallocate pair (i.e. indirections and checks). |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor. |
Move assignment operator. |
|
Obtain a writable block of n contiguous bytes, allocating more space if necessary, and mark it as used. methodset Allocation |
|
|
|
Append the queue to a std::string. methodset Utility |
|
Get cached chain length. methodset Capacity |
|
Clear the queue, but try to clear and keep the largest buffer for reuse when possible. methodset Allocation |
|
Returns true iff the IOBuf chain length is 0. methodset Capacity |
|
Access the front IOBuf. methodset Access |
|
Calls IOBuf::gather() on the head of the queue, if it exists. methodset Capacity |
|
Get writeable headroom methodset Access |
|
Indicate that n bytes from the headroom have been used. methodset Shifting |
|
Transfer ownership of the queue's entire IOBuf chain to the caller. methodset Conversions |
|
Transfer the queue's entire IOBuf chain to the caller, by value. |
|
Get the options used to configure this IOBufQueue. methodset Configuration |
|
Removes and returns the first IOBuf in the chain. methodset Conversions |
|
Tell the queue that the caller has written data into the first n bytes provided by the previous preallocate() call. methodset Allocation |
|
Obtain a writable block of contiguous bytes at the end of this queue, allocating more space if necessary. methodset Allocation |
|
Prepend an existing range methodset Modifiers |
|
Clear the queue, freeing all the buffers. methodset Allocation |
|
Set a custom IOBufFactory for buffer allocations. methodset Configuration |
|
Split off the first n bytes of the queue into a separate IOBuf chain. methodset Modifiers |
|
Split at most n bytes. methodset Modifiers |
|
Get the amount of free space at the end of the buffer. methodset Access |
|
Remove bytes from the end. methodset Shifting |
|
Maybe remove bytes from the end. methodset Shifting |
|
Remove bytes from the front. methodset Shifting |
|
Maybe remove bytes from the front. methodset Shifting |
|
Append a buffer by wrapping. methodset Modifiers |
|
Get a pointer to the writable tail section. methodset Access |
Static Member Functions
Name |
Description |
Get Options with cacheChainLength=true. methodset Configuration |
Static Data Members
Name |
Description |
The maximum number of bytes copied per node when packing a chain. |
Friends
Name |
Description |
Read‐write cursor over an IOBuf chain. |
Created with MrDocs