Rerun C++ SDK
Loading...
Searching...
No Matches
container_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_types/definitions/rerun/blueprint/archetypes/container_blueprint.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/active_tab.hpp"
7#include "../../blueprint/components/column_share.hpp"
8#include "../../blueprint/components/container_kind.hpp"
9#include "../../blueprint/components/grid_columns.hpp"
10#include "../../blueprint/components/included_content.hpp"
11#include "../../blueprint/components/row_share.hpp"
12#include "../../collection.hpp"
13#include "../../component_batch.hpp"
14#include "../../component_column.hpp"
15#include "../../components/name.hpp"
16#include "../../components/visible.hpp"
17#include "../../result.hpp"
18
19#include <cstdint>
20#include <optional>
21#include <utility>
22#include <vector>
23
24namespace rerun::blueprint::archetypes {
25 /// **Archetype**: The description of a container.
26 ///
27 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
28 ///
30 /// The class of the view.
31 std::optional<ComponentBatch> container_kind;
32
33 /// The name of the container.
34 std::optional<ComponentBatch> display_name;
35
36 /// `ContainerId`s or `ViewId`s that are children of this container.
37 std::optional<ComponentBatch> contents;
38
39 /// The layout shares of each column in the container.
40 ///
41 /// For `components::ContainerKind::Horizontal` containers, the length of this list should always match the number of contents.
42 ///
43 /// Ignored for `components::ContainerKind::Vertical` containers.
44 std::optional<ComponentBatch> col_shares;
45
46 /// The layout shares of each row of the container.
47 ///
48 /// For `components::ContainerKind::Vertical` containers, the length of this list should always match the number of contents.
49 ///
50 /// Ignored for `components::ContainerKind::Horizontal` containers.
51 std::optional<ComponentBatch> row_shares;
52
53 /// Which tab is active.
54 ///
55 /// Only applies to `Tabs` containers.
56 std::optional<ComponentBatch> active_tab;
57
58 /// Whether this container is visible.
59 ///
60 /// Defaults to true if not specified.
61 std::optional<ComponentBatch> visible;
62
63 /// How many columns this grid should have.
64 ///
65 /// If unset, the grid layout will be auto.
66 ///
67 /// Ignored for `components::ContainerKind::Horizontal`/`components::ContainerKind::Vertical` containers.
68 std::optional<ComponentBatch> grid_columns;
69
70 public:
71 /// The name of the archetype as used in `ComponentDescriptor`s.
72 static constexpr const char ArchetypeName[] =
73 "rerun.blueprint.archetypes.ContainerBlueprint";
74
75 /// `ComponentDescriptor` for the `container_kind` field.
77 ArchetypeName, "ContainerBlueprint:container_kind",
79 );
80 /// `ComponentDescriptor` for the `display_name` field.
82 ArchetypeName, "ContainerBlueprint:display_name",
84 );
85 /// `ComponentDescriptor` for the `contents` field.
87 ArchetypeName, "ContainerBlueprint:contents",
89 );
90 /// `ComponentDescriptor` for the `col_shares` field.
92 ArchetypeName, "ContainerBlueprint:col_shares",
94 );
95 /// `ComponentDescriptor` for the `row_shares` field.
97 ArchetypeName, "ContainerBlueprint:row_shares",
99 );
100 /// `ComponentDescriptor` for the `active_tab` field.
102 ArchetypeName, "ContainerBlueprint:active_tab",
104 );
105 /// `ComponentDescriptor` for the `visible` field.
107 ArchetypeName, "ContainerBlueprint:visible",
109 );
110 /// `ComponentDescriptor` for the `grid_columns` field.
112 ArchetypeName, "ContainerBlueprint:grid_columns",
114 );
115
116 public:
117 ContainerBlueprint() = default;
118 ContainerBlueprint(ContainerBlueprint&& other) = default;
119 ContainerBlueprint(const ContainerBlueprint& other) = default;
120 ContainerBlueprint& operator=(const ContainerBlueprint& other) = default;
121 ContainerBlueprint& operator=(ContainerBlueprint&& other) = default;
122
123 explicit ContainerBlueprint(rerun::blueprint::components::ContainerKind _container_kind)
124 : container_kind(ComponentBatch::from_loggable(
125 std::move(_container_kind), Descriptor_container_kind
126 )
127 .value_or_throw()) {}
128
129 /// Update only some specific fields of a `ContainerBlueprint`.
131 return ContainerBlueprint();
132 }
133
134 /// Clear all the fields of a `ContainerBlueprint`.
136
137 /// The class of the view.
139 const rerun::blueprint::components::ContainerKind& _container_kind
140 ) && {
143 .value_or_throw();
144 return std::move(*this);
145 }
146
147 /// The name of the container.
150 .value_or_throw();
151 return std::move(*this);
152 }
153
154 /// `ContainerId`s or `ViewId`s that are children of this container.
157 ) && {
158 contents =
159 ComponentBatch::from_loggable(_contents, Descriptor_contents).value_or_throw();
160 return std::move(*this);
161 }
162
163 /// The layout shares of each column in the container.
164 ///
165 /// For `components::ContainerKind::Horizontal` containers, the length of this list should always match the number of contents.
166 ///
167 /// Ignored for `components::ContainerKind::Vertical` containers.
170 ) && {
171 col_shares =
172 ComponentBatch::from_loggable(_col_shares, Descriptor_col_shares).value_or_throw();
173 return std::move(*this);
174 }
175
176 /// The layout shares of each row of the container.
177 ///
178 /// For `components::ContainerKind::Vertical` containers, the length of this list should always match the number of contents.
179 ///
180 /// Ignored for `components::ContainerKind::Horizontal` containers.
183 ) && {
184 row_shares =
185 ComponentBatch::from_loggable(_row_shares, Descriptor_row_shares).value_or_throw();
186 return std::move(*this);
187 }
188
189 /// Which tab is active.
190 ///
191 /// Only applies to `Tabs` containers.
194 ) && {
195 active_tab =
196 ComponentBatch::from_loggable(_active_tab, Descriptor_active_tab).value_or_throw();
197 return std::move(*this);
198 }
199
200 /// Whether this container is visible.
201 ///
202 /// Defaults to true if not specified.
204 visible = ComponentBatch::from_loggable(_visible, Descriptor_visible).value_or_throw();
205 return std::move(*this);
206 }
207
208 /// How many columns this grid should have.
209 ///
210 /// If unset, the grid layout will be auto.
211 ///
212 /// Ignored for `components::ContainerKind::Horizontal`/`components::ContainerKind::Vertical` containers.
215 ) && {
217 .value_or_throw();
218 return std::move(*this);
219 }
220
221 /// Partitions the component data into multiple sub-batches.
222 ///
223 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
224 /// instead, via `ComponentBatch::partitioned`.
225 ///
226 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
227 ///
228 /// The specified `lengths` must sum to the total length of the component batch.
230
231 /// Partitions the component data into unit-length sub-batches.
232 ///
233 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
234 /// where `n` is automatically guessed.
236 };
237
238} // namespace rerun::blueprint::archetypes
239
240namespace rerun {
241 /// \private
242 template <typename T>
243 struct AsComponents;
244
245 /// \private
246 template <>
247 struct AsComponents<blueprint::archetypes::ContainerBlueprint> {
248 /// Serialize all set component batches.
249 static Result<Collection<ComponentBatch>> as_batches(
251 );
252 };
253} // 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
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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: The description of a container.
Definition container_blueprint.hpp:29
static constexpr auto Descriptor_display_name
ComponentDescriptor for the display_name field.
Definition container_blueprint.hpp:81
ContainerBlueprint with_col_shares(const Collection< rerun::blueprint::components::ColumnShare > &_col_shares) &&
The layout shares of each column in the container.
Definition container_blueprint.hpp:168
std::optional< ComponentBatch > active_tab
Which tab is active.
Definition container_blueprint.hpp:56
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition container_blueprint.hpp:72
std::optional< ComponentBatch > display_name
The name of the container.
Definition container_blueprint.hpp:34
ContainerBlueprint with_container_kind(const rerun::blueprint::components::ContainerKind &_container_kind) &&
The class of the view.
Definition container_blueprint.hpp:138
static constexpr auto Descriptor_grid_columns
ComponentDescriptor for the grid_columns field.
Definition container_blueprint.hpp:111
ContainerBlueprint with_visible(const rerun::components::Visible &_visible) &&
Whether this container is visible.
Definition container_blueprint.hpp:203
std::optional< ComponentBatch > container_kind
The class of the view.
Definition container_blueprint.hpp:31
static constexpr auto Descriptor_contents
ComponentDescriptor for the contents field.
Definition container_blueprint.hpp:86
ContainerBlueprint with_grid_columns(const rerun::blueprint::components::GridColumns &_grid_columns) &&
How many columns this grid should have.
Definition container_blueprint.hpp:213
ContainerBlueprint with_display_name(const rerun::components::Name &_display_name) &&
The name of the container.
Definition container_blueprint.hpp:148
std::optional< ComponentBatch > row_shares
The layout shares of each row of the container.
Definition container_blueprint.hpp:51
std::optional< ComponentBatch > contents
ContainerIds or ViewIds that are children of this container.
Definition container_blueprint.hpp:37
static constexpr auto Descriptor_container_kind
ComponentDescriptor for the container_kind field.
Definition container_blueprint.hpp:76
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
ContainerBlueprint with_contents(const Collection< rerun::blueprint::components::IncludedContent > &_contents) &&
ContainerIds or ViewIds that are children of this container.
Definition container_blueprint.hpp:155
ContainerBlueprint with_row_shares(const Collection< rerun::blueprint::components::RowShare > &_row_shares) &&
The layout shares of each row of the container.
Definition container_blueprint.hpp:181
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_active_tab
ComponentDescriptor for the active_tab field.
Definition container_blueprint.hpp:101
static ContainerBlueprint clear_fields()
Clear all the fields of a ContainerBlueprint.
std::optional< ComponentBatch > col_shares
The layout shares of each column in the container.
Definition container_blueprint.hpp:44
static constexpr auto Descriptor_row_shares
ComponentDescriptor for the row_shares field.
Definition container_blueprint.hpp:96
std::optional< ComponentBatch > visible
Whether this container is visible.
Definition container_blueprint.hpp:61
static constexpr auto Descriptor_col_shares
ComponentDescriptor for the col_shares field.
Definition container_blueprint.hpp:91
static ContainerBlueprint update_fields()
Update only some specific fields of a ContainerBlueprint.
Definition container_blueprint.hpp:130
ContainerBlueprint with_active_tab(const rerun::blueprint::components::ActiveTab &_active_tab) &&
Which tab is active.
Definition container_blueprint.hpp:192
static constexpr auto Descriptor_visible
ComponentDescriptor for the visible field.
Definition container_blueprint.hpp:106
std::optional< ComponentBatch > grid_columns
How many columns this grid should have.
Definition container_blueprint.hpp:68
Component: The active tab in a tabbed container.
Definition active_tab.hpp:19
Component: How many columns a grid container should have.
Definition grid_columns.hpp:17
Component: A display name, typically for an entity or a item like a plot series.
Definition name.hpp:16
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:14