#include "gpr_processor.hpp"

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <numeric>
#include <queue>
#include <stdexcept>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

namespace radar::processing {
namespace {

// Algorithm bodies stay private to this translation unit; the public processor remains a small dispatcher.
#include "gpr_backprojection_processor.ipp"
#include "gpr_legacy_processor.ipp"

}  // namespace

auto GprProcessor::name() const -> std::string {
    return "gpr";
}

auto GprProcessor::process_collection(
    const config::RunConfig& run_config,
    const ipc::PreprocessedCollection& collection,
    std::span<const ipc::PreprocessedCollection> previous_collections,
    const ProcessingLiveConfig& live_config
) -> ipc::ResultCollection {
    return process_backprojection_gpr(run_config, collection, previous_collections, live_config);
}

auto LegacyGprProcessor::name() const -> std::string {
    return "legacy_gpr";
}

auto LegacyGprProcessor::process_collection(
    const config::RunConfig& run_config,
    const ipc::PreprocessedCollection& collection,
    std::span<const ipc::PreprocessedCollection> previous_collections,
    const ProcessingLiveConfig& live_config
) -> ipc::ResultCollection {
    return process_legacy_gpr(run_config, collection, previous_collections, live_config);
}

}  // namespace radar::processing
