Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_dimension.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/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:
29 // Extensions to generated type defined in 'tensor_dimension_ext.cpp'
30
31 /// Nameless dimension.
32 TensorDimension(size_t size_) : size(size_) {}
33
34 /// Dimension with name.
35 TensorDimension(size_t size_, std::string name_) : size(size_), name(std::move(name_)) {}
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 /// Fills an arrow array builder with an array of this type.
55 static rerun::Error fill_arrow_array_builder(
56 arrow::StructBuilder* builder, const datatypes::TensorDimension* elements,
57 size_t num_elements
58 );
59
60 /// Serializes an array of `rerun::datatypes::TensorDimension` into an arrow array.
61 static Result<std::shared_ptr<arrow::Array>> to_arrow(
62 const datatypes::TensorDimension* instances, size_t num_instances
63 );
64 };
65} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Datatype: A single dimension within a multi-dimensional tensor.
Definition tensor_dimension.hpp:21
TensorDimension(size_t size_)
Nameless dimension.
Definition tensor_dimension.hpp:32
TensorDimension(size_t size_, std::string name_)
Dimension with name.
Definition tensor_dimension.hpp:35
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