Builds a RegularArray that describes lists that have the same length, a single integer size. Its underlying content is a flattened view of the data; that is, each list is not stored separately in memory, but is inferred as a subinterval of the underlying data. More...
#include <LayoutBuilder.h>
Public Member Functions | |
Regular () | |
Creates a new Regular layout builder. | |
BUILDER & | content () noexcept |
Returns the reference to the builder content. | |
BUILDER & | begin_list () noexcept |
Begins a list and returns the reference to the content of the builder. | |
void | end_list () noexcept |
Ends a list and increments the number of lists. | |
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 |
Clears the builder content. | |
size_t | length () const noexcept |
Current number of lists of length SIZE . | |
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. | |
Builds a RegularArray that describes lists that have the same length, a single integer size. Its underlying content is a flattened view of the data; that is, each list is not stored separately in memory, but is inferred as a subinterval of the underlying data.
A multidimensional NumpyArray
is equivalent to a one-dimensional NumpyArray
nested within several RegularArrays, one for each dimension. However, RegularArrays can be used to make lists of any other type.
SIZE | |
BUILDER | The type of builder content. |
Begins a list and returns the reference to the content of the builder.
Retrieves the names and sizes (in bytes) of the buffers used in the builder and its contents.
Clears the builder content.
Returns the reference to the builder content.
Ends a list and increments the number of lists.
Generates a unique description of the builder and its contents in the form of a JSON-like string.
|
inlinenoexcept |
Checks for validity and consistency.
Current number of lists of length SIZE
.
Parameters for the builder form.
Assigns a unique ID to each node.
|
inlinenoexcept |
Sets the form parameters.
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.
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