Wrapper class to handle a IOBuf as a typed buffer (to a standard layout class).
Synopsis
Declared in <folly/io/TypedIOBuf.h>
template<class T>
class TypedIOBuf;
Description
This class punts on alignment, and assumes that you know what you're doing.
All methods are wrappers around the corresponding IOBuf methods. The TypedIOBuf object is stateless, so it's perfectly okay to access the underlying IOBuf in between TypedIOBuf method calls.
Type Aliases
Name |
Description |
Const element iterator. |
|
Const reference to an element. |
|
Mutable element iterator. |
|
Reference to an element. |
|
Type used for element counts. |
|
The element type stored in the buffer. |
Member Functions
Name |
Description |
|
Constructors |
Move assignment operator. |
|
Advances the data pointer forward by n elements. |
|
Appends n elements from the tailroom. |
|
Returns the last element. |
|
|
|
Returns a pointer to the start of the allocated buffer. |
|
Returns a pointer just past the end of the allocated buffer. |
|
Returns the buffer capacity, in elements. |
|
Returns a const iterator to the first element. |
|
Returns a const iterator just past the last element. |
|
Resets the buffer to empty. |
|
Returns a pointer to the first element. |
|
Returns true if the buffer holds no elements. |
|
|
|
Returns the first element. |
|
Returns the available headroom, in elements. |
|
Returns the underlying IOBuf. |
|
Returns the number of elements in the buffer. |
|
Subscript operators |
|
Prepends n elements from the headroom. |
|
|
|
Appends one element. |
|
|
|
Moves the data pointer backward by n elements. |
|
Returns the number of elements in the buffer. |
|
Returns a pointer just past the last element. |
|
Returns the available tailroom, in elements. |
|
Removes n elements from the end. |
|
Removes n elements from the start. |
|
Returns a writable pointer to the start of the allocated buffer. |
|
Returns a writable pointer to the first element. |
|
Returns a writable pointer just past the last element. |
Created with MrDocs