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_sdk_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 /// Transform frames may be derived from entity paths to refer to Rerun's implicit
18 /// entity path driven hierarchy which is defined via `archetypes::Transform3D`, `archetypes::Pinhole` etc..
19 /// These implicit transform frames look like `tf#path/to/entity`.
20 ///
21 /// Note that any `archetypes::Transform3D`s logged with both `parent_frame` and `child_frame` set
22 /// describes a relationship between these parent and child transform frames, **not** the transform frame
23 /// that the entity path may be using (defined by an `archetypes::CoordinateFrame`).
26
27 public: // START of extensions from transform_frame_id_ext.cpp:
28 TransformFrameId(std::string_view path_) : value(std::string(path_)) {}
29
30 TransformFrameId(const char* path_) : value(std::string(path_)) {}
31
32 // END of extensions from transform_frame_id_ext.cpp, start of generated code:
33
34 public:
35 TransformFrameId() = default;
36
37 TransformFrameId(rerun::datatypes::Utf8 value_) : value(std::move(value_)) {}
38
39 TransformFrameId& operator=(rerun::datatypes::Utf8 value_) {
40 value = std::move(value_);
41 return *this;
42 }
43
44 TransformFrameId(std::string value_) : value(std::move(value_)) {}
45
46 TransformFrameId& operator=(std::string value_) {
47 value = std::move(value_);
48 return *this;
49 }
50
51 /// Cast to the underlying Utf8 datatype
52 operator rerun::datatypes::Utf8() const {
53 return value;
54 }
55 };
56} // namespace rerun::components
57
58namespace rerun {
59 static_assert(sizeof(rerun::datatypes::Utf8) == sizeof(components::TransformFrameId));
60
61 /// \private
62 template <>
63 struct Loggable<components::TransformFrameId> {
64 static constexpr std::string_view ComponentType = "rerun.components.TransformFrameId";
65
66 /// Returns the arrow data type this type corresponds to.
67 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
68 return Loggable<rerun::datatypes::Utf8>::arrow_datatype();
69 }
70
71 /// Serializes an array of `rerun::components::TransformFrameId` into an arrow array.
72 static Result<std::shared_ptr<arrow::Array>> to_arrow(
73 const components::TransformFrameId* instances, size_t num_instances
74 ) {
75 if (num_instances == 0) {
76 return Loggable<rerun::datatypes::Utf8>::to_arrow(nullptr, 0);
77 } else if (instances == nullptr) {
78 return rerun::Error(
79 ErrorCode::UnexpectedNullArgument,
80 "Passed array instances is null when num_elements> 0."
81 );
82 } else {
83 return Loggable<rerun::datatypes::Utf8>::to_arrow(&instances->value, num_instances);
84 }
85 }
86 };
87} // 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:24
Datatype: A string of text, encoded as UTF-8.
Definition utf8.hpp:21