Rerun C++ SDK
Loading...
Searching...
No Matches
class_id.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/components/class_id.fbs".
3
4#pragma once
5
6#include "../datatypes/class_id.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace arrow {
13 /// \private
14 template <typename T>
15 class NumericBuilder;
16
17 class Array;
18 class DataType;
19 class UInt16Type;
20 using UInt16Builder = NumericBuilder<UInt16Type>;
21} // namespace arrow
22
23namespace rerun::components {
24 /// **Component**: A 16-bit ID representing a type of semantic class.
25 struct ClassId {
27
28 public:
29 ClassId() = default;
30
31 ClassId(rerun::datatypes::ClassId id_) : id(id_) {}
32
33 ClassId& operator=(rerun::datatypes::ClassId id_) {
34 id = id_;
35 return *this;
36 }
37
38 ClassId(uint16_t id_) : id(id_) {}
39
40 ClassId& operator=(uint16_t id_) {
41 id = id_;
42 return *this;
43 }
44
45 /// Cast to the underlying ClassId datatype
46 operator rerun::datatypes::ClassId() const {
47 return id;
48 }
49 };
50} // namespace rerun::components
51
52namespace rerun {
53 template <typename T>
54 struct Loggable;
55
56 /// \private
57 template <>
58 struct Loggable<components::ClassId> {
59 static constexpr const char Name[] = "rerun.components.ClassId";
60
61 /// Returns the arrow data type this type corresponds to.
62 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
63
64 /// Fills an arrow array builder with an array of this type.
65 static rerun::Error fill_arrow_array_builder(
66 arrow::UInt16Builder* builder, const components::ClassId* elements, size_t num_elements
67 );
68
69 /// Serializes an array of `rerun::components::ClassId` into an arrow array.
70 static Result<std::shared_ptr<arrow::Array>> to_arrow(
71 const components::ClassId* instances, size_t num_instances
72 );
73 };
74} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:69
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Component: A 16-bit ID representing a type of semantic class.
Definition class_id.hpp:25
Datatype: A 16-bit ID representing a type of semantic class.
Definition class_id.hpp:24