Compare commits
8 Commits
add-from-t
...
v0.3.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e980816688 | ||
|
|
4b3f3b9df3 | ||
|
|
a45fffdb67 | ||
|
|
85856426f3 | ||
|
|
de9f614cb0 | ||
|
|
9ebd5f24d5 | ||
|
|
87982ab114 | ||
|
|
3bf43bbc51 |
@@ -1,5 +1,6 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
### 0.3.9
|
||||||
* Added `from_to` and `to` location constraints to sequence diagrams (#154)
|
* Added `from_to` and `to` location constraints to sequence diagrams (#154)
|
||||||
* Fixed 'else if' statement generation in sequence diagrams (#81)
|
* Fixed 'else if' statement generation in sequence diagrams (#81)
|
||||||
* Implemented removal of redundant dependency relationhips (#28)
|
* Implemented removal of redundant dependency relationhips (#28)
|
||||||
|
|||||||
2
Doxyfile
2
Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = "clang-uml"
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.3.8
|
PROJECT_NUMBER = 0.3.9
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
|
|||||||
5
Makefile
5
Makefile
@@ -39,6 +39,8 @@ PKG_VERSION ?= $(shell git describe --tags --always --abbrev=7 | tr - .)
|
|||||||
GIT_COMMIT ?= $(shell git rev-parse HEAD)
|
GIT_COMMIT ?= $(shell git rev-parse HEAD)
|
||||||
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf debug release debug_tidy
|
rm -rf debug release debug_tidy
|
||||||
@@ -88,6 +90,9 @@ test: debug
|
|||||||
test_release: release
|
test_release: release
|
||||||
CTEST_OUTPUT_ON_FAILURE=1 make -C release test
|
CTEST_OUTPUT_ON_FAILURE=1 make -C release test
|
||||||
|
|
||||||
|
install: release
|
||||||
|
make -C release install DESTDIR=${DESTDIR}
|
||||||
|
|
||||||
test_plantuml: test
|
test_plantuml: test
|
||||||
plantuml -tsvg debug/tests/puml/*.puml
|
plantuml -tsvg debug/tests/puml/*.puml
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[](https://github.com/bkryza/clang-uml/actions)
|
[](https://github.com/bkryza/clang-uml/actions)
|
||||||
[](https://codecov.io/gh/bkryza/clang-uml)
|
[](https://codecov.io/gh/bkryza/clang-uml)
|
||||||
[](https://github.com/bkryza/clang-uml/releases)
|
[](https://github.com/bkryza/clang-uml/releases)
|
||||||
[](https://github.com/bkryza/clang-uml/releases)
|
[](https://github.com/bkryza/clang-uml/releases)
|
||||||
[](https://clang-uml.github.io)
|
[](https://clang-uml.github.io)
|
||||||
|
|
||||||
|
|||||||
@@ -30,16 +30,16 @@ sudo apt install clang-uml
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Fedora 36
|
# Fedora 36
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.3.8/clang-uml-0.3.8-1.fc36.x86_64.rpm
|
wget https://github.com/bkryza/clang-uml/releases/download/0.3.9/clang-uml-0.3.9-1.fc36.x86_64.rpm
|
||||||
sudo dnf install ./clang-uml-0.3.8-1.fc36.x86_64.rpm
|
sudo dnf install ./clang-uml-0.3.9-1.fc36.x86_64.rpm
|
||||||
|
|
||||||
# Fedora 37
|
# Fedora 37
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.3.8/clang-uml-0.3.8-1.fc37.x86_64.rpm
|
wget https://github.com/bkryza/clang-uml/releases/download/0.3.9/clang-uml-0.3.9-1.fc37.x86_64.rpm
|
||||||
sudo dnf install ./clang-uml-0.3.8-1.fc37.x86_64.rpm
|
sudo dnf install ./clang-uml-0.3.9-1.fc37.x86_64.rpm
|
||||||
|
|
||||||
# Fedora 38
|
# Fedora 38
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.3.8/clang-uml-0.3.8-1.fc38.x86_64.rpm
|
wget https://github.com/bkryza/clang-uml/releases/download/0.3.9/clang-uml-0.3.9-1.fc38.x86_64.rpm
|
||||||
sudo dnf install ./clang-uml-0.3.8-1.fc38.x86_64.rpm
|
sudo dnf install ./clang-uml-0.3.9-1.fc38.x86_64.rpm
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Conda
|
#### Conda
|
||||||
@@ -77,9 +77,11 @@ release/src/clang-uml --help
|
|||||||
# To build using a specific installed version of LLVM use:
|
# To build using a specific installed version of LLVM use:
|
||||||
LLVM_VERSION=14 make release
|
LLVM_VERSION=14 make release
|
||||||
|
|
||||||
# Optionally
|
# Optionally, to install in default prefix
|
||||||
make install
|
make install
|
||||||
# or
|
# or to install in custom prefix
|
||||||
|
make install DESTDIR=/opt/clang-uml
|
||||||
|
# or simply
|
||||||
export PATH=$PATH:$PWD/release
|
export PATH=$PATH:$PWD/release
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -159,7 +161,7 @@ bin\clang-uml.exe --version
|
|||||||
```
|
```
|
||||||
It should produce something like:
|
It should produce something like:
|
||||||
```bash
|
```bash
|
||||||
clang-uml 0.3.8
|
clang-uml 0.3.9
|
||||||
Copyright (C) 2021-2023 Bartek Kryza <bkryza@gmail.com>
|
Copyright (C) 2021-2023 Bartek Kryza <bkryza@gmail.com>
|
||||||
Built against LLVM/Clang libraries version: 15.0.6
|
Built against LLVM/Clang libraries version: 15.0.6
|
||||||
Using LLVM/Clang libraries version: clang version 15.0.6 (https://github.com/llvm/llvm-project.git 088f33605d8a61ff519c580a71b1dd57d16a03f8)
|
Using LLVM/Clang libraries version: clang version 15.0.6 (https://github.com/llvm/llvm-project.git 088f33605d8a61ff519c580a71b1dd57d16a03f8)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
* [Sequence diagram overview](#sequence-diagram-overview)
|
* [Sequence diagram overview](#sequence-diagram-overview)
|
||||||
* [Specifying diagram entry point](#specifying-diagram-entry-point)
|
* [Specifying diagram location constraints](#specifying-diagram-location-constraints)
|
||||||
* [Grouping free functions by file](#grouping-free-functions-by-file)
|
* [Grouping free functions by file](#grouping-free-functions-by-file)
|
||||||
* [Lambda expressions in sequence diagrams](#lambda-expressions-in-sequence-diagrams)
|
* [Lambda expressions in sequence diagrams](#lambda-expressions-in-sequence-diagrams)
|
||||||
* [Customizing participants order](#customizing-participants-order)
|
* [Customizing participants order](#customizing-participants-order)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
* [Clang produces several warnings during diagram generation](#clang-produces-several-warnings-during-diagram-generation)
|
* [Clang produces several warnings during diagram generation](#clang-produces-several-warnings-during-diagram-generation)
|
||||||
* [Cannot generate diagrams from header-only projects](#cannot-generate-diagrams-from-header-only-projects)
|
* [Cannot generate diagrams from header-only projects](#cannot-generate-diagrams-from-header-only-projects)
|
||||||
* [YAML anchors and aliases are not fully supported](#yaml-anchors-and-aliases-are-not-fully-supported)
|
* [YAML anchors and aliases are not fully supported](#yaml-anchors-and-aliases-are-not-fully-supported)
|
||||||
|
* [Schema validation error is thrown, but the configuration file is correct](#schema-validation-error-is-thrown-but-the-configuration-file-is-correct)
|
||||||
* [Class diagrams](#class-diagrams)
|
* [Class diagrams](#class-diagrams)
|
||||||
* ["fatal error: 'stddef.h' file not found"](#fatal-error-stddefh-file-not-found)
|
* ["fatal error: 'stddef.h' file not found"](#fatal-error-stddefh-file-not-found)
|
||||||
* [How can I generate class diagram of my entire project](#how-can-i-generate-class-diagram-of-my-entire-project)
|
* [How can I generate class diagram of my entire project](#how-can-i-generate-class-diagram-of-my-entire-project)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ types:
|
|||||||
tooltip: string
|
tooltip: string
|
||||||
git_t:
|
git_t:
|
||||||
branch: string
|
branch: string
|
||||||
revision: string
|
revision: [string, int]
|
||||||
commit: string
|
commit: string
|
||||||
toplevel: string
|
toplevel: string
|
||||||
layout_hint_key: !variant
|
layout_hint_key: !variant
|
||||||
|
|||||||
@@ -285,11 +285,11 @@ common::model::diagram_element::id_t diagram::get_from_activity_id(
|
|||||||
return from_activity;
|
return from_activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unordered_set<message_chain_t> diagram::get_all_from_to_message_chains(
|
std::vector<message_chain_t> diagram::get_all_from_to_message_chains(
|
||||||
const common::model::diagram_element::id_t from_activity,
|
const common::model::diagram_element::id_t from_activity,
|
||||||
const common::model::diagram_element::id_t to_activity) const
|
const common::model::diagram_element::id_t to_activity) const
|
||||||
{
|
{
|
||||||
std::unordered_set<message_chain_t> message_chains_unique{};
|
std::vector<message_chain_t> message_chains_unique{};
|
||||||
|
|
||||||
// Message (call) chains matching the specified from_to condition
|
// Message (call) chains matching the specified from_to condition
|
||||||
std::vector<message_chain_t> message_chains;
|
std::vector<message_chain_t> message_chains;
|
||||||
@@ -382,15 +382,31 @@ std::unordered_set<message_chain_t> diagram::get_all_from_to_message_chains(
|
|||||||
|
|
||||||
// Reverse the message chains order (they were added starting from
|
// Reverse the message chains order (they were added starting from
|
||||||
// the destination activity)
|
// the destination activity)
|
||||||
for (auto &mc : message_chains)
|
for (auto &mc : message_chains) {
|
||||||
std::reverse(mc.begin(), mc.end());
|
std::reverse(mc.begin(), mc.end());
|
||||||
|
|
||||||
std::copy_if(message_chains.begin(), message_chains.end(),
|
if (mc.empty())
|
||||||
std::inserter(message_chains_unique, message_chains_unique.begin()),
|
continue;
|
||||||
[from_activity](const message_chain_t &mc) {
|
|
||||||
return !mc.empty() &&
|
if (std::find(message_chains_unique.begin(),
|
||||||
(from_activity == 0 || (mc.front().from() == from_activity));
|
message_chains_unique.end(), mc) != message_chains_unique.end())
|
||||||
});
|
continue;
|
||||||
|
|
||||||
|
if (from_activity == 0 || (mc.front().from() == from_activity)) {
|
||||||
|
message_chains_unique.push_back(mc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_TRACE("Message chains unique", iter++);
|
||||||
|
int message_chain_index{};
|
||||||
|
for (const auto &mc : message_chains_unique) {
|
||||||
|
LOG_TRACE("\t{}: {}", message_chain_index++,
|
||||||
|
fmt::join(util::map<std::string>(mc,
|
||||||
|
[](const model::message &m) -> std::string {
|
||||||
|
return m.message_name();
|
||||||
|
}),
|
||||||
|
"->"));
|
||||||
|
}
|
||||||
|
|
||||||
return message_chains_unique;
|
return message_chains_unique;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ public:
|
|||||||
* @param to_activity Target activity for from_to message chain
|
* @param to_activity Target activity for from_to message chain
|
||||||
* @return List of message chains
|
* @return List of message chains
|
||||||
*/
|
*/
|
||||||
std::unordered_set<message_chain_t> get_all_from_to_message_chains(
|
std::vector<message_chain_t> get_all_from_to_message_chains(
|
||||||
common::model::diagram_element::id_t from_activity,
|
common::model::diagram_element::id_t from_activity,
|
||||||
common::model::diagram_element::id_t to_activity) const;
|
common::model::diagram_element::id_t to_activity) const;
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ message::message(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool message::operator==(const message &other) const noexcept
|
||||||
|
{
|
||||||
|
return from_ == other.from_ && to_ == other.to_ && type_ == other.type_ &&
|
||||||
|
scope_ == other.scope_ && message_name_ == other.message_name_ &&
|
||||||
|
return_type_ == other.return_type_ &&
|
||||||
|
condition_text_ == other.condition_text_;
|
||||||
|
}
|
||||||
|
|
||||||
void message::set_type(common::model::message_t t) { type_ = t; }
|
void message::set_type(common::model::message_t t) { type_ = t; }
|
||||||
|
|
||||||
common::model::message_t message::type() const { return type_; }
|
common::model::message_t message::type() const { return type_; }
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ public:
|
|||||||
message(common::model::message_t type,
|
message(common::model::message_t type,
|
||||||
common::model::diagram_element::id_t from);
|
common::model::diagram_element::id_t from);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Equality operator
|
||||||
|
*
|
||||||
|
* @param other Compare this to other message
|
||||||
|
* @return True, if 2 messages are equal
|
||||||
|
*/
|
||||||
|
bool operator==(const message &other) const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set message type
|
* @brief Set message type
|
||||||
*
|
*
|
||||||
@@ -162,33 +170,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace clanguml::sequence_diagram::model
|
} // namespace clanguml::sequence_diagram::model
|
||||||
|
|
||||||
namespace std {
|
|
||||||
|
|
||||||
template <> struct hash<clanguml::sequence_diagram::model::message> {
|
|
||||||
std::size_t operator()(
|
|
||||||
const clanguml::sequence_diagram::model::message &m) const
|
|
||||||
{
|
|
||||||
std::size_t seed = clanguml::util::hash_seed(m.from());
|
|
||||||
seed ^= m.to();
|
|
||||||
seed += std::hash<std::string>{}(m.full_name(true));
|
|
||||||
|
|
||||||
return seed;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct hash<std::vector<clanguml::sequence_diagram::model::message>> {
|
|
||||||
std::size_t operator()(
|
|
||||||
const std::vector<clanguml::sequence_diagram::model::message> &msgs)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
std::size_t seed = clanguml::util::hash_seed(msgs.size());
|
|
||||||
for (const auto &m : msgs) {
|
|
||||||
seed ^= std::hash<clanguml::sequence_diagram::model::message>{}(m);
|
|
||||||
}
|
|
||||||
return seed;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace std
|
|
||||||
|
|||||||
@@ -139,9 +139,12 @@ TEST_CASE("t00014", "[test-case][class]")
|
|||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(puml,
|
||||||
IsAggregation(_A("R<T>"),
|
IsAggregation(_A("R<T>"),
|
||||||
_A("A<float,std::unique_ptr<std::string>>"), "-floatstring"));
|
_A("A<float,std::unique_ptr<std::string>>"), "-floatstring"));
|
||||||
|
#if !defined(__APPLE__)
|
||||||
|
// TODO(#176)
|
||||||
REQUIRE_THAT(puml, IsDependency(_A("R<T>"), _A("A<char,std::string>")));
|
REQUIRE_THAT(puml, IsDependency(_A("R<T>"), _A("A<char,std::string>")));
|
||||||
REQUIRE_THAT(
|
REQUIRE_THAT(
|
||||||
puml, IsDependency(_A("R<T>"), _A("A<wchar_t,std::string>")));
|
puml, IsDependency(_A("R<T>"), _A("A<wchar_t,std::string>")));
|
||||||
|
#endif
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
config.output_directory() + "/" + diagram->name + ".puml", puml);
|
config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <concepts>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
|
|||||||
Reference in New Issue
Block a user