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/store/re_types/definitions/rerun/blueprint/archetypes/dataframe_query.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/apply_latest_at.hpp"
7#include "../../blueprint/components/filter_by_range.hpp"
8#include "../../blueprint/components/filter_is_not_null.hpp"
9#include "../../blueprint/components/selected_columns.hpp"
10#include "../../blueprint/components/timeline_name.hpp"
11#include "../../collection.hpp"
12#include "../../component_batch.hpp"
13#include "../../component_column.hpp"
14#include "../../result.hpp"
15
16#include <cstdint>
17#include <optional>
18#include <utility>
19#include <vector>
20
21namespace rerun::blueprint::archetypes {
22 /// **Archetype**: The query for the dataframe view.
23 ///
24 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25 ///
27 /// The timeline for this query.
28 ///
29 /// If unset, the timeline currently active on the time panel is used.
30 std::optional<ComponentBatch> timeline;
31
32 /// If provided, only rows whose timestamp is within this range will be shown.
33 ///
34 /// Note: will be unset as soon as `timeline` is changed.
35 std::optional<ComponentBatch> filter_by_range;
36
37 /// If provided, only show rows which contains a logged event for the specified component.
38 std::optional<ComponentBatch> filter_is_not_null;
39
40 /// Should empty cells be filled with latest-at queries?
41 std::optional<ComponentBatch> apply_latest_at;
42
43 /// Selected columns. If unset, all columns are selected.
44 std::optional<ComponentBatch> select;
45
46 public:
47 /// The name of the archetype as used in `ComponentDescriptor`s.
48 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.DataframeQuery";
49
50 /// `ComponentDescriptor` for the `timeline` field.
52 ArchetypeName, "DataframeQuery:timeline",
54 );
55 /// `ComponentDescriptor` for the `filter_by_range` field.
57 ArchetypeName, "DataframeQuery:filter_by_range",
59 );
60 /// `ComponentDescriptor` for the `filter_is_not_null` field.
62 ArchetypeName, "DataframeQuery:filter_is_not_null",
64 );
65 /// `ComponentDescriptor` for the `apply_latest_at` field.
67 ArchetypeName, "DataframeQuery:apply_latest_at",
69 );
70 /// `ComponentDescriptor` for the `select` field.
71 static constexpr auto Descriptor_select = ComponentDescriptor(
72 ArchetypeName, "DataframeQuery:select",
74 );
75
76 public:
77 DataframeQuery() = default;
78 DataframeQuery(DataframeQuery&& other) = default;
79 DataframeQuery(const DataframeQuery& other) = default;
80 DataframeQuery& operator=(const DataframeQuery& other) = default;
81 DataframeQuery& operator=(DataframeQuery&& other) = default;
82
83 /// Update only some specific fields of a `DataframeQuery`.
85 return DataframeQuery();
86 }
87
88 /// Clear all the fields of a `DataframeQuery`.
90
91 /// The timeline for this query.
92 ///
93 /// If unset, the timeline currently active on the time panel is used.
95 ) && {
96 timeline =
97 ComponentBatch::from_loggable(_timeline, Descriptor_timeline).value_or_throw();
98 return std::move(*this);
99 }
100
101 /// If provided, only rows whose timestamp is within this range will be shown.
102 ///
103 /// Note: will be unset as soon as `timeline` is changed.
105 const rerun::blueprint::components::FilterByRange& _filter_by_range
106 ) && {
109 .value_or_throw();
110 return std::move(*this);
111 }
112
113 /// If provided, only show rows which contains a logged event for the specified component.
115 const rerun::blueprint::components::FilterIsNotNull& _filter_is_not_null
116 ) && {
119 .value_or_throw();
120 return std::move(*this);
121 }
122
123 /// Should empty cells be filled with latest-at queries?
125 const rerun::blueprint::components::ApplyLatestAt& _apply_latest_at
126 ) && {
129 .value_or_throw();
130 return std::move(*this);
131 }
132
133 /// Selected columns. If unset, all columns are selected.
135 ) && {
136 select = ComponentBatch::from_loggable(_select, Descriptor_select).value_or_throw();
137 return std::move(*this);
138 }
139
140 /// Partitions the component data into multiple sub-batches.
141 ///
142 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
143 /// instead, via `ComponentBatch::partitioned`.
144 ///
145 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
146 ///
147 /// The specified `lengths` must sum to the total length of the component batch.
149
150 /// Partitions the component data into unit-length sub-batches.
151 ///
152 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
153 /// where `n` is automatically guessed.
155 };
156
157} // namespace rerun::blueprint::archetypes
158
159namespace rerun {
160 /// \private
161 template <typename T>
162 struct AsComponents;
163
164 /// \private
165 template <>
166 struct AsComponents<blueprint::archetypes::DataframeQuery> {
167 /// Serialize all set component batches.
168 static Result<Collection<ComponentBatch>> as_batches(
170 );
171 };
172} // 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: The query for the dataframe view.
Definition dataframe_query.hpp:26
std::optional< ComponentBatch > timeline
The timeline for this query.
Definition dataframe_query.hpp:30
std::optional< ComponentBatch > select
Selected columns. If unset, all columns are selected.
Definition dataframe_query.hpp:44
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:94
static constexpr auto Descriptor_timeline
ComponentDescriptor for the timeline field.
Definition dataframe_query.hpp:51
DataframeQuery with_select(const rerun::blueprint::components::SelectedColumns &_select) &&
Selected columns. If unset, all columns are selected.
Definition dataframe_query.hpp:134
static constexpr auto Descriptor_filter_is_not_null
ComponentDescriptor for the filter_is_not_null field.
Definition dataframe_query.hpp:61
std::optional< ComponentBatch > filter_by_range
If provided, only rows whose timestamp is within this range will be shown.
Definition dataframe_query.hpp:35
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:104
static constexpr auto Descriptor_select
ComponentDescriptor for the select field.
Definition dataframe_query.hpp:71
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:124
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > apply_latest_at
Should empty cells be filled with latest-at queries?
Definition dataframe_query.hpp:41
static constexpr auto Descriptor_filter_by_range
ComponentDescriptor for the filter_by_range field.
Definition dataframe_query.hpp:56
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_apply_latest_at
ComponentDescriptor for the apply_latest_at field.
Definition dataframe_query.hpp:66
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:38
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition dataframe_query.hpp:48
static DataframeQuery update_fields()
Update only some specific fields of a DataframeQuery.
Definition dataframe_query.hpp:84
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:114
Component: Whether empty cells in a dataframe should be filled with a latest-at query.
Definition apply_latest_at.hpp:17
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:19