Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_dimension_index_selection.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 "../component_descriptor.hpp"
7#include "../datatypes/tensor_dimension_index_selection.hpp"
8#include "../result.hpp"
9
10#include <cstdint>
11#include <memory>
12
13namespace rerun::components {
14 /// **Component**: Specifies a concrete index on a tensor dimension.
17
18 public:
20
22 : selection(selection_) {}
23
26 ) {
27 selection = selection_;
28 return *this;
29 }
30
31 /// Cast to the underlying TensorDimensionIndexSelection datatype
33 return selection;
34 }
35 };
36} // namespace rerun::components
37
38namespace rerun {
39 static_assert(
41 sizeof(components::TensorDimensionIndexSelection)
42 );
43
44 /// \private
45 template <>
46 struct Loggable<components::TensorDimensionIndexSelection> {
47 static constexpr ComponentDescriptor Descriptor =
48 "rerun.components.TensorDimensionIndexSelection";
49
50 /// Returns the arrow data type this type corresponds to.
51 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
52 return Loggable<rerun::datatypes::TensorDimensionIndexSelection>::arrow_datatype();
53 }
54
55 /// Serializes an array of `rerun::components::TensorDimensionIndexSelection` into an arrow array.
56 static Result<std::shared_ptr<arrow::Array>> to_arrow(
57 const components::TensorDimensionIndexSelection* instances, size_t num_instances
58 ) {
59 if (num_instances == 0) {
60 return Loggable<rerun::datatypes::TensorDimensionIndexSelection>::to_arrow(
61 nullptr,
62 0
63 );
64 } else if (instances == nullptr) {
65 return rerun::Error(
66 ErrorCode::UnexpectedNullArgument,
67 "Passed array instances is null when num_elements> 0."
68 );
69 } else {
70 return Loggable<rerun::datatypes::TensorDimensionIndexSelection>::to_arrow(
71 &instances->selection,
72 num_instances
73 );
74 }
75 }
76 };
77} // 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:80
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: Specifies a concrete index on a tensor dimension.
Definition tensor_dimension_index_selection.hpp:15
Datatype: Indexing a specific tensor dimension.
Definition tensor_dimension_index_selection.hpp:22