Rerun C++ SDK
Loading...
Searching...
No Matches
table_column.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/build/re_type_definitions/rerun/blueprint/archetypes/table_column.def.rs".
3
4#pragma once
5
6#include "../../blueprint/components/editable.hpp"
7#include "../../blueprint/components/table_cell_kind.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../components/name.hpp"
12#include "../../components/visible.hpp"
13#include "../../result.hpp"
14
15#include <cstdint>
16#include <optional>
17#include <utility>
18#include <vector>
19
20namespace rerun::blueprint::archetypes {
21 /// **Archetype**: Blueprint for a column used by a table or card layout.
22 ///
23 /// This archetype is stored at the layout-specific path for its source column.
24 /// The source is the final `components::ColumnName` part of that path.
25 ///
26 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27 ///
28 struct TableColumn {
29 /// The name shown for the column.
30 ///
31 /// If unset, the name is inferred from the source column.
32 std::optional<ComponentBatch> name;
33
34 /// Whether the column's values can be edited.
35 ///
36 /// If unset, editing is disabled.
37 /// Edits requires a remote table with a column marked by `rerun:is_table_index` metadata and write permission.
38 /// ⚠ Currently only boolean values are supported.
39 std::optional<ComponentBatch> editable;
40
41 /// Whether the column is visible in this layout.
42 ///
43 /// If unset, the enclosing layout determines visibility.
44 /// Table layouts use the viewer default for the source column.
45 /// Card layouts show sources listed in `field_order` and hide unlisted sources.
46 std::optional<ComponentBatch> visible;
47
48 /// How to render the column's values.
49 ///
50 /// If unset or `Auto`, the viewer infers the renderer from the component or Arrow datatype.
51 std::optional<ComponentBatch> cell_kind;
52
53 public:
54 /// The name of the archetype as used in `ComponentDescriptor`s.
55 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TableColumn";
56
57 /// `ComponentDescriptor` for the `name` field.
58 static constexpr auto Descriptor_name = ComponentDescriptor(
60 );
61 /// `ComponentDescriptor` for the `editable` field.
63 ArchetypeName, "TableColumn:editable",
65 );
66 /// `ComponentDescriptor` for the `visible` field.
67 static constexpr auto Descriptor_visible = ComponentDescriptor(
68 ArchetypeName, "TableColumn:visible",
70 );
71 /// `ComponentDescriptor` for the `cell_kind` field.
73 ArchetypeName, "TableColumn:cell_kind",
75 );
76
77 public:
78 TableColumn() = default;
79 TableColumn(TableColumn&& other) = default;
80 TableColumn(const TableColumn& other) = default;
81 TableColumn& operator=(const TableColumn& other) = default;
82 TableColumn& operator=(TableColumn&& other) = default;
83
84 /// Update only some specific fields of a `TableColumn`.
86 return TableColumn();
87 }
88
89 /// Clear all the fields of a `TableColumn`.
91
92 /// The name shown for the column.
93 ///
94 /// If unset, the name is inferred from the source column.
96 name = ComponentBatch::from_loggable(_name, Descriptor_name).value_or_throw();
97 return std::move(*this);
98 }
99
100 /// Whether the column's values can be edited.
101 ///
102 /// If unset, editing is disabled.
103 /// Edits requires a remote table with a column marked by `rerun:is_table_index` metadata and write permission.
104 /// ⚠ Currently only boolean values are supported.
106 editable =
107 ComponentBatch::from_loggable(_editable, Descriptor_editable).value_or_throw();
108 return std::move(*this);
109 }
110
111 /// Whether the column is visible in this layout.
112 ///
113 /// If unset, the enclosing layout determines visibility.
114 /// Table layouts use the viewer default for the source column.
115 /// Card layouts show sources listed in `field_order` and hide unlisted sources.
117 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
118 return std::move(*this);
119 }
120
121 /// How to render the column's values.
122 ///
123 /// If unset or `Auto`, the viewer infers the renderer from the component or Arrow datatype.
124 TableColumn with_cell_kind(const rerun::blueprint::components::TableCellKind& _cell_kind
125 ) && {
126 cell_kind =
127 ComponentBatch::from_loggable(_cell_kind, Descriptor_cell_kind).value_or_throw();
128 return std::move(*this);
129 }
130
131 /// Partitions the component data into multiple sub-batches.
132 ///
133 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
134 /// instead, via `ComponentBatch::partitioned`.
135 ///
136 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
137 ///
138 /// The specified `lengths` must sum to the total length of the component batch.
140
141 /// Partitions the component data into unit-length sub-batches.
142 ///
143 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
144 /// where `n` is automatically guessed.
146 };
147
148} // namespace rerun::blueprint::archetypes
149
150namespace rerun {
151 /// \private
152 template <typename T>
153 struct AsComponents;
154
155 /// \private
156 template <>
157 struct AsComponents<blueprint::archetypes::TableColumn> {
158 /// Serialize all set component batches.
159 static Result<Collection<ComponentBatch>> as_batches(
161 );
162 };
163} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
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:26
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Blueprint for a column used by a table or card layout.
Definition table_column.hpp:28
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
std::optional< ComponentBatch > visible
Whether the column is visible in this layout.
Definition table_column.hpp:46
TableColumn with_cell_kind(const rerun::blueprint::components::TableCellKind &_cell_kind) &&
How to render the column's values.
Definition table_column.hpp:124
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition table_column.hpp:55
TableColumn with_visible(const rerun::components::Visible &_visible) &&
Whether the column is visible in this layout.
Definition table_column.hpp:116
static TableColumn clear_fields()
Clear all the fields of a TableColumn.
std::optional< ComponentBatch > editable
Whether the column's values can be edited.
Definition table_column.hpp:39
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > cell_kind
How to render the column's values.
Definition table_column.hpp:51
static constexpr auto Descriptor_cell_kind
ComponentDescriptor for the cell_kind field.
Definition table_column.hpp:72
static constexpr auto Descriptor_editable
ComponentDescriptor for the editable field.
Definition table_column.hpp:62
TableColumn with_editable(const rerun::blueprint::components::Editable &_editable) &&
Whether the column's values can be edited.
Definition table_column.hpp:105
static TableColumn update_fields()
Update only some specific fields of a TableColumn.
Definition table_column.hpp:85
std::optional< ComponentBatch > name
The name shown for the column.
Definition table_column.hpp:32
TableColumn with_name(const rerun::components::Name &_name) &&
The name shown for the column.
Definition table_column.hpp:95
static constexpr auto Descriptor_name
ComponentDescriptor for the name field.
Definition table_column.hpp:58
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition table_column.hpp:67
Component: Whether a table column's values can be edited.
Definition editable.hpp:17
Component: A display name, typically for an entity or a item like a plot series.
Definition name.hpp:19
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:14