Rerun C++ SDK
Loading...
Searching...
No Matches
blob.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/blob.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../component_descriptor.hpp"
8#include "../result.hpp"
9
10#include <cstdint>
11#include <memory>
12#include <utility>
13
14namespace arrow {
15 class Array;
16 class DataType;
17 class ListBuilder;
18} // namespace arrow
19
20namespace rerun::datatypes {
21 /// **Datatype**: A binary blob of data.
22 struct Blob {
24
25 public: // START of extensions from blob_ext.cpp:
26 /// Number of bytes
27 size_t size() const {
28 return data.size();
29 }
30
31 // END of extensions from blob_ext.cpp, start of generated code:
32
33 public:
34 Blob() = default;
35
36 Blob(rerun::Collection<uint8_t> data_) : data(std::move(data_)) {}
37
38 Blob& operator=(rerun::Collection<uint8_t> data_) {
39 data = std::move(data_);
40 return *this;
41 }
42 };
43} // namespace rerun::datatypes
44
45namespace rerun {
46 template <typename T>
47 struct Loggable;
48
49 /// \private
50 template <>
51 struct Loggable<datatypes::Blob> {
52 static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.Blob";
53
54 /// Returns the arrow data type this type corresponds to.
55 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
56
57 /// Serializes an array of `rerun::datatypes::Blob` into an arrow array.
58 static Result<std::shared_ptr<arrow::Array>> to_arrow(
59 const datatypes::Blob* instances, size_t num_instances
60 );
61
62 /// Fills an arrow array builder with an array of this type.
63 static rerun::Error fill_arrow_array_builder(
64 arrow::ListBuilder* builder, const datatypes::Blob* elements, size_t num_elements
65 );
66 };
67} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
size_t size() const
Returns the number of instances in this collection.
Definition collection.hpp:291
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:83
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Datatype: A binary blob of data.
Definition blob.hpp:22
size_t size() const
Number of bytes.
Definition blob.hpp:27