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 "../result.hpp"
8
9#include <cstdint>
10#include <memory>
11#include <utility>
12
13namespace arrow {
14 class Array;
15 class DataType;
16 class ListBuilder;
17} // namespace arrow
18
19namespace rerun::datatypes {
20 /// **Datatype**: A binary blob of data.
21 struct Blob {
23
24 public: // START of extensions from blob_ext.cpp:
25 /// Number of bytes
26 size_t size() const {
27 return data.size();
28 }
29
30 // END of extensions from blob_ext.cpp, start of generated code:
31
32 public:
33 Blob() = default;
34
35 Blob(rerun::Collection<uint8_t> data_) : data(std::move(data_)) {}
36
37 Blob& operator=(rerun::Collection<uint8_t> data_) {
38 data = std::move(data_);
39 return *this;
40 }
41 };
42} // namespace rerun::datatypes
43
44namespace rerun {
45 template <typename T>
46 struct Loggable;
47
48 /// \private
49 template <>
50 struct Loggable<datatypes::Blob> {
51 static constexpr const char Name[] = "rerun.datatypes.Blob";
52
53 /// Returns the arrow data type this type corresponds to.
54 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
55
56 /// Serializes an array of `rerun::datatypes::Blob` into an arrow array.
57 static Result<std::shared_ptr<arrow::Array>> to_arrow(
58 const datatypes::Blob* instances, size_t num_instances
59 );
60
61 /// Fills an arrow array builder with an array of this type.
62 static rerun::Error fill_arrow_array_builder(
63 arrow::ListBuilder* builder, const datatypes::Blob* elements, size_t num_elements
64 );
65 };
66} // 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:275
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:91
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:78
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Datatype: A binary blob of data.
Definition blob.hpp:21
size_t size() const
Number of bytes.
Definition blob.hpp:26