Rerun C++ SDK
Loading...
Searching...
No Matches
time_axis.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_types/definitions/rerun/blueprint/archetypes/time_axis.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/link_axis.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**: Configuration for the time (Y) axis of a plot.
19 ///
20 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
21 ///
22 struct TimeAxis {
23 /// How should the horizontal/X/time axis be linked across multiple plots?
24 std::optional<ComponentBatch> link;
25
26 public:
27 /// The name of the archetype as used in `ComponentDescriptor`s.
28 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TimeAxis";
29
30 /// `ComponentDescriptor` for the `link` field.
31 static constexpr auto Descriptor_link = ComponentDescriptor(
32 ArchetypeName, "TimeAxis:link",
34 );
35
36 public:
37 TimeAxis() = default;
38 TimeAxis(TimeAxis&& other) = default;
39 TimeAxis(const TimeAxis& other) = default;
40 TimeAxis& operator=(const TimeAxis& other) = default;
41 TimeAxis& operator=(TimeAxis&& other) = default;
42
43 /// Update only some specific fields of a `TimeAxis`.
45 return TimeAxis();
46 }
47
48 /// Clear all the fields of a `TimeAxis`.
50
51 /// How should the horizontal/X/time axis be linked across multiple plots?
52 TimeAxis with_link(const rerun::blueprint::components::LinkAxis& _link) && {
53 link = ComponentBatch::from_loggable(_link, Descriptor_link).value_or_throw();
54 return std::move(*this);
55 }
56
57 /// Partitions the component data into multiple sub-batches.
58 ///
59 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
60 /// instead, via `ComponentBatch::partitioned`.
61 ///
62 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
63 ///
64 /// The specified `lengths` must sum to the total length of the component batch.
66
67 /// Partitions the component data into unit-length sub-batches.
68 ///
69 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
70 /// where `n` is automatically guessed.
72 };
73
74} // namespace rerun::blueprint::archetypes
75
76namespace rerun {
77 /// \private
78 template <typename T>
79 struct AsComponents;
80
81 /// \private
82 template <>
83 struct AsComponents<blueprint::archetypes::TimeAxis> {
84 /// Serialize all set component batches.
85 static Result<Collection<ComponentBatch>> as_batches(
86 const blueprint::archetypes::TimeAxis& archetype
87 );
88 };
89} // 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: Configuration for the time (Y) axis of a plot.
Definition time_axis.hpp:22
static TimeAxis update_fields()
Update only some specific fields of a TimeAxis.
Definition time_axis.hpp:44
TimeAxis with_link(const rerun::blueprint::components::LinkAxis &_link) &&
How should the horizontal/X/time axis be linked across multiple plots?
Definition time_axis.hpp:52
std::optional< ComponentBatch > link
How should the horizontal/X/time axis be linked across multiple plots?
Definition time_axis.hpp:24
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static TimeAxis clear_fields()
Clear all the fields of a TimeAxis.
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition time_axis.hpp:28
static constexpr auto Descriptor_link
ComponentDescriptor for the link field.
Definition time_axis.hpp:31