387 lines
9.9 KiB
Markdown
387 lines
9.9 KiB
Markdown
# t20009 - Smart pointer dereference call expression test case
|
|
## Config
|
|
```yaml
|
|
diagrams:
|
|
t20009_sequence:
|
|
type: sequence
|
|
glob:
|
|
- t20009.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20009
|
|
using_namespace: clanguml::t20009
|
|
from:
|
|
- function: "clanguml::t20009::tmain()"
|
|
```
|
|
## Source code
|
|
File `tests/t20009/t20009.cc`
|
|
```cpp
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace clanguml {
|
|
namespace t20009 {
|
|
template <typename T> struct A {
|
|
void a(T arg) { }
|
|
};
|
|
|
|
template <typename T> struct B {
|
|
void b(T arg) { a->a(arg); }
|
|
|
|
std::unique_ptr<A<T>> a;
|
|
};
|
|
|
|
using BFloatPtr = std::shared_ptr<B<float>>;
|
|
|
|
void tmain()
|
|
{
|
|
std::shared_ptr<B<std::string>> bstring;
|
|
auto bint = std::make_unique<B<int>>();
|
|
BFloatPtr bfloat;
|
|
|
|
bstring->b("b");
|
|
bint.get()->b(42);
|
|
bfloat->b(1.0);
|
|
}
|
|
}
|
|
}
|
|
```
|
|
## Generated PlantUML diagrams
|
|

|
|
## Generated Mermaid diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "sequence",
|
|
"name": "t20009_sequence",
|
|
"participants": [
|
|
{
|
|
"display_name": "tmain()",
|
|
"full_name": "clanguml::t20009::tmain()",
|
|
"id": "791066686606379857",
|
|
"name": "tmain",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 6,
|
|
"file": "t20009.cc",
|
|
"line": 18,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "function"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "b(std::string)",
|
|
"full_name": "clanguml::t20009::B<std::string>::b(std::string)",
|
|
"id": "1960266381909090879",
|
|
"name": "b",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "B<std::string>",
|
|
"full_name": "clanguml::t20009::B<std::string>",
|
|
"id": "450813573860627679",
|
|
"name": "B",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 10,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "a(std::string)",
|
|
"full_name": "clanguml::t20009::A<std::string>::a(std::string)",
|
|
"id": "1716775846967761286",
|
|
"name": "a",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 7,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "A<std::string>",
|
|
"full_name": "clanguml::t20009::A<std::string>",
|
|
"id": "1197403810800583218",
|
|
"name": "A",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 6,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "b(int)",
|
|
"full_name": "clanguml::t20009::B<int>::b(int)",
|
|
"id": "660557928399203634",
|
|
"name": "b",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "B<int>",
|
|
"full_name": "clanguml::t20009::B<int>",
|
|
"id": "2002310682025149090",
|
|
"name": "B",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 10,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "a(int)",
|
|
"full_name": "clanguml::t20009::A<int>::a(int)",
|
|
"id": "2030629454810805092",
|
|
"name": "a",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 7,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "A<int>",
|
|
"full_name": "clanguml::t20009::A<int>",
|
|
"id": "1228498754558363121",
|
|
"name": "A",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 6,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "b(float)",
|
|
"full_name": "clanguml::t20009::B<float>::b(float)",
|
|
"id": "367805163135583282",
|
|
"name": "b",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "B<float>",
|
|
"full_name": "clanguml::t20009::B<float>",
|
|
"id": "1461902328659683203",
|
|
"name": "B",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 10,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"activities": [
|
|
{
|
|
"display_name": "a(float)",
|
|
"full_name": "clanguml::t20009::A<float>::a(float)",
|
|
"id": "1643733911490581293",
|
|
"name": "a",
|
|
"namespace": "",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t20009.cc",
|
|
"line": 7,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "method"
|
|
}
|
|
],
|
|
"display_name": "A<float>",
|
|
"full_name": "clanguml::t20009::A<float>",
|
|
"id": "1243520246309441967",
|
|
"name": "A",
|
|
"namespace": "clanguml::t20009",
|
|
"source_location": {
|
|
"column": 30,
|
|
"file": "t20009.cc",
|
|
"line": 6,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"type": "class"
|
|
}
|
|
],
|
|
"sequences": [
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "791066686606379857",
|
|
"participant_id": "791066686606379857"
|
|
},
|
|
"name": "b(std::string)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20009.cc",
|
|
"line": 24,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1960266381909090879",
|
|
"participant_id": "450813573860627679"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1960266381909090879",
|
|
"participant_id": "450813573860627679"
|
|
},
|
|
"name": "a(std::string)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 21,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1716775846967761286",
|
|
"participant_id": "1197403810800583218"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "791066686606379857",
|
|
"participant_id": "791066686606379857"
|
|
},
|
|
"name": "b(int)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20009.cc",
|
|
"line": 25,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "660557928399203634",
|
|
"participant_id": "2002310682025149090"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "660557928399203634",
|
|
"participant_id": "2002310682025149090"
|
|
},
|
|
"name": "a(int)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 21,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2030629454810805092",
|
|
"participant_id": "1228498754558363121"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "791066686606379857",
|
|
"participant_id": "791066686606379857"
|
|
},
|
|
"name": "b(float)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 5,
|
|
"file": "t20009.cc",
|
|
"line": 26,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "367805163135583282",
|
|
"participant_id": "1461902328659683203"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "367805163135583282",
|
|
"participant_id": "1461902328659683203"
|
|
},
|
|
"name": "a(float)",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 21,
|
|
"file": "t20009.cc",
|
|
"line": 11,
|
|
"translation_unit": "t20009.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1643733911490581293",
|
|
"participant_id": "1243520246309441967"
|
|
},
|
|
"type": "message"
|
|
}
|
|
],
|
|
"start_from": {
|
|
"id": 791066686606379857,
|
|
"location": "clanguml::t20009::tmain()"
|
|
}
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t20009"
|
|
}
|
|
```
|