// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
// Based on "crates/store/re_sdk_types/definitions/rerun/datatypes/utf8_pair.fbs".

#pragma once

#include "../result.hpp"
#include "utf8.hpp"

#include <cstdint>
#include <memory>

namespace arrow {
    class Array;
    class DataType;
    class StructBuilder;
} // namespace arrow

namespace rerun::datatypes {
    /// **Datatype**: Stores a tuple of UTF-8 strings.
    struct Utf8Pair {
        /// The first string.
        rerun::datatypes::Utf8 first;

        /// The second string.
        rerun::datatypes::Utf8 second;

      public: // START of extensions from utf8pair_ext.cpp:
        /// Creates a string pair.
        Utf8Pair(rerun::datatypes::Utf8 first_, rerun::datatypes::Utf8 second_)
            : first(std::move(first_)), second(std::move(second_)) {}

        // END of extensions from utf8pair_ext.cpp, start of generated code:

      public:
        Utf8Pair() = default;
    };
} // namespace rerun::datatypes

namespace rerun {
    template <typename T>
    struct Loggable;

    /// \private
    template <>
    struct Loggable<datatypes::Utf8Pair> {
        static constexpr std::string_view ComponentType = "rerun.datatypes.Utf8Pair";

        /// Returns the arrow data type this type corresponds to.
        static const std::shared_ptr<arrow::DataType>& arrow_datatype();

        /// Serializes an array of `rerun::datatypes::Utf8Pair` into an arrow array.
        static Result<std::shared_ptr<arrow::Array>> to_arrow(
            const datatypes::Utf8Pair* instances, size_t num_instances
        );

        /// Fills an arrow array builder with an array of this type.
        static rerun::Error fill_arrow_array_builder(
            arrow::StructBuilder* builder, const datatypes::Utf8Pair* elements, size_t num_elements
        );
    };
} // namespace rerun
