attaching schema nodes progress

This commit is contained in:
Sascha Kühl
2025-07-15 16:04:43 +02:00
parent dd737623f4
commit a0bfa3261b
11 changed files with 147 additions and 100 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ const utils::identifier& basic_object_info::primary_key() const {
return identifier_.value();
}
void basic_object_info::register_relation_endpoint(const std::type_index &type, const std::shared_ptr<relation_endpoint> &endpoint) {
relation_endpoints_.insert(std::make_pair(type, endpoint));
basic_object_info::endpoint_iterator basic_object_info::register_relation_endpoint(const std::type_index &type, const std::shared_ptr<relation_endpoint> &endpoint) {
return relation_endpoints_.insert(std::make_pair(type, endpoint)).first;
}
void basic_object_info::unregister_relation_endpoint(const std::type_index &type) {
@@ -19,6 +19,10 @@ utils::result<shadow_schema::node_ptr, utils::error> shadow_schema::find_node( c
return schema_.find_node(type_index);
}
utils::result<shadow_schema::node_ptr, utils::error> shadow_schema::find_node( const std::string& name ) const {
return schema_.find_node(name);
}
utils::result<shadow_schema::node_ptr, utils::error> shadow_schema::attach_node( const std::shared_ptr<schema_node>& node ) const {
return schema_.attach_node(node, "");
}
+3 -3
View File
@@ -64,11 +64,11 @@ utils::result<std::shared_ptr<attribute_definition>, utils::error> schema::refer
void schema::dump(std::ostream &os) const {
for (const auto &node : *this) {
os << "node [" << node->name() << "] (" << node->type_index().name() << ")\n";
os << "node [" << node->name() << "] (" /*<< node->type_index().name()*/ << ")\n";
for (auto it = node->info().endpoint_begin(); it != node->info().endpoint_end(); ++it) {
os << " " << /*node.name() << "::" <<*/ it->second->field_name() << " (" << it->second->type_name() << ")";
os << " " /*<< node->name() << "::"*/ << it->second->field_name() << " (" << it->second->type_name() << ")";
if (it->second->foreign_endpoint()) {
os << " <---> " << it->second->foreign_endpoint()->node().name() << "::" << it->second->foreign_endpoint()->field_name() << " (" << it->second->foreign_endpoint()->type_name() << ")\n";
os << " <---> " << it->second->node().name() << "::" << it->second->foreign_endpoint()->field_name() << " (" << it->second->foreign_endpoint()->type_name() << ")\n";
} else {
os << "\n";
}