Added thread pool to parallelize diagram generation
This commit is contained in:
@@ -90,8 +90,8 @@ void generator<C, D>::generate_config_layout_hints(std::ostream &ostr) const
|
||||
ostr << hint_str.str();
|
||||
}
|
||||
catch (clanguml::error::uml_alias_missing &e) {
|
||||
LOG_ERROR("=== Skipping layout hint from {} to {} due "
|
||||
"to: {}",
|
||||
LOG_DBG("=== Skipping layout hint from {} to {} due "
|
||||
"to: {}",
|
||||
entity, hint.entity, e.what());
|
||||
}
|
||||
}
|
||||
@@ -133,8 +133,8 @@ void generator<C, D>::generate_notes(
|
||||
|
||||
template <typename DiagramModel, typename DiagramConfig,
|
||||
typename DiagramVisitor>
|
||||
DiagramModel generate(cppast::libclang_compilation_database &db,
|
||||
const std::string &name, DiagramConfig &diagram)
|
||||
DiagramModel generate(const cppast::libclang_compilation_database &db,
|
||||
const std::string &name, DiagramConfig &diagram, bool verbose = false)
|
||||
{
|
||||
LOG_INFO("Generating diagram {}.puml", name);
|
||||
DiagramModel d;
|
||||
@@ -151,8 +151,10 @@ DiagramModel generate(cppast::libclang_compilation_database &db,
|
||||
}
|
||||
|
||||
cppast::cpp_entity_index idx;
|
||||
auto logger =
|
||||
verbose ? cppast::default_logger() : cppast::default_quiet_logger();
|
||||
cppast::simple_file_parser<cppast::libclang_parser> parser{
|
||||
type_safe::ref(idx)};
|
||||
type_safe::ref(idx), std::move(logger)};
|
||||
|
||||
// Process all matching translation units
|
||||
DiagramVisitor ctx(idx, d, diagram);
|
||||
|
||||
@@ -37,15 +37,15 @@ std::string element::alias() const { return fmt::format("C_{:010}", m_id); }
|
||||
void element::add_relationship(relationship &&cr)
|
||||
{
|
||||
if (cr.destination().empty()) {
|
||||
LOG_WARN("Skipping relationship '{}' - {} - '{}' due empty "
|
||||
"destination",
|
||||
LOG_DBG("Skipping relationship '{}' - {} - '{}' due empty "
|
||||
"destination",
|
||||
cr.destination(), to_string(cr.type()), full_name(true));
|
||||
return;
|
||||
}
|
||||
|
||||
if ((cr.type() == relationship_t::kInstantiation) &&
|
||||
(cr.destination() == full_name(true))) {
|
||||
LOG_WARN("Skipping self instantiation relationship for {}",
|
||||
LOG_DBG("Skipping self instantiation relationship for {}",
|
||||
cr.destination());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,7 @@ public:
|
||||
LOG_DBG("Getting nested element at path: {}", path.to_string());
|
||||
|
||||
if (path.is_empty() || !has_element(path[0])) {
|
||||
LOG_WARN(
|
||||
"Nested element {} not found in element", path.to_string());
|
||||
LOG_DBG("Nested element {} not found in element", path.to_string());
|
||||
return type_safe::optional_ref<V>{};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user