Rerun C++ SDK
Loading...
Searching...
No Matches
dataframe_query.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/build/re_type_definitions/rerun/blueprint/archetypes/dataframe_query.def.rs".
3
4#pragma once
5
6#include "../../archetype_utils.hpp"
7#include "../../blueprint/components/apply_latest_at.hpp"
8#include "../../blueprint/components/auto_scroll.hpp"
9#include "../../blueprint/components/column_order.hpp"
10#include "../../blueprint/components/filter_by_range.hpp"
11#include "../../blueprint/components/filter_is_not_null.hpp"
12#include "../../blueprint/components/selected_columns.hpp"
13#include "../../blueprint/components/timeline_name.hpp"
14#include "../../collection.hpp"
15#include "../../component_batch.hpp"
16#include "../../component_column.hpp"
17#include "../../result.hpp"
18
19#include <cstdint>
20#include <optional>
21#include <utility>
22#include <vector>
23
24namespace rerun::blueprint::archetypes {
25 /// **Archetype**: The query for the dataframe view.
26 ///
27 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
28 ///
30 /// The timeline for this query.
31 ///
32 /// If unset, the timeline currently active on the time panel is used.
33 std::optional<ComponentBatch> timeline;
34
35 /// If provided, only rows whose timestamp is within this range will be shown.
36 ///
37 /// Note: will be unset as soon as `timeline` is changed.
38 std::optional<ComponentBatch> filter_by_range;
39
40 /// If provided, only show rows which contains a logged event for the specified component.
41 std::optional<ComponentBatch> filter_is_not_null;
42
43 /// Should empty cells be filled with latest-at queries?
44 std::optional<ComponentBatch> apply_latest_at;
45
46 /// Selected columns. If unset, only the active timeline and all component columns are selected.
47 std::optional<ComponentBatch> select;
48
49 /// The order of entity path column groups. If unset, the default order is used.
50 ///
51 /// This affects the order of component columns, which are always grouped by entity path. Timeline columns always
52 /// come first. Entities not listed here are appended at the end in default order.
53 ///
54 /// If `entity_order` contains any entity path that is not included in the view, they are ignored.
55 std::optional<ComponentBatch> entity_order;
56
57 /// Whether to auto-scroll to track the time cursor.
58 ///
59 /// When enabled and the view's timeline matches the time panel's active timeline,
60 /// the view will scroll to keep the row at or before the current time cursor visible.
61 std::optional<ComponentBatch> auto_scroll;
62
63 public:
64 /// The name of the archetype as used in `ComponentDescriptor`s.
65 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.DataframeQuery";
66
67 /// `ComponentDescriptor` for the `timeline` field.
69 ArchetypeName, "DataframeQuery:timeline",
71 );
72 /// `ComponentDescriptor` for the `filter_by_range` field.
74 ArchetypeName, "DataframeQuery:filter_by_range",
76 );
77 /// `ComponentDescriptor` for the `filter_is_not_null` field.
79 ArchetypeName, "DataframeQuery:filter_is_not_null",
81 );
82 /// `ComponentDescriptor` for the `apply_latest_at` field.
84 ArchetypeName, "DataframeQuery:apply_latest_at",
86 );
87 /// `ComponentDescriptor` for the `select` field.
88 static constexpr auto Descriptor_select = ComponentDescriptor(
89 ArchetypeName, "DataframeQuery:select",
91 );
92 /// `ComponentDescriptor` for the `entity_order` field.
94 ArchetypeName, "DataframeQuery:entity_order",
96 );
97 /// `ComponentDescriptor` for the `auto_scroll` field.
99 ArchetypeName, "DataframeQuery:auto_scroll",
101 );
102
103 public:
104 DataframeQuery() = default;
105 DataframeQuery(DataframeQuery&& other) = default;
106 DataframeQuery(const DataframeQuery& other) = default;
107 DataframeQuery& operator=(const DataframeQuery& other) = default;
108 DataframeQuery& operator=(DataframeQuery&& other) = default;
109
110 /// Update only some specific fields of a `DataframeQuery`.
112 return DataframeQuery();
113 }
114
115 /// Clear all the fields of a `DataframeQuery`.
117
118 /// The timeline for this query.
119 ///
120 /// If unset, the timeline currently active on the time panel is used.
122 ) && {
123 timeline =
124 ComponentBatch::from_loggable(_timeline, Descriptor_timeline).value_or_throw();
125 return std::move(*this);
126 }
127
128 /// If provided, only rows whose timestamp is within this range will be shown.
129 ///
130 /// Note: will be unset as soon as `timeline` is changed.
132 const rerun::blueprint::components::FilterByRange& _filter_by_range
133 ) && {
136 .value_or_throw();
137 return std::move(*this);
138 }
139
140 /// If provided, only show rows which contains a logged event for the specified component.
142 const rerun::blueprint::components::FilterIsNotNull& _filter_is_not_null
143 ) && {
146 .value_or_throw();
147 return std::move(*this);
148 }
149
150 /// Should empty cells be filled with latest-at queries?
152 const rerun::blueprint::components::ApplyLatestAt& _apply_latest_at
153 ) && {
156 .value_or_throw();
157 return std::move(*this);
158 }
159
160 /// Selected columns. If unset, only the active timeline and all component columns are selected.
162 ) && {
163 select = ComponentBatch::from_loggable(_select, Descriptor_select).value_or_throw();
164 return std::move(*this);
165 }
166
167 /// The order of entity path column groups. If unset, the default order is used.
168 ///
169 /// This affects the order of component columns, which are always grouped by entity path. Timeline columns always
170 /// come first. Entities not listed here are appended at the end in default order.
171 ///
172 /// If `entity_order` contains any entity path that is not included in the view, they are ignored.
175 ) && {
177 .value_or_throw();
178 return std::move(*this);
179 }
180
181 /// Whether to auto-scroll to track the time cursor.
182 ///
183 /// When enabled and the view's timeline matches the time panel's active timeline,
184 /// the view will scroll to keep the row at or before the current time cursor visible.
186 ) && {
188 .value_or_throw();
189 return std::move(*this);
190 }
191
192 /// Partitions the component data into multiple sub-batches.
193 ///
194 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
195 /// instead, via `ComponentBatch::partitioned`.
196 ///
197 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
198 ///
199 /// The specified `lengths` must sum to the total length of the component batch.
201 return detail::partition_batches(
202 {&timeline,
206 &select,
208 &auto_scroll},
209 lengths_
210 )
211 .value_or_throw();
212 }
213
214 /// Partitions the component data into unit-length sub-batches.
215 ///
216 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
217 /// where `n` is automatically guessed.
219 return detail::partition_batches_of_unit_length({&timeline,
223 &select,
225 &auto_scroll})
226 .value_or_throw();
227 }
228 };
229
230} // namespace rerun::blueprint::archetypes
231
232namespace rerun {
233 /// \private
234 template <typename T>
235 struct AsComponents;
236
237 /// \private
238 template <>
239 struct AsComponents<blueprint::archetypes::DataframeQuery> {
240 /// Serialize all set component batches.
241 static Result<Collection<ComponentBatch>> as_batches(
243 ) {
244 return detail::collect_batches(
245 {&archetype.timeline,
246 &archetype.filter_by_range,
247 &archetype.filter_is_not_null,
248 &archetype.apply_latest_at,
249 &archetype.select,
250 &archetype.entity_order,
251 &archetype.auto_scroll}
252 );
253 }
254 };
255} // 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: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: The query for the dataframe view.
Definition dataframe_query.hpp:29
std::optional< ComponentBatch > timeline
The timeline for this query.
Definition dataframe_query.hpp:33
std::optional< ComponentBatch > select
Selected columns. If unset, only the active timeline and all component columns are selected.
Definition dataframe_query.hpp:47
std::optional< ComponentBatch > entity_order
The order of entity path column groups.
Definition dataframe_query.hpp:55
static DataframeQuery clear_fields()
Clear all the fields of a DataframeQuery.
DataframeQuery with_timeline(const rerun::blueprint::components::TimelineName &_timeline) &&
The timeline for this query.
Definition dataframe_query.hpp:121
static constexpr auto Descriptor_timeline
ComponentDescriptor for the timeline field.
Definition dataframe_query.hpp:68
DataframeQuery with_select(const rerun::blueprint::components::SelectedColumns &_select) &&
Selected columns. If unset, only the active timeline and all component columns are selected.
Definition dataframe_query.hpp:161
static constexpr auto Descriptor_filter_is_not_null
ComponentDescriptor for the filter_is_not_null field.
Definition dataframe_query.hpp:78
std::optional< ComponentBatch > filter_by_range
If provided, only rows whose timestamp is within this range will be shown.
Definition dataframe_query.hpp:38
DataframeQuery with_filter_by_range(const rerun::blueprint::components::FilterByRange &_filter_by_range) &&
If provided, only rows whose timestamp is within this range will be shown.
Definition dataframe_query.hpp:131
static constexpr auto Descriptor_select
ComponentDescriptor for the select field.
Definition dataframe_query.hpp:88
DataframeQuery with_auto_scroll(const rerun::blueprint::components::AutoScroll &_auto_scroll) &&
Whether to auto-scroll to track the time cursor.
Definition dataframe_query.hpp:185
DataframeQuery with_apply_latest_at(const rerun::blueprint::components::ApplyLatestAt &_apply_latest_at) &&
Should empty cells be filled with latest-at queries?
Definition dataframe_query.hpp:151
static constexpr auto Descriptor_auto_scroll
ComponentDescriptor for the auto_scroll field.
Definition dataframe_query.hpp:98
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition dataframe_query.hpp:218
std::optional< ComponentBatch > auto_scroll
Whether to auto-scroll to track the time cursor.
Definition dataframe_query.hpp:61
std::optional< ComponentBatch > apply_latest_at
Should empty cells be filled with latest-at queries?
Definition dataframe_query.hpp:44
static constexpr auto Descriptor_filter_by_range
ComponentDescriptor for the filter_by_range field.
Definition dataframe_query.hpp:73
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition dataframe_query.hpp:200
static constexpr auto Descriptor_apply_latest_at
ComponentDescriptor for the apply_latest_at field.
Definition dataframe_query.hpp:83
std::optional< ComponentBatch > filter_is_not_null
If provided, only show rows which contains a logged event for the specified component.
Definition dataframe_query.hpp:41
static constexpr auto Descriptor_entity_order
ComponentDescriptor for the entity_order field.
Definition dataframe_query.hpp:93
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition dataframe_query.hpp:65
static DataframeQuery update_fields()
Update only some specific fields of a DataframeQuery.
Definition dataframe_query.hpp:111
DataframeQuery with_entity_order(const rerun::blueprint::components::ColumnOrder &_entity_order) &&
The order of entity path column groups.
Definition dataframe_query.hpp:173
DataframeQuery with_filter_is_not_null(const rerun::blueprint::components::FilterIsNotNull &_filter_is_not_null) &&
If provided, only show rows which contains a logged event for the specified component.
Definition dataframe_query.hpp:141
Component: Whether empty cells in a dataframe should be filled with a latest-at query.
Definition apply_latest_at.hpp:17
Component: Whether the view should auto-scroll to follow the time cursor.
Definition auto_scroll.hpp:17
Component: The order of component columns (which remain always grouped by entity path) in the datafra...
Definition column_order.hpp:28
Component: Configuration for a filter-by-range feature of the dataframe view.
Definition filter_by_range.hpp:17
Component: Configuration for the filter is not null feature of the dataframe view.
Definition filter_is_not_null.hpp:18
Component: Describe a component column to be selected in the dataframe view.
Definition selected_columns.hpp:18
Component: A timeline identified by its name.
Definition timeline_name.hpp:22