added collection, collection proxy and collection resolver implementations
This commit is contained in:
@@ -1,33 +1,18 @@
|
||||
#ifndef MATADOR_OBJECT_LOADER_HPP
|
||||
#define MATADOR_OBJECT_LOADER_HPP
|
||||
|
||||
#include "matador/object/abstract_type_resolver.hpp"
|
||||
#include <memory>
|
||||
#include <typeindex>
|
||||
|
||||
namespace matador::utils {
|
||||
class identifier;
|
||||
}
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
class abstract_object_resolver {
|
||||
public:
|
||||
virtual ~abstract_object_resolver() = default;
|
||||
|
||||
[[nodiscard]] const std::type_index& type() const { return type_; }
|
||||
|
||||
protected:
|
||||
explicit abstract_object_resolver(const std::type_index& ti) : type_(ti) {}
|
||||
|
||||
public:
|
||||
const std::type_index type_;
|
||||
};
|
||||
|
||||
|
||||
template<typename Type>
|
||||
class object_resolver : public abstract_object_resolver {
|
||||
class object_resolver : public abstract_type_resolver {
|
||||
public:
|
||||
object_resolver() : abstract_object_resolver(typeid(Type)) {}
|
||||
object_resolver() : abstract_type_resolver(typeid(Type)) {}
|
||||
|
||||
virtual std::shared_ptr<Type> resolve(const utils::identifier& id) = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user