247 lines
7.2 KiB
Markdown
247 lines
7.2 KiB
Markdown
# t20013 - Function and method arguments in sequence diagrams test case
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: diagrams
|
|
diagrams:
|
|
t20013_sequence:
|
|
type: sequence
|
|
glob:
|
|
- ../../tests/t20013/t20013.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20013
|
|
using_namespace:
|
|
- clanguml::t20013
|
|
from:
|
|
- function: "clanguml::t20013::tmain(int,char **)"
|
|
```
|
|
## Source code
|
|
File t20013.cc
|
|
```cpp
|
|
namespace clanguml {
|
|
namespace t20013 {
|
|
|
|
struct A {
|
|
int a1(int i) { return i; }
|
|
double a2(double d) { return d; }
|
|
const char *a3(const char *s) { return s; }
|
|
};
|
|
|
|
struct B {
|
|
int b(int i) { return a.a1(i); }
|
|
double b(double d) { return a.a2(d); }
|
|
const char *b(const char *s) { return a.a3(s); }
|
|
|
|
A a;
|
|
};
|
|
|
|
void tmain(int argc, char **argv)
|
|
{
|
|
B b;
|
|
|
|
b.b(1);
|
|
b.b(2.0);
|
|
b.b("three");
|
|
}
|
|
}
|
|
}
|
|
```
|
|
## Generated PlantUML diagrams
|
|

|
|
## Generated Mermaid diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "sequence",
|
|
"metadata": {
|
|
"clang_uml_version": "0.3.9-23-g7e22b0b",
|
|
"llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)",
|
|
"schema_version": 1
|
|
},
|
|
"name": "t20013_sequence",
|
|
"participants": [
|
|
{
|
|
"id": "1249768632077843821",
|
|
"name": "clanguml::t20013::tmain(int,char **)",
|
|
"source_location": {
|
|
"column": 6,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 18,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"type": "function"
|
|
},
|
|
{
|
|
"id": "1106407610612951303",
|
|
"name": "clanguml::t20013::B",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 10,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"id": "976623130699225079",
|
|
"name": "clanguml::t20013::A",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 4,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"type": "class"
|
|
}
|
|
],
|
|
"sequences": [
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1249768632077843821",
|
|
"activity_name": "clanguml::t20013::tmain(int,char **)",
|
|
"participant_id": "1249768632077843821",
|
|
"participant_name": "clanguml::t20013::tmain(int,char **)"
|
|
},
|
|
"name": "b(int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 22,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2144804108273682993",
|
|
"activity_name": "clanguml::t20013::B::b(int)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "2144804108273682993",
|
|
"activity_name": "clanguml::t20013::B::b(int)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"name": "a1(int)",
|
|
"return_type": "int",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 27,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 11,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1034027282942033004",
|
|
"activity_name": "clanguml::t20013::A::a1(int)",
|
|
"participant_id": "976623130699225079"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1249768632077843821",
|
|
"activity_name": "clanguml::t20013::tmain(int,char **)",
|
|
"participant_id": "1249768632077843821",
|
|
"participant_name": "clanguml::t20013::tmain(int,char **)"
|
|
},
|
|
"name": "b(double)",
|
|
"return_type": "double",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 23,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "640747884486165287",
|
|
"activity_name": "clanguml::t20013::B::b(double)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "640747884486165287",
|
|
"activity_name": "clanguml::t20013::B::b(double)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"name": "a2(double)",
|
|
"return_type": "double",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 33,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 12,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "394053399890813915",
|
|
"activity_name": "clanguml::t20013::A::a2(double)",
|
|
"participant_id": "976623130699225079"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1249768632077843821",
|
|
"activity_name": "clanguml::t20013::tmain(int,char **)",
|
|
"participant_id": "1249768632077843821",
|
|
"participant_name": "clanguml::t20013::tmain(int,char **)"
|
|
},
|
|
"name": "b(const char *)",
|
|
"return_type": "const char *",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 24,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1066935874364409142",
|
|
"activity_name": "clanguml::t20013::B::b(const char *)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1066935874364409142",
|
|
"activity_name": "clanguml::t20013::B::b(const char *)",
|
|
"participant_id": "1106407610612951303"
|
|
},
|
|
"name": "a3(const char *)",
|
|
"return_type": "const char *",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 43,
|
|
"file": "../../tests/t20013/t20013.cc",
|
|
"line": 13,
|
|
"translation_unit": "../../tests/t20013/t20013.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1841239321495867611",
|
|
"activity_name": "clanguml::t20013::A::a3(const char *)",
|
|
"participant_id": "976623130699225079"
|
|
},
|
|
"type": "message"
|
|
}
|
|
],
|
|
"start_from": {
|
|
"id": 1249768632077843821,
|
|
"location": "clanguml::t20013::tmain(int,char **)"
|
|
}
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t20013"
|
|
}
|
|
```
|