This commit is contained in:
ZY4N
2024-12-22 16:58:40 +01:00
parent 2704814de2
commit db8db8f9d7
161 changed files with 17102 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#pragma once
#include <optional>
#include <tuple>
#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
#include "util/uix.hpp"
#include "util/string_lookup.hpp"
#include "util/id_type.hpp"
#include "util/result.hpp"
template<typename C, class... Loaders>
class base_dynamic_loader
{
public:
using loader_id_type = ztu::id_type_for<base_dynamic_loader, ztu::u32>;
explicit base_dynamic_loader(C enabled_components);
[[nodiscard]] std::optional<loader_id_type> find_loader(std::string_view name);
[[nodiscard]] static consteval std::optional<loader_id_type> find_loader_static(std::string_view name);
template<loader_id_type ID>
auto& get_loader();
protected:
template<typename F>
ztu::result<dynamic_point_cloud_store::id_type> invoke_with_matching_loader(loader_id_type loader_id, F&& f);
std::tuple<Loaders...> m_loaders{};
ztu::string_lookup<loader_id_type> m_loader_id_lookup{};
C m_enabled_components{ 0 };
};
#define INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION
#include "assets/dynamic_data_loaders/generic/base_dynamic_loader.ipp"
#undef INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION