Rerun C++ SDK
Loading...
Searching...
No Matches
table_blueprint.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/store/re_sdk_types/definitions/rerun/blueprint/archetypes/table_blueprint.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/column_name.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.hpp"
10#include "../../result.hpp"
11
12#include <cstdint>
13#include <optional>
14#include <utility>
15#include <vector>
16
17namespace rerun::blueprint::archetypes {
18 /// **Archetype**: Blueprint for configuring the styling of a table.
19 ///
20 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
21 ///
23 /// The name of the column that contains recording URIs for segment previews.
24 ///
25 /// Every row can at most preview a single segment.
26 ///
27 /// For the preview, the rest of the blueprint data is read it as it would be with regular recording blueprints,
28 /// meaning that the regular structure of `archetypes::ViewportBlueprint`, and `archetypes::ViewBlueprint` structure applies.
29 /// However, this mostly ignores layout container types as well as automatic spawning.
30 std::optional<ComponentBatch> segment_preview_column;
31
32 /// The name of the boolean column used for flag/annotation toggles.
33 ///
34 /// Must be set for flagging to be available. The named column must exist in the
35 /// table and be of boolean type.
36 /// Additionally, the table must be remote and have another column with
37 /// `rerun:is_table_index` metadata since flag changes are persisted to the server
38 /// via upsert.
39 std::optional<ComponentBatch> flag_column;
40
41 /// The name of the column to use as the card title in grid view.
42 ///
43 /// If unset, the first visible string column is used as the title.
44 std::optional<ComponentBatch> grid_view_card_title;
45
46 /// The name of the column containing URLs to open when a card is clicked in grid view.
47 ///
48 /// If unset, defaults to the first URL column in the table that points to the same
49 /// Rerun server. If no such column exists, no URL is associated with cards and
50 /// clicking them does not navigate anywhere.
51 std::optional<ComponentBatch> url_column;
52
53 public:
54 /// The name of the archetype as used in `ComponentDescriptor`s.
55 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TableBlueprint";
56
57 /// `ComponentDescriptor` for the `segment_preview_column` field.
59 ArchetypeName, "TableBlueprint:segment_preview_column",
61 );
62 /// `ComponentDescriptor` for the `flag_column` field.
64 ArchetypeName, "TableBlueprint:flag_column",
66 );
67 /// `ComponentDescriptor` for the `grid_view_card_title` field.
69 ArchetypeName, "TableBlueprint:grid_view_card_title",
71 );
72 /// `ComponentDescriptor` for the `url_column` field.
74 ArchetypeName, "TableBlueprint:url_column",
76 );
77
78 public:
79 TableBlueprint() = default;
80 TableBlueprint(TableBlueprint&& other) = default;
81 TableBlueprint(const TableBlueprint& other) = default;
82 TableBlueprint& operator=(const TableBlueprint& other) = default;
83 TableBlueprint& operator=(TableBlueprint&& other) = default;
84
85 /// Update only some specific fields of a `TableBlueprint`.
87 return TableBlueprint();
88 }
89
90 /// Clear all the fields of a `TableBlueprint`.
92
93 /// The name of the column that contains recording URIs for segment previews.
94 ///
95 /// Every row can at most preview a single segment.
96 ///
97 /// For the preview, the rest of the blueprint data is read it as it would be with regular recording blueprints,
98 /// meaning that the regular structure of `archetypes::ViewportBlueprint`, and `archetypes::ViewBlueprint` structure applies.
99 /// However, this mostly ignores layout container types as well as automatic spawning.
101 const rerun::blueprint::components::ColumnName& _segment_preview_column
102 ) && {
104 _segment_preview_column,
106 )
107 .value_or_throw();
108 return std::move(*this);
109 }
110
111 /// The name of the boolean column used for flag/annotation toggles.
112 ///
113 /// Must be set for flagging to be available. The named column must exist in the
114 /// table and be of boolean type.
115 /// Additionally, the table must be remote and have another column with
116 /// `rerun:is_table_index` metadata since flag changes are persisted to the server
117 /// via upsert.
119 ) && {
121 .value_or_throw();
122 return std::move(*this);
123 }
124
125 /// The name of the column to use as the card title in grid view.
126 ///
127 /// If unset, the first visible string column is used as the title.
129 const rerun::blueprint::components::ColumnName& _grid_view_card_title
130 ) && {
132 _grid_view_card_title,
134 )
135 .value_or_throw();
136 return std::move(*this);
137 }
138
139 /// The name of the column containing URLs to open when a card is clicked in grid view.
140 ///
141 /// If unset, defaults to the first URL column in the table that points to the same
142 /// Rerun server. If no such column exists, no URL is associated with cards and
143 /// clicking them does not navigate anywhere.
145 ) && {
146 url_column =
147 ComponentBatch::from_loggable(_url_column, Descriptor_url_column).value_or_throw();
148 return std::move(*this);
149 }
150
151 /// Partitions the component data into multiple sub-batches.
152 ///
153 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
154 /// instead, via `ComponentBatch::partitioned`.
155 ///
156 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
157 ///
158 /// The specified `lengths` must sum to the total length of the component batch.
160
161 /// Partitions the component data into unit-length sub-batches.
162 ///
163 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
164 /// where `n` is automatically guessed.
166 };
167
168} // namespace rerun::blueprint::archetypes
169
170namespace rerun {
171 /// \private
172 template <typename T>
173 struct AsComponents;
174
175 /// \private
176 template <>
177 struct AsComponents<blueprint::archetypes::TableBlueprint> {
178 /// Serialize all set component batches.
179 static Result<Collection<ComponentBatch>> as_batches(
181 );
182 };
183} // 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:23
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 configuring the styling of a table.
Definition table_blueprint.hpp:22
static TableBlueprint update_fields()
Update only some specific fields of a TableBlueprint.
Definition table_blueprint.hpp:86
std::optional< ComponentBatch > url_column
The name of the column containing URLs to open when a card is clicked in grid view.
Definition table_blueprint.hpp:51
std::optional< ComponentBatch > segment_preview_column
The name of the column that contains recording URIs for segment previews.
Definition table_blueprint.hpp:30
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition table_blueprint.hpp:55
static constexpr auto Descriptor_flag_column
ComponentDescriptor for the flag_column field.
Definition table_blueprint.hpp:63
TableBlueprint with_flag_column(const rerun::blueprint::components::ColumnName &_flag_column) &&
The name of the boolean column used for flag/annotation toggles.
Definition table_blueprint.hpp:118
static constexpr auto Descriptor_segment_preview_column
ComponentDescriptor for the segment_preview_column field.
Definition table_blueprint.hpp:58
std::optional< ComponentBatch > flag_column
The name of the boolean column used for flag/annotation toggles.
Definition table_blueprint.hpp:39
std::optional< ComponentBatch > grid_view_card_title
The name of the column to use as the card title in grid view.
Definition table_blueprint.hpp:44
TableBlueprint with_grid_view_card_title(const rerun::blueprint::components::ColumnName &_grid_view_card_title) &&
The name of the column to use as the card title in grid view.
Definition table_blueprint.hpp:128
TableBlueprint with_url_column(const rerun::blueprint::components::ColumnName &_url_column) &&
The name of the column containing URLs to open when a card is clicked in grid view.
Definition table_blueprint.hpp:144
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static constexpr auto Descriptor_url_column
ComponentDescriptor for the url_column field.
Definition table_blueprint.hpp:73
static constexpr auto Descriptor_grid_view_card_title
ComponentDescriptor for the grid_view_card_title field.
Definition table_blueprint.hpp:68
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
TableBlueprint with_segment_preview_column(const rerun::blueprint::components::ColumnName &_segment_preview_column) &&
The name of the column that contains recording URIs for segment previews.
Definition table_blueprint.hpp:100
static TableBlueprint clear_fields()
Clear all the fields of a TableBlueprint.
Component: The name of a column in a table.
Definition column_name.hpp:19