6#include "collection.hpp"
7#include "component_type.hpp"
16struct rr_component_batch;
24 std::shared_ptr<arrow::Array>
array;
36 rerun::is_loggable<T>,
37 "The given type does not implement the rerun::Loggable trait."
48 RR_RETURN_NOT_OK(
array.error);
51 component_batch.
array = std::move(
array.value);
53 return component_batch;
73 if (component.has_value()) {
89 if (components.has_value()) {
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
static Collection< TElement > borrow(const T *data, size_t num_instances=1)
Borrows binary compatible data into the collection from a typed pointer.
Definition collection.hpp:154
size_t size() const
Returns the number of instances in this collection.
Definition collection.hpp:291
const TElement * data() const
Returns a raw pointer to the underlying data.
Definition collection.hpp:327
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
uint32_t ComponentTypeHandle
Handle to a registered component types.
Definition component_type.hpp:14
Arrow-encoded data of a single batch components for a single entity.
Definition component_batch.hpp:22
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:34
static Result< ComponentBatch > from_loggable(const T &component)
Creates a new component batch from a single component instance.
Definition component_batch.hpp:60
static Result< ComponentBatch > from_loggable(const std::optional< rerun::Collection< T > > &components)
Creates a new data cell from an optional collection of component instances.
Definition component_batch.hpp:86
Error to_c_ffi_struct(rr_component_batch &out_component_batch) const
To rerun C API component batch.
ComponentTypeHandle component_type
The type of the component instances in array.
Definition component_batch.hpp:27
std::shared_ptr< arrow::Array > array
Arrow-encoded data of the component instances.
Definition component_batch.hpp:24
static Result< ComponentBatch > from_loggable(const std::optional< T > &component)
Creates a new data cell from a single optional component instance.
Definition component_batch.hpp:72
A type of component that can be registered.
Definition component_type.hpp:19
Result< ComponentTypeHandle > register_component() const
Registers a component type with the SDK.
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11