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

Arrow-encoded data of a single batch of components together with a component descriptor. More...

#include <rerun/component_batch.hpp>

Public Member Functions

Result< ComponentColumnpartitioned (const Collection< uint32_t > &lengths) &&
 Partitions the component data into multiple sub-batches.
 
Result< ComponentColumnpartitioned () &&
 Partitions the component data into unit-length sub-batches.
 
Result< ComponentColumnpartitioned (const Collection< uint32_t > &lengths) const &
 Partitions the component data into multiple sub-batches.
 
Result< ComponentColumnpartitioned () const &
 Partitions the component data into unit-length sub-batches.
 
size_t length () const
 Size in the number of elements the underlying arrow array contains.
 
Error to_c_ffi_struct (rr_component_batch &out_component_batch) const
 To rerun C API component batch.
 

Static Public Member Functions

template<typename T >
static Result< ComponentBatchempty (const ComponentDescriptor &descriptor)
 Creates a new empty component batch with a given descriptor.
 
template<typename T >
static Result< ComponentBatchfrom_loggable (const rerun::Collection< T > &components, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new component batch from a collection of component instances.
 
template<typename T >
static Result< ComponentBatchfrom_loggable (const T &component, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new component batch from a single component instance.
 
template<typename T >
static Result< ComponentBatchfrom_loggable (const std::optional< T > &component, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new data cell from a single optional component instance.
 
template<typename T >
static Result< ComponentBatchfrom_loggable (const std::optional< rerun::Collection< T > > &components, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new data cell from an optional collection of component instances.
 
template<typename Archetype >
static Result< ComponentBatchfrom_indicator ()
 Creates a new component batch for an archetype indicator.
 
static Result< ComponentBatchfrom_arrow_array (std::shared_ptr< arrow::Array > array, const ComponentDescriptor &descriptor)
 Creates a new component batch from an already existing arrow array.
 

Public Attributes

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

Detailed Description

Arrow-encoded data of a single batch of components together with a component descriptor.

Component descriptors are registered when first encountered.

Member Function Documentation

◆ from_loggable() [1/4]

template<typename T >
static Result< ComponentBatch > rerun::ComponentBatch::from_loggable ( const rerun::Collection< T > &  components,
const ComponentDescriptor descriptor = rerun::Loggable<T>::Descriptor 
)
inlinestatic

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

Automatically registers the descriptor the first time it is encountered.

TODO(#4257) should take a rerun::Collection instead of pointer and size.

◆ from_loggable() [2/4]

template<typename T >
static Result< ComponentBatch > rerun::ComponentBatch::from_loggable ( const T &  component,
const ComponentDescriptor descriptor = rerun::Loggable<T>::Descriptor 
)
inlinestatic

Creates a new component batch from a single component instance.

Automatically registers the descriptor the first time it is encountered.

◆ from_loggable() [3/4]

template<typename T >
static Result< ComponentBatch > rerun::ComponentBatch::from_loggable ( const std::optional< T > &  component,
const ComponentDescriptor descriptor = rerun::Loggable<T>::Descriptor 
)
inlinestatic

Creates a new data cell from a single optional component instance.

None is represented as a data cell with 0 instances.

Automatically registers the descriptor the first time it is encountered.

◆ from_loggable() [4/4]

template<typename T >
static Result< ComponentBatch > rerun::ComponentBatch::from_loggable ( const std::optional< rerun::Collection< T > > &  components,
const ComponentDescriptor descriptor = rerun::Loggable<T>::Descriptor 
)
inlinestatic

Creates a new data cell from an optional collection of component instances.

None is represented as a data cell with 0 instances.

Automatically registers the descriptor the first time it is encountered.

◆ from_arrow_array()

static Result< ComponentBatch > rerun::ComponentBatch::from_arrow_array ( std::shared_ptr< arrow::Array >  array,
const ComponentDescriptor descriptor 
)
static

Creates a new component batch from an already existing arrow array.

Automatically registers the descriptor the first time it is encountered.

◆ partitioned() [1/4]

Result< ComponentColumn > rerun::ComponentBatch::partitioned ( const Collection< uint32_t > &  lengths) &&

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into a ComponentColumn.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

Parameters
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.

◆ partitioned() [2/4]

Result< ComponentColumn > rerun::ComponentBatch::partitioned ( ) &&

Partitions the component data into unit-length sub-batches.

Specifically, this transforms the existing ComponentBatch data into a ComponentColumn. This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

◆ partitioned() [3/4]

Result< ComponentColumn > rerun::ComponentBatch::partitioned ( const Collection< uint32_t > &  lengths) const &

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into a ComponentColumn. This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

Parameters
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.

◆ partitioned() [4/4]

Result< ComponentColumn > rerun::ComponentBatch::partitioned ( ) const &

Partitions the component data into unit-length sub-batches.

Specifically, this transforms the existing ComponentBatch data into a ComponentColumn. This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

◆ to_c_ffi_struct()

Error rerun::ComponentBatch::to_c_ffi_struct ( rr_component_batch &  out_component_batch) const

To rerun C API component batch.

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


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