relation endpoint progress
This commit is contained in:
@@ -43,4 +43,56 @@ std::shared_ptr<attribute_definition> basic_object_info::reference_column() cons
|
||||
return pk_column_;
|
||||
}
|
||||
|
||||
void basic_object_info::register_relation_endpoint(const std::type_index &tindex, const relation_endpoint &endpoint) {
|
||||
relation_endpoints_.insert(std::make_pair(tindex, endpoint));
|
||||
}
|
||||
|
||||
void basic_object_info::unregister_relation_endpoint(const std::type_index &tindex) {
|
||||
relation_endpoints_.erase(tindex);
|
||||
}
|
||||
|
||||
basic_object_info::const_endpoint_iterator
|
||||
basic_object_info::find_relation_endpoint(const std::type_index &tindex) const {
|
||||
return relation_endpoints_.find(tindex);
|
||||
}
|
||||
|
||||
basic_object_info::endpoint_iterator basic_object_info::find_relation_endpoint(const std::type_index &tindex) {
|
||||
return relation_endpoints_.find(tindex);
|
||||
}
|
||||
|
||||
basic_object_info::const_endpoint_iterator basic_object_info::find_relation_endpoint(const std::string &field) const {
|
||||
return std::find_if(relation_endpoints_.begin(), relation_endpoints_.end(), [&field](const t_endpoint_map::value_type &value) {
|
||||
return value.second.field_name() == field;
|
||||
});
|
||||
}
|
||||
|
||||
basic_object_info::endpoint_iterator basic_object_info::find_relation_endpoint(const std::string &field) {
|
||||
return std::find_if(relation_endpoints_.begin(), relation_endpoints_.end(), [&field](const t_endpoint_map::value_type &value) {
|
||||
return value.second.field_name() == field;
|
||||
});
|
||||
}
|
||||
|
||||
basic_object_info::endpoint_iterator basic_object_info::endpoint_begin() {
|
||||
return relation_endpoints_.begin();
|
||||
}
|
||||
|
||||
basic_object_info::const_endpoint_iterator basic_object_info::endpoint_begin() const {
|
||||
return relation_endpoints_.begin();
|
||||
}
|
||||
|
||||
basic_object_info::endpoint_iterator basic_object_info::endpoint_end() {
|
||||
return relation_endpoints_.end();
|
||||
}
|
||||
|
||||
basic_object_info::const_endpoint_iterator basic_object_info::endpoint_end() const {
|
||||
return relation_endpoints_.end();
|
||||
}
|
||||
|
||||
std::size_t basic_object_info::endpoints_size() const {
|
||||
return relation_endpoints_.size();
|
||||
}
|
||||
|
||||
bool basic_object_info::endpoints_empty() const {
|
||||
return relation_endpoints_.empty();
|
||||
}
|
||||
} // namespace matador::object
|
||||
|
||||
Reference in New Issue
Block a user