Improved documentation
This commit is contained in:
@@ -114,8 +114,7 @@ diagrams:
|
||||
type: class
|
||||
glob:
|
||||
- src/*.cc
|
||||
using_namespace:
|
||||
- myproject
|
||||
using_namespace: myproject
|
||||
include:
|
||||
namespaces:
|
||||
- myproject
|
||||
|
||||
@@ -29,8 +29,7 @@ diagrams:
|
||||
glob:
|
||||
- src/*.cc
|
||||
# Render all names in the diagram relative to specific namespace
|
||||
using_namespace:
|
||||
- ns1
|
||||
using_namespace: ns1
|
||||
# Include only classes from specific namespace
|
||||
include:
|
||||
namespaces:
|
||||
@@ -109,7 +108,7 @@ public:
|
||||
};
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class R {
|
||||
};
|
||||
```
|
||||
|
||||
generates the following class diagram:
|
||||
results in the following class diagram:
|
||||
|
||||

|
||||
|
||||
@@ -141,7 +141,7 @@ struct R {
|
||||
};
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
@@ -185,7 +185,7 @@ struct R {
|
||||
};
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
@@ -226,6 +226,6 @@ struct R {
|
||||
};
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
@@ -57,7 +57,7 @@ The syntax is simple and based on glob patterns, which can be added to the confi
|
||||
|
||||
The glob patterns only need to match the translation units, which are also in the `compile_commands.json` file, i.e.
|
||||
any files that match the glob patterns but are not in `compile_commands.json` will be ignored. In case the `glob`
|
||||
pattern set does not much any translation units an error will be printed on the standard output.
|
||||
pattern set does not match any translation units an error will be printed on the standard output.
|
||||
|
||||
For small projects, the `glob` property can be omitted, which will result in `clang-uml` parsing all translation units
|
||||
from `compile_commands.json` for the diagram. However for large projects, constraining the number of translation units
|
||||
@@ -96,13 +96,14 @@ specific diagram element.
|
||||
|
||||
## Resolving include path and compiler flags issues
|
||||
Due to the fact, that your project can be compiled with different compilers
|
||||
and toolchains than the Clang version, which `clang-uml` uses on your platform,
|
||||
include paths specified in the generated `compile_commands.json` can be incorrect.
|
||||
and toolchains, the system paths and compilation flags detected by the Clang
|
||||
version linked to your `clang-uml` installation might differ from the ones
|
||||
actually used to compile your project.
|
||||
|
||||
> This is often an issue on macOS, when `clang-uml` uses Homebrew version of LLVM
|
||||
> and your project was built using system Apple Clang
|
||||
|
||||
Typically, this results in ugly error messages on the screen during diagram
|
||||
Typically, this results in error messages on the console during diagram
|
||||
generation, such as:
|
||||
|
||||
```
|
||||
@@ -154,15 +155,15 @@ already as `argv[0]` in your `compile_commands.json`, you can simply invoke
|
||||
clang-uml --query-driver .
|
||||
```
|
||||
|
||||
however please make sure that the `compile_commands.json` contain a command,
|
||||
however please make sure that the `compile_commands.json` contains a command,
|
||||
which is safe to execute.
|
||||
|
||||
### Manually add and remove compile flags from the compilation database
|
||||
If the system paths extracted from the compiler are not sufficient to resolve
|
||||
include paths issues, it is possible to manually adjust the compilation
|
||||
flags providing `add_compile_flags` and `remove_compile_flags` in the
|
||||
flags by providing `add_compile_flags` and `remove_compile_flags` in the
|
||||
configuration file, or providing `--add-compile-flag` and `--remove-compile-flag`
|
||||
in the `clang-uml` command line.
|
||||
on the `clang-uml` command line.
|
||||
|
||||
For instance:
|
||||
|
||||
|
||||
@@ -194,8 +194,10 @@ are included based on access scope (e.g. `public`).
|
||||
|
||||
## callee_types
|
||||
|
||||
This filter is specific for `sequence diagrams` and allows to control which types calls should be included/excluded from the diagram.
|
||||
In a sequence diagram, a `callee` is the receiver of a message, and this filter specifies which types of receivers should match.
|
||||
This filter is specific for `sequence diagrams` and allows to control, which
|
||||
types of callees should be included/excluded from the diagram. In a sequence diagram,
|
||||
a `callee` is the receiver of a message, and this filter specifies which types
|
||||
of receivers should match.
|
||||
|
||||
The following callee types are supported:
|
||||
* constructor
|
||||
@@ -210,8 +212,9 @@ The following callee types are supported:
|
||||
|
||||
## dependants and dependencies
|
||||
|
||||
These filters allow to specify that only dependants or dependencies of a given class should be included in the diagram.
|
||||
This can be useful for analyzing what classes in your project depend on some other class, which could have impact for
|
||||
These filters allow to specify that only dependants or dependencies of a given
|
||||
class should be included in the diagram. This can be useful for analyzing what
|
||||
classes in your project depend on some other class, which could have impact for
|
||||
instance on refactoring.
|
||||
|
||||
For instance the following code:
|
||||
@@ -283,6 +286,6 @@ and the following filter:
|
||||
- dependency
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
@@ -54,7 +54,7 @@ diagram_templates:
|
||||
|
||||
## Adding templates to the configuration file
|
||||
Diagram templates can be added directly to the `.clang-uml` configuration file,
|
||||
under a `diagram_templates:` key. However, for practical reasons its better
|
||||
under a `diagram_templates:` key. However, for practical reasons it is better
|
||||
to keep diagram template definitions in a separate Yaml file, and reference
|
||||
it in the configuration file using `include!` directive, e.g.:
|
||||
|
||||
|
||||
@@ -46,45 +46,45 @@ An example PlantUML diagram is presented below:
|
||||
```plantuml
|
||||
@startuml
|
||||
class "A" as C_0001371951663534295727
|
||||
class C_0001371951663534295727 [[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L7{A}]] {
|
||||
+A() = default : void
|
||||
+A(int i) : void
|
||||
+A(A &&) = default : void
|
||||
+A(const A &) = deleted : void
|
||||
class C_0001371951663534295727 [[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L7{A}]] {
|
||||
+A() = default : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L9{A}]]]
|
||||
+A(int i) : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L10{A}]]]
|
||||
+A(A &&) = default : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L21{A}]]]
|
||||
+A(const A &) = deleted : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L22{A}]]]
|
||||
+A<T>(T t) : void
|
||||
+~A() = default : void
|
||||
+~A() = default : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L23{~A}]]]
|
||||
..
|
||||
+operator=(A && other) noexcept : A &
|
||||
+operator=(A & other) noexcept : A &
|
||||
+operator=(A && other) noexcept : A & [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L36{operator=}]]]
|
||||
+operator=(A & other) noexcept : A & [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L37{operator=}]]]
|
||||
..
|
||||
+operator++() : A &
|
||||
+operator++() : A & [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L30{operator++}]]]
|
||||
..
|
||||
+auto_method() : int
|
||||
+basic_method() : void
|
||||
+const_method() const : void
|
||||
{static} +create_from_int(int i) : A
|
||||
+default_int(int i = 12) : int
|
||||
+default_string(int i, std::string s = "abc") : std::string
|
||||
+double_int(const int i) : int
|
||||
-private_method() : void
|
||||
#protected_method() : void
|
||||
+size() constexpr const : std::size_t
|
||||
{static} +static_method() : int
|
||||
+sum(const double a, const double b) : int
|
||||
+auto_method() : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L28{auto_method}]]]
|
||||
+basic_method() : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L25{basic_method}]]]
|
||||
+const_method() const : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L27{const_method}]]]
|
||||
{static} +create_from_int(int i) : A [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L50{create_from_int}]]]
|
||||
+default_int(int i = 12) : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L44{default_int}]]]
|
||||
+default_string(int i, std::string s = "abc") : std::string [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L45{default_string}]]]
|
||||
+double_int(const int i) : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L41{double_int}]]]
|
||||
-private_method() : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L67{private_method}]]]
|
||||
#protected_method() : void [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L58{protected_method}]]]
|
||||
+size() constexpr const : std::size_t [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L39{size}]]]
|
||||
{static} +static_method() : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L26{static_method}]]]
|
||||
+sum(const double a, const double b) : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L42{sum}]]]
|
||||
__
|
||||
-a_ : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L70{a_}]]]
|
||||
{static} +auto_member : const unsigned long [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L55{auto_member}]]]
|
||||
-b_ : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L70{b_}]]]
|
||||
-c_ : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L70{c_}]]]
|
||||
#compare : std::function<bool (const int)> [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L62{compare}]]]
|
||||
-private_member : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L69{private_member}]]]
|
||||
#protected_member : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L60{protected_member}]]]
|
||||
+public_member : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L52{public_member}]]]
|
||||
{static} +static_const_int : const int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L54{static_const_int}]]]
|
||||
{static} +static_int : int [[[https://github.com/bkryza/clang-uml/blob/a39af67987036732468c95087191562780a518de/tests/t00003/t00003.cc#L53{static_int}]]]
|
||||
-a_ : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L70{a_}]]]
|
||||
{static} +auto_member : const unsigned long [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L55{auto_member}]]]
|
||||
-b_ : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L70{b_}]]]
|
||||
-c_ : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L70{c_}]]]
|
||||
#compare : std::function<bool (const int)> [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L62{compare}]]]
|
||||
-private_member : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L69{private_member}]]]
|
||||
#protected_member : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L60{protected_member}]]]
|
||||
+public_member : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L52{public_member}]]]
|
||||
{static} +static_const_int : const int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L54{static_const_int}]]]
|
||||
{static} +static_int : int [[[https://github.com/bkryza/clang-uml/blob/59d6fd5c7f14e028d1817274d80da29c338c2b53/tests/t00003/t00003.cc#L53{static_int}]]]
|
||||
}
|
||||
|
||||
'Generated with clang-uml, version 0.3.7-20-ga39af67
|
||||
'Generated with clang-uml, version 0.3.8
|
||||
'LLVM version Ubuntu clang version 15.0.6
|
||||
@enduml
|
||||
```
|
||||
@@ -253,6 +253,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "A",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 5,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 9,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -277,6 +283,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 5,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 10,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -301,6 +313,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "clanguml::t00003::A &&"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 5,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 21,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -325,6 +343,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "const clanguml::t00003::A &"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 5,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 22,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -344,6 +368,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": true,
|
||||
"name": "~A",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 13,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 23,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -363,6 +393,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "basic_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 25,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -382,6 +418,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "static_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 16,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 26,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@@ -401,6 +443,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "const_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 27,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -420,6 +468,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "auto_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 28,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@@ -439,6 +493,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "operator++",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 8,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 30,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "clanguml::t00003::A &"
|
||||
},
|
||||
{
|
||||
@@ -463,6 +523,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "clanguml::t00003::A &&"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 8,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 36,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "clanguml::t00003::A &"
|
||||
},
|
||||
{
|
||||
@@ -487,6 +553,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "clanguml::t00003::A &"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 8,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 37,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "clanguml::t00003::A &"
|
||||
},
|
||||
{
|
||||
@@ -506,6 +578,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "size",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 27,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 39,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "std::size_t"
|
||||
},
|
||||
{
|
||||
@@ -530,6 +608,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "const int"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 41,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@@ -558,6 +642,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "const double"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 42,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@@ -583,6 +673,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 44,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@@ -612,6 +708,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "std::string"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 17,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 45,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "std::string"
|
||||
},
|
||||
{
|
||||
@@ -636,6 +738,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"source_location": {
|
||||
"column": 14,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 50,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "clanguml::t00003::A"
|
||||
},
|
||||
{
|
||||
@@ -655,6 +763,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "protected_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 58,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -674,6 +788,12 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
"is_virtual": false,
|
||||
"name": "private_method",
|
||||
"parameters": [],
|
||||
"source_location": {
|
||||
"column": 10,
|
||||
"file": "../../tests/t00003/t00003.cc",
|
||||
"line": 67,
|
||||
"translation_unit": "../../tests/t00003/t00003.cc"
|
||||
},
|
||||
"type": "void"
|
||||
},
|
||||
{
|
||||
@@ -714,7 +834,7 @@ An equivalent of the above PlantUML diagram in JSON is presented below:
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"clang_uml_version": "0.3.7-20-ga39af67",
|
||||
"clang_uml_version": "0.3.8",
|
||||
"llvm_version": "Ubuntu clang version 15.0.6",
|
||||
"schema_version": 1
|
||||
},
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
Package diagrams are simple diagrams which can be useful to determine the high level structure of a C++ project,
|
||||
by rendering all projects namespaces as UML packages and their interdependencies.
|
||||
Package diagrams are simple diagrams, which can be useful to visualize a high
|
||||
level structure of a C++ project, by rendering all projects namespaces or
|
||||
subdirectories as UML packages and their interdependencies.
|
||||
|
||||
The minimal config required to generate a package diagram is presented below:
|
||||
```yaml
|
||||
@@ -156,7 +157,7 @@ results the following diagram:
|
||||
|
||||

|
||||
|
||||
By default, packages are generated from C++ namespaces in the code. However
|
||||
By default, packages are generated from C++ namespaces in the code. However,
|
||||
they can also be generated from the subdirectories in the filesystem tree by
|
||||
adding the following option to the configuration file:
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@ To add an initial class diagram to your project, follow these steps:
|
||||
glob:
|
||||
- src/*.cc
|
||||
# Render all names relative to `myproject` namespace
|
||||
using_namespace:
|
||||
- myproject
|
||||
using_namespace: myproject
|
||||
include:
|
||||
# Include only elements in `myproject` namespace
|
||||
namespaces:
|
||||
|
||||
@@ -105,8 +105,8 @@ following rules:
|
||||
* If lambda expression is called within the scope of the diagram, the calls from the lambda will be placed
|
||||
at the lambda invocation and not declaration
|
||||
* If lambda expression is passed to some function or method, which is outside the scope of the diagram
|
||||
(e.g. used in `std::transform` call) the call will be generated at the point where lambda is passed as parameter
|
||||
* If the lambda is passed as template parameter in instantiation it will not be generated at the moment at all
|
||||
(e.g. used in `std::transform` call) the call will not be generated
|
||||
* If the lambda is passed as template parameter in instantiation it will not be generated
|
||||
|
||||
Another issue is the naming of lambda participants. Currently, each lambda is rendered in the diagram as a separate
|
||||
class whose name is composed of the lambda location in the code (the only unique way of identifying lambdas I was able
|
||||
@@ -211,7 +211,7 @@ void tmain()
|
||||
}
|
||||
```
|
||||
|
||||
generates the following diagram:
|
||||
results in the following diagram:
|
||||
|
||||

|
||||
|
||||
@@ -235,16 +235,15 @@ diagrams:
|
||||
exclude:
|
||||
access:
|
||||
- private
|
||||
using_namespace:
|
||||
- clanguml::t20029
|
||||
using_namespace: clanguml::t20029
|
||||
start_from:
|
||||
- function: clanguml::t20029::tmain()
|
||||
participants_order:
|
||||
- clanguml::t20029::tmain()
|
||||
- clanguml::t20029::Encoder<clanguml::t20029::Retrier<clanguml::t20029::ConnectionPool>>
|
||||
- clanguml::t20029::Retrier<clanguml::t20029::ConnectionPool>
|
||||
- clanguml::t20029::ConnectionPool
|
||||
- clanguml::t20029::encode_b64(std::string &&)
|
||||
- "clanguml::t20029::tmain()"
|
||||
- "clanguml::t20029::Encoder<clanguml::t20029::Retrier<clanguml::t20029::ConnectionPool>>"
|
||||
- "clanguml::t20029::Retrier<clanguml::t20029::ConnectionPool>"
|
||||
- "clanguml::t20029::ConnectionPool"
|
||||
- "clanguml::t20029::encode_b64(std::string &&)"
|
||||
```
|
||||
|
||||
## Generating return types
|
||||
@@ -262,6 +261,9 @@ generate_return_types: true
|
||||
This option only affects the `plantuml` generation, in `json` generator
|
||||
`return_type` property is always present in the message nodes.
|
||||
|
||||
The diagram below presents what it looks like in a PlantUML generated diagram:
|
||||

|
||||
|
||||
|
||||
## Generating condition statements
|
||||
Sometimes, it is useful to include actual condition statements (for instance
|
||||
@@ -274,3 +276,6 @@ This can be enabled using the following option:
|
||||
generate_condition_statements: true
|
||||
```
|
||||
|
||||
An example of a diagram with this feature enabled is presented below:
|
||||

|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ diagrams:
|
||||
type: class
|
||||
glob:
|
||||
- ../../tests/t00003/t00003.cc
|
||||
using_namespace:
|
||||
- clanguml::t00003
|
||||
using_namespace: clanguml::t00003
|
||||
include:
|
||||
namespaces:
|
||||
- clanguml::t00003
|
||||
|
||||
Reference in New Issue
Block a user