Rerun C++ SDK
Loading...
Searching...
No Matches
table_layout.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_layout.def.rs".
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 displaying table records as rows and columns.
19 ///
20 /// This archetype is stored at the entity `/table/layouts/table`.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
24 struct TableLayout {
25 /// Source columns to show first, in display order.
26 ///
27 /// Unmentioned columns retain the viewer defaults and follow in default order.
28 /// Each source column may appear at most once.
29 std::optional<ComponentBatch> column_order;
30
31 public:
32 /// The name of the archetype as used in `ComponentDescriptor`s.
33 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TableLayout";
34
35 /// `ComponentDescriptor` for the `column_order` field.
37 ArchetypeName, "TableLayout:column_order",
39 );
40
41 public:
42 TableLayout() = default;
43 TableLayout(TableLayout&& other) = default;
44 TableLayout(const TableLayout& other) = default;
45 TableLayout& operator=(const TableLayout& other) = default;
46 TableLayout& operator=(TableLayout&& other) = default;
47
48 /// Update only some specific fields of a `TableLayout`.
50 return TableLayout();
51 }
52
53 /// Clear all the fields of a `TableLayout`.
55
56 /// Source columns to show first, in display order.
57 ///
58 /// Unmentioned columns retain the viewer defaults and follow in default order.
59 /// Each source column may appear at most once.
62 ) && {
64 .value_or_throw();
65 return std::move(*this);
66 }
67
68 /// Partitions the component data into multiple sub-batches.
69 ///
70 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
71 /// instead, via `ComponentBatch::partitioned`.
72 ///
73 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
74 ///
75 /// The specified `lengths` must sum to the total length of the component batch.
77
78 /// Partitions the component data into unit-length sub-batches.
79 ///
80 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
81 /// where `n` is automatically guessed.
83 };
84
85} // namespace rerun::blueprint::archetypes
86
87namespace rerun {
88 /// \private
89 template <typename T>
90 struct AsComponents;
91
92 /// \private
93 template <>
94 struct AsComponents<blueprint::archetypes::TableLayout> {
95 /// Serialize all set component batches.
96 static Result<Collection<ComponentBatch>> as_batches(
98 );
99 };
100} // 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 displaying table records as rows and columns.
Definition table_layout.hpp:24
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition table_layout.hpp:33
std::optional< ComponentBatch > column_order
Source columns to show first, in display order.
Definition table_layout.hpp:29
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static constexpr auto Descriptor_column_order
ComponentDescriptor for the column_order field.
Definition table_layout.hpp:36
TableLayout with_column_order(const Collection< rerun::blueprint::components::ColumnName > &_column_order) &&
Source columns to show first, in display order.
Definition table_layout.hpp:60
static TableLayout clear_fields()
Clear all the fields of a TableLayout.
static TableLayout update_fields()
Update only some specific fields of a TableLayout.
Definition table_layout.hpp:49