object generation progress
This commit is contained in:
@@ -32,14 +32,10 @@ std::string basic_object_info::name() const {
|
||||
return node_->name();
|
||||
}
|
||||
|
||||
const std::vector<attribute>& basic_object_info::attributes() const {
|
||||
const std::list<attribute>& basic_object_info::attributes() const {
|
||||
return object_->attributes();
|
||||
}
|
||||
|
||||
// std::shared_ptr<attribute> basic_object_info::reference_column() const {
|
||||
// return pk_as_fk_column_;
|
||||
// }
|
||||
|
||||
bool basic_object_info::has_primary_key() const {
|
||||
return object_->has_primary_key();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
namespace matador::object {
|
||||
constraints_generator::constraints_generator(std::vector<class constraint> &constraints, const repository& repo, object &obj)
|
||||
constraints_generator::constraints_generator(std::list<class constraint> &constraints, const repository& repo, object &obj)
|
||||
: constraints_(constraints)
|
||||
, repo_(repo)
|
||||
, obj_(obj) {}
|
||||
@@ -46,7 +46,7 @@ void constraints_generator::create_unique_constraint(const std::string& name) co
|
||||
pk_constraint.owner_ = &obj_;
|
||||
}
|
||||
|
||||
std::vector<attribute>::iterator constraints_generator::find_attribute_by_name(const std::string& name) const {
|
||||
std::list<attribute>::iterator constraints_generator::find_attribute_by_name(const std::string& name) const {
|
||||
return std::find_if(std::begin(obj_.attributes_), std::end(obj_.attributes_), [&name](const attribute& elem) {
|
||||
return elem.name() == name;
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ size_t object::attribute_count() const {
|
||||
return attributes_.size();
|
||||
}
|
||||
|
||||
const std::vector<attribute>& object::attributes() const {
|
||||
const std::list<attribute>& object::attributes() const {
|
||||
return attributes_;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ size_t object::constraint_count() const {
|
||||
return constraints_.size();
|
||||
}
|
||||
|
||||
const std::vector<class constraint>& object::constraints() const {
|
||||
const std::list<class constraint>& object::constraints() const {
|
||||
return constraints_;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "matador/object/repository.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace matador::object {
|
||||
object_generator::object_generator( const repository& repo, std::unique_ptr<object>&& object )
|
||||
: repo_(repo)
|
||||
@@ -47,7 +49,7 @@ void object_generator::create_unique_constraint(const std::string& name) const {
|
||||
pk_constraint.owner_ = object_.get();
|
||||
}
|
||||
|
||||
std::vector<attribute>::iterator object_generator::find_attribute_by_name(const std::string& name) const {
|
||||
std::list<attribute>::iterator object_generator::find_attribute_by_name(const std::string& name) const {
|
||||
return std::find_if(std::begin(object_->attributes_), std::end(object_->attributes_), [&name](const attribute& elem) {
|
||||
return elem.name() == name;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user