Rerun C++ SDK
Loading...
Searching...
No Matches
recording_info.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/archetypes/recording_info.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../component_batch.hpp"
8#include "../component_column.hpp"
9#include "../components/name.hpp"
10#include "../components/timestamp.hpp"
11#include "../result.hpp"
12
13#include <cstdint>
14#include <optional>
15#include <utility>
16#include <vector>
17
18namespace rerun::archetypes {
19 /// **Archetype**: A list of properties associated with a recording.
21 /// When the recording started.
22 ///
23 /// Should be an absolute time, i.e. relative to Unix Epoch.
24 std::optional<ComponentBatch> start_time;
25
26 /// A user-chosen name for the recording.
27 std::optional<ComponentBatch> name;
28
29 public:
30 /// The name of the archetype as used in `ComponentDescriptor`s.
31 static constexpr const char ArchetypeName[] = "rerun.archetypes.RecordingInfo";
32
33 /// `ComponentDescriptor` for the `start_time` field.
35 ArchetypeName, "RecordingInfo:start_time",
37 );
38 /// `ComponentDescriptor` for the `name` field.
39 static constexpr auto Descriptor_name = ComponentDescriptor(
41 );
42
43 public:
44 RecordingInfo() = default;
45 RecordingInfo(RecordingInfo&& other) = default;
46 RecordingInfo(const RecordingInfo& other) = default;
47 RecordingInfo& operator=(const RecordingInfo& other) = default;
48 RecordingInfo& operator=(RecordingInfo&& other) = default;
49
50 /// Update only some specific fields of a `RecordingInfo`.
52 return RecordingInfo();
53 }
54
55 /// Clear all the fields of a `RecordingInfo`.
57
58 /// When the recording started.
59 ///
60 /// Should be an absolute time, i.e. relative to Unix Epoch.
63 ComponentBatch::from_loggable(_start_time, Descriptor_start_time).value_or_throw();
64 return std::move(*this);
65 }
66
67 /// This method makes it possible to pack multiple `start_time` in a single component batch.
68 ///
69 /// This only makes sense when used in conjunction with `columns`. `with_start_time` should
70 /// be used when logging a single row's worth of data.
73 ) && {
75 ComponentBatch::from_loggable(_start_time, Descriptor_start_time).value_or_throw();
76 return std::move(*this);
77 }
78
79 /// A user-chosen name for the recording.
81 name = ComponentBatch::from_loggable(_name, Descriptor_name).value_or_throw();
82 return std::move(*this);
83 }
84
85 /// This method makes it possible to pack multiple `name` in a single component batch.
86 ///
87 /// This only makes sense when used in conjunction with `columns`. `with_name` should
88 /// be used when logging a single row's worth of data.
90 name = ComponentBatch::from_loggable(_name, Descriptor_name).value_or_throw();
91 return std::move(*this);
92 }
93
94 /// Partitions the component data into multiple sub-batches.
95 ///
96 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
97 /// instead, via `ComponentBatch::partitioned`.
98 ///
99 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
100 ///
101 /// The specified `lengths` must sum to the total length of the component batch.
103
104 /// Partitions the component data into unit-length sub-batches.
105 ///
106 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
107 /// where `n` is automatically guessed.
109 };
110
111} // namespace rerun::archetypes
112
113namespace rerun {
114 /// \private
115 template <typename T>
116 struct AsComponents;
117
118 /// \private
119 template <>
120 struct AsComponents<archetypes::RecordingInfo> {
121 /// Serialize all set component batches.
122 static Result<Collection<ComponentBatch>> as_batches(
123 const archetypes::RecordingInfo& archetype
124 );
125 };
126} // 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 built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:76
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: A list of properties associated with a recording.
Definition recording_info.hpp:20
static constexpr auto Descriptor_name
ComponentDescriptor for the name field.
Definition recording_info.hpp:39
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
RecordingInfo with_name(const rerun::components::Name &_name) &&
A user-chosen name for the recording.
Definition recording_info.hpp:80
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_start_time
ComponentDescriptor for the start_time field.
Definition recording_info.hpp:34
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition recording_info.hpp:31
RecordingInfo with_many_name(const Collection< rerun::components::Name > &_name) &&
This method makes it possible to pack multiple name in a single component batch.
Definition recording_info.hpp:89
static RecordingInfo update_fields()
Update only some specific fields of a RecordingInfo.
Definition recording_info.hpp:51
std::optional< ComponentBatch > start_time
When the recording started.
Definition recording_info.hpp:24
std::optional< ComponentBatch > name
A user-chosen name for the recording.
Definition recording_info.hpp:27
static RecordingInfo clear_fields()
Clear all the fields of a RecordingInfo.
RecordingInfo with_start_time(const rerun::components::Timestamp &_start_time) &&
When the recording started.
Definition recording_info.hpp:61
RecordingInfo with_many_start_time(const Collection< rerun::components::Timestamp > &_start_time) &&
This method makes it possible to pack multiple start_time in a single component batch.
Definition recording_info.hpp:71
Component: A display name, typically for an entity or a item like a plot series.
Definition name.hpp:16
Component: When the recording started.
Definition timestamp.hpp:16