query/include/matador/object/collection_resolver_factory...

21 lines
699 B
C++

#ifndef MATADOR_CONTAINER_RESOLVER_FACTORY_HPP
#define MATADOR_CONTAINER_RESOLVER_FACTORY_HPP
#include "matador/object/abstract_type_resolver_factory.hpp"
#include "matador/object/collection_resolver.hpp"
namespace matador::object {
class collection_resolver_factory : public abstract_type_resolver_factory {
public:
template<class Type>
std::shared_ptr<collection_resolver<Type>> resolver() {
const auto res = acquire_resolver(typeid(std::vector<object_ptr<Type>>));
if (!res) {
return std::dynamic_pointer_cast<collection_resolver<Type>>(res);
}
return std::dynamic_pointer_cast<collection_resolver<Type>>(res);
}
};
}
#endif //MATADOR_CONTAINER_RESOLVER_FACTORY_HPP