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/table_layout_kind.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 /// The table blueprint as a whole is distributed across these entity paths:
21 /// * `/table` for this archetype and `archetypes::PreviewsConfig`.
22 /// * `/table/layouts/table` for `archetypes::TableLayout`.
23 /// * `/table/layouts/table/columns/{column_name}` for table `archetypes::TableColumn` archetypes and per-column options such as `archetypes::TableColumnPreview`.
24 /// * `/table/layouts/cards` for `archetypes::CardLayout`.
25 /// * `/table/layouts/cards/fields/{column_name}` for card `archetypes::TableColumn` archetypes and per-field options such as `archetypes::TableColumnPreview`.
26 /// * `/view/{view_id}` for preview `archetypes::ViewBlueprint` definitions.
27 ///
28 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
29 ///
31 /// The currently selected layout.
32 ///
33 /// If unset, defaults to card layout if available.
34 /// `Cards` falls back to table layout when no `archetypes::CardLayout` is configured.
35 std::optional<ComponentBatch> layout;
36
37 public:
38 /// The name of the archetype as used in `ComponentDescriptor`s.
39 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TableBlueprint";
40
41 /// `ComponentDescriptor` for the `layout` field.
42 static constexpr auto Descriptor_layout = ComponentDescriptor(
43 ArchetypeName, "TableBlueprint:layout",
45 );
46
47 public:
48 TableBlueprint() = default;
49 TableBlueprint(TableBlueprint&& other) = default;
50 TableBlueprint(const TableBlueprint& other) = default;
51 TableBlueprint& operator=(const TableBlueprint& other) = default;
52 TableBlueprint& operator=(TableBlueprint&& other) = default;
53
54 /// Update only some specific fields of a `TableBlueprint`.
56 return TableBlueprint();
57 }
58
59 /// Clear all the fields of a `TableBlueprint`.
61
62 /// The currently selected layout.
63 ///
64 /// If unset, defaults to card layout if available.
65 /// `Cards` falls back to table layout when no `archetypes::CardLayout` is configured.
66 TableBlueprint with_layout(const rerun::blueprint::components::TableLayoutKind& _layout
67 ) && {
68 layout = ComponentBatch::from_loggable(_layout, Descriptor_layout).value_or_throw();
69 return std::move(*this);
70 }
71
72 /// Partitions the component data into multiple sub-batches.
73 ///
74 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
75 /// instead, via `ComponentBatch::partitioned`.
76 ///
77 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
78 ///
79 /// The specified `lengths` must sum to the total length of the component batch.
81
82 /// Partitions the component data into unit-length sub-batches.
83 ///
84 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
85 /// where `n` is automatically guessed.
87 };
88
89} // namespace rerun::blueprint::archetypes
90
91namespace rerun {
92 /// \private
93 template <typename T>
94 struct AsComponents;
95
96 /// \private
97 template <>
98 struct AsComponents<blueprint::archetypes::TableBlueprint> {
99 /// Serialize all set component batches.
100 static Result<Collection<ComponentBatch>> as_batches(
102 );
103 };
104} // 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:30
static TableBlueprint update_fields()
Update only some specific fields of a TableBlueprint.
Definition table_blueprint.hpp:55
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition table_blueprint.hpp:39
static constexpr auto Descriptor_layout
ComponentDescriptor for the layout field.
Definition table_blueprint.hpp:42
std::optional< ComponentBatch > layout
The currently selected layout.
Definition table_blueprint.hpp:35
TableBlueprint with_layout(const rerun::blueprint::components::TableLayoutKind &_layout) &&
The currently selected layout.
Definition table_blueprint.hpp:66
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
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.