// 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/blueprint/archetypes/time_range_table_order.fbs".

#pragma once

#include "../../blueprint/components/sort_key.hpp"
#include "../../blueprint/components/sort_order.hpp"
#include "../../collection.hpp"
#include "../../compiler_utils.hpp"
#include "../../component_batch.hpp"
#include "../../indicator_component.hpp"
#include "../../result.hpp"

#include <cstdint>
#include <optional>
#include <utility>
#include <vector>

namespace rerun::blueprint::archetypes {
    /// **Archetype**: Ordering of the time range table of the dataframe view
    struct TimeRangeTableOrder {
        /// The primary sort key
        std::optional<rerun::blueprint::components::SortKey> sort_key;

        /// The sort order
        std::optional<rerun::blueprint::components::SortOrder> sort_order;

      public:
        static constexpr const char IndicatorComponentName[] =
            "rerun.blueprint.components.TimeRangeTableOrderIndicator";

        /// Indicator component, used to identify the archetype when converting to a list of components.
        using IndicatorComponent = rerun::components::IndicatorComponent<IndicatorComponentName>;

      public:
        TimeRangeTableOrder() = default;
        TimeRangeTableOrder(TimeRangeTableOrder&& other) = default;

        /// The primary sort key
        TimeRangeTableOrder with_sort_key(rerun::blueprint::components::SortKey _sort_key) && {
            sort_key = std::move(_sort_key);
            // See: https://github.com/rerun-io/rerun/issues/4027
            RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
        }

        /// The sort order
        TimeRangeTableOrder with_sort_order(rerun::blueprint::components::SortOrder _sort_order
        ) && {
            sort_order = std::move(_sort_order);
            // See: https://github.com/rerun-io/rerun/issues/4027
            RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
        }
    };

} // namespace rerun::blueprint::archetypes

namespace rerun {
    /// \private
    template <typename T>
    struct AsComponents;

    /// \private
    template <>
    struct AsComponents<blueprint::archetypes::TimeRangeTableOrder> {
        /// Serialize all set component batches.
        static Result<std::vector<ComponentBatch>> serialize(
            const blueprint::archetypes::TimeRangeTableOrder& archetype
        );
    };
} // namespace rerun
