Rerun C++ SDK
Loading...
Searching...
No Matches
text_document_format.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_sdk_types/definitions/rerun/blueprint/archetypes/text_document_format.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/enabled.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**: Formatting options for the text document view.
19 ///
20 /// These options only apply to plain text documents and have no effect on Markdown documents.
21 ///
22 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
23 ///
25 /// Whether to use a monospace font for the document body.
26 ///
27 /// Defaults to disabled.
28 std::optional<ComponentBatch> monospace;
29
30 /// Whether to wrap long lines in the document body.
31 ///
32 /// Defaults to enabled.
33 std::optional<ComponentBatch> word_wrap;
34
35 public:
36 /// The name of the archetype as used in `ComponentDescriptor`s.
37 static constexpr const char ArchetypeName[] =
38 "rerun.blueprint.archetypes.TextDocumentFormat";
39
40 /// `ComponentDescriptor` for the `monospace` field.
42 ArchetypeName, "TextDocumentFormat:monospace",
44 );
45 /// `ComponentDescriptor` for the `word_wrap` field.
47 ArchetypeName, "TextDocumentFormat:word_wrap",
49 );
50
51 public:
52 TextDocumentFormat() = default;
53 TextDocumentFormat(TextDocumentFormat&& other) = default;
54 TextDocumentFormat(const TextDocumentFormat& other) = default;
55 TextDocumentFormat& operator=(const TextDocumentFormat& other) = default;
56 TextDocumentFormat& operator=(TextDocumentFormat&& other) = default;
57
58 /// Update only some specific fields of a `TextDocumentFormat`.
60 return TextDocumentFormat();
61 }
62
63 /// Clear all the fields of a `TextDocumentFormat`.
65
66 /// Whether to use a monospace font for the document body.
67 ///
68 /// Defaults to disabled.
70 ) && {
71 monospace =
72 ComponentBatch::from_loggable(_monospace, Descriptor_monospace).value_or_throw();
73 return std::move(*this);
74 }
75
76 /// Whether to wrap long lines in the document body.
77 ///
78 /// Defaults to enabled.
80 ) && {
81 word_wrap =
82 ComponentBatch::from_loggable(_word_wrap, Descriptor_word_wrap).value_or_throw();
83 return std::move(*this);
84 }
85
86 /// Partitions the component data into multiple sub-batches.
87 ///
88 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
89 /// instead, via `ComponentBatch::partitioned`.
90 ///
91 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
92 ///
93 /// The specified `lengths` must sum to the total length of the component batch.
95
96 /// Partitions the component data into unit-length sub-batches.
97 ///
98 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
99 /// where `n` is automatically guessed.
101 };
102
103} // namespace rerun::blueprint::archetypes
104
105namespace rerun {
106 /// \private
107 template <typename T>
108 struct AsComponents;
109
110 /// \private
111 template <>
112 struct AsComponents<blueprint::archetypes::TextDocumentFormat> {
113 /// Serialize all set component batches.
114 static Result<Collection<ComponentBatch>> as_batches(
116 );
117 };
118} // 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
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: Formatting options for the text document view.
Definition text_document_format.hpp:24
std::optional< ComponentBatch > word_wrap
Whether to wrap long lines in the document body.
Definition text_document_format.hpp:33
static constexpr auto Descriptor_monospace
ComponentDescriptor for the monospace field.
Definition text_document_format.hpp:41
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_word_wrap
ComponentDescriptor for the word_wrap field.
Definition text_document_format.hpp:46
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition text_document_format.hpp:37
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static TextDocumentFormat update_fields()
Update only some specific fields of a TextDocumentFormat.
Definition text_document_format.hpp:59
TextDocumentFormat with_word_wrap(const rerun::blueprint::components::Enabled &_word_wrap) &&
Whether to wrap long lines in the document body.
Definition text_document_format.hpp:79
static TextDocumentFormat clear_fields()
Clear all the fields of a TextDocumentFormat.
TextDocumentFormat with_monospace(const rerun::blueprint::components::Enabled &_monospace) &&
Whether to use a monospace font for the document body.
Definition text_document_format.hpp:69
std::optional< ComponentBatch > monospace
Whether to use a monospace font for the document body.
Definition text_document_format.hpp:28
Component: Whether a procedure is enabled.
Definition enabled.hpp:17