boost::redis::resp3::flat_tree
A generic response that stores data contiguously.
Description
Implements a container of RESP3 nodes. It's similar to boost::redis::resp3::tree, but node data is stored contiguously. This allows for amortized no allocations when re‐using flat_tree objects. Like tree, it can contain the response to several Redis commands or several server pushes. Use get_total_msgs to obtain how many responses this object contains.
Objects are typically created by the user and passed to connection::async_exec to be used as response containers. Call get_view to access the actual RESP3 nodes. Once populated, flat_tree can't be modified, except for clear and assignment.
A flat_tree is conceptually similar to a pair of std::vector objects, one holding resp3::node_view objects, and another owning the the string data that these views point to. The node capacity and the data capacity are the capacities of these two vectors.
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
Reserves capacity for incoming data. |
|
Clears the tree so it contains no nodes. |
|
Returns the size of the data buffer, in bytes. |
|
Returns the capacity of the data buffer, in bytes. |
|
Returns a vector with the nodes in the tree. |
|
Returns the number of memory reallocations that took place in the data buffer. |
|
Returns the number of complete RESP3 messages contained in this object. |
Friends
| Name | Description |
|---|---|
|
|
Inequality operator. |
|
Equality operator. |
Non-Member Functions
Name |
Description |
Inequality operator. |
|
Equality operator. |
Created with MrDocs