Added default diagram generation error for empty diagrams (#246)

This commit is contained in:
Bartek Kryza
2024-03-04 19:55:55 +01:00
parent cb44c3ded4
commit baef768f6c
27 changed files with 315 additions and 10 deletions

View File

@@ -249,6 +249,11 @@ void diagram::remove_redundant_dependencies()
}
}
bool diagram::is_empty() const
{
return element_view<class_>::is_empty() &&
element_view<enum_>::is_empty() && element_view<concept_>::is_empty();
}
} // namespace clanguml::class_diagram::model
namespace clanguml::common::model {

View File

@@ -249,6 +249,13 @@ public:
*/
inja::json context() const override;
/**
* @brief Check whether the diagram is empty
*
* @return True, if diagram is empty
*/
bool is_empty() const override;
private:
template <typename ElementT>
bool add_with_namespace_path(std::unique_ptr<ElementT> &&e);