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