413 lines
9.0 KiB
Markdown
413 lines
9.0 KiB
Markdown
# t20014 - Multiple translation units sequence diagram test case
|
|
## Config
|
|
```yaml
|
|
diagrams:
|
|
t20014_sequence:
|
|
type: sequence
|
|
glob:
|
|
- t20014.cc
|
|
- t20014_c.cc
|
|
- t20014_b.cc
|
|
- t20014_a.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20014
|
|
using_namespace: clanguml::t20014
|
|
from:
|
|
- function: "clanguml::t20014::tmain()"
|
|
```
|
|
## Source code
|
|
File `tests/t20014/t20014.cc`
|
|
```cpp
|
|
#include "include/t20014.h"
|
|
#include "include/t20014_b.h"
|
|
#include "include/t20014_c.h"
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
void log(const char *msg) { }
|
|
|
|
int tmain()
|
|
{
|
|
B b;
|
|
C<B, int> c;
|
|
|
|
b.b1(0, 1);
|
|
b.b2(1, 2);
|
|
|
|
c.c1(2, 3);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/t20014_a.cc`
|
|
```cpp
|
|
#include "include/t20014_a.h"
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
int A::a1(int i, int j) { return i + j; }
|
|
|
|
int A::a2(int i, int j) { return i - j; }
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/t20014_b.cc`
|
|
```cpp
|
|
#include "include/t20014_b.h"
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
int B::b1(int i, int j) { return a_.a1(i, j); }
|
|
|
|
int B::b2(int i, int j) { return a_.a2(i, j); }
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/t20014_c.cc`
|
|
```cpp
|
|
#include "include/t20014_c.h"
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/include/t20014_b.h`
|
|
```cpp
|
|
#pragma once
|
|
|
|
#include "t20014_a.h"
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
struct B {
|
|
int b1(int i, int);
|
|
int b2(int i, int);
|
|
|
|
A a_;
|
|
};
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/include/t20014.h`
|
|
```cpp
|
|
#pragma once
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
int tmain();
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/include/t20014_c.h`
|
|
```cpp
|
|
#pragma once
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
template <typename T, typename F> struct C {
|
|
F c1(F i, F j) { return c_.b1(i, j); }
|
|
|
|
F c2(F i, F j) { return c_.b2(i, j); }
|
|
|
|
T c_;
|
|
};
|
|
|
|
}
|
|
}
|
|
```
|
|
File `tests/t20014/include/t20014_a.h`
|
|
```cpp
|
|
#pragma once
|
|
|
|
namespace clanguml {
|
|
namespace t20014 {
|
|
|
|
struct A {
|
|
int a1(int i, int j);
|
|
int a2(int i, int j);
|
|
};
|
|
|
|
}
|
|
}
|
|
```
|
|
## Generated PlantUML diagrams
|
|

|
|
## Generated Mermaid diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "sequence",
|
|
"name": "t20014_sequence",
|
|
"participants": [
|
|
{
|
|
"display_name": "tmain()",
|
|
"id": "512436830818921250",
|
|
"name": "tmain",
|
|
"namespace": "clanguml::t20014",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20014.cc",
|
|
"line": 10,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "function"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "b1(int,int)",
|
|
"id": "1251633571711578431",
|
|
"name": "b1",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "include/t20014_b.h",
|
|
"line": 9,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "method"
|
|
},
|
|
{
|
|
"display_name": "b2(int,int)",
|
|
"id": "767830966714379991",
|
|
"name": "b2",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "include/t20014_b.h",
|
|
"line": 10,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "B",
|
|
"id": "1537634076295867978",
|
|
"name": "B",
|
|
"namespace": "clanguml::t20014",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "include/t20014_b.h",
|
|
"line": 8,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "a1(int,int)",
|
|
"id": "1753682948110709616",
|
|
"name": "a1",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "include/t20014_a.h",
|
|
"line": 7,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "method"
|
|
},
|
|
{
|
|
"display_name": "a2(int,int)",
|
|
"id": "1943487088673912694",
|
|
"name": "a2",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "include/t20014_a.h",
|
|
"line": 8,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "A",
|
|
"id": "1504706415756333840",
|
|
"name": "A",
|
|
"namespace": "clanguml::t20014",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "include/t20014_a.h",
|
|
"line": 6,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "c1(int,int)",
|
|
"id": "407559038402563981",
|
|
"name": "c1",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "include/t20014_c.h",
|
|
"line": 7,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "C<B,int>",
|
|
"id": "500712304857049435",
|
|
"name": "C",
|
|
"namespace": "clanguml::t20014",
|
|
"source_location": {
|
|
"column": 42,
|
|
"file": "include/t20014_c.h",
|
|
"line": 6,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"type": "class"
|
|
}
|
|
],
|
|
"sequences": [
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "512436830818921250",
|
|
"participant_id": "512436830818921250"
|
|
},
|
|
"name": "b1(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20014.cc",
|
|
"line": 15,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1251633571711578431",
|
|
"participant_id": "1537634076295867978"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1251633571711578431",
|
|
"participant_id": "1537634076295867978"
|
|
},
|
|
"name": "a1(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 34,
|
|
"file": "t20014_b.cc",
|
|
"line": 5,
|
|
"translation_unit": "t20014_b.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1753682948110709616",
|
|
"participant_id": "1504706415756333840"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "512436830818921250",
|
|
"participant_id": "512436830818921250"
|
|
},
|
|
"name": "b2(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20014.cc",
|
|
"line": 16,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "767830966714379991",
|
|
"participant_id": "1537634076295867978"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "767830966714379991",
|
|
"participant_id": "1537634076295867978"
|
|
},
|
|
"name": "a2(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 34,
|
|
"file": "t20014_b.cc",
|
|
"line": 7,
|
|
"translation_unit": "t20014_b.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1943487088673912694",
|
|
"participant_id": "1504706415756333840"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "512436830818921250",
|
|
"participant_id": "512436830818921250"
|
|
},
|
|
"name": "c1(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20014.cc",
|
|
"line": 18,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "407559038402563981",
|
|
"participant_id": "500712304857049435"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "407559038402563981",
|
|
"participant_id": "500712304857049435"
|
|
},
|
|
"name": "b1(int,int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 29,
|
|
"file": "include/t20014_c.h",
|
|
"line": 7,
|
|
"translation_unit": "t20014.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1251633571711578431",
|
|
"participant_id": "1537634076295867978"
|
|
},
|
|
"type": "message"
|
|
}
|
|
],
|
|
"start_from": {
|
|
"id": 512436830818921250,
|
|
"location": "clanguml::t20014::tmain()"
|
|
}
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t20014"
|
|
}
|
|
```
|