30#include <clang/AST/RecursiveASTVisitor.h>
31#include <clang/Basic/SourceManager.h>
75 :
public clang::RecursiveASTVisitor<translation_unit_visitor>,
113 clang::ClassTemplateDecl *class_template_declaration);
116 clang::ClassTemplateSpecializationDecl *cls);
144 void add_class(std::unique_ptr<class_> &&c);
151 void add_enum(std::unique_ptr<enum_> &&e);
163 std::unique_ptr<common::model::template_element> element)
override;
165 std::unique_ptr<class_>
create_element(
const clang::NamedDecl *decl)
const;
169 const std::string &full_name,
eid_t templated_decl_id);
178 std::unique_ptr<clanguml::class_diagram::model::class_>
187 std::unique_ptr<clanguml::class_diagram::model::enum_>
189 const clang::EnumDecl *enm,
const clang::TypedefDecl *typedef_decl);
197 std::unique_ptr<clanguml::class_diagram::model::class_>
206 std::unique_ptr<clanguml::class_diagram::model::objc_interface>
215 std::unique_ptr<clanguml::class_diagram::model::objc_interface>
224 std::unique_ptr<clanguml::class_diagram::model::objc_interface>
232 std::unique_ptr<clanguml::class_diagram::model::concept_>
305 std::unique_ptr<clanguml::class_diagram::model::class_>
307 clang::ClassTemplateSpecializationDecl *cls);
315 const clang::ClassTemplateSpecializationDecl *cls,
class_ &c);
343 const class_ &c,
const std::string &method_name,
370 void process_field(
const clang::FieldDecl &field_declaration,
400 const std::set<std::string> &template_parameter_names = {});
431 const clang::QualType &type, found_relationships_t & ,
449 const found_relationships_t &relationships,
450 bool break_on_first_aggregation =
false);
462 clang::RecordDecl *cls,
class_ &c,
const namespace_ &ns);
514 const clang::ConceptSpecializationExpr *concept_specialization);
526 const clang::ConceptSpecializationExpr *concept_specialization,
527 const clang::ConceptDecl *cpt,
528 std::vector<std::string> &constrained_template_params,
529 size_t argument_index, std::string &type_name)
const;
553 template <
typename T>
555 namespace_ parent_ns,
const clang::RecordDecl *decl);
558 std::optional<eid_t> &parent_id_opt, namespace_ &parent_ns)
const;
562 std::map<eid_t, std::unique_ptr<clanguml::class_diagram::model::class_>>
568 std::optional<size_t> >>
571 std::map<const clang::EnumDecl *, const clang::TypedefDecl *>
586 class_ &c, namespace_ parent_ns,
const clang::RecordDecl *decl)
591 auto parent_class =
diagram().find<T>(parent_id);
594 const auto cls_name = decl->getNameAsString();
595 if (cls_name.empty()) {
598 const auto &[label, hint, access, destination_multiplicity] =
601 c.
set_name(parent_class.value().name() +
"##" +
602 fmt::format(
"({})", label));
604 std::string destination_multiplicity_str{};
605 if (destination_multiplicity.has_value()) {
606 destination_multiplicity_str =
607 std::to_string(*destination_multiplicity);
610 parent_class.value().add_relationship(
612 destination_multiplicity_str});
615 c.
set_name(parent_class.value().name() +
"##" +
616 fmt::format(
"(anonymous_{})", std::to_string(decl->getID())));
620 parent_class.value().name() +
"##" + decl->getNameAsString());
625 if (!(decl->getNameAsString().empty())) {