Rerun C++ SDK
Loading...
Searching...
No Matches
sort_by.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/build/re_type_definitions/rerun/blueprint/components/sort_by.def.rs".
3
4#pragma once
5
6#include "../../blueprint/encodings/sort_by.hpp"
7#include "../../result.hpp"
8
9#include <cstdint>
10#include <memory>
11#include <utility>
12
13namespace rerun::blueprint::components {
14 /// **Component**: The column and direction a table's rows are sorted by.
15 ///
16 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
17 ///
18 struct SortBy {
20
21 public:
22 SortBy() = default;
23
24 SortBy(rerun::blueprint::encodings::SortBy sort_by_) : sort_by(std::move(sort_by_)) {}
25
26 SortBy& operator=(rerun::blueprint::encodings::SortBy sort_by_) {
27 sort_by = std::move(sort_by_);
28 return *this;
29 }
30
31 /// Cast to the underlying SortBy encoding
33 return sort_by;
34 }
35 };
36} // namespace rerun::blueprint::components
37
38namespace rerun {
39 static_assert(
41 );
42
43 /// \private
44 template <>
45 struct Loggable<blueprint::components::SortBy> {
46 static constexpr std::string_view ComponentType = "rerun.blueprint.components.SortBy";
47
48 /// Returns the arrow data type this type corresponds to.
49 static const std::shared_ptr<arrow::DataType>& arrow_data_type() {
51 }
52
53 /// Serializes an array of `rerun::blueprint:: components::SortBy` into an arrow array.
54 static Result<std::shared_ptr<arrow::Array>> to_arrow(
55 const blueprint::components::SortBy* instances, size_t num_instances
56 ) {
57 if (num_instances == 0) {
58 return Loggable<rerun::blueprint::encodings::SortBy>::to_arrow(nullptr, 0);
59 } else if (instances == nullptr) {
60 return rerun::Error(
61 ErrorCode::UnexpectedNullArgument,
62 "Passed array instances is null when num_elements> 0."
63 );
64 } else {
65 return Loggable<rerun::blueprint::encodings::SortBy>::to_arrow(
66 &instances->sort_by,
67 num_instances
68 );
69 }
70 }
71 };
72} // namespace rerun
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:104
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
A type of component that can be registered.
Definition component_type.hpp:19
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Component: The column and direction a table's rows are sorted by.
Definition sort_by.hpp:18
Encoding: The column and direction a table's rows are sorted by.
Definition sort_by.hpp:25