6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/color.hpp"
11#include "../components/text.hpp"
12#include "../components/text_log_level.hpp"
13#include "../result.hpp"
90 std::optional<ComponentBatch>
text;
95 std::optional<ComponentBatch>
level;
98 std::optional<ComponentBatch>
color;
139 return std::move(*
this);
148 return std::move(*
this);
156 return std::move(*
this);
165 return std::move(*
this);
171 return std::move(*
this);
180 return std::move(*
this);
192 return detail::partition_batches({&
text, &
level, &
color}, lengths_).value_or_throw();
200 return detail::partition_batches_of_unit_length({&
text, &
level, &
color})
209 template <
typename T>
214 struct AsComponents<archetypes::TextLog> {
216 static Result<Collection<ComponentBatch>> as_batches(
const archetypes::TextLog& archetype) {
217 return detail::collect_batches({&archetype.text, &archetype.level, &archetype.color});
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 log entry in a text log, comprised of a text body and its log level.
Definition text_log.hpp:88
std::optional< ComponentBatch > color
Optional color to use for the log line in the Rerun Viewer.
Definition text_log.hpp:98
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition text_log.hpp:102
static constexpr auto Descriptor_text
ComponentDescriptor for the text field.
Definition text_log.hpp:105
TextLog with_many_level(const Collection< rerun::components::TextLogLevel > &_level) &&
This method makes it possible to pack multiple level in a single component batch.
Definition text_log.hpp:163
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition text_log.hpp:191
TextLog with_color(const rerun::components::Color &_color) &&
Optional color to use for the log line in the Rerun Viewer.
Definition text_log.hpp:169
static constexpr auto Descriptor_color
ComponentDescriptor for the color field.
Definition text_log.hpp:113
static TextLog update_fields()
Update only some specific fields of a TextLog.
Definition text_log.hpp:129
TextLog with_text(const rerun::components::Text &_text) &&
The body of the message.
Definition text_log.hpp:137
static TextLog clear_fields()
Clear all the fields of a TextLog.
TextLog with_level(const rerun::components::TextLogLevel &_level) &&
The verbosity level of the message.
Definition text_log.hpp:154
std::optional< ComponentBatch > level
The verbosity level of the message.
Definition text_log.hpp:95
static constexpr auto Descriptor_level
ComponentDescriptor for the level field.
Definition text_log.hpp:109
std::optional< ComponentBatch > text
The body of the message.
Definition text_log.hpp:90
TextLog with_many_color(const Collection< rerun::components::Color > &_color) &&
This method makes it possible to pack multiple color in a single component batch.
Definition text_log.hpp:178
TextLog 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_log.hpp:146
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition text_log.hpp:199
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:17
Component: The severity level of a text log message.
Definition text_log_level.hpp:25
Component: A string of text, e.g. for labels and text documents.
Definition text.hpp:16