Rerun C++ SDK
Loading...
Searching...
No Matches
text_log_columns.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/text_log_columns.def.rs".
3
4#pragma once
5
6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/text_log_column.hpp"
8#include "../../blueprint/components/timeline_column.hpp"
9#include "../../collection.hpp"
10#include "../../component_batch.hpp"
11#include "../../component_column.hpp"
12#include "../../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::blueprint::archetypes {
20 /// **Archetype**: Configuration of the text log columns.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// What timeline columns to show.
26 ///
27 /// Defaults to displaying only the active timeline.
28 std::optional<ComponentBatch> timeline_columns;
29
30 /// All columns to be displayed.
31 ///
32 /// Defaults to showing all text log column kinds in the order of the enum.
33 std::optional<ComponentBatch> text_log_columns;
34
35 public:
36 /// The name of the archetype as used in `ComponentDescriptor`s.
37 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TextLogColumns";
38
39 /// `ComponentDescriptor` for the `timeline_columns` field.
41 ArchetypeName, "TextLogColumns:timeline_columns",
43 );
44 /// `ComponentDescriptor` for the `text_log_columns` field.
46 ArchetypeName, "TextLogColumns:text_log_columns",
48 );
49
50 public:
51 TextLogColumns() = default;
52 TextLogColumns(TextLogColumns&& other) = default;
53 TextLogColumns(const TextLogColumns& other) = default;
54 TextLogColumns& operator=(const TextLogColumns& other) = default;
55 TextLogColumns& operator=(TextLogColumns&& other) = default;
56
57 /// Update only some specific fields of a `TextLogColumns`.
59 return TextLogColumns();
60 }
61
62 /// Clear all the fields of a `TextLogColumns`.
64
65 /// What timeline columns to show.
66 ///
67 /// Defaults to displaying only the active timeline.
70 ) && {
73 .value_or_throw();
74 return std::move(*this);
75 }
76
77 /// All columns to be displayed.
78 ///
79 /// Defaults to showing all text log column kinds in the order of the enum.
82 ) && {
85 .value_or_throw();
86 return std::move(*this);
87 }
88
89 /// Partitions the component data into multiple sub-batches.
90 ///
91 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
92 /// instead, via `ComponentBatch::partitioned`.
93 ///
94 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
95 ///
96 /// The specified `lengths` must sum to the total length of the component batch.
98 return detail::partition_batches({&timeline_columns, &text_log_columns}, lengths_)
99 .value_or_throw();
100 }
101
102 /// Partitions the component data into unit-length sub-batches.
103 ///
104 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
105 /// where `n` is automatically guessed.
107 return detail::partition_batches_of_unit_length({&timeline_columns, &text_log_columns})
108 .value_or_throw();
109 }
110 };
111
112} // namespace rerun::blueprint::archetypes
113
114namespace rerun {
115 /// \private
116 template <typename T>
117 struct AsComponents;
118
119 /// \private
120 template <>
121 struct AsComponents<blueprint::archetypes::TextLogColumns> {
122 /// Serialize all set component batches.
123 static Result<Collection<ComponentBatch>> as_batches(
125 ) {
126 return detail::collect_batches(
127 {&archetype.timeline_columns, &archetype.text_log_columns}
128 );
129 }
130 };
131} // 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: Configuration of the text log columns.
Definition text_log_columns.hpp:24
static constexpr auto Descriptor_text_log_columns
ComponentDescriptor for the text_log_columns field.
Definition text_log_columns.hpp:45
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition text_log_columns.hpp:106
std::optional< ComponentBatch > text_log_columns
All columns to be displayed.
Definition text_log_columns.hpp:33
std::optional< ComponentBatch > timeline_columns
What timeline columns to show.
Definition text_log_columns.hpp:28
TextLogColumns with_text_log_columns(const Collection< rerun::blueprint::components::TextLogColumn > &_text_log_columns) &&
All columns to be displayed.
Definition text_log_columns.hpp:80
static TextLogColumns update_fields()
Update only some specific fields of a TextLogColumns.
Definition text_log_columns.hpp:58
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition text_log_columns.hpp:97
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition text_log_columns.hpp:37
TextLogColumns with_timeline_columns(const Collection< rerun::blueprint::components::TimelineColumn > &_timeline_columns) &&
What timeline columns to show.
Definition text_log_columns.hpp:68
static constexpr auto Descriptor_timeline_columns
ComponentDescriptor for the timeline_columns field.
Definition text_log_columns.hpp:40
static TextLogColumns clear_fields()
Clear all the fields of a TextLogColumns.