collection_resolver progress

This commit is contained in:
Sascha Kühl
2026-01-27 16:31:37 +01:00
parent b6cabbe3ed
commit 6205ae81c9
20 changed files with 294 additions and 134 deletions
+8 -17
View File
@@ -1,30 +1,21 @@
#ifndef MATADOR_COLLECTION_RESOLVER_HPP
#define MATADOR_COLLECTION_RESOLVER_HPP
#include "matador/object/abstract_type_resolver.hpp"
#include "matador/object/object_ptr.hpp"
#include "matador/object/abstract_collection_resolver.hpp"
#include <typeindex>
#include <vector>
namespace matador::utils {
class identifier;
}
namespace matador::object {
class abstract_collection_resolver {
public:
virtual ~abstract_collection_resolver() = default;
[[nodiscard]] const std::type_index& type() const { return type_; }
protected:
explicit abstract_collection_resolver(const std::type_index& ti) : type_(ti) {}
public:
const std::type_index type_;
};
template<typename Type>
class collection_resolver : public abstract_type_resolver {
class collection_resolver : public abstract_collection_resolver {
public:
collection_resolver() : abstract_type_resolver(typeid(std::vector<Type>)) {}
collection_resolver(const std::type_index& root_type, std::string collection_name)
: abstract_collection_resolver(root_type, typeid(Type), std::move(collection_name)) {}
virtual std::vector<Type> resolve(const utils::identifier& id) = 0;
};