Rerun C++ SDK
Loading...
Searching...
No Matches
transform_frame_id.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/components/transform_frame_id.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::components {
15 /// **Component**: A string identifier for a transform frame.
16 ///
17 /// **Experimental:** Transform frames are still in early development!
18 ///
19 /// Transform frames may be derived from entity paths to refer to Rerun's implicit
20 /// entity path driven hierarchy which is defined via `archetypes::Transform3D`, `archetypes::Pinhole` etc..
21 /// Note that any transform logged at an entity path describes a relationship between the two transform
22 /// frames represented by that entity path and its parent path,
23 /// **not** the transform frame that the entity path may be using.
24 ///
25 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
26 ///
29
30 public: // START of extensions from transform_frame_id_ext.cpp:
31 TransformFrameId(std::string_view path_) : value(std::string(path_)) {}
32
33 TransformFrameId(const char* path_) : value(std::string(path_)) {}
34
35 // END of extensions from transform_frame_id_ext.cpp, start of generated code:
36
37 public:
38 TransformFrameId() = default;
39
40 TransformFrameId(rerun::datatypes::Utf8 value_) : value(std::move(value_)) {}
41
42 TransformFrameId& operator=(rerun::datatypes::Utf8 value_) {
43 value = std::move(value_);
44 return *this;
45 }
46
47 TransformFrameId(std::string value_) : value(std::move(value_)) {}
48
49 TransformFrameId& operator=(std::string value_) {
50 value = std::move(value_);
51 return *this;
52 }
53
54 /// Cast to the underlying Utf8 datatype
55 operator rerun::datatypes::Utf8() const {
56 return value;
57 }
58 };
59} // namespace rerun::components
60
61namespace rerun {
62 static_assert(sizeof(rerun::datatypes::Utf8) == sizeof(components::TransformFrameId));
63
64 /// \private
65 template <>
66 struct Loggable<components::TransformFrameId> {
67 static constexpr std::string_view ComponentType = "rerun.components.TransformFrameId";
68
69 /// Returns the arrow data type this type corresponds to.
70 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
71 return Loggable<rerun::datatypes::Utf8>::arrow_datatype();
72 }
73
74 /// Serializes an array of `rerun::components::TransformFrameId` into an arrow array.
75 static Result<std::shared_ptr<arrow::Array>> to_arrow(
76 const components::TransformFrameId* instances, size_t num_instances
77 ) {
78 if (num_instances == 0) {
79 return Loggable<rerun::datatypes::Utf8>::to_arrow(nullptr, 0);
80 } else if (instances == nullptr) {
81 return rerun::Error(
82 ErrorCode::UnexpectedNullArgument,
83 "Passed array instances is null when num_elements> 0."
84 );
85 } else {
86 return Loggable<rerun::datatypes::Utf8>::to_arrow(&instances->value, num_instances);
87 }
88 }
89 };
90} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:103
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: A string identifier for a transform frame.
Definition transform_frame_id.hpp:27
Datatype: A string of text, encoded as UTF-8.
Definition utf8.hpp:21