Rerun C++ SDK
Loading...
Searching...
No Matches
query_expression.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/components/query_expression.fbs".
3
4#pragma once
5
6#include "../../datatypes/utf8.hpp"
7#include "../../result.hpp"
8
9#include <cstdint>
10#include <memory>
11#include <string>
12#include <utility>
13
14namespace rerun::blueprint::components {
15 /// **Component**: An individual query expression used to filter a set of `datatypes::EntityPath`s.
16 ///
17 /// Each expression is either an inclusion or an exclusion expression.
18 /// Inclusions start with an optional `+` and exclusions must start with a `-`.
19 ///
20 /// Multiple expressions are combined together as part of `SpaceViewContents`.
21 ///
22 /// The `/**` suffix matches the whole subtree, i.e. self and any child, recursively
23 /// (`/world/**` matches both `/world` and `/world/car/driver`).
24 /// Other uses of `*` are not (yet) supported.
27
28 public:
29 QueryExpression() = default;
30
31 QueryExpression(rerun::datatypes::Utf8 filter_) : filter(std::move(filter_)) {}
32
33 QueryExpression& operator=(rerun::datatypes::Utf8 filter_) {
34 filter = std::move(filter_);
35 return *this;
36 }
37
38 QueryExpression(std::string value_) : filter(std::move(value_)) {}
39
40 QueryExpression& operator=(std::string value_) {
41 filter = std::move(value_);
42 return *this;
43 }
44
45 /// Cast to the underlying Utf8 datatype
46 operator rerun::datatypes::Utf8() const {
47 return filter;
48 }
49 };
50} // namespace rerun::blueprint::components
51
52namespace rerun {
53 static_assert(sizeof(rerun::datatypes::Utf8) == sizeof(blueprint::components::QueryExpression));
54
55 /// \private
56 template <>
57 struct Loggable<blueprint::components::QueryExpression> {
58 static constexpr const char Name[] = "rerun.blueprint.components.QueryExpression";
59
60 /// Returns the arrow data type this type corresponds to.
61 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
63 }
64
65 /// Serializes an array of `rerun::blueprint:: components::QueryExpression` into an arrow array.
66 static Result<std::shared_ptr<arrow::Array>> to_arrow(
67 const blueprint::components::QueryExpression* instances, size_t num_instances
68 ) {
69 if (num_instances == 0) {
70 return Loggable<rerun::datatypes::Utf8>::to_arrow(nullptr, 0);
71 } else if (instances == nullptr) {
72 return rerun::Error(
73 ErrorCode::UnexpectedNullArgument,
74 "Passed array instances is null when num_elements> 0."
75 );
76 } else {
77 return Loggable<rerun::datatypes::Utf8>::to_arrow(
78 &instances->filter,
79 num_instances
80 );
81 }
82 }
83 };
84} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Component: An individual query expression used to filter a set of datatypes::EntityPaths.
Definition query_expression.hpp:25
Datatype: A string of text, encoded as UTF-8.
Definition utf8.hpp:21