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< ComponentColumn > from_loggable_with_lengths (const Collection< T > &components, const Collection< uint32_t > &lengths, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new component column from a collection of component instances.
 
template<typename T >
static Result< ComponentColumn > from_loggable (const Collection< T > &components, const ComponentDescriptor &descriptor=rerun::Loggable< T >::Descriptor)
 Creates a new component column from a collection of component instances where each run has a length of one.
 
static Result< ComponentColumn > from_batch_with_lengths (ComponentBatch batch, const Collection< uint32_t > &lengths)
 Creates a new component batch partition from a batch and a collection of run lengths.
 
static Result< ComponentColumn > from_batch_with_offsets (ComponentBatch batch, Collection< uint32_t > offsets)
 Creates a new component batch partition from a batch and a collection of component offsets.
 
static Result< ComponentColumn > from_batch_with_offsets (ComponentBatch batch, std::shared_ptr< arrow::Buffer > offsets, size_t num_rows)
 Creates a new component batch partition from a batch and a shared Arrow offsets buffer.
 

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,
const ComponentDescriptor &  descriptor = rerun::Loggable<T>::Descriptor 
)
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.
descriptorDescriptor of the component type for this column.

◆ from_loggable()

template<typename T >
static Result< ComponentColumn > rerun::ComponentColumn::from_loggable ( const Collection< T > &  components,
const ComponentDescriptor &  descriptor = rerun::Loggable<T>::Descriptor 
)
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.
descriptorDescriptor of the component type for this column.

◆ from_batch_with_lengths()

static Result< ComponentColumn > rerun::ComponentColumn::from_batch_with_lengths ( ComponentBatch  batch,
const Collection< uint32_t > &  lengths 
)
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.

◆ from_batch_with_offsets() [1/2]

static Result< ComponentColumn > rerun::ComponentColumn::from_batch_with_offsets ( ComponentBatch  batch,
Collection< uint32_t >  offsets 
)
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 PartitionedComponentBatch 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

◆ from_batch_with_offsets() [2/2]

static Result< ComponentColumn > rerun::ComponentColumn::from_batch_with_offsets ( ComponentBatch  batch,
std::shared_ptr< arrow::Buffer >  offsets,
size_t  num_rows 
)
static

Creates a new component batch partition from a batch and a shared Arrow offsets buffer.

The column shares ownership of the offsets buffer and the batch's values without copying them, and retains the batch's component type handle. Multiple columns can share the same offsets buffer.

Parameters
batchA batch of components which is about to be partitioned.
offsetsA non-null buffer containing num_rows + 1 contiguous uint32_t offsets into batch. Offsets must start at zero, be nondecreasing, and end at the total number of components in the batch. Equal consecutive offsets produce an empty row. For example, five components divided into two rows of lengths two and three use [0, 2, 5]. The buffer must not be modified while any column uses it.
num_rowsThe number of component runs (rows), one less than the number of offsets.

The caller must supply valid Arrow list offsets; this method does not validate them.

◆ 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: