removed name member from restriction and changed attribute member to a reference
This commit is contained in:
@@ -4,32 +4,16 @@
|
||||
#include "matador/object/object.hpp"
|
||||
|
||||
namespace matador::object {
|
||||
restriction::restriction(std::string name)
|
||||
: name_(std::move(name)) {}
|
||||
restriction::restriction(const class attribute& attr)
|
||||
: attr_(attr) {}
|
||||
|
||||
std::string restriction::name() const {
|
||||
return type_string() + name_;
|
||||
}
|
||||
|
||||
const class attribute* restriction::attribute() const {
|
||||
if (std::holds_alternative<class attribute*>(attr_)) {
|
||||
return std::get<class attribute*>(attr_);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
const class attribute& restriction::attribute() const {
|
||||
return attr_;
|
||||
}
|
||||
|
||||
std::string restriction::column_name() const {
|
||||
if (std::holds_alternative<class attribute*>(attr_)) {
|
||||
return std::get<class attribute*>(attr_)->name();
|
||||
}
|
||||
if (std::holds_alternative<std::string>(attr_)) {
|
||||
return std::get<std::string>(attr_);
|
||||
}
|
||||
|
||||
return "";
|
||||
return attr_.name();
|
||||
}
|
||||
|
||||
std::shared_ptr<object> restriction::owner() const {
|
||||
return owner_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user