diff --git a/docs/test_cases.md b/docs/test_cases.md
index ac535af2..a92fdb95 100644
--- a/docs/test_cases.md
+++ b/docs/test_cases.md
@@ -96,6 +96,7 @@
* [t00089](./test_cases/t00089.md) - Test case for '::' prefix in class diagrams for namespaces outside of using_namespace
* [t00090](./test_cases/t00090.md) - Metaprogramming test case with recursive type list
* [t00091](./test_cases/t00091.md) - Declaration forwarding test case
+ * [t00092](./test_cases/t00092.md) - Test case for relationship_hints config option
## Sequence diagrams
* [t20001](./test_cases/t20001.md) - Basic sequence diagram test case
* [t20002](./test_cases/t20002.md) - Free function sequence diagram test case
diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md
index 94b27e6c..333afa4c 100644
--- a/docs/test_cases/t00002.md
+++ b/docs/test_cases/t00002.md
@@ -736,35 +736,35 @@ private:
abstract
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L7
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L7
This is class A
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L16
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L16
This is class B
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L27
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L27
This is class C - class C has a long comment
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L36
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L36
D
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L61
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L61
E
@@ -801,7 +801,7 @@ private:
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L58
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L58
association
as
private
@@ -815,7 +815,7 @@ private:
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00002/t00002.cc#L83
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00002/t00002.cc#L83
association
as
private
diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg
index 040f132b..7dcf2bba 100644
--- a/docs/test_cases/t00002_class.svg
+++ b/docs/test_cases/t00002_class.svg
@@ -5,7 +5,7 @@
Basic class diagram example
-
+
@@ -13,23 +13,23 @@
A
-
+
-
+
foo_a() = 0 : void
-
+
-
+
foo_c() = 0 : void
-
+
@@ -37,16 +37,16 @@
B
-
+
-
+
foo_a() : void
-
+
@@ -54,16 +54,16 @@
C
-
+
-
+
foo_c() : void
-
+
@@ -71,30 +71,30 @@
D
-
+
-
+
foo_a() : void
-
+
-
+
foo_c() : void
-
+
-
+
as : std::vector<A *>
-
+
@@ -102,27 +102,27 @@
E
-
+
-
+
foo_a() : void
-
+
-
+
foo_c() : void
-
+
-
+
as : std::vector<A *>
@@ -152,7 +152,7 @@
-
+
@@ -166,7 +166,7 @@
-
+
diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg
index 1b333d7f..fc97fca2 100644
--- a/docs/test_cases/t00002_class_mermaid.svg
+++ b/docs/test_cases/t00002_class_mermaid.svg
@@ -185,7 +185,7 @@
-
+
@@ -214,7 +214,7 @@
-
+
@@ -238,7 +238,7 @@
-
+
@@ -262,7 +262,7 @@
-
+
@@ -296,7 +296,7 @@
-
+
diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md
index e8bb3f08..517f4a61 100644
--- a/docs/test_cases/t00004.md
+++ b/docs/test_cases/t00004.md
@@ -820,148 +820,148 @@ public:
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L4
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L4
Color
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L6
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L6
B
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L8
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L8
B::AA
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L9
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L9
B::BB
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L10
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L10
B::CC
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L18
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L18
A
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L22
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L22
A::AA
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L24
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L24
A::AA::Lights
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L26
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L26
A::AA::AAA
class
]]>
true
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L48
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L48
C::B
class
]]>
true
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L34
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L34
C
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L38
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L38
C::AA
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L39
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L39
C::AA::AAA
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L41
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L41
C::AA::CCC
class
]]>
true
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L44
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L44
C::B
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L50
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L50
C::CC
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L54
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L54
D
enum
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L56
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L56
D::AA
class
false
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L58
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L58
D::DD
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L12
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L12
aggregation
aa
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L13
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L13
aggregation
bb
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L14
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L14
aggregation
cc
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L15
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L15
association
color
public
@@ -975,7 +975,7 @@ public:
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L27
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L27
aggregation
lights
private
@@ -985,7 +985,7 @@ public:
public
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t00004/t00004.cc#L48
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t00004/t00004.cc#L48
aggregation
b_int
public
diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg
index b66b4452..59a00d74 100644
--- a/docs/test_cases/t00004_class.svg
+++ b/docs/test_cases/t00004_class.svg
@@ -3,7 +3,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
@@ -25,36 +25,36 @@
-
+
-
+
aa : AA
-
+
-
+
bb : BB
-
+
-
+
cc : CC
-
+
-
+
color : Color *
-
+
@@ -67,7 +67,7 @@
-
+
@@ -80,7 +80,7 @@
-
+
@@ -93,7 +93,7 @@
-
+
@@ -101,23 +101,23 @@
A
-
+
-
+
foo() const : void
-
+
-
+
foo2() const : void
-
+
@@ -127,7 +127,7 @@
-
+
@@ -140,7 +140,7 @@
-
+
@@ -149,15 +149,15 @@
-
+
-
+
lights : Lights
-
+
@@ -169,7 +169,7 @@
-
+
@@ -180,22 +180,22 @@
-
+
-
+
b_int : B<int>
-
+
-
+
t : T
-
+
@@ -205,7 +205,7 @@
-
+
@@ -215,7 +215,7 @@
-
+
@@ -227,7 +227,7 @@
-
+
@@ -238,15 +238,15 @@
-
+
-
+
b : V
-
+
@@ -258,7 +258,7 @@
-
+
@@ -268,7 +268,7 @@
-
+
@@ -281,7 +281,7 @@
-
+
@@ -291,7 +291,7 @@
-
+
@@ -303,7 +303,7 @@
-
+
@@ -315,7 +315,7 @@
-
+
@@ -327,7 +327,7 @@
-
+
@@ -351,7 +351,7 @@
-
+
@@ -361,7 +361,7 @@
-
+
diff --git a/docs/test_cases/t00004_class_mermaid.svg b/docs/test_cases/t00004_class_mermaid.svg
index 3016fb7e..17a79e2d 100644
--- a/docs/test_cases/t00004_class_mermaid.svg
+++ b/docs/test_cases/t00004_class_mermaid.svg
@@ -299,7 +299,7 @@
-
+
@@ -333,7 +333,7 @@
-
+
@@ -372,7 +372,7 @@
-
+
@@ -406,7 +406,7 @@
-
+
@@ -440,7 +440,7 @@
-
+
@@ -474,7 +474,7 @@
-
+
@@ -503,7 +503,7 @@
-
+
@@ -522,7 +522,7 @@
-
+
@@ -556,7 +556,7 @@
-
+
@@ -580,7 +580,7 @@
-
+
@@ -599,7 +599,7 @@
-
+
@@ -628,7 +628,7 @@
-
+
@@ -647,7 +647,7 @@
-
+
@@ -666,7 +666,7 @@
-
+
@@ -695,7 +695,7 @@
-
+
@@ -719,7 +719,7 @@
-
+
@@ -748,7 +748,7 @@
-
+
@@ -767,7 +767,7 @@
-
+
@@ -801,7 +801,7 @@
-
+
diff --git a/docs/test_cases/t00065_class.svg b/docs/test_cases/t00065_class.svg
index 052c9584..7e0dc898 100644
--- a/docs/test_cases/t00065_class.svg
+++ b/docs/test_cases/t00065_class.svg
@@ -3,22 +3,22 @@
-
+
module1
-
+
submodule1a
-
+
module2
-
+
concepts
diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg
index aaac15c7..22dc7c9d 100644
--- a/docs/test_cases/t20029_sequence.svg
+++ b/docs/test_cases/t20029_sequence.svg
@@ -60,31 +60,31 @@
-
+
tmain()
tmain()
-
+
Encoder<Retrier<ConnectionPool>>
Encoder<Retrier<ConnectionPool>>
-
+
Retrier<ConnectionPool>
Retrier<ConnectionPool>
-
+
ConnectionPool
ConnectionPool
-
+
encode_b64(std::string &&)
@@ -122,7 +122,7 @@
Establish connection to the
remote server synchronously
-
+
connect()
@@ -137,7 +137,7 @@
alt
-
+
[
@@ -149,14 +149,14 @@
Encode the message using
Base64 encoding and pass
it to the next layer
-
+
encode(std::string &&)
-
+
@@ -166,7 +166,7 @@
-
+
send(std::string &&)
@@ -181,7 +181,7 @@
alt
-
+
[
diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md
index 5f327923..a9abe080 100644
--- a/docs/test_cases/t30001.md
+++ b/docs/test_cases/t30001.md
@@ -271,26 +271,26 @@ namespace BB {
A
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L3
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L3
A
AA
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L5
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L5
AA
AAA
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L6
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L6
AAA
BBB
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L8
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L8
BBB
@@ -306,7 +306,7 @@ namespace BB {
BB
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L11
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L11
BB
@@ -322,26 +322,26 @@ namespace BB {
B
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L14
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L14
B
AA
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L16
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L16
AA
AAA
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L17
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L17
AAA
BBB
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L19
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L19
BBB
@@ -350,7 +350,7 @@ namespace BB {
BB
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30001/t30001.cc#L22
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30001/t30001.cc#L22
BB
diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg
index 9124e5af..ea18318f 100644
--- a/docs/test_cases/t30001_package.svg
+++ b/docs/test_cases/t30001_package.svg
@@ -5,52 +5,52 @@
Basic package diagram example
-
+
A
-
+
AA
-
+
B
-
+
AA
-
+
AAA
-
+
BBB
-
+
BB
-
+
AAA
-
+
BBB
-
+
BB
diff --git a/docs/test_cases/t30018.md b/docs/test_cases/t30018.md
index dcfec1fb..0a7eece7 100644
--- a/docs/test_cases/t30018.md
+++ b/docs/test_cases/t30018.md
@@ -191,49 +191,49 @@ struct FF {
context
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L2
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L2
context
B
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L9
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L9
B
D
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L27
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L27
D
E
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L31
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L31
E
F
namespace
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L38
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L38
F
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L33
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L33
dependency
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L34
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L34
dependency
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t30018/t30018.cc#L40
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t30018/t30018.cc#L40
dependency
diff --git a/docs/test_cases/t30018_package.svg b/docs/test_cases/t30018_package.svg
index 9aa9fe29..4a552b5f 100644
--- a/docs/test_cases/t30018_package.svg
+++ b/docs/test_cases/t30018_package.svg
@@ -3,40 +3,40 @@
-
+
context
-
+
B
-
+
D
-
+
E
-
+
F
-
+
-
+
-
+
diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md
index a08b9e58..cb9b27ff 100644
--- a/docs/test_cases/t40002.md
+++ b/docs/test_cases/t40002.md
@@ -357,7 +357,7 @@ int foo();
file
source
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t40002/src/t40002.cc#L0
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t40002/src/t40002.cc#L0
t40002.cc
@@ -368,7 +368,7 @@ int foo();
file
source
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t40002/src/lib1/lib1.cc#L0
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t40002/src/lib1/lib1.cc#L0
lib1.cc
@@ -381,7 +381,7 @@ int foo();
file
source
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t40002/src/lib2/lib2.cc#L0
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t40002/src/lib2/lib2.cc#L0
lib2.cc
@@ -400,7 +400,7 @@ int foo();
file
header
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t40002/include/lib1/lib1.h#L0
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t40002/include/lib1/lib1.h#L0
lib1.h
@@ -413,7 +413,7 @@ int foo();
file
header
- https://github.com/bkryza/clang-uml/blob/2d1cd9fd8701d055ebe38f007cb01bbea0869cea/tests/t40002/include/lib2/lib2.h#L0
+ https://github.com/bkryza/clang-uml/blob/3938b2ee66bd0616942008a46264579c64c5bf2b/tests/t40002/include/lib2/lib2.h#L0
lib2.h
diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg
index ccf9a4cb..339fe963 100644
--- a/docs/test_cases/t40002_include.svg
+++ b/docs/test_cases/t40002_include.svg
@@ -33,27 +33,27 @@
lib2
-
+
t40002.cc
-
+
lib1.cc
-
+
lib2.cc
-
+
lib1.h
-
+
lib2.h
diff --git a/docs/test_cases/t40002_include_mermaid.svg b/docs/test_cases/t40002_include_mermaid.svg
index e8359dc0..22c7b27a 100644
--- a/docs/test_cases/t40002_include_mermaid.svg
+++ b/docs/test_cases/t40002_include_mermaid.svg
@@ -149,7 +149,7 @@
-
+
@@ -164,7 +164,7 @@
-
+
@@ -179,7 +179,7 @@
-
+
@@ -194,7 +194,7 @@
-
+
@@ -209,7 +209,7 @@
-
+
diff --git a/src/class_diagram/model/class.h b/src/class_diagram/model/class.h
index 25bb905e..d3b239c0 100644
--- a/src/class_diagram/model/class.h
+++ b/src/class_diagram/model/class.h
@@ -161,7 +161,6 @@ class class_ : public common::model::template_element,
bool is_union_{false};
std::vector members_;
std::vector methods_;
- std::string full_name_;
};
} // namespace clanguml::class_diagram::model
diff --git a/src/class_diagram/model/diagram.h b/src/class_diagram/model/diagram.h
index 514c2230..b688e2bc 100644
--- a/src/class_diagram/model/diagram.h
+++ b/src/class_diagram/model/diagram.h
@@ -417,7 +417,7 @@ bool diagram::add_with_filesystem_path(
auto package_path =
common::model::path(parent_path.begin(), it, parent_path.type());
pkg->set_namespace(package_path);
- pkg->set_id(common::to_id(pkg->full_name(false)));
+ pkg->set_id(common::to_id("__directory__" + pkg->full_name(false)));
LOG_DBG("Adding filesystem package {} at path {}", pkg->name(),
package_path.to_string());
diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc
index 64754302..bceeb740 100644
--- a/src/class_diagram/visitor/translation_unit_visitor.cc
+++ b/src/class_diagram/visitor/translation_unit_visitor.cc
@@ -1740,22 +1740,32 @@ bool translation_unit_visitor::find_relationships(const clang::Decl *decl,
}
// TODO: Objc support
else if (type->isRecordType()) {
- const auto *type_instantiation_decl =
+ const auto *type_instantiation_type =
type->getAs();
- if (type_instantiation_decl != nullptr) {
+ if (type_instantiation_type != nullptr) {
+ const auto *type_instantiation_template_decl =
+ type_instantiation_type->getTemplateName().getAsTemplateDecl();
+
// If this template should be included in the diagram
// add it - and then process recursively its arguments
- if (should_include(type_instantiation_decl->getTemplateName()
- .getAsTemplateDecl())) {
+ if (should_include(type_instantiation_template_decl)) {
relationships.emplace_back(
- type_instantiation_decl->getTemplateName()
+ type_instantiation_type->getTemplateName()
.getAsTemplateDecl()
->getID(),
relationship_hint, decl);
}
+
+ auto idx{0};
for (const auto &template_argument :
- type_instantiation_decl->template_arguments()) {
+ type_instantiation_type->template_arguments()) {
+
+ auto [overridden_relationship_hint, overridden] =
+ override_relationship_hint(type_instantiation_template_decl
+ ->getQualifiedNameAsString(),
+ idx, relationship_hint);
+
const auto template_argument_kind = template_argument.getKind();
if (template_argument_kind ==
clang::TemplateArgument::ArgKind::Integral) {
@@ -1795,8 +1805,9 @@ bool translation_unit_visitor::find_relationships(const clang::Decl *decl,
clang::TemplateArgument::ArgKind::Type) {
result =
find_relationships(decl, template_argument.getAsType(),
- relationships, relationship_hint);
+ relationships, overridden_relationship_hint);
}
+ idx++;
}
}
else if (type->getAsCXXRecordDecl() != nullptr) {
@@ -1813,6 +1824,8 @@ bool translation_unit_visitor::find_relationships(const clang::Decl *decl,
else if (const auto *template_specialization_type =
type->getAs();
template_specialization_type != nullptr) {
+ const auto *type_instantiation_template_decl =
+ template_specialization_type->getTemplateName().getAsTemplateDecl();
if (should_include(template_specialization_type->getTemplateName()
.getAsTemplateDecl())) {
relationships.emplace_back(
@@ -1821,8 +1834,15 @@ bool translation_unit_visitor::find_relationships(const clang::Decl *decl,
->getID(),
relationship_hint, decl);
}
+ auto idx{0};
for (const auto &template_argument :
template_specialization_type->template_arguments()) {
+
+ auto [overridden_relationship_hint, overridden] =
+ override_relationship_hint(type_instantiation_template_decl
+ ->getQualifiedNameAsString(),
+ idx, relationship_hint);
+
const auto template_argument_kind = template_argument.getKind();
if (template_argument_kind ==
clang::TemplateArgument::ArgKind::Integral) {
@@ -1860,8 +1880,9 @@ bool translation_unit_visitor::find_relationships(const clang::Decl *decl,
else if (template_argument_kind ==
clang::TemplateArgument::ArgKind::Type) {
result = find_relationships(decl, template_argument.getAsType(),
- relationships, relationship_hint);
+ relationships, overridden_relationship_hint);
}
+ idx++;
}
}
@@ -2041,6 +2062,27 @@ void translation_unit_visitor::add_relationships(
}
}
+std::pair
+translation_unit_visitor::override_relationship_hint(
+ const std::string &type_name, int index, relationship_t hint)
+{
+ bool overridden{false};
+
+ for (const auto &[pattern, rel_hint] : config().relationship_hints()) {
+ if (type_name.find(pattern) == 0) {
+ if (index == -1)
+ hint = rel_hint.default_hint;
+ else
+ hint = rel_hint.get(index, hint);
+
+ overridden = true;
+ break;
+ }
+ }
+
+ return {hint, overridden};
+}
+
void translation_unit_visitor::process_static_field(
const clang::VarDecl &field_declaration, class_ &c)
{
@@ -2197,10 +2239,10 @@ void translation_unit_visitor::process_field(
field_type = field_type.getNonReferenceType();
}
- if (type_name.find("std::shared_ptr") == 0)
- relationship_hint = relationship_t::kAssociation;
- if (type_name.find("std::weak_ptr") == 0)
- relationship_hint = relationship_t::kAssociation;
+ auto [overridden_relationship_hint, overridden] =
+ override_relationship_hint(type_name, -1, relationship_hint);
+ if (overridden)
+ relationship_hint = overridden_relationship_hint;
found_relationships_t relationships;
@@ -2268,20 +2310,29 @@ void translation_unit_visitor::process_field(
// Try to find relationships to types nested in the template
// instantiation
found_relationships_t nested_relationships;
+ auto idx{0};
if (!template_instantiation_added_as_aggregation) {
for (const auto &template_argument :
template_specialization.template_params()) {
+ auto template_argument_str = template_argument.to_string(
+ config().using_namespace(), false);
+
LOG_DBG("Looking for nested relationships from {}::{} in "
"template argument {}",
- c, field_name,
- template_argument.to_string(
- config().using_namespace(), false));
+ c, field_name, template_argument_str);
+
+ auto [overridden_relationship_hint_param,
+ overridden_param] =
+ override_relationship_hint(
+ template_specialization.full_name(false), idx,
+ relationship_hint);
template_instantiation_added_as_aggregation =
template_argument.find_nested_relationships(
&field_declaration, nested_relationships,
- relationship_hint,
+ overridden_relationship_hint_param,
+ !overridden_param,
[&d = diagram()](const std::string &full_name) {
if (full_name.empty())
return false;
@@ -2294,6 +2345,8 @@ void translation_unit_visitor::process_field(
// unless the top level type has been added as aggregation
add_relationships(c, field, nested_relationships,
/* break on first aggregation */ false);
+
+ idx++;
}
// Add the template instantiation object to the diagram if it
@@ -2357,7 +2410,8 @@ void translation_unit_visitor::find_record_parent_id(const clang::TagDecl *decl,
// regular class
parent_id_opt = id_mapper().get_global_id(local_id);
- // If not, check if the parent template declaration is in the model
+ // If not, check if the parent template declaration is in the
+ // model
if (!parent_id_opt) {
if (parent_record_decl->getDescribedTemplate() != nullptr) {
local_id =
@@ -2414,9 +2468,9 @@ void translation_unit_visitor::resolve_local_to_global_ids()
const auto maybe_id =
id_mapper().get_global_id(rel.destination());
if (maybe_id) {
- LOG_TRACE(
- "= Resolved instantiation destination from local "
- "id {} to global id {}",
+ LOG_TRACE("= Resolved instantiation destination "
+ "from local "
+ "id {} to global id {}",
rel.destination(), *maybe_id);
rel.set_destination(*maybe_id);
}
diff --git a/src/class_diagram/visitor/translation_unit_visitor.h b/src/class_diagram/visitor/translation_unit_visitor.h
index 67334944..5e7afa7f 100644
--- a/src/class_diagram/visitor/translation_unit_visitor.h
+++ b/src/class_diagram/visitor/translation_unit_visitor.h
@@ -487,6 +487,16 @@ class translation_unit_visitor
const found_relationships_t &relationships,
bool break_on_first_aggregation = false);
+ /**
+ * @brief Try to override relationship hint using configuration file
+ *
+ * @param type_name
+ * @param hint
+ * @return Maybe overridden relationship type hint
+ */
+ std::pair override_relationship_hint(
+ const std::string &type_name, int index, relationship_t hint);
+
/**
* @brief Process record parent element (e.g. for nested classes)
*
diff --git a/src/common/model/template_parameter.cc b/src/common/model/template_parameter.cc
index 74a366ac..60a2f339 100644
--- a/src/common/model/template_parameter.cc
+++ b/src/common/model/template_parameter.cc
@@ -492,7 +492,7 @@ std::string template_parameter::to_string(
bool template_parameter::find_nested_relationships(const clang::Decl *decl,
std::vector> &nested_relationships,
- common::model::relationship_t hint,
+ common::model::relationship_t hint, bool allow_hint_override,
const std::function &should_include)
const
{
@@ -502,11 +502,11 @@ bool template_parameter::find_nested_relationships(const clang::Decl *decl,
// just add it and skip recursion (e.g. this is a user defined type)
const auto maybe_type = type();
- if (is_function_template())
+ if (allow_hint_override && is_function_template())
hint = common::model::relationship_t::kDependency;
if (maybe_type && should_include(maybe_type.value())) {
- if (is_association())
+ if (allow_hint_override && is_association())
hint = common::model::relationship_t::kAssociation;
const auto maybe_id = id();
@@ -525,8 +525,7 @@ bool template_parameter::find_nested_relationships(const clang::Decl *decl,
const auto maybe_arg_type = template_argument.type();
if (maybe_id && maybe_arg_type && should_include(*maybe_arg_type)) {
-
- if (template_argument.is_association() &&
+ if (allow_hint_override && template_argument.is_association() &&
hint == common::model::relationship_t::kAggregation)
hint = common::model::relationship_t::kAssociation;
@@ -536,12 +535,14 @@ bool template_parameter::find_nested_relationships(const clang::Decl *decl,
(hint == common::model::relationship_t::kAggregation);
}
else {
- if (template_argument.is_function_template())
+ if (allow_hint_override &&
+ template_argument.is_function_template())
hint = common::model::relationship_t::kDependency;
added_aggregation_relationship =
- template_argument.find_nested_relationships(
- decl, nested_relationships, hint, should_include);
+ template_argument.find_nested_relationships(decl,
+ nested_relationships, hint, allow_hint_override,
+ should_include);
}
}
}
diff --git a/src/common/model/template_parameter.h b/src/common/model/template_parameter.h
index a238d8bb..be68cde1 100644
--- a/src/common/model/template_parameter.h
+++ b/src/common/model/template_parameter.h
@@ -405,7 +405,7 @@ class template_parameter {
bool find_nested_relationships(const clang::Decl *decl,
std::vector> &nested_relationships,
- common::model::relationship_t hint,
+ common::model::relationship_t hint, bool allow_hint_override,
const std::function &should_include)
const;
diff --git a/src/config/config.h b/src/config/config.h
index 9a12668c..9c2f50f0 100644
--- a/src/config/config.h
+++ b/src/config/config.h
@@ -550,12 +550,13 @@ struct relationship_hint_t {
{
}
- common::model::relationship_t get(unsigned int argument_index) const
+ common::model::relationship_t get(unsigned int argument_index,
+ std::optional def = {}) const
{
if (argument_hints.count(argument_index) > 0)
return argument_hints.at(argument_index);
- return default_hint;
+ return def.has_value() ? *def : default_hint;
}
};
diff --git a/src/config/schema.h b/src/config/schema.h
index 7e09cbe9..ca174ca7 100644
--- a/src/config/schema.h
+++ b/src/config/schema.h
@@ -418,6 +418,7 @@ const std::string schema_str = R"(
type_aliases: !optional map_t
filter_mode: !optional filter_mode_t
include_system_headers: !optional bool
+ relationship_hints: !optional map_t
)";
} // namespace clanguml::config
\ No newline at end of file
diff --git a/tests/t00092/.clang-uml b/tests/t00092/.clang-uml
new file mode 100644
index 00000000..0573f6e9
--- /dev/null
+++ b/tests/t00092/.clang-uml
@@ -0,0 +1,21 @@
+diagrams:
+ t00092_class:
+ type: class
+ glob:
+ - t00092.cc
+ include:
+ namespaces:
+ - clanguml::t00092
+ exclude:
+ elements:
+ - r: "clanguml::t00092::OwningPtr.*"
+ - r: "clanguml::t00092::WeakPtr.*"
+ - r: "clanguml::t00092::Map.*"
+ relationship_hints:
+ clanguml::t00092::OwningPtr: aggregation
+ clanguml::t00092::WeakPtr: association
+ clanguml::t00092::Map:
+ default: association
+ 0: dependency
+ 1: aggregation
+ using_namespace: clanguml::t00092
\ No newline at end of file
diff --git a/tests/t00092/t00092.cc b/tests/t00092/t00092.cc
new file mode 100644
index 00000000..1249e163
--- /dev/null
+++ b/tests/t00092/t00092.cc
@@ -0,0 +1,34 @@
+#include