Awkward Array: Panel< PRIMITIVE > Class Template Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Panel< PRIMITIVE > Class Template Reference

`#include <GrowableBuffer.h>`

## Public Member Functions
| Panel (size_t reserved)
| Creates a Panel by allocating a new panel, taking a reserved number of slots. More...
| Panel (std::unique_ptr< PRIMITIVE[]> ptr, size_t length, size_t reserved)
| Creates a Panel from a full set of parameters. More...
PRIMITIVE & | operator[] (size_t i)
| Overloads [] operator to access elements like an array. More...
Panel * | append_panel (size_t reserved)
| Creates a new panel with slots equal to reserved and appends it after the current panel. More...
void | fill_panel (PRIMITIVE datum)
| Inserts one `datum` into the panel. More...
std::unique_ptr< Panel > & | next ()
| Pointer to the next panel. More...
size_t | current_length ()
| Currently used number of elements in the panel. More...
size_t | reserved ()
| Currently allocated number of elements in the panel. More...
void | append (PRIMITIVE *to_ptr, size_t offset, size_t from, int64_t length) const noexcept
| Copies the data from a panel to one contiguously allocated `to_ptr`. More...
void | concatenate_to_from (PRIMITIVE *to_ptr, size_t offset, size_t from) const noexcept
| Copies and concatenates the accumulated data from multiple panels `ptr_` to one contiguously allocated `to_ptr`. More...
void | concatenate_to (PRIMITIVE *to_ptr, size_t offset) const noexcept
| Copies and concatenates the accumulated data from multiple panels `ptr_` to one contiguously allocated `to_ptr`. More...
template<typename TO_PRIMITIVE >
void | copy_as (TO_PRIMITIVE *to_ptr, size_t offset)
| Fills (one panel) GrowableBuffer<TO_PRIMITIVE> with the elements of (possibly multi-panels) GrowableBuffer<PRIMITIVE>. More...

## Detailed Description

template<typename PRIMITIVE>
class awkward::Panel< PRIMITIVE >

Creates a contiguous, one-dimensional panel.

## Constructor & Destructor Documentation

## ◆ Panel() [1/2]

Panel | ( | size_t | reserved | ) |
| inline

Creates a Panel by allocating a new panel, taking a reserved number of slots.

Parameters

  reserved | Currently allocated number of elements in the panel.

## ◆ Panel() [2/2]

Panel | ( | std::unique_ptr< PRIMITIVE[]> | ptr,
|  | size_t | length,
|  | size_t | reserved
| ) |  |
| inline

Creates a Panel from a full set of parameters.

Parameters

  ptr | Unique reference to the panel data.
  length | Currently number used of elements in the panel.
  reserved | Currently allocated number of elements in the panel.

## Member Function Documentation

## ◆ append()

void append | ( | PRIMITIVE * | to_ptr,
|  | size_t | offset,
|  | size_t | from,
|  | int64_t | length
| ) |  | const
| inlinenoexcept

Copies the data from a panel to one contiguously allocated `to_ptr`.

Parameters

  to_ptr | One contiguously allocated panel.
  offset | Distance between `to_ptr` and the pointer to the destination where the accumulated data is copied.
  from | Distance between `ptr` and pointer to the source of the data to be copied.
  length | Length of the data to be copied.

## ◆ append_panel()

Panel * append_panel | ( | size_t | reserved | ) |
| inline

Creates a new panel with slots equal to reserved and appends it after the current panel.

## ◆ concatenate_to()

void concatenate_to | ( | PRIMITIVE * | to_ptr,
|  | size_t | offset
| ) |  | const
| inlinenoexcept

Copies and concatenates the accumulated data from multiple panels `ptr_` to one contiguously allocated `to_ptr`.

Parameters

  to_ptr | One contiguously allocated panel.
  offset | Distance between `to_ptr` and the pointer to the destination where the accumulated data is copied.

## ◆ concatenate_to_from()

void concatenate_to_from | ( | PRIMITIVE * | to_ptr,
|  | size_t | offset,
|  | size_t | from
| ) |  | const
| inlinenoexcept

Copies and concatenates the accumulated data from multiple panels `ptr_` to one contiguously allocated `to_ptr`.

Parameters

  to_ptr | One contiguously allocated panel.
  offset | Distance between `to_ptr` and the pointer to the destination where the accumulated data is copied.
  from | Distance between `ptr` and pointer to the source of the data to be copied.

## ◆ copy_as()

void copy_as | ( | TO_PRIMITIVE * | to_ptr,
|  | size_t | offset
| ) |  |
| inline

Fills (one panel) GrowableBuffer<TO_PRIMITIVE> with the elements of (possibly multi-panels) GrowableBuffer<PRIMITIVE>.

Changes the data type from `PRIMITIVE` to `TO_PRIMITIVE`/

## ◆ current_length()

size_t current_length | ( |  | ) |
| inline

Currently used number of elements in the panel.

## ◆ fill_panel()

void fill_panel | ( | PRIMITIVE | datum | ) |
| inline

Inserts one `datum` into the panel.

## ◆ next()

std::unique_ptr< Panel > & next | ( |  | ) |
| inline

Pointer to the next panel.

## ◆ operator[]()

PRIMITIVE & operator[] | ( | size_t | i | ) |
| inline

Overloads [] operator to access elements like an array.

## ◆ reserved()

size_t reserved | ( |  | ) |
| inline

Currently allocated number of elements in the panel.

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

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