Loading...
Searching...
No Matches
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.
 
 Panel (std::unique_ptr< PRIMITIVE[]> ptr, size_t length, size_t reserved)
 Creates a Panel from a full set of parameters.
 
 ~Panel ()
 Deletes a Panel.
 
PRIMITIVE & operator[] (size_t i)
 Overloads [] operator to access elements like an array.
 
Panelappend_panel (size_t reserved)
 Creates a new panel with slots equal to reserved and appends it after the current panel.
 
void fill_panel (PRIMITIVE datum)
 Inserts one datum into the panel.
 
std::unique_ptr< Panel > & next ()
 Pointer to the next panel.
 
size_t current_length ()
 Currently used number of elements in the panel.
 
size_t reserved ()
 Currently allocated number of elements in the panel.
 
std::unique_ptr< PRIMITIVE[]> & data ()
 Unique pointer to the panel data.
 
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.
 
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.
 
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.
 
template<typename TO_PRIMITIVE >
std::enable_if<(!awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&!awkward::is_tt< std::complex, PRIMITIVE >::value)||(awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&awkward::is_tt< std::complex, PRIMITIVE >::value)>::type copy_as (TO_PRIMITIVE *to_ptr, size_t offset)
 Fills (one panel) GrowableBuffer<TO_PRIMITIVE> with the elements of (possibly multi-panels) GrowableBuffer<PRIMITIVE>.
 
template<typename TO_PRIMITIVE >
std::enable_if<!awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&awkward::is_tt< std::complex, PRIMITIVE >::value >::type copy_as (TO_PRIMITIVE *to_ptr, size_t offset)
 
template<typename TO_PRIMITIVE >
std::enable_if< awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&!awkward::is_tt< std::complex, PRIMITIVE >::value >::type copy_as (TO_PRIMITIVE *to_ptr, size_t offset)
 'copy_as' specialization of a 'std::complex' template type. Fills (one panel) GrowableBuffer<std::complex> with the elements of (possibly multi-panels) GrowableBuffer<PRIMITIVE>.
 

Detailed Description

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

Creates a contiguous, one-dimensional panel.

Constructor & Destructor Documentation

◆ Panel() [1/2]

template<typename PRIMITIVE >
Panel ( size_t reserved)
inline

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

Parameters
reservedCurrently allocated number of elements in the panel.

◆ Panel() [2/2]

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

Creates a Panel from a full set of parameters.

Parameters
ptrUnique reference to the panel data.
lengthCurrently number used of elements in the panel.
reservedCurrently allocated number of elements in the panel.

◆ ~Panel()

template<typename PRIMITIVE >
~Panel ( )
inline

Deletes a Panel.

Unchain the pointers to avoid a stack overflow when a recursive implicit destructor is invoked.

Member Function Documentation

◆ append()

template<typename PRIMITIVE >
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_ptrOne contiguously allocated panel.
offsetDistance between to_ptr and the pointer to the destination where the accumulated data is copied.
fromDistance between ptr and pointer to the source of the data to be copied.
lengthLength of the data to be copied.

◆ append_panel()

template<typename PRIMITIVE >
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()

template<typename PRIMITIVE >
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_ptrOne contiguously allocated panel.
offsetDistance between to_ptr and the pointer to the destination where the accumulated data is copied.

◆ concatenate_to_from()

template<typename PRIMITIVE >
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_ptrOne contiguously allocated panel.
offsetDistance between to_ptr and the pointer to the destination where the accumulated data is copied.
fromDistance between ptr and pointer to the source of the data to be copied.

◆ copy_as() [1/3]

template<typename PRIMITIVE >
template<typename TO_PRIMITIVE >
std::enable_if<(!awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&!awkward::is_tt< std::complex, PRIMITIVE >::value)||(awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&awkward::is_tt< std::complex, PRIMITIVE >::value)>::type 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/

◆ copy_as() [2/3]

template<typename PRIMITIVE >
template<typename TO_PRIMITIVE >
std::enable_if<!awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&awkward::is_tt< std::complex, PRIMITIVE >::value >::type copy_as ( TO_PRIMITIVE * to_ptr,
size_t offset )
inline

◆ copy_as() [3/3]

template<typename PRIMITIVE >
template<typename TO_PRIMITIVE >
std::enable_if< awkward::is_tt< std::complex, TO_PRIMITIVE >::value &&!awkward::is_tt< std::complex, PRIMITIVE >::value >::type copy_as ( TO_PRIMITIVE * to_ptr,
size_t offset )
inline

'copy_as' specialization of a 'std::complex' template type. Fills (one panel) GrowableBuffer<std::complex> with the elements of (possibly multi-panels) GrowableBuffer<PRIMITIVE>.

Changes the data type from PRIMITIVE to std::complex/

◆ current_length()

template<typename PRIMITIVE >
size_t current_length ( )
inline

Currently used number of elements in the panel.

◆ data()

template<typename PRIMITIVE >
std::unique_ptr< PRIMITIVE[]> & data ( )
inline

Unique pointer to the panel data.

◆ fill_panel()

template<typename PRIMITIVE >
void fill_panel ( PRIMITIVE datum)
inline

Inserts one datum into the panel.

◆ next()

template<typename PRIMITIVE >
std::unique_ptr< Panel > & next ( )
inline

Pointer to the next panel.

◆ operator[]()

template<typename PRIMITIVE >
PRIMITIVE & operator[] ( size_t i)
inline

Overloads [] operator to access elements like an array.

◆ reserved()

template<typename PRIMITIVE >
size_t reserved ( )
inline

Currently allocated number of elements in the panel.


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