collection resolver progress
This commit is contained in:
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
// Eager
|
||||
collection_proxy(std::weak_ptr<collection_resolver<Type>> resolver, std::vector<Type> items)
|
||||
: items_(std::move(items)), resolver_(std::move(resolver)) {}
|
||||
: loaded_{true}, items_(std::move(items)), resolver_(std::move(resolver)) {}
|
||||
|
||||
// Transient
|
||||
explicit collection_proxy(std::vector<Type> items)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MATADOR_COLLECTION_UTILS_HPP
|
||||
#define MATADOR_COLLECTION_UTILS_HPP
|
||||
|
||||
#include <string>
|
||||
#include <typeindex>
|
||||
|
||||
namespace matador::object {
|
||||
struct collection_composite_key {
|
||||
std::type_index root_type;
|
||||
std::type_index type;
|
||||
std::string name;
|
||||
|
||||
bool operator==(const collection_composite_key& other) const;
|
||||
};
|
||||
|
||||
struct collection_composite_key_hash {
|
||||
std::size_t operator()(const collection_composite_key& k) const noexcept;
|
||||
};
|
||||
}
|
||||
#endif //MATADOR_COLLECTION_UTILS_HPP
|
||||
@@ -62,7 +62,7 @@ protected:
|
||||
object::repository repo_;
|
||||
std::unordered_map<std::type_index, schema_node> schema_nodes_;
|
||||
std::unordered_map<std::type_index, std::unique_ptr<sql::object_resolver_producer>> resolver_producers_;
|
||||
std::unordered_map<sql::composite_key, std::unique_ptr<sql::collection_resolver_producer>, sql::composite_key_hash> collection_resolver_producers_;
|
||||
std::unordered_map<object::collection_composite_key, std::unique_ptr<sql::collection_resolver_producer>, object::collection_composite_key_hash> collection_resolver_producers_;
|
||||
};
|
||||
}
|
||||
#endif //MATADOR_BASIC_SCHEMA_HPP
|
||||
@@ -15,15 +15,20 @@ namespace matador::query {
|
||||
template<typename Type>
|
||||
class query_collection_resolver : public object::collection_resolver<Type> {
|
||||
public:
|
||||
explicit query_collection_resolver(sql::statement &&stmt, const std::type_index& root_type, std::string join_column)
|
||||
explicit query_collection_resolver(sql::statement &&stmt,
|
||||
const std::type_index& root_type,
|
||||
std::string join_column,
|
||||
const std::shared_ptr<object::object_resolver<typename Type::value_type>> &resolver)
|
||||
: object::collection_resolver<Type>(root_type, join_column)
|
||||
, stmt_(std::move(stmt))
|
||||
, resolver_(resolver)
|
||||
{}
|
||||
|
||||
std::vector<Type> resolve(const utils::identifier &id) override;
|
||||
protected:
|
||||
sql::statement stmt_;
|
||||
std::type_index index{typeid(Type)};
|
||||
std::shared_ptr<object::object_resolver<typename Type::value_type>> resolver_;
|
||||
};
|
||||
|
||||
struct value_to_identifier{
|
||||
@@ -76,7 +81,7 @@ std::vector<Type> query_collection_resolver<Type>::resolve(const utils::identifi
|
||||
}
|
||||
identifier_creator creator;
|
||||
r.at(0).process(creator);
|
||||
const auto op = std::make_shared<object::object_proxy<typename Type::value_type>>(std::shared_ptr<object::object_resolver<typename Type::value_type>>{}, creator.visitor.id_);
|
||||
const auto op = std::make_shared<object::object_proxy<typename Type::value_type>>(resolver_, creator.visitor.id_);
|
||||
out.emplace_back(op);
|
||||
}
|
||||
return out;
|
||||
|
||||
@@ -18,27 +18,6 @@ class executor;
|
||||
}
|
||||
|
||||
namespace matador::query {
|
||||
|
||||
template<typename Type>
|
||||
class query_object_resolver_producer : public sql::object_resolver_producer {
|
||||
public:
|
||||
query_object_resolver_producer() = default;
|
||||
query_object_resolver_producer(const basic_schema& repo, const table& tab, std::string pk_name)
|
||||
: object_resolver_producer(typeid(Type))
|
||||
, repo_(repo)
|
||||
, table_(tab)
|
||||
, pk_name_(std::move(pk_name)) {}
|
||||
|
||||
std::shared_ptr<object::abstract_type_resolver> produce(sql::executor &exec) override {
|
||||
return std::make_shared<query_object_resolver<Type>>(repo_, exec, table_, std::move(pk_name_));
|
||||
}
|
||||
|
||||
private:
|
||||
const basic_schema& repo_;
|
||||
const table& table_;
|
||||
std::string pk_name_;
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
class query_collection_resolver_producer : public sql::collection_resolver_producer {
|
||||
public:
|
||||
@@ -53,6 +32,7 @@ public:
|
||||
std::shared_ptr<object::abstract_collection_resolver> produce(sql::executor &exec) override {
|
||||
const auto *pk_column = table_[pk_name_];
|
||||
const auto *join_column = table_[collection_name()];
|
||||
const auto object_resolver = exec.resolver()->object_resolver<typename Type::value_type>();
|
||||
|
||||
auto stmt = query::select({*pk_column})
|
||||
.from(table_)
|
||||
@@ -63,7 +43,7 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
return std::make_shared<query_collection_resolver<Type>>(stmt.release(), root_type(), collection_name());
|
||||
return std::make_shared<query_collection_resolver<Type>>(stmt.release(), root_type(), collection_name(), object_resolver);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -72,6 +52,82 @@ private:
|
||||
std::string pk_name_;
|
||||
};
|
||||
|
||||
class producer_creator final {
|
||||
public:
|
||||
producer_creator(basic_schema& schema, const std::type_index& root_type)
|
||||
: schema_(schema)
|
||||
, root_type_(root_type)
|
||||
{}
|
||||
|
||||
template<typename ValueType>
|
||||
static void on_primary_key(const char * /*id*/, ValueType &/*value*/, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
template<class Type>
|
||||
static void on_attribute(const char * /*id*/, Type &/*value*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
template<class Pointer>
|
||||
static void on_belongs_to(const char * /*id*/, Pointer & /*x*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class Pointer>
|
||||
static void on_has_one(const char * /*id*/, Pointer & /*x*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *, ContainerType &, const char * /*join_column*/, const char * /*inverse_join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *, ContainerType &, const utils::foreign_attributes &/*attr*/) {}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &/*cont*/, const char *join_column, const utils::foreign_attributes &/*attr*/, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
const auto it = schema_.find(typeid(typename CollectionType::value_type::value_type));
|
||||
if (it == schema_.end()) {
|
||||
throw query_builder_exception{query_build_error::UnknownType};
|
||||
}
|
||||
if (!it->second.node().info().has_primary_key()) {
|
||||
throw query_builder_exception{query_build_error::MissingPrimaryKey};
|
||||
}
|
||||
|
||||
auto producer = std::make_unique<query_collection_resolver_producer<typename CollectionType::value_type>>(
|
||||
schema_,
|
||||
it->second.table(),
|
||||
it->second.node().info().primary_key_attribute()->name(),
|
||||
root_type_,
|
||||
join_column);
|
||||
const object::collection_composite_key key{root_type_, typeid(typename CollectionType::value_type), join_column};
|
||||
schema_.collection_resolver_producers_[key] = std::move(producer);
|
||||
}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &/*cont*/, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
basic_schema& schema_;
|
||||
const std::type_index root_type_;
|
||||
};
|
||||
|
||||
|
||||
template<typename Type>
|
||||
class query_object_resolver_producer : public sql::object_resolver_producer {
|
||||
public:
|
||||
query_object_resolver_producer() = default;
|
||||
query_object_resolver_producer(basic_schema& repo, const table& tab, std::string pk_name)
|
||||
: object_resolver_producer(typeid(Type))
|
||||
, repo_(repo)
|
||||
, table_(tab)
|
||||
, pk_name_(std::move(pk_name)) {}
|
||||
|
||||
std::shared_ptr<object::abstract_type_resolver> produce(sql::executor &exec) override {
|
||||
producer_creator pc(repo_, typeid(Type));
|
||||
Type obj;
|
||||
access::process(pc, obj);
|
||||
|
||||
return std::make_shared<query_object_resolver<Type>>(repo_, exec, table_, std::move(pk_name_));
|
||||
}
|
||||
|
||||
private:
|
||||
basic_schema& repo_;
|
||||
const table& table_;
|
||||
std::string pk_name_;
|
||||
};
|
||||
|
||||
class schema;
|
||||
|
||||
using schema_ref = std::reference_wrapper<schema>;
|
||||
@@ -180,57 +236,6 @@ utils::result<void, utils::error> schema::drop_table(const sql::connection &conn
|
||||
return utils::failure(info.err());
|
||||
}
|
||||
|
||||
class producer_creator final {
|
||||
public:
|
||||
producer_creator(basic_schema& schema, const std::type_index& root_type)
|
||||
: schema_(schema)
|
||||
, root_type_(root_type)
|
||||
{}
|
||||
|
||||
template<typename ValueType>
|
||||
static void on_primary_key(const char * /*id*/, ValueType &/*value*/, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
template<class Type>
|
||||
static void on_attribute(const char * /*id*/, Type &/*value*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
template<class Pointer>
|
||||
static void on_belongs_to(const char * /*id*/, Pointer & /*x*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class Pointer>
|
||||
static void on_has_one(const char * /*id*/, Pointer & /*x*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *, ContainerType &, const char * /*join_column*/, const char * /*inverse_join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *, ContainerType &, const utils::foreign_attributes &/*attr*/) {}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &/*cont*/, const char *join_column, const utils::foreign_attributes &/*attr*/, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
const auto it = schema_.find(typeid(typename CollectionType::value_type::value_type));
|
||||
if (it == schema_.end()) {
|
||||
throw query_builder_exception{query_build_error::UnknownType};
|
||||
}
|
||||
if (!it->second.node().info().has_primary_key()) {
|
||||
throw query_builder_exception{query_build_error::MissingPrimaryKey};
|
||||
}
|
||||
|
||||
auto producer = std::make_unique<query_collection_resolver_producer<typename CollectionType::value_type>>(
|
||||
schema_,
|
||||
it->second.table(),
|
||||
it->second.node().info().primary_key_attribute()->name(),
|
||||
root_type_,
|
||||
join_column);
|
||||
const sql::composite_key key{root_type_, typeid(typename CollectionType::value_type), join_column};
|
||||
schema_.collection_resolver_producers_[key] = std::move(producer);
|
||||
}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &/*cont*/, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
basic_schema& schema_;
|
||||
const std::type_index root_type_;
|
||||
};
|
||||
|
||||
template <typename Type>
|
||||
void schema_observer<Type>::on_attach(const object::repository_node &node, const Type &/*prototype*/) const {
|
||||
const auto it = schema_.insert_table(typeid(Type), node);
|
||||
@@ -241,11 +246,6 @@ void schema_observer<Type>::on_attach(const object::repository_node &node, const
|
||||
|
||||
auto producer = std::make_unique<query_object_resolver_producer<Type>>(schema_, it->second.table(), it->second.node().info().primary_key_attribute()->name());
|
||||
schema_.resolver_producers_[typeid(Type)] = std::move(producer);
|
||||
|
||||
producer_creator pc(schema_, typeid(Type));
|
||||
Type obj;
|
||||
access::process(pc, obj);
|
||||
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
void on_has_many(const char * /*id*/, CollectionType &, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
}
|
||||
|
||||
template<class ContainerType>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <typeindex>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace matador::utils {
|
||||
class value;
|
||||
@@ -63,9 +64,9 @@ public:
|
||||
template<class ContainerType>
|
||||
static void on_has_many(const char * /*id*/, ContainerType &, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *id, ContainerType &c, const char * /*join_column*/, const char * /*inverse_join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
static void on_has_many_to_many(const char * /*id*/, ContainerType &c, const char * /*join_column*/, const char * /*inverse_join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many_to_many(const char *id, ContainerType &c, const utils::foreign_attributes &/*attr*/) {}
|
||||
static void on_has_many_to_many(const char * /*id*/, ContainerType &c, const utils::foreign_attributes &/*attr*/) {}
|
||||
|
||||
private:
|
||||
size_t column_index_{};
|
||||
@@ -126,32 +127,10 @@ public:
|
||||
}
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
using value_type = typename CollectionType::value_type::value_type;
|
||||
auto object_resolver = resolver_->object_resolver<value_type>();
|
||||
auto resolver = resolver_->collection_resolver<typename CollectionType::value_type>(result_type_, join_column);
|
||||
|
||||
std::vector<typename CollectionType::value_type> objects;
|
||||
if (attr.fetch() == utils::fetch_type::Lazy) {
|
||||
cont.reset(std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, current_pk_));
|
||||
} else {
|
||||
const auto ti = std::type_index(typeid(value_type));
|
||||
auto obj = std::make_shared<typename CollectionType::value_type::value_type>();
|
||||
type_stack_.push(ti);
|
||||
access::process(*this, *obj);
|
||||
type_stack_.pop();
|
||||
auto ptr = typename CollectionType::value_type(std::make_shared<object::object_proxy<value_type>>(object_resolver, obj));
|
||||
const auto pk = ptr.primary_key();
|
||||
if (ptr.primary_key().is_valid()) {
|
||||
cont.push_back(ptr);
|
||||
}
|
||||
}
|
||||
// auto cp = std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, objects);
|
||||
// cont.reset();
|
||||
}
|
||||
void on_has_many(const char * /*id*/, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr);
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
void on_has_many(const char * /*id*/, CollectionType &, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
@@ -164,38 +143,8 @@ public:
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
bool fetch(Type &obj) {
|
||||
bool first = true;
|
||||
do {
|
||||
if (auto fetched = reader_->fetch(); !fetched.is_ok() || !*fetched) {
|
||||
return !first;
|
||||
}
|
||||
last_pk_ = current_pk_;
|
||||
current_pk_ = discover_current_primary_key(obj);
|
||||
if (pk_has_changed()) {
|
||||
reader_->unshift();
|
||||
last_pk_.clear();
|
||||
current_pk_.clear();
|
||||
break;
|
||||
}
|
||||
first = false;
|
||||
type_stack_.emplace(typeid(Type));
|
||||
column_index_ = reader_->start_column_index();
|
||||
access::process(*this, obj);
|
||||
type_stack_.pop();
|
||||
} while (last_pk_ == current_pk_);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fetch(record &rec) {
|
||||
if (auto fetched = reader_->fetch(); !fetched.is_ok() || !*fetched) {
|
||||
return false;
|
||||
}
|
||||
|
||||
column_index_ = reader_->start_column_index();
|
||||
access::process(*this, rec);
|
||||
return true;
|
||||
}
|
||||
bool fetch(Type &obj);
|
||||
bool fetch(record &rec);
|
||||
|
||||
[[nodiscard]] const std::vector<object::attribute> &prototype() const;
|
||||
|
||||
@@ -234,8 +183,59 @@ protected:
|
||||
std::stack<std::type_index> type_stack_;
|
||||
utils::identifier current_pk_{};
|
||||
utils::identifier last_pk_{};
|
||||
std::unordered_set<object::collection_composite_key, object::collection_composite_key_hash> initialized_collections_;
|
||||
};
|
||||
|
||||
template<class CollectionType>
|
||||
void query_result_impl::on_has_many(const char *, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> *) {
|
||||
using value_type = typename CollectionType::value_type::value_type;
|
||||
auto object_resolver = resolver_->object_resolver<value_type>();
|
||||
auto resolver = resolver_->collection_resolver<typename CollectionType::value_type>(result_type_, join_column);
|
||||
|
||||
if (attr.fetch() == utils::fetch_type::Lazy) {
|
||||
cont.reset(std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, current_pk_));
|
||||
} else {
|
||||
if (initialized_collections_.insert({result_type_, typeid(typename CollectionType::value_type), std::string{join_column}}).second) {
|
||||
cont.reset(std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, std::vector<typename CollectionType::value_type>()));
|
||||
}
|
||||
|
||||
const auto ti = std::type_index(typeid(value_type));
|
||||
type_stack_.push(ti);
|
||||
auto obj = std::make_shared<typename CollectionType::value_type::value_type>();
|
||||
access::process(*this, *obj);
|
||||
type_stack_.pop();
|
||||
auto ptr = typename CollectionType::value_type(std::make_shared<object::object_proxy<value_type>>(object_resolver, obj));
|
||||
const auto pk = ptr.primary_key();
|
||||
if (ptr.primary_key().is_valid()) {
|
||||
cont.push_back(ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
bool query_result_impl::fetch(Type &obj) {
|
||||
bool first = true;
|
||||
do {
|
||||
if (auto fetched = reader_->fetch(); !fetched.is_ok() || !*fetched) {
|
||||
return !first;
|
||||
}
|
||||
last_pk_ = current_pk_;
|
||||
current_pk_ = discover_current_primary_key(obj);
|
||||
if (pk_has_changed()) {
|
||||
reader_->unshift();
|
||||
last_pk_.clear();
|
||||
current_pk_.clear();
|
||||
break;
|
||||
}
|
||||
first = false;
|
||||
type_stack_.emplace(typeid(Type));
|
||||
column_index_ = reader_->start_column_index();
|
||||
access::process(*this, obj);
|
||||
type_stack_.pop();
|
||||
} while (last_pk_ == current_pk_);
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
template<typename ValueType>
|
||||
void pk_reader::on_primary_key(const char *id, ValueType &value, const utils::primary_key_attribute& attr) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "matador/object/abstract_collection_resolver.hpp"
|
||||
#include "matador/object/object_resolver_factory.hpp"
|
||||
#include "matador/object/collection_resolver_factory.hpp"
|
||||
#include "matador/object/collection_utils.hpp"
|
||||
|
||||
namespace matador::sql {
|
||||
class executor;
|
||||
@@ -19,33 +20,6 @@ private:
|
||||
std::unordered_map<std::type_index, std::shared_ptr<object::abstract_type_resolver>> resolvers_;
|
||||
};
|
||||
|
||||
struct composite_key {
|
||||
std::type_index root_type;
|
||||
std::type_index type;
|
||||
std::string name;
|
||||
|
||||
bool operator==(const composite_key& other) const {
|
||||
return root_type == other.root_type &&
|
||||
type == other.type &&
|
||||
name == other.name;
|
||||
}
|
||||
};
|
||||
|
||||
struct composite_key_hash {
|
||||
std::size_t operator()(const composite_key& k) const noexcept {
|
||||
const std::size_t h1 = std::hash<std::type_index>{}(k.root_type);
|
||||
const std::size_t h2 = std::hash<std::type_index>{}(k.type);
|
||||
const std::size_t h3 = std::hash<std::string>{}(k.name);
|
||||
|
||||
// Klassische Hash-Kombination (Boost-Style)
|
||||
std::size_t seed = h1;
|
||||
seed ^= h2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||
seed ^= h3 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||
|
||||
return seed;
|
||||
}
|
||||
};
|
||||
|
||||
class producer_collection_resolver_factory : public object::collection_resolver_factory {
|
||||
public:
|
||||
[[nodiscard]] std::shared_ptr<object::abstract_collection_resolver> acquire_collection_resolver(const std::type_index& root_type,
|
||||
@@ -54,7 +28,7 @@ public:
|
||||
void register_collection_resolver(std::shared_ptr<object::abstract_collection_resolver>&& resolver) override;
|
||||
|
||||
private:
|
||||
std::unordered_map<composite_key, std::shared_ptr<object::abstract_collection_resolver>, composite_key_hash> resolvers_;
|
||||
std::unordered_map<object::collection_composite_key, std::shared_ptr<object::abstract_collection_resolver>, object::collection_composite_key_hash> resolvers_;
|
||||
};
|
||||
}
|
||||
#endif //MATADOR_RESOLVER_FACTORY_HPP
|
||||
Reference in New Issue
Block a user