Rerun C++ SDK
Loading...
Searching...
No Matches
view_origin.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/view_origin.fbs".
3
4#pragma once
5
6#include "../../component_descriptor.hpp"
7#include "../../datatypes/entity_path.hpp"
8#include "../../result.hpp"
9
10#include <cstdint>
11#include <memory>
12#include <string>
13#include <utility>
14
15namespace rerun::blueprint::components {
16 /// **Component**: The origin of a view.
17 ///
18 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
19 ///
20 struct ViewOrigin {
22
23 public:
24 ViewOrigin() = default;
25
26 ViewOrigin(rerun::datatypes::EntityPath value_) : value(std::move(value_)) {}
27
28 ViewOrigin& operator=(rerun::datatypes::EntityPath value_) {
29 value = std::move(value_);
30 return *this;
31 }
32
33 ViewOrigin(std::string path_) : value(std::move(path_)) {}
34
35 ViewOrigin& operator=(std::string path_) {
36 value = std::move(path_);
37 return *this;
38 }
39
40 /// Cast to the underlying EntityPath datatype
42 return value;
43 }
44 };
45} // namespace rerun::blueprint::components
46
47namespace rerun {
48 static_assert(
50 );
51
52 /// \private
53 template <>
54 struct Loggable<blueprint::components::ViewOrigin> {
55 static constexpr ComponentDescriptor Descriptor = "rerun.blueprint.components.ViewOrigin";
56
57 /// Returns the arrow data type this type corresponds to.
58 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
60 }
61
62 /// Serializes an array of `rerun::blueprint:: components::ViewOrigin` into an arrow array.
63 static Result<std::shared_ptr<arrow::Array>> to_arrow(
64 const blueprint::components::ViewOrigin* instances, size_t num_instances
65 ) {
66 if (num_instances == 0) {
67 return Loggable<rerun::datatypes::EntityPath>::to_arrow(nullptr, 0);
68 } else if (instances == nullptr) {
69 return rerun::Error(
70 ErrorCode::UnexpectedNullArgument,
71 "Passed array instances is null when num_elements> 0."
72 );
73 } else {
74 return Loggable<rerun::datatypes::EntityPath>::to_arrow(
75 &instances->value,
76 num_instances
77 );
78 }
79 }
80 };
81} // 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 ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:14
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Component: The origin of a view.
Definition view_origin.hpp:20
Datatype: A path to an entity in the ChunkStore.
Definition entity_path.hpp:22