Rerun C++ SDK
Loading...
Searching...
No Matches
indicator_component.hpp
1#pragma once
2
3#include <memory> // std::shared_ptr
4#include "loggable.hpp"
5#include "result.hpp"
6
7namespace arrow {
8 class DataType;
9 class Array;
10} // namespace arrow
11
12namespace rerun::components {
13 /// Arrow data type shared by all instances of IndicatorComponent.
14 const std::shared_ptr<arrow::DataType>& indicator_arrow_datatype();
15
16 /// Returns an arrow array for a single indicator component.
17 const std::shared_ptr<arrow::Array>& indicator_arrow_array();
18
19 /// Indicator component used by archetypes when converting them to component lists.
20 ///
21 /// This is done in order to track how a collection of component was logged.
22 template <const char Name[]>
24} // namespace rerun::components
25
26namespace rerun {
27 /// \private
28 template <const char Name_[]>
29 struct Loggable<components::IndicatorComponent<Name_>> {
30 /// Returns the name of this type.
31 static constexpr const char* Name = Name_;
32
33 /// Returns the arrow data type this type corresponds to.
34 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
36 }
37
38 /// Creates an arrow DataCell from an array of IndicatorComponent components.
39 static Result<std::shared_ptr<arrow::Array>> to_arrow(
40 const components::IndicatorComponent<Name_>*, size_t
41 ) {
43 }
44 };
45} // namespace rerun
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:75
const std::shared_ptr< arrow::DataType > & indicator_arrow_datatype()
Arrow data type shared by all instances of IndicatorComponent.
const std::shared_ptr< arrow::Array > & indicator_arrow_array()
Returns an arrow array for a single indicator component.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:21
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:23