6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/text.hpp"
11#include "../result.hpp"
57 std::optional<ComponentBatch>
state;
61 static constexpr const char ArchetypeName[] =
"rerun.archetypes.StateChange";
92 return std::move(*
this);
104 return detail::partition_batches({&
state}, lengths_).value_or_throw();
112 return detail::partition_batches_of_unit_length({&
state}).value_or_throw();
120 template <
typename T>
125 struct AsComponents<archetypes::StateChange> {
127 static Result<Collection<ComponentBatch>> as_batches(
128 const archetypes::StateChange& archetype
130 return detail::collect_batches({&archetype.state});
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
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 state change, representing a transition of an entity into a new state.
Definition state_change.hpp:49
static StateChange clear_fields()
Clear all the fields of a StateChange.
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition state_change.hpp:103
static StateChange update_fields()
Update only some specific fields of a StateChange.
Definition state_change.hpp:76
StateChange with_state(const Collection< rerun::components::Text > &_state) &&
The new state values; each instance gets its own lane in the state timeline view.
Definition state_change.hpp:90
static constexpr auto Descriptor_state
ComponentDescriptor for the state field.
Definition state_change.hpp:64
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition state_change.hpp:61
std::optional< ComponentBatch > state
The new state values; each instance gets its own lane in the state timeline view.
Definition state_change.hpp:57
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition state_change.hpp:111