#ifndef OBJECT_INFO_HPP #define OBJECT_INFO_HPP #include "matador/object/basic_object_info.hpp" namespace matador::object { class repository_node; template class object_info final : public basic_object_info { public: using create_func = std::function()>; object_info(const std::shared_ptr& node, const std::vector &attributes, utils::identifier &&pk, const std::shared_ptr &ref_column, create_func&& creator) : basic_object_info(node, attributes, std::move(pk), ref_column) , creator_(std::move(creator)){ } object_info(const std::shared_ptr& node, const std::vector &attributes, create_func&& creator) : basic_object_info(node, attributes) , creator_(std::move(creator)){ } explicit object_info(const std::shared_ptr& node) : basic_object_info(node, {}) { } const Type &prototype() const { return prototype_; } std::unique_ptr create() const { return creator_(); } private: Type prototype_; create_func creator_{[]{ return std::make_unique(); }}; }; template using object_info_ref = std::reference_wrapper>; namespace detail { struct null_type {}; } using null_info = object_info; } #endif //OBJECT_INFO_HPP