Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_dimension.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/tensor_dimension.fbs".
3
4#pragma once
5
6#include "../component_descriptor.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11#include <optional>
12#include <string>
13
14namespace arrow {
15 class Array;
16 class DataType;
17 class StructBuilder;
18} // namespace arrow
19
20namespace rerun::datatypes {
21 /// **Datatype**: A single dimension within a multi-dimensional tensor.
23 /// The length of this dimension.
24 uint64_t size;
25
26 /// The name of this dimension, e.g. "width", "height", "channel", "batch', ….
27 std::optional<std::string> name;
28
29 public: // START of extensions from tensor_dimension_ext.cpp:
30 /// Nameless dimension.
31 TensorDimension(size_t size_) : size(size_) {}
32
33 /// Dimension with name.
34 TensorDimension(size_t size_, std::string name_) : size(size_), name(std::move(name_)) {}
35
36 // END of extensions from tensor_dimension_ext.cpp, start of generated code:
37
38 public:
39 TensorDimension() = default;
40 };
41} // namespace rerun::datatypes
42
43namespace rerun {
44 template <typename T>
45 struct Loggable;
46
47 /// \private
48 template <>
49 struct Loggable<datatypes::TensorDimension> {
50 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.TensorDimension";
51
52 /// Returns the arrow data type this type corresponds to.
53 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
54
55 /// Serializes an array of `rerun::datatypes::TensorDimension` into an arrow array.
56 static Result<std::shared_ptr<arrow::Array>> to_arrow(
57 const datatypes::TensorDimension* instances, size_t num_instances
58 );
59
60 /// Fills an arrow array builder with an array of this type.
61 static rerun::Error fill_arrow_array_builder(
62 arrow::StructBuilder* builder, const datatypes::TensorDimension* elements,
63 size_t num_elements
64 );
65 };
66} // 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 single dimension within a multi-dimensional tensor.
Definition tensor_dimension.hpp:22
TensorDimension(size_t size_)
Nameless dimension.
Definition tensor_dimension.hpp:31
TensorDimension(size_t size_, std::string name_)
Dimension with name.
Definition tensor_dimension.hpp:34
uint64_t size
The length of this dimension.
Definition tensor_dimension.hpp:24
std::optional< std::string > name
The name of this dimension, e.g. "width", "height", "channel", "batch', ….
Definition tensor_dimension.hpp:27