#pragma once

#include <functional>
#include <string>
#include <vector>

#include "application/contracts/DiagnosticsUiTypes.h"

namespace ta::application::diagnostics
{
    class DiagnosticsRegistry final
    {
    public:
        using Contributor = std::function<void(ta::ui::DiagnosticsSnapshot&)>;

        void add(std::string name, Contributor contributor);
        [[nodiscard]] ta::ui::DiagnosticsSnapshot capture() const;

    private:
        struct Entry final
        {
            std::string name;
            Contributor contributor;
        };

        std::vector<Entry> entries_;
    };
}
