Rerun C++ SDK
Loading...
Searching...
No Matches
uvec3d.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/datatypes/uvec3d.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../result.hpp"
8
9#include <array>
10#include <cstdint>
11#include <memory>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class FixedSizeListBuilder;
17} // namespace arrow
18
19namespace rerun::datatypes {
20 /// **Datatype**: A uint32 vector in 3D space.
21 struct UVec3D {
22 std::array<uint32_t, 3> xyz;
23
24 public: // START of extensions from uvec3d_ext.cpp:
25 /// Construct UVec3D from x/y/z values.
26 UVec3D(uint32_t x, uint32_t y, uint32_t z) : xyz{x, y, z} {}
27
28 /// Construct UVec3D from x/y/z uint32_t pointer.
29 explicit UVec3D(const uint32_t* xyz_) : xyz{xyz_[0], xyz_[1], xyz_[2]} {}
30
31 uint32_t x() const {
32 return xyz[0];
33 }
34
35 uint32_t y() const {
36 return xyz[1];
37 }
38
39 uint32_t z() const {
40 return xyz[2];
41 }
42
43 // END of extensions from uvec3d_ext.cpp, start of generated code:
44
45 public:
46 UVec3D() = default;
47
48 UVec3D(std::array<uint32_t, 3> xyz_) : xyz(xyz_) {}
49
50 UVec3D& operator=(std::array<uint32_t, 3> xyz_) {
51 xyz = xyz_;
52 return *this;
53 }
54 };
55} // namespace rerun::datatypes
56
57namespace rerun {
58 template <typename T>
59 struct Loggable;
60
61 /// \private
62 template <>
63 struct Loggable<datatypes::UVec3D> {
64 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.UVec3D";
65
66 /// Returns the arrow data type this type corresponds to.
67 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
68
69 /// Serializes an array of `rerun::datatypes::UVec3D` into an arrow array.
70 static Result<std::shared_ptr<arrow::Array>> to_arrow(
71 const datatypes::UVec3D* instances, size_t num_instances
72 );
73
74 /// Fills an arrow array builder with an array of this type.
75 static rerun::Error fill_arrow_array_builder(
76 arrow::FixedSizeListBuilder* builder, const datatypes::UVec3D* elements,
77 size_t num_elements
78 );
79 };
80} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:83
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Datatype: A uint32 vector in 3D space.
Definition uvec3d.hpp:21
UVec3D(const uint32_t *xyz_)
Construct UVec3D from x/y/z uint32_t pointer.
Definition uvec3d.hpp:29
UVec3D(uint32_t x, uint32_t y, uint32_t z)
Construct UVec3D from x/y/z values.
Definition uvec3d.hpp:26