6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/media_type.hpp"
11#include "../components/text.hpp"
12#include "../result.hpp"
79 std::optional<ComponentBatch>
text;
92 static constexpr const char ArchetypeName[] =
"rerun.archetypes.TextDocument";
126 return std::move(*
this);
135 return std::move(*
this);
148 return std::move(*
this);
160 return std::move(*
this);
172 return detail::partition_batches({&
text, &
media_type}, lengths_).value_or_throw();
180 return detail::partition_batches_of_unit_length({&
text, &
media_type}).value_or_throw();
188 template <
typename T>
193 struct AsComponents<archetypes::TextDocument> {
195 static Result<Collection<ComponentBatch>> as_batches(
196 const archetypes::TextDocument& archetype
198 return detail::collect_batches({&archetype.text, &archetype.media_type});
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
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: A text element intended to be displayed in its own text box.
Definition text_document.hpp:77
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition text_document.hpp:92
static TextDocument update_fields()
Update only some specific fields of a TextDocument.
Definition text_document.hpp:116
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition text_document.hpp:179
std::optional< ComponentBatch > media_type
The Media Type of the text.
Definition text_document.hpp:88
static constexpr auto Descriptor_media_type
ComponentDescriptor for the media_type field.
Definition text_document.hpp:99
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition text_document.hpp:171
static constexpr auto Descriptor_text
ComponentDescriptor for the text field.
Definition text_document.hpp:95
TextDocument with_text(const rerun::components::Text &_text) &&
Contents of the text document.
Definition text_document.hpp:124
std::optional< ComponentBatch > text
Contents of the text document.
Definition text_document.hpp:79
TextDocument with_many_text(const Collection< rerun::components::Text > &_text) &&
This method makes it possible to pack multiple text in a single component batch.
Definition text_document.hpp:133
TextDocument with_media_type(const rerun::components::MediaType &_media_type) &&
The Media Type of the text.
Definition text_document.hpp:145
static TextDocument clear_fields()
Clear all the fields of a TextDocument.
TextDocument with_many_media_type(const Collection< rerun::components::MediaType > &_media_type) &&
This method makes it possible to pack multiple media_type in a single component batch.
Definition text_document.hpp:155
Component: A string of text, e.g. for labels and text documents.
Definition text.hpp:16