Adding template specialization handling
This commit is contained in:
@@ -97,6 +97,17 @@ void tu_visitor::operator()(const cppast::cpp_entity &file)
|
||||
ctx.namespace_.pop_back();
|
||||
}
|
||||
}
|
||||
else if (e.kind() ==
|
||||
cppast::cpp_entity_kind::class_template_specialization_t) {
|
||||
LOG_DBG("========== Visiting '{}' - {}",
|
||||
cx::util::full_name(ctx.namespace_, e),
|
||||
cppast::to_string(e.kind()));
|
||||
|
||||
auto &tspec = static_cast<
|
||||
const cppast::cpp_class_template_specialization &>(e);
|
||||
|
||||
process_class_declaration(tspec.class_(), tspec);
|
||||
}
|
||||
else if (e.kind() == cppast::cpp_entity_kind::class_t) {
|
||||
LOG_DBG("========== Visiting '{}' - {}",
|
||||
cx::util::full_name(ctx.namespace_, e),
|
||||
@@ -112,6 +123,7 @@ void tu_visitor::operator()(const cppast::cpp_entity &file)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx.config.should_include(
|
||||
cx::util::fully_prefixed(ctx.namespace_, cls)))
|
||||
process_class_declaration(cls);
|
||||
@@ -204,7 +216,8 @@ void tu_visitor::process_enum_declaration(const cppast::cpp_enum &enm)
|
||||
ctx.d.add_enum(std::move(e));
|
||||
}
|
||||
|
||||
void tu_visitor::process_class_declaration(const cppast::cpp_class &cls)
|
||||
void tu_visitor::process_class_declaration(const cppast::cpp_class &cls,
|
||||
type_safe::optional_ref<const cppast::cpp_template_specialization> tspec)
|
||||
{
|
||||
class_ c;
|
||||
c.is_struct = cls.class_kind() == cppast::cpp_class_kind::struct_t;
|
||||
@@ -344,6 +357,10 @@ void tu_visitor::process_class_declaration(const cppast::cpp_class &cls)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_WARN("Class {} is templated but it's scope {} is not :-|",
|
||||
cls.name(), scope.name());
|
||||
}
|
||||
}
|
||||
|
||||
// Find if class is contained in another class
|
||||
|
||||
@@ -149,7 +149,9 @@ public:
|
||||
|
||||
void operator()(const cppast::cpp_entity &file);
|
||||
|
||||
void process_class_declaration(const cppast::cpp_class &cls);
|
||||
void process_class_declaration(const cppast::cpp_class &cls,
|
||||
type_safe::optional_ref<const cppast::cpp_template_specialization>
|
||||
tspec = nullptr);
|
||||
|
||||
void process_enum_declaration(const cppast::cpp_enum &enm);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace clanguml {
|
||||
namespace t00016 {
|
||||
|
||||
template <typename> struct is_numeric {
|
||||
template <typename T> struct is_numeric {
|
||||
enum { value = false };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user