Skip to content

Commit 177dbfa

Browse files
committed
Add get_buffers docstring
1 parent 35ebb09 commit 177dbfa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/sparrow_ipc/deserialize_utils.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ namespace sparrow_ipc::utils
7777
const org::apache::arrow::flatbuf::BodyCompression* compression
7878
);
7979

80+
/**
81+
* @brief Extracts a buffer from a RecordBatch's body.
82+
*
83+
* This function retrieves a buffer span from the specified index in the RecordBatch's
84+
* buffer list and increments the index.
85+
*
86+
* @param record_batch The Arrow RecordBatch containing buffer metadata.
87+
* @param body The raw buffer data as a byte span.
88+
* @param buffer_index The index of the buffer to retrieve. This value is incremented by the function.
89+
*
90+
* @return A `std::span<const uint8_t>` viewing the extracted buffer data.
91+
* @throws std::runtime_error if the buffer metadata indicates a buffer that exceeds the body size.
92+
*/
8093
[[nodiscard]] std::span<const uint8_t> get_buffer(
8194
const org::apache::arrow::flatbuf::RecordBatch& record_batch,
8295
std::span<const uint8_t> body,

0 commit comments

Comments
 (0)