Loading...
Searching...
No Matches
Regular< SIZE, BUILDER > Class Template Reference

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_buffer (void *buffer, const char *name) const noexcept
 Copies and concatenates the accumulated data in the buffers of the builder content to user-defined pointers if the given node name matches with the node associated with that builder.
 
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.
 

Detailed Description

template<unsigned SIZE, typename BUILDER>
class awkward::LayoutBuilder::Regular< SIZE, BUILDER >

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.

Template Parameters
SIZE
BUILDERThe type of builder content.

Constructor & Destructor Documentation

◆ Regular()

template<unsigned SIZE, typename BUILDER >
Regular ( )
inline

Creates a new Regular layout builder.

Member Function Documentation

◆ begin_list()

template<unsigned SIZE, typename BUILDER >
BUILDER & begin_list ( )
inlinenoexcept

Begins a list and returns the reference to the content of the builder.

◆ buffer_nbytes()

template<unsigned SIZE, 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<unsigned SIZE, typename BUILDER >
void clear ( )
inlinenoexcept

Clears the builder content.

◆ content()

template<unsigned SIZE, typename BUILDER >
BUILDER & content ( )
inlinenoexcept

Returns the reference to the builder content.

◆ end_list()

template<unsigned SIZE, typename BUILDER >
void end_list ( )
inlinenoexcept

Ends a list and increments the number of lists.

◆ form()

template<unsigned SIZE, 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<unsigned SIZE, typename BUILDER >
bool is_valid ( std::string & error) const
inlinenoexcept

Checks for validity and consistency.

◆ length()

template<unsigned SIZE, typename BUILDER >
size_t length ( ) const
inlinenoexcept

Current number of lists of length SIZE.

◆ parameters()

template<unsigned SIZE, typename BUILDER >
const std::string & parameters ( ) const
inlinenoexcept

Parameters for the builder form.

◆ set_id()

template<unsigned SIZE, typename BUILDER >
void set_id ( size_t & id)
inlinenoexcept

Assigns a unique ID to each node.

◆ set_parameters()

template<unsigned SIZE, typename BUILDER >
void set_parameters ( std::string parameter)
inlinenoexcept

Sets the form parameters.

◆ to_buffer()

template<unsigned SIZE, typename BUILDER >
void to_buffer ( void * buffer,
const char * name ) const
inlinenoexcept

Copies and concatenates the accumulated data in the buffers of the builder content to user-defined pointers if the given node name matches with the node associated with that builder.

◆ to_buffers()

template<unsigned SIZE, 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<unsigned SIZE, 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: