Rerun C++ SDK
Loading...
Searching...
No Matches
mcap_statistics.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/mcap_statistics.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../component_batch.hpp"
8#include "../component_column.hpp"
9#include "../components/channel_message_counts.hpp"
10#include "../components/count.hpp"
11#include "../components/timestamp.hpp"
12#include "../result.hpp"
13
14#include <cstdint>
15#include <optional>
16#include <utility>
17#include <vector>
18
19namespace rerun::archetypes {
20 /// **Archetype**: Recording-level statistics about an MCAP file, logged as a part of `archetypes::RecordingInfo`.
21 ///
22 /// This archetype contains summary information about an entire MCAP recording, including
23 /// counts of messages, schemas, channels, and other records, as well as timing information
24 /// spanning the full recording duration. It is typically logged once per recording to provide
25 /// an overview of the dataset's structure and content.
26 ///
27 /// See also `archetypes::McapChannel` for individual channel definitions,
28 /// `archetypes::McapMessage` for message content, `archetypes::McapSchema` for schema definitions,
29 /// and the [MCAP specification](https://mcap.dev/) for complete format details.
30 ///
31 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
32 ///
34 /// Total number of data messages contained in the MCAP recording.
35 ///
36 /// This count includes all timestamped data messages but excludes metadata records,
37 /// schema definitions, and other non-message records.
38 std::optional<ComponentBatch> message_count;
39
40 /// Number of unique schema definitions in the recording.
41 ///
42 /// Each schema defines the structure for one or more message types used by channels.
43 std::optional<ComponentBatch> schema_count;
44
45 /// Number of channels defined in the recording.
46 ///
47 /// Each channel represents a unique topic and encoding combination for publishing messages.
48 std::optional<ComponentBatch> channel_count;
49
50 /// Number of file attachments embedded in the recording.
51 ///
52 /// Attachments can include calibration files, configuration data, or other auxiliary files.
53 std::optional<ComponentBatch> attachment_count;
54
55 /// Number of metadata records providing additional context about the recording.
56 ///
57 /// Metadata records contain key-value pairs with information about the recording environment,
58 /// system configuration, or other contextual data.
59 std::optional<ComponentBatch> metadata_count;
60
61 /// Number of data chunks used to organize messages in the file.
62 ///
63 /// Chunks group related messages together for efficient storage and indexed access.
64 std::optional<ComponentBatch> chunk_count;
65
66 /// Timestamp of the earliest message in the recording.
67 ///
68 /// This marks the beginning of the recorded data timeline.
69 std::optional<ComponentBatch> message_start_time;
70
71 /// Timestamp of the latest message in the recording.
72 ///
73 /// Together with `message_start_time`, this defines the total duration of the recording.
74 std::optional<ComponentBatch> message_end_time;
75
76 /// Detailed breakdown of message counts per channel.
77 std::optional<ComponentBatch> channel_message_counts;
78
79 public:
80 /// The name of the archetype as used in `ComponentDescriptor`s.
81 static constexpr const char ArchetypeName[] = "rerun.archetypes.McapStatistics";
82
83 /// `ComponentDescriptor` for the `message_count` field.
85 ArchetypeName, "McapStatistics:message_count",
87 );
88 /// `ComponentDescriptor` for the `schema_count` field.
90 ArchetypeName, "McapStatistics:schema_count",
92 );
93 /// `ComponentDescriptor` for the `channel_count` field.
95 ArchetypeName, "McapStatistics:channel_count",
97 );
98 /// `ComponentDescriptor` for the `attachment_count` field.
100 ArchetypeName, "McapStatistics:attachment_count",
102 );
103 /// `ComponentDescriptor` for the `metadata_count` field.
105 ArchetypeName, "McapStatistics:metadata_count",
107 );
108 /// `ComponentDescriptor` for the `chunk_count` field.
110 ArchetypeName, "McapStatistics:chunk_count",
112 );
113 /// `ComponentDescriptor` for the `message_start_time` field.
115 ArchetypeName, "McapStatistics:message_start_time",
117 );
118 /// `ComponentDescriptor` for the `message_end_time` field.
120 ArchetypeName, "McapStatistics:message_end_time",
122 );
123 /// `ComponentDescriptor` for the `channel_message_counts` field.
125 ArchetypeName, "McapStatistics:channel_message_counts",
127 );
128
129 public:
130 McapStatistics() = default;
131 McapStatistics(McapStatistics&& other) = default;
132 McapStatistics(const McapStatistics& other) = default;
133 McapStatistics& operator=(const McapStatistics& other) = default;
134 McapStatistics& operator=(McapStatistics&& other) = default;
135
136 explicit McapStatistics(
137 rerun::components::Count _message_count, rerun::components::Count _schema_count,
138 rerun::components::Count _channel_count, rerun::components::Count _attachment_count,
139 rerun::components::Count _metadata_count, rerun::components::Count _chunk_count,
140 rerun::components::Timestamp _message_start_time,
141 rerun::components::Timestamp _message_end_time
142 )
144 ComponentBatch::from_loggable(std::move(_message_count), Descriptor_message_count)
145 .value_or_throw()
146 ),
148 ComponentBatch::from_loggable(std::move(_schema_count), Descriptor_schema_count)
149 .value_or_throw()
150 ),
152 ComponentBatch::from_loggable(std::move(_channel_count), Descriptor_channel_count)
153 .value_or_throw()
154 ),
155 attachment_count(ComponentBatch::from_loggable(
156 std::move(_attachment_count), Descriptor_attachment_count
157 )
158 .value_or_throw()),
159 metadata_count(ComponentBatch::from_loggable(
160 std::move(_metadata_count), Descriptor_metadata_count
161 )
162 .value_or_throw()),
164 ComponentBatch::from_loggable(std::move(_chunk_count), Descriptor_chunk_count)
165 .value_or_throw()
166 ),
167 message_start_time(ComponentBatch::from_loggable(
168 std::move(_message_start_time), Descriptor_message_start_time
169 )
170 .value_or_throw()),
171 message_end_time(ComponentBatch::from_loggable(
172 std::move(_message_end_time), Descriptor_message_end_time
173 )
174 .value_or_throw()) {}
175
176 /// Update only some specific fields of a `McapStatistics`.
178 return McapStatistics();
179 }
180
181 /// Clear all the fields of a `McapStatistics`.
183
184 /// Total number of data messages contained in the MCAP recording.
185 ///
186 /// This count includes all timestamped data messages but excludes metadata records,
187 /// schema definitions, and other non-message records.
190 .value_or_throw();
191 return std::move(*this);
192 }
193
194 /// This method makes it possible to pack multiple `message_count` in a single component batch.
195 ///
196 /// This only makes sense when used in conjunction with `columns`. `with_message_count` should
197 /// be used when logging a single row's worth of data.
199 const Collection<rerun::components::Count>& _message_count
200 ) && {
202 .value_or_throw();
203 return std::move(*this);
204 }
205
206 /// Number of unique schema definitions in the recording.
207 ///
208 /// Each schema defines the structure for one or more message types used by channels.
211 .value_or_throw();
212 return std::move(*this);
213 }
214
215 /// This method makes it possible to pack multiple `schema_count` in a single component batch.
216 ///
217 /// This only makes sense when used in conjunction with `columns`. `with_schema_count` should
218 /// be used when logging a single row's worth of data.
220 const Collection<rerun::components::Count>& _schema_count
221 ) && {
223 .value_or_throw();
224 return std::move(*this);
225 }
226
227 /// Number of channels defined in the recording.
228 ///
229 /// Each channel represents a unique topic and encoding combination for publishing messages.
232 .value_or_throw();
233 return std::move(*this);
234 }
235
236 /// This method makes it possible to pack multiple `channel_count` in a single component batch.
237 ///
238 /// This only makes sense when used in conjunction with `columns`. `with_channel_count` should
239 /// be used when logging a single row's worth of data.
241 const Collection<rerun::components::Count>& _channel_count
242 ) && {
244 .value_or_throw();
245 return std::move(*this);
246 }
247
248 /// Number of file attachments embedded in the recording.
249 ///
250 /// Attachments can include calibration files, configuration data, or other auxiliary files.
254 .value_or_throw();
255 return std::move(*this);
256 }
257
258 /// This method makes it possible to pack multiple `attachment_count` in a single component batch.
259 ///
260 /// This only makes sense when used in conjunction with `columns`. `with_attachment_count` should
261 /// be used when logging a single row's worth of data.
263 const Collection<rerun::components::Count>& _attachment_count
264 ) && {
267 .value_or_throw();
268 return std::move(*this);
269 }
270
271 /// Number of metadata records providing additional context about the recording.
272 ///
273 /// Metadata records contain key-value pairs with information about the recording environment,
274 /// system configuration, or other contextual data.
278 .value_or_throw();
279 return std::move(*this);
280 }
281
282 /// This method makes it possible to pack multiple `metadata_count` in a single component batch.
283 ///
284 /// This only makes sense when used in conjunction with `columns`. `with_metadata_count` should
285 /// be used when logging a single row's worth of data.
287 const Collection<rerun::components::Count>& _metadata_count
288 ) && {
291 .value_or_throw();
292 return std::move(*this);
293 }
294
295 /// Number of data chunks used to organize messages in the file.
296 ///
297 /// Chunks group related messages together for efficient storage and indexed access.
300 .value_or_throw();
301 return std::move(*this);
302 }
303
304 /// This method makes it possible to pack multiple `chunk_count` in a single component batch.
305 ///
306 /// This only makes sense when used in conjunction with `columns`. `with_chunk_count` should
307 /// be used when logging a single row's worth of data.
309 const Collection<rerun::components::Count>& _chunk_count
310 ) && {
312 .value_or_throw();
313 return std::move(*this);
314 }
315
316 /// Timestamp of the earliest message in the recording.
317 ///
318 /// This marks the beginning of the recorded data timeline.
320 const rerun::components::Timestamp& _message_start_time
321 ) && {
324 .value_or_throw();
325 return std::move(*this);
326 }
327
328 /// This method makes it possible to pack multiple `message_start_time` in a single component batch.
329 ///
330 /// This only makes sense when used in conjunction with `columns`. `with_message_start_time` should
331 /// be used when logging a single row's worth of data.
333 const Collection<rerun::components::Timestamp>& _message_start_time
334 ) && {
337 .value_or_throw();
338 return std::move(*this);
339 }
340
341 /// Timestamp of the latest message in the recording.
342 ///
343 /// Together with `message_start_time`, this defines the total duration of the recording.
345 ) && {
348 .value_or_throw();
349 return std::move(*this);
350 }
351
352 /// This method makes it possible to pack multiple `message_end_time` in a single component batch.
353 ///
354 /// This only makes sense when used in conjunction with `columns`. `with_message_end_time` should
355 /// be used when logging a single row's worth of data.
357 const Collection<rerun::components::Timestamp>& _message_end_time
358 ) && {
361 .value_or_throw();
362 return std::move(*this);
363 }
364
365 /// Detailed breakdown of message counts per channel.
367 const rerun::components::ChannelMessageCounts& _channel_message_counts
368 ) && {
370 _channel_message_counts,
372 )
373 .value_or_throw();
374 return std::move(*this);
375 }
376
377 /// This method makes it possible to pack multiple `channel_message_counts` in a single component batch.
378 ///
379 /// This only makes sense when used in conjunction with `columns`. `with_channel_message_counts` should
380 /// be used when logging a single row's worth of data.
382 const Collection<rerun::components::ChannelMessageCounts>& _channel_message_counts
383 ) && {
385 _channel_message_counts,
387 )
388 .value_or_throw();
389 return std::move(*this);
390 }
391
392 /// Partitions the component data into multiple sub-batches.
393 ///
394 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
395 /// instead, via `ComponentBatch::partitioned`.
396 ///
397 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
398 ///
399 /// The specified `lengths` must sum to the total length of the component batch.
401
402 /// Partitions the component data into unit-length sub-batches.
403 ///
404 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
405 /// where `n` is automatically guessed.
407 };
408
409} // namespace rerun::archetypes
410
411namespace rerun {
412 /// \private
413 template <typename T>
414 struct AsComponents;
415
416 /// \private
417 template <>
418 struct AsComponents<archetypes::McapStatistics> {
419 /// Serialize all set component batches.
420 static Result<Collection<ComponentBatch>> as_batches(
421 const archetypes::McapStatistics& archetype
422 );
423 };
424} // 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
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: Recording-level statistics about an MCAP file, logged as a part of archetypes::RecordingIn...
Definition mcap_statistics.hpp:33
std::optional< ComponentBatch > attachment_count
Number of file attachments embedded in the recording.
Definition mcap_statistics.hpp:53
McapStatistics with_message_count(const rerun::components::Count &_message_count) &&
Total number of data messages contained in the MCAP recording.
Definition mcap_statistics.hpp:188
McapStatistics with_metadata_count(const rerun::components::Count &_metadata_count) &&
Number of metadata records providing additional context about the recording.
Definition mcap_statistics.hpp:275
std::optional< ComponentBatch > message_count
Total number of data messages contained in the MCAP recording.
Definition mcap_statistics.hpp:38
static constexpr auto Descriptor_chunk_count
ComponentDescriptor for the chunk_count field.
Definition mcap_statistics.hpp:109
std::optional< ComponentBatch > channel_message_counts
Detailed breakdown of message counts per channel.
Definition mcap_statistics.hpp:77
static constexpr auto Descriptor_schema_count
ComponentDescriptor for the schema_count field.
Definition mcap_statistics.hpp:89
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static McapStatistics clear_fields()
Clear all the fields of a McapStatistics.
McapStatistics with_many_channel_count(const Collection< rerun::components::Count > &_channel_count) &&
This method makes it possible to pack multiple channel_count in a single component batch.
Definition mcap_statistics.hpp:240
McapStatistics with_channel_count(const rerun::components::Count &_channel_count) &&
Number of channels defined in the recording.
Definition mcap_statistics.hpp:230
McapStatistics with_many_channel_message_counts(const Collection< rerun::components::ChannelMessageCounts > &_channel_message_counts) &&
This method makes it possible to pack multiple channel_message_counts in a single component batch.
Definition mcap_statistics.hpp:381
McapStatistics with_many_attachment_count(const Collection< rerun::components::Count > &_attachment_count) &&
This method makes it possible to pack multiple attachment_count in a single component batch.
Definition mcap_statistics.hpp:262
std::optional< ComponentBatch > message_end_time
Timestamp of the latest message in the recording.
Definition mcap_statistics.hpp:74
McapStatistics with_many_message_count(const Collection< rerun::components::Count > &_message_count) &&
This method makes it possible to pack multiple message_count in a single component batch.
Definition mcap_statistics.hpp:198
McapStatistics with_message_end_time(const rerun::components::Timestamp &_message_end_time) &&
Timestamp of the latest message in the recording.
Definition mcap_statistics.hpp:344
McapStatistics with_many_chunk_count(const Collection< rerun::components::Count > &_chunk_count) &&
This method makes it possible to pack multiple chunk_count in a single component batch.
Definition mcap_statistics.hpp:308
std::optional< ComponentBatch > chunk_count
Number of data chunks used to organize messages in the file.
Definition mcap_statistics.hpp:64
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition mcap_statistics.hpp:81
static constexpr auto Descriptor_channel_count
ComponentDescriptor for the channel_count field.
Definition mcap_statistics.hpp:94
std::optional< ComponentBatch > schema_count
Number of unique schema definitions in the recording.
Definition mcap_statistics.hpp:43
McapStatistics with_attachment_count(const rerun::components::Count &_attachment_count) &&
Number of file attachments embedded in the recording.
Definition mcap_statistics.hpp:251
McapStatistics with_many_metadata_count(const Collection< rerun::components::Count > &_metadata_count) &&
This method makes it possible to pack multiple metadata_count in a single component batch.
Definition mcap_statistics.hpp:286
McapStatistics with_schema_count(const rerun::components::Count &_schema_count) &&
Number of unique schema definitions in the recording.
Definition mcap_statistics.hpp:209
static constexpr auto Descriptor_attachment_count
ComponentDescriptor for the attachment_count field.
Definition mcap_statistics.hpp:99
static constexpr auto Descriptor_message_end_time
ComponentDescriptor for the message_end_time field.
Definition mcap_statistics.hpp:119
McapStatistics with_chunk_count(const rerun::components::Count &_chunk_count) &&
Number of data chunks used to organize messages in the file.
Definition mcap_statistics.hpp:298
McapStatistics with_many_message_start_time(const Collection< rerun::components::Timestamp > &_message_start_time) &&
This method makes it possible to pack multiple message_start_time in a single component batch.
Definition mcap_statistics.hpp:332
static constexpr auto Descriptor_channel_message_counts
ComponentDescriptor for the channel_message_counts field.
Definition mcap_statistics.hpp:124
McapStatistics with_message_start_time(const rerun::components::Timestamp &_message_start_time) &&
Timestamp of the earliest message in the recording.
Definition mcap_statistics.hpp:319
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > channel_count
Number of channels defined in the recording.
Definition mcap_statistics.hpp:48
McapStatistics with_many_message_end_time(const Collection< rerun::components::Timestamp > &_message_end_time) &&
This method makes it possible to pack multiple message_end_time in a single component batch.
Definition mcap_statistics.hpp:356
static constexpr auto Descriptor_metadata_count
ComponentDescriptor for the metadata_count field.
Definition mcap_statistics.hpp:104
static McapStatistics update_fields()
Update only some specific fields of a McapStatistics.
Definition mcap_statistics.hpp:177
static constexpr auto Descriptor_message_count
ComponentDescriptor for the message_count field.
Definition mcap_statistics.hpp:84
std::optional< ComponentBatch > message_start_time
Timestamp of the earliest message in the recording.
Definition mcap_statistics.hpp:69
static constexpr auto Descriptor_message_start_time
ComponentDescriptor for the message_start_time field.
Definition mcap_statistics.hpp:114
std::optional< ComponentBatch > metadata_count
Number of metadata records providing additional context about the recording.
Definition mcap_statistics.hpp:59
McapStatistics with_channel_message_counts(const rerun::components::ChannelMessageCounts &_channel_message_counts) &&
Detailed breakdown of message counts per channel.
Definition mcap_statistics.hpp:366
McapStatistics with_many_schema_count(const Collection< rerun::components::Count > &_schema_count) &&
This method makes it possible to pack multiple schema_count in a single component batch.
Definition mcap_statistics.hpp:219
Component: A mapping of channel IDs to their respective message counts.
Definition channel_message_counts.hpp:27
Component: A generic count value.
Definition count.hpp:19
Component: When the recording started.
Definition timestamp.hpp:16