Loading...
Searching...
No Matches
Indexed< PRIMITIVE, BUILDER > Class Template Reference

Builds an IndexedArray which consists of an index buffer. More...

#include <LayoutBuilder.h>

Public Member Functions

 Indexed ()
 Creates a new Indexed layout builder by allocating a new index buffer, using AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS for initializing the buffer.
 
 Indexed (const awkward::BuilderOptions &options)
 Creates a new Indexed layout builder by allocating a new index buffer, taking options from BuilderOptions for initializing the buffer.
 
BUILDER & content () noexcept
 Returns the reference to the builder content.
 
BUILDER & append_index () noexcept
 Inserts the last valid index in the index buffer and returns the reference to the builder content.
 
BUILDER & append_index (size_t i) noexcept
 Inserts an explicit value in the index buffer and returns the reference to the builder content.
 
BUILDER & extend_index (size_t size) noexcept
 Inserts size number indices in the index buffer and returns the reference to the builder content.
 
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
 Discards the accumulated index and clears the content of the builder.
 
size_t length () const noexcept
 Current length of the index buffer.
 
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.
 
bool is_valid (std::string &error) const noexcept
 Checks for validity and consistency.
 
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 builder buffer to a user-defined pointer if the given node name matches with the node associated with the builder; otherwise, it searches the builder contents to locate a matching node.
 
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<typename PRIMITIVE, typename BUILDER>
class awkward::LayoutBuilder::Indexed< PRIMITIVE, BUILDER >

Builds an IndexedArray which consists of an index buffer.

The index values can be 64-bit signed integers int64, 32-bit signed integers int32 or 32-bit unsigned integers uint32.

Template Parameters
PRIMITIVEThe type of index buffer.
BUILDERThe type of builder content.

Constructor & Destructor Documentation

◆ Indexed() [1/2]

template<typename PRIMITIVE , typename BUILDER >
Indexed ( )
inline

Creates a new Indexed layout builder by allocating a new index buffer, using AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS for initializing the buffer.

◆ Indexed() [2/2]

template<typename PRIMITIVE , typename BUILDER >
Indexed ( const awkward::BuilderOptions & options)
inline

Creates a new Indexed layout builder by allocating a new index buffer, taking options from BuilderOptions for initializing the buffer.

Parameters
optionsInitial size configuration of a buffer.

Member Function Documentation

◆ append_index() [1/2]

template<typename PRIMITIVE , typename BUILDER >
BUILDER & append_index ( )
inlinenoexcept

Inserts the last valid index in the index buffer and returns the reference to the builder content.

◆ append_index() [2/2]

template<typename PRIMITIVE , typename BUILDER >
BUILDER & append_index ( size_t i)
inlinenoexcept

Inserts an explicit value in the index buffer and returns the reference to the builder content.

◆ buffer_nbytes()

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

Discards the accumulated index and clears the content of the builder.

◆ content()

template<typename PRIMITIVE , typename BUILDER >
BUILDER & content ( )
inlinenoexcept

Returns the reference to the builder content.

◆ extend_index()

template<typename PRIMITIVE , typename BUILDER >
BUILDER & extend_index ( size_t size)
inlinenoexcept

Inserts size number indices in the index buffer and returns the reference to the builder content.

Just an interface; not actually faster than calling append many times.

◆ form()

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

Checks for validity and consistency.

◆ length()

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

Current length of the index buffer.

◆ parameters()

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

Parameters for the builder form.

◆ set_id()

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

Assigns a unique ID to each node.

◆ set_parameters()

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

Sets the form parameters.

◆ to_buffer()

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

Copies and concatenates the accumulated data in the builder buffer to a user-defined pointer if the given node name matches with the node associated with the builder; otherwise, it searches the builder contents to locate a matching node.

◆ to_buffers()

template<typename PRIMITIVE , 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<typename PRIMITIVE , 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: