relation endpoint progress
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#define BASIC_PROTOTYPE_INFO_HPP
|
||||
|
||||
#include "matador/object/object_definition.hpp"
|
||||
#include "matador/object/relation_endpoint.hpp"
|
||||
|
||||
#include "matador/utils/identifier.hpp"
|
||||
|
||||
#include <string>
|
||||
@@ -13,6 +15,10 @@ class schema_node;
|
||||
|
||||
class basic_object_info {
|
||||
public:
|
||||
using t_endpoint_map = std::unordered_map<std::type_index, relation_endpoint>;
|
||||
using endpoint_iterator = t_endpoint_map::iterator;
|
||||
using const_endpoint_iterator = t_endpoint_map::const_iterator;
|
||||
|
||||
virtual ~basic_object_info() = default;
|
||||
|
||||
[[nodiscard]] std::type_index type_index() const;
|
||||
@@ -20,6 +26,24 @@ public:
|
||||
[[nodiscard]] const object_definition& definition() const;
|
||||
[[nodiscard]] std::shared_ptr<attribute_definition> reference_column() const;
|
||||
|
||||
void register_relation_endpoint(const std::type_index &tindex, const relation_endpoint &endpoint);
|
||||
void unregister_relation_endpoint(const std::type_index &tindex);
|
||||
|
||||
const_endpoint_iterator find_relation_endpoint(const std::type_index &tindex) const;
|
||||
endpoint_iterator find_relation_endpoint(const std::type_index &tindex);
|
||||
|
||||
const_endpoint_iterator find_relation_endpoint(const std::string &field) const;
|
||||
endpoint_iterator find_relation_endpoint(const std::string &field);
|
||||
|
||||
endpoint_iterator endpoint_begin();
|
||||
const_endpoint_iterator endpoint_begin() const;
|
||||
|
||||
endpoint_iterator endpoint_end();
|
||||
const_endpoint_iterator endpoint_end() const;
|
||||
|
||||
std::size_t endpoints_size() const;
|
||||
bool endpoints_empty() const;
|
||||
|
||||
protected:
|
||||
basic_object_info(std::shared_ptr<schema_node> node, std::type_index type_index, utils::identifier &&pk, std::shared_ptr<attribute_definition> &&pk_column, object_definition &&definition);
|
||||
basic_object_info(std::shared_ptr<schema_node> node, std::type_index type_index, utils::identifier &&pk, std::shared_ptr<attribute_definition> &&pk_column);
|
||||
@@ -30,6 +54,7 @@ protected:
|
||||
object_definition definition_;
|
||||
std::optional<utils::identifier> identifier_;
|
||||
std::shared_ptr<attribute_definition> pk_column_;
|
||||
t_endpoint_map relation_endpoints_;
|
||||
};
|
||||
|
||||
using basic_object_info_ref = std::reference_wrapper<const basic_object_info>;
|
||||
|
||||
Reference in New Issue
Block a user