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/build/re_type_definitions/rerun/blueprint/archetypes/table_blueprint.def.rs".
3
4#pragma once
5
6#include "../../blueprint/components/column_display_mode.hpp"
7#include "../../blueprint/components/table_layout_kind.hpp"
8#include "../../collection.hpp"
9#include "../../component_batch.hpp"
10#include "../../component_column.hpp"
11#include "../../result.hpp"
12
13#include <cstdint>
14#include <optional>
15#include <utility>
16#include <vector>
17
18namespace rerun::blueprint::archetypes {
19 /// **Archetype**: Blueprint for configuring the styling of a table.
20 ///
21 /// The table blueprint as a whole is distributed across these entity paths:
22 /// * `/table` for this archetype and `archetypes::PreviewsConfig`.
23 /// * `/table/layouts/table` for `archetypes::TableLayout`.
24 /// * `/table/layouts/table/columns/{column_name}` for table `archetypes::TableColumn` archetypes and per-column options such as `archetypes::TableColumnPreview`.
25 /// * `/table/layouts/cards` for `archetypes::CardLayout`.
26 /// * `/table/layouts/cards/fields/{column_name}` for card `archetypes::TableColumn` archetypes and per-field options such as `archetypes::TableColumnPreview`.
27 /// * `/view/{view_id}` for preview `archetypes::ViewBlueprint` definitions.
28 ///
29 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
30 ///
32 /// The currently selected layout.
33 ///
34 /// If unset, defaults to card layout if available.
35 /// `Cards` falls back to table layout when no `archetypes::CardLayout` is configured.
36 std::optional<ComponentBatch> layout;
37
38 /// Formatting for column names in table and card layouts.
39 ///
40 /// Defaults to compact formatting when unset.
41 /// Explicit column display names take precedence.
42 std::optional<ComponentBatch> column_display_mode;
43
44 public:
45 /// The name of the archetype as used in `ComponentDescriptor`s.
46 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TableBlueprint";
47
48 /// `ComponentDescriptor` for the `layout` field.
49 static constexpr auto Descriptor_layout = ComponentDescriptor(
50 ArchetypeName, "TableBlueprint:layout",
52 );
53 /// `ComponentDescriptor` for the `column_display_mode` field.
55 ArchetypeName, "TableBlueprint:column_display_mode",
57 );
58
59 public:
60 TableBlueprint() = default;
61 TableBlueprint(TableBlueprint&& other) = default;
62 TableBlueprint(const TableBlueprint& other) = default;
63 TableBlueprint& operator=(const TableBlueprint& other) = default;
64 TableBlueprint& operator=(TableBlueprint&& other) = default;
65
66 /// Update only some specific fields of a `TableBlueprint`.
68 return TableBlueprint();
69 }
70
71 /// Clear all the fields of a `TableBlueprint`.
73
74 /// The currently selected layout.
75 ///
76 /// If unset, defaults to card layout if available.
77 /// `Cards` falls back to table layout when no `archetypes::CardLayout` is configured.
78 TableBlueprint with_layout(const rerun::blueprint::components::TableLayoutKind& _layout
79 ) && {
80 layout = ComponentBatch::from_loggable(_layout, Descriptor_layout).value_or_throw();
81 return std::move(*this);
82 }
83
84 /// Formatting for column names in table and card layouts.
85 ///
86 /// Defaults to compact formatting when unset.
87 /// Explicit column display names take precedence.
89 const rerun::blueprint::components::ColumnDisplayMode& _column_display_mode
90 ) && {
93 .value_or_throw();
94 return std::move(*this);
95 }
96
97 /// Partitions the component data into multiple sub-batches.
98 ///
99 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
100 /// instead, via `ComponentBatch::partitioned`.
101 ///
102 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
103 ///
104 /// The specified `lengths` must sum to the total length of the component batch.
106
107 /// Partitions the component data into unit-length sub-batches.
108 ///
109 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
110 /// where `n` is automatically guessed.
112 };
113
114} // namespace rerun::blueprint::archetypes
115
116namespace rerun {
117 /// \private
118 template <typename T>
119 struct AsComponents;
120
121 /// \private
122 template <>
123 struct AsComponents<blueprint::archetypes::TableBlueprint> {
124 /// Serialize all set component batches.
125 static Result<Collection<ComponentBatch>> as_batches(
127 );
128 };
129} // 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 configuring the styling of a table.
Definition table_blueprint.hpp:31
static constexpr auto Descriptor_column_display_mode
ComponentDescriptor for the column_display_mode field.
Definition table_blueprint.hpp:54
static TableBlueprint update_fields()
Update only some specific fields of a TableBlueprint.
Definition table_blueprint.hpp:67
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition table_blueprint.hpp:46
static constexpr auto Descriptor_layout
ComponentDescriptor for the layout field.
Definition table_blueprint.hpp:49
std::optional< ComponentBatch > layout
The currently selected layout.
Definition table_blueprint.hpp:36
TableBlueprint with_layout(const rerun::blueprint::components::TableLayoutKind &_layout) &&
The currently selected layout.
Definition table_blueprint.hpp:78
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > column_display_mode
Formatting for column names in table and card layouts.
Definition table_blueprint.hpp:42
TableBlueprint with_column_display_mode(const rerun::blueprint::components::ColumnDisplayMode &_column_display_mode) &&
Formatting for column names in table and card layouts.
Definition table_blueprint.hpp:88
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static TableBlueprint clear_fields()
Clear all the fields of a TableBlueprint.