Builds a ListArray which generalizes ListOffsetArray. Instead of a single offsets array, ListArray has - starts which is the starting index of each list and stops which is the stopping index of each list.
More...
#include <LayoutBuilder.h>
|
| List () |
| Creates a new List layout builder by allocating new starts and stops buffer, using default_options for initializing the buffer.
|
|
| List (const awkward::BuilderOptions &options) |
| Creates a new List layout builder by allocating new starts and stops buffer, taking options from BuilderOptions for initializing the buffer.
|
|
BUILDER & | content () noexcept |
| Returns the reference to the builder content.
|
|
BUILDER & | begin_list () noexcept |
| Begins a list, appends the current length of the list contents in the starts buffer and returns the reference to the builder content.
|
|
void | end_list () noexcept |
| Ends a list and appends the current length of the list contents in the stops buffer.
|
|
const std::string & | parameters () const noexcept |
| Parameters for the builder form.
|
|
void | set_parameters (std::string parameter) noexcept |
| Sets the form parameters.
|
|
void | set_id (size_t &id) noexcept |
| Assigns a unique ID to each node.
|
|
void | clear () noexcept |
| Discards the accumulated starts and stops, and clears the builder content.
|
|
size_t | length () const noexcept |
| Current length of the content and starts buffer.
|
|
bool | is_valid (std::string &error) const noexcept |
| Checks for validity and consistency.
|
|
void | buffer_nbytes (std::map< std::string, size_t > &names_nbytes) const noexcept |
| Retrieves the names and sizes (in bytes) of the buffers used in the builder and its contents.
|
|
void | to_buffers (std::map< std::string, void * > &buffers) const noexcept |
| Copies and concatenates all the accumulated data in each of the buffers of the builder and its contents to user-defined pointers.
|
|
void | to_char_buffers (std::map< std::string, uint8_t * > &buffers) const noexcept |
| Copies and concatenates all the accumulated data in the builder to a map of user-allocated buffers.
|
|
std::string | form () const noexcept |
| Generates a unique description of the builder and its contents in the form of a JSON-like string.
|
|
template<typename PRIMITIVE, typename BUILDER>
class awkward::LayoutBuilder::List< PRIMITIVE, BUILDER >
Builds a ListArray which generalizes ListOffsetArray. Instead of a single offsets array, ListArray has - starts which is the starting index of each list and stops which is the stopping index of each list.
The starts and stops values can be 64-bit signed integers int64
, 32-bit signed integers int32
or 32-bit unsigned integers uint32
.
- Template Parameters
-
PRIMITIVE | The type of starts and stops buffer. |
BUILDER | The type of builder content. |
◆ List() [1/2]
template<typename PRIMITIVE , typename BUILDER >
Creates a new List layout builder by allocating new starts
and stops
buffer, using default_options
for initializing the buffer.
◆ List() [2/2]
template<typename PRIMITIVE , typename BUILDER >
Creates a new List layout builder by allocating new starts
and stops
buffer, taking options
from BuilderOptions
for initializing the buffer.
- Parameters
-
options | Initial size configuration of a buffer. |
◆ begin_list()
template<typename PRIMITIVE , typename BUILDER >
Begins a list, appends the current length of the list contents in the starts
buffer and returns the reference to the builder content.
◆ buffer_nbytes()
template<typename PRIMITIVE , typename BUILDER >
void buffer_nbytes |
( |
std::map< std::string, size_t > & |
names_nbytes | ) |
const |
|
inlinenoexcept |
Retrieves the names and sizes (in bytes) of the buffers used in the builder and its contents.
◆ clear()
template<typename PRIMITIVE , typename BUILDER >
Discards the accumulated starts and stops, and clears the builder content.
◆ content()
template<typename PRIMITIVE , typename BUILDER >
Returns the reference to the builder content.
◆ end_list()
template<typename PRIMITIVE , typename BUILDER >
Ends a list and appends the current length of the list contents in the stops
buffer.
◆ form()
template<typename PRIMITIVE , typename BUILDER >
std::string form |
( |
| ) |
const |
|
inlinenoexcept |
Generates a unique description of the builder and its contents in the form of a JSON-like string.
◆ is_valid()
template<typename PRIMITIVE , typename BUILDER >
bool is_valid |
( |
std::string & |
error | ) |
const |
|
inlinenoexcept |
Checks for validity and consistency.
◆ length()
template<typename PRIMITIVE , typename BUILDER >
Current length of the content and starts
buffer.
◆ parameters()
template<typename PRIMITIVE , typename BUILDER >
const std::string & parameters |
( |
| ) |
const |
|
inlinenoexcept |
Parameters for the builder form.
◆ set_id()
template<typename PRIMITIVE , typename BUILDER >
void set_id |
( |
size_t & |
id | ) |
|
|
inlinenoexcept |
Assigns a unique ID to each node.
◆ set_parameters()
template<typename PRIMITIVE , typename BUILDER >
void set_parameters |
( |
std::string |
parameter | ) |
|
|
inlinenoexcept |
Sets the form parameters.
◆ to_buffers()
template<typename PRIMITIVE , typename BUILDER >
void to_buffers |
( |
std::map< std::string, void * > & |
buffers | ) |
const |
|
inlinenoexcept |
Copies and concatenates all the accumulated data in each of the buffers of the builder and its contents to user-defined pointers.
Used to fill the buffers map by allocating it with user-defined pointers using the same names and sizes (in bytes) obtained from buffer_nbytes.
◆ to_char_buffers()
template<typename PRIMITIVE , typename BUILDER >
void to_char_buffers |
( |
std::map< std::string, uint8_t * > & |
buffers | ) |
const |
|
inlinenoexcept |
Copies and concatenates all the accumulated data in the builder to a map of user-allocated buffers.
The map keys and the buffer sizes are obtained from buffer_nbytes
The documentation for this class was generated from the following file:
- /home/runner/work/awkward/awkward/awkward-cpp/header-only/layout-builder/awkward/LayoutBuilder.h