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 rerun::components {
13 /// **Component**: A 16-bit ID representing a type of semantic class.
14 struct ClassId {
16
17 public:
18 ClassId() = default;
19
20 ClassId(rerun::datatypes::ClassId id_) : id(id_) {}
21
22 ClassId& operator=(rerun::datatypes::ClassId id_) {
23 id = id_;
24 return *this;
25 }
26
27 ClassId(uint16_t id_) : id(id_) {}
28
29 ClassId& operator=(uint16_t id_) {
30 id = id_;
31 return *this;
32 }
33
34 /// Cast to the underlying ClassId datatype
35 operator rerun::datatypes::ClassId() const {
36 return id;
37 }
38 };
39} // namespace rerun::components
40
41namespace rerun {
42 static_assert(sizeof(rerun::datatypes::ClassId) == sizeof(components::ClassId));
43
44 /// \private
45 template <>
46 struct Loggable<components::ClassId> {
47 static constexpr const char Name[] = "rerun.components.ClassId";
48
49 /// Returns the arrow data type this type corresponds to.
50 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
51 return Loggable<rerun::datatypes::ClassId>::arrow_datatype();
52 }
53
54 /// Serializes an array of `rerun::components::ClassId` into an arrow array.
55 static Result<std::shared_ptr<arrow::Array>> to_arrow(
56 const components::ClassId* instances, size_t num_instances
57 ) {
58 return Loggable<rerun::datatypes::ClassId>::to_arrow(&instances->id, num_instances);
59 }
60 };
61} // namespace rerun
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:75
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:21
Component: A 16-bit ID representing a type of semantic class.
Definition class_id.hpp:14
Datatype: A 16-bit ID representing a type of semantic class.
Definition class_id.hpp:24