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

#pragma once

#include "../result.hpp"
#include "uint16.hpp"
#include "uint64.hpp"

#include <cstdint>
#include <memory>

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

namespace rerun::datatypes {
    /// **Datatype**: A pair representing a channel ID and its associated message count.
    struct ChannelCountPair {
        /// The channel ID.
        rerun::datatypes::UInt16 channel_id;

        /// The message count for this channel.
        rerun::datatypes::UInt64 message_count;

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

namespace rerun {
    template <typename T>
    struct Loggable;

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

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

        /// Serializes an array of `rerun::datatypes::ChannelCountPair` into an arrow array.
        static Result<std::shared_ptr<arrow::Array>> to_arrow(
            const datatypes::ChannelCountPair* 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::ChannelCountPair* elements,
            size_t num_elements
        );
    };
} // namespace rerun
