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