Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_width_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/components/tensor_dimension_selection.fbs".
3
4#pragma once
5
6#include "../datatypes/tensor_dimension_selection.hpp"
7#include "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11
12namespace rerun::components {
13 /// **Component**: Specifies which dimension to use for width.
16
17 public:
18 TensorWidthDimension() = default;
19
21 : dimension(dimension_) {}
22
24 dimension = dimension_;
25 return *this;
26 }
27
28 /// Cast to the underlying TensorDimensionSelection datatype
30 return dimension;
31 }
32 };
33} // namespace rerun::components
34
35namespace rerun {
36 static_assert(
38 sizeof(components::TensorWidthDimension)
39 );
40
41 /// \private
42 template <>
43 struct Loggable<components::TensorWidthDimension> {
44 static constexpr const char Name[] = "rerun.components.TensorWidthDimension";
45
46 /// Returns the arrow data type this type corresponds to.
47 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
48 return Loggable<rerun::datatypes::TensorDimensionSelection>::arrow_datatype();
49 }
50
51 /// Serializes an array of `rerun::components::TensorWidthDimension` into an arrow array.
52 static Result<std::shared_ptr<arrow::Array>> to_arrow(
53 const components::TensorWidthDimension* instances, size_t num_instances
54 ) {
55 if (num_instances == 0) {
56 return Loggable<rerun::datatypes::TensorDimensionSelection>::to_arrow(nullptr, 0);
57 } else if (instances == nullptr) {
58 return rerun::Error(
59 ErrorCode::UnexpectedNullArgument,
60 "Passed array instances is null when num_elements> 0."
61 );
62 } else {
63 return Loggable<rerun::datatypes::TensorDimensionSelection>::to_arrow(
64 &instances->dimension,
65 num_instances
66 );
67 }
68 }
69 };
70} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Component: Specifies which dimension to use for width.
Definition tensor_width_dimension.hpp:14
Datatype: Selection of a single tensor dimension.
Definition tensor_dimension_selection.hpp:19