Fixed duplicate dependency relationships
This commit is contained in:
@@ -117,6 +117,13 @@ struct class_relationship {
|
|||||||
std::string cardinality_source;
|
std::string cardinality_source;
|
||||||
std::string cardinality_destination;
|
std::string cardinality_destination;
|
||||||
std::string label;
|
std::string label;
|
||||||
|
|
||||||
|
friend bool operator==(
|
||||||
|
const class_relationship &l, const class_relationship &r)
|
||||||
|
{
|
||||||
|
return l.type == r.type && l.destination == r.destination &&
|
||||||
|
l.label == r.label;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct class_template {
|
struct class_template {
|
||||||
@@ -140,6 +147,13 @@ public:
|
|||||||
std::vector<class_template> templates;
|
std::vector<class_template> templates;
|
||||||
std::string base_template_usr;
|
std::string base_template_usr;
|
||||||
|
|
||||||
|
void add_relationship(class_relationship &&cr)
|
||||||
|
{
|
||||||
|
auto it = std::find(relationships.begin(), relationships.end(), cr);
|
||||||
|
if (it == relationships.end())
|
||||||
|
relationships.emplace_back(std::move(cr));
|
||||||
|
}
|
||||||
|
|
||||||
std::string full_name(
|
std::string full_name(
|
||||||
const std::vector<std::string> &using_namespaces) const
|
const std::vector<std::string> &using_namespaces) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ static enum CXChildVisitResult method_parameter_visitor(
|
|||||||
|
|
||||||
assert(ctx->parent_class != nullptr);
|
assert(ctx->parent_class != nullptr);
|
||||||
|
|
||||||
ctx->parent_class->relationships.emplace_back(std::move(r));
|
ctx->parent_class->add_relationship(std::move(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = CXChildVisit_Continue;
|
ret = CXChildVisit_Continue;
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public:
|
|||||||
// TODO: int get_b(const B &b) { return b.b; }
|
// TODO: int get_b(const B &b) { return b.b; }
|
||||||
int get_c(C c) { return c.c; }
|
int get_c(C c) { return c.c; }
|
||||||
int get_d(D &&d) { return d.d; }
|
int get_d(D &&d) { return d.d; }
|
||||||
|
// Dependency relationship should be rendered only once
|
||||||
|
int get_d2(D &&d) { return d.d; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user