removed name member from restriction and changed attribute member to a reference

This commit is contained in:
Sascha Kühl
2025-12-11 09:26:35 +01:00
parent f842efb611
commit 571cfd52ae
4 changed files with 25 additions and 50 deletions
+3 -6
View File
@@ -17,11 +17,9 @@ class object;
class restriction {
public:
restriction() = default;
explicit restriction(std::string name);
explicit restriction(const class attribute& attr);
[[nodiscard]] std::string name() const;
[[nodiscard]] const class attribute* attribute() const;
[[nodiscard]] const class attribute& attribute() const;
[[nodiscard]] std::string column_name() const;
[[nodiscard]] std::shared_ptr<object> owner() const;
[[nodiscard]] bool is_primary_key_constraint() const;
@@ -39,8 +37,7 @@ private:
friend class object_generator;
friend class object;
std::string name_;
std::variant<class attribute*, std::string> attr_;
const class attribute& attr_;
std::shared_ptr<object> owner_;
std::shared_ptr<object> reference_;
utils::constraints options_{utils::constraints::None};