relation_completer progress

This commit is contained in:
Sascha Kühl
2025-07-01 17:13:52 +02:00
parent 5a7ab5d4d0
commit 38cbffc18b
11 changed files with 153 additions and 32 deletions
+18 -6
View File
@@ -10,21 +10,33 @@ class schema_node;
template<typename Type>
class object_info final : public basic_object_info {
public:
explicit object_info(const std::shared_ptr<schema_node>& node,
std::shared_ptr<attribute_definition> &&ref_column)
using create_func = std::function<std::unique_ptr<Type>()>;
object_info(const std::shared_ptr<schema_node>& node,
std::shared_ptr<attribute_definition> &&ref_column)
: basic_object_info(node, typeid(Type), {}, std::move(ref_column), {}) {
}
explicit object_info(const std::shared_ptr<schema_node>& node,
utils::identifier &&pk,
std::shared_ptr<attribute_definition> &&ref_column,
object_definition &&definition)
object_info(const std::shared_ptr<schema_node>& node,
utils::identifier &&pk,
std::shared_ptr<attribute_definition> &&ref_column,
object_definition &&definition)
: basic_object_info(node, typeid(Type), std::move(pk), std::move(ref_column), std::move(definition)) {
}
object_info(const std::shared_ptr<schema_node>& node,
utils::identifier &&pk,
std::shared_ptr<attribute_definition> &&ref_column,
object_definition &&definition,
create_func&& creator)
: basic_object_info(node, typeid(Type), std::move(pk), std::move(ref_column), std::move(definition))
, creator_(std::move(creator)){
}
const Type &prototype() const { return prototype_; }
std::unique_ptr<Type> create() const { return creator_(); }
private:
Type prototype_;
create_func creator_{[]{ return std::make_unique<Type>(); }};
};
template<typename Type>