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