188 lines
4.5 KiB
Markdown
188 lines
4.5 KiB
Markdown
# t20022 - Forward class declaration sequence diagram test case
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: puml
|
|
diagrams:
|
|
t20022_sequence:
|
|
type: sequence
|
|
glob:
|
|
- ../../tests/t20022/t20022.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20022
|
|
using_namespace:
|
|
- clanguml::t20022
|
|
start_from:
|
|
- function: "clanguml::t20022::tmain()"
|
|
```
|
|
## Source code
|
|
File t20022.cc
|
|
```cpp
|
|
#include <memory>
|
|
|
|
namespace clanguml {
|
|
namespace t20022 {
|
|
class B;
|
|
|
|
class A {
|
|
public:
|
|
A(std::unique_ptr<B> b);
|
|
|
|
void a();
|
|
|
|
std::unique_ptr<B> b_;
|
|
};
|
|
|
|
class B {
|
|
public:
|
|
void b() { }
|
|
};
|
|
|
|
A::A(std::unique_ptr<B> b)
|
|
: b_{std::move(b)}
|
|
{
|
|
}
|
|
|
|
void A::a() { b_->b(); }
|
|
|
|
int tmain()
|
|
{
|
|
A a{std::make_unique<B>()};
|
|
|
|
a.a();
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
```
|
|
## Generated UML diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "sequence",
|
|
"metadata": {
|
|
"clang_uml_version": "0.3.7-47-g2104d93",
|
|
"llvm_version": "Ubuntu clang version 15.0.6",
|
|
"schema_version": 1
|
|
},
|
|
"name": "t20022_sequence",
|
|
"participants": [
|
|
{
|
|
"id": "1374011101998494743",
|
|
"name": "clanguml::t20022::tmain()",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 28,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"type": "function"
|
|
},
|
|
{
|
|
"id": "1535467498096081224",
|
|
"name": "clanguml::t20022::A",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 7,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"id": "1316821731069034940",
|
|
"name": "clanguml::t20022::B",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 16,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"type": "class"
|
|
}
|
|
],
|
|
"sequences": [
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1374011101998494743",
|
|
"activity_name": "clanguml::t20022::tmain()",
|
|
"participant_id": "1374011101998494743",
|
|
"participant_name": "clanguml::t20022::tmain()"
|
|
},
|
|
"name": "A(std::unique_ptr<B>)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 30,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1226569306557207632",
|
|
"activity_name": "clanguml::t20022::A::A(std::unique_ptr<B>)",
|
|
"participant_id": "1535467498096081224"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1374011101998494743",
|
|
"activity_name": "clanguml::t20022::tmain()",
|
|
"participant_id": "1374011101998494743",
|
|
"participant_name": "clanguml::t20022::tmain()"
|
|
},
|
|
"name": "a()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 32,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1158824701633811441",
|
|
"activity_name": "clanguml::t20022::A::a()",
|
|
"participant_id": "1535467498096081224"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1158824701633811441",
|
|
"activity_name": "clanguml::t20022::A::a()",
|
|
"participant_id": "1535467498096081224"
|
|
},
|
|
"name": "b()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 15,
|
|
"file": "../../tests/t20022/t20022.cc",
|
|
"line": 26,
|
|
"translation_unit": "../../tests/t20022/t20022.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2114222968575993291",
|
|
"activity_name": "clanguml::t20022::B::b()",
|
|
"participant_id": "1316821731069034940"
|
|
},
|
|
"type": "message"
|
|
}
|
|
],
|
|
"start_from": {
|
|
"id": 1374011101998494743,
|
|
"location": "clanguml::t20022::tmain()"
|
|
}
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t20022"
|
|
}
|
|
```
|