Awkward Array: Tuple< BUILDERS > Class Template Reference

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Tuple< BUILDERS > Class Template Reference

Builds a RecordArray which represents an array of tuples which can be of same or different types without field names, indexed only by their order. More...

`#include <LayoutBuilder.h>`

## Public Member Functions
| Tuple ()
| Creates a new Tuple layout builder. More...
template<std::size_t INDEX>
TupleContentType< INDEX > & | index () noexcept
| Returns the reference to the builder contents at `INDEX`. More...
const std::string & | parameters () const noexcept
| Parameters for the builder form. More...
void | set_parameters (std::string parameter) noexcept
| Sets the form parameters. More...
void | set_id (size_t &id) noexcept
| Assigns a unique ID to each node. More...
void | clear () noexcept
| Clears the builder contents. More...
const size_t | length () const noexcept
| Current number of records in the first index of the tuple. More...
bool | is_valid (std::string &error) const noexcept
| Checks for validity and consistency. More...
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. More...
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. More...
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. More...
std::string | form () const noexcept
| Generates a unique description of the builder and its contents in the form of a JSON-like string. More...

## Public Attributes
TupleContents | contents
| The contents of the RecordArray without fields. More...

## Detailed Description

template<typename... BUILDERS>
class awkward::LayoutBuilder::Tuple< BUILDERS >

Builds a RecordArray which represents an array of tuples which can be of same or different types without field names, indexed only by their order.

Template Parameters

  BUILDERS | The types of builder contents.

## Constructor & Destructor Documentation

## ◆ Tuple()

Tuple | ( |  | ) |
| inline

Creates a new Tuple layout builder.

## Member Function Documentation

## ◆ buffer_nbytes()

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()

void clear | ( |  | ) |
| inlinenoexcept

Clears the builder contents.

Discards the accumulated data and the contents at each tuple index.

## ◆ form()

std::string form | ( |  | ) | const
| inlinenoexcept

Generates a unique description of the builder and its contents in the form of a JSON-like string.

## ◆ index()

TupleContentType< INDEX > & index | ( |  | ) |
| inlinenoexcept

Returns the reference to the builder contents at `INDEX`.

## ◆ is_valid()

bool is_valid | ( | std::string & | error | ) | const
| inlinenoexcept

Checks for validity and consistency.

## ◆ length()

const size_t length | ( |  | ) | const
| inlinenoexcept

Current number of records in the first index of the tuple.

## ◆ parameters()

const std::string & parameters | ( |  | ) | const
| inlinenoexcept

Parameters for the builder form.

## ◆ set_id()

void set_id | ( | size_t & | id | ) |
| inlinenoexcept

Assigns a unique ID to each node.

## ◆ set_parameters()

void set_parameters | ( | std::string | parameter | ) |
| inlinenoexcept

Sets the form parameters.

## ◆ to_buffers()

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()

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

## Member Data Documentation

## ◆ contents

TupleContents contents

The contents of the RecordArray without fields.

The documentation for this class was generated from the following file:

- src/awkward/_v2/cpp-headers/awkward/LayoutBuilder.h