Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::ComponentColumn Struct Reference

Arrow-encoded data of a column of components. More...

#include <rerun/component_column.hpp>

Public Member Functions

Error to_c_ffi_struct (rr_component_column &out_component_batch) const
 To rerun C API component batch.
 

Static Public Member Functions

template<typename T >
static Result< ComponentColumnfrom_loggable_with_lengths (const Collection< T > &components, const Collection< uint32_t > &lengths)
 Creates a new component column from a collection of component instances.
 
template<typename T >
static Result< ComponentColumnfrom_loggable (const Collection< T > &components)
 Creates a new component column from a collection of component instances where each run has a length of one.
 
template<typename Archetype >
static Result< ComponentColumnfrom_indicators (uint32_t num_indicators)
 Creates a new component column with a given number of archetype indicators for a given archetype type.
 
static Result< ComponentColumnfrom_batch_with_lengths (ComponentBatch batch, const Collection< uint32_t > &lengths, std::shared_ptr< arrow::DataType > list_array_type)
 Creates a new component batch partition from a batch and a collection of run lengths.
 
static Result< ComponentColumnfrom_batch_with_offsets (ComponentBatch batch, Collection< uint32_t > offsets, std::shared_ptr< arrow::DataType > list_array_type)
 Creates a new component batch partition from a batch and a collection of component offsets.
 
template<typename T >
static const std::shared_ptr< arrow::DataType > & list_array_type_for ()
 Returns the list array type for the given loggable type.
 
static std::shared_ptr< arrow::DataType > list_array_type_for (std::shared_ptr< arrow::DataType > inner_type)
 Creates a new arrow::Datatype for an underlying type.
 

Public Attributes

std::shared_ptr< arrow::Array > array
 Arrow-encoded list array of component batches.
 
ComponentTypeHandle component_type
 The type of the component instances in array.
 

Detailed Description

Arrow-encoded data of a column of components.

This is essentially an array of rerun::ComponentBatch with all batches continuously in a single array.

See also
rerun::RecordingStream::send_columns

Member Function Documentation

◆ from_loggable_with_lengths()

template<typename T >
static Result< ComponentColumn > rerun::ComponentColumn::from_loggable_with_lengths ( const Collection< T > &  components,
const Collection< uint32_t > &  lengths 
)
inlinestatic

Creates a new component column from a collection of component instances.

Automatically registers the component type the first time this type is encountered.

Parameters
componentsContinuous collection of components which is about to be partitioned.
lengthsThe number of components in each run. for rerun::RecordingStream::send_columns, this specifies the number of components at each time point. The sum of the lengths must be equal to the number of components in the batch.

◆ from_loggable()

template<typename T >
static Result< ComponentColumn > rerun::ComponentColumn::from_loggable ( const Collection< T > &  components)
inlinestatic

Creates a new component column from a collection of component instances where each run has a length of one.

When used with rerun::RecordingStream::send_columns, this is equivalent to from_loggable(components, std::vector{1, 1, ...}). I.e. there's a single component for each time point.

Automatically registers the component type the first time this type is encountered.

Parameters
componentsContinuous collection of components which is about to be partitioned into runs of length one.

◆ from_batch_with_lengths()

static Result< ComponentColumn > rerun::ComponentColumn::from_batch_with_lengths ( ComponentBatch  batch,
const Collection< uint32_t > &  lengths,
std::shared_ptr< arrow::DataType >  list_array_type 
)
static

Creates a new component batch partition from a batch and a collection of run lengths.

Parameters
batchA batch of components which is about to be partitioned.
lengthsThe number of components in each run. for rerun::RecordingStream::send_columns, this specifies the number of components at each time point. The sum of the lengths must be equal to the number of components in the batch.
list_array_typeThe type of the list array to use for the component column. Can be retrieved using list_array_type_for<T>().

◆ from_batch_with_offsets()

static Result< ComponentColumn > rerun::ComponentColumn::from_batch_with_offsets ( ComponentBatch  batch,
Collection< uint32_t >  offsets,
std::shared_ptr< arrow::DataType >  list_array_type 
)
static

Creates a new component batch partition from a batch and a collection of component offsets.

Parameters
batchA batch of components which is about to be partitioned.
offsetsAn offset within batch for each array of components. The last offset is the total number of components in the batch. Meaning that this array has to be one element longer than the number of component runs. E.g. a ParitionedComponentBatch with a single component would have an offset array of [0, 1]. A ComponentColumn with 5 components divided into runs of length 2 and 3
list_array_typeThe type of the list array to use for the component column. Can be retrieved using list_array_type_for<T>().

◆ list_array_type_for() [1/2]

template<typename T >
static const std::shared_ptr< arrow::DataType > & rerun::ComponentColumn::list_array_type_for ( )
inlinestatic

Returns the list array type for the given loggable type.

Lazily creates the type on first call and then returns a reference to it.

◆ list_array_type_for() [2/2]

static std::shared_ptr< arrow::DataType > rerun::ComponentColumn::list_array_type_for ( std::shared_ptr< arrow::DataType >  inner_type)
static

Creates a new arrow::Datatype for an underlying type.

To avoid repeated allocation, use the templated version of this method.

◆ to_c_ffi_struct()

Error rerun::ComponentColumn::to_c_ffi_struct ( rr_component_column &  out_component_batch) const

To rerun C API component batch.

The resulting rr_component_column keeps the arrow::Array alive until it is released.


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