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 `archetypes::ViewContents`.
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.
25 ///
26 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27 ///
30
31 public:
32 QueryExpression() = default;
33
34 QueryExpression(rerun::datatypes::Utf8 filter_) : filter(std::move(filter_)) {}
35
36 QueryExpression& operator=(rerun::datatypes::Utf8 filter_) {
37 filter = std::move(filter_);
38 return *this;
39 }
40
41 QueryExpression(std::string value_) : filter(std::move(value_)) {}
42
43 QueryExpression& operator=(std::string value_) {
44 filter = std::move(value_);
45 return *this;
46 }
47
48 /// Cast to the underlying Utf8 datatype
49 operator rerun::datatypes::Utf8() const {
50 return filter;
51 }
52 };
53} // namespace rerun::blueprint::components
54
55namespace rerun {
56 static_assert(sizeof(rerun::datatypes::Utf8) == sizeof(blueprint::components::QueryExpression));
57
58 /// \private
59 template <>
60 struct Loggable<blueprint::components::QueryExpression> {
61 static constexpr std::string_view ComponentType =
62 "rerun.blueprint.components.QueryExpression";
63
64 /// Returns the arrow data type this type corresponds to.
65 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
67 }
68
69 /// Serializes an array of `rerun::blueprint:: components::QueryExpression` into an arrow array.
70 static Result<std::shared_ptr<arrow::Array>> to_arrow(
71 const blueprint::components::QueryExpression* instances, size_t num_instances
72 ) {
73 if (num_instances == 0) {
74 return Loggable<rerun::datatypes::Utf8>::to_arrow(nullptr, 0);
75 } else if (instances == nullptr) {
76 return rerun::Error(
77 ErrorCode::UnexpectedNullArgument,
78 "Passed array instances is null when num_elements> 0."
79 );
80 } else {
81 return Loggable<rerun::datatypes::Utf8>::to_arrow(
82 &instances->filter,
83 num_instances
84 );
85 }
86 }
87 };
88} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:99
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
A type of component that can be registered.
Definition component_type.hpp:19
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:28
Datatype: A string of text, encoded as UTF-8.
Definition utf8.hpp:21