6.1 KiB
6.1 KiB
t20031 - Callee type sequence diagram filter test case
Config
compilation_database_dir: ..
output_directory: puml
diagrams:
t20031_sequence:
type: sequence
glob:
- ../../tests/t20031/t20031.cc
include:
namespaces:
- clanguml::t20031
exclude:
callee_types:
- constructor
- operator
- lambda
using_namespace:
- clanguml::t20031
start_from:
- function: "clanguml::t20031::tmain(int)"
- function: "clanguml::t20031::tmain(bool,int)"
Source code
File t20031.cc
#include <functional>
namespace clanguml {
namespace t20031 {
int magic() { return 42; }
int zero() { return 0; }
int one() { return 1; }
int execute(std::function<int()> f) { return f(); }
class A {
public:
A() { create(); }
A(int v) { a_ = v; }
A &operator=(const A &a)
{
set(a.a_);
return *this;
}
A &operator+=(int a)
{
add(a);
return *this;
}
int value() const { return a_; }
private:
void create() { a_ = 0; }
void add(int a) { a_ += a; }
void set(int a) { a_ = a; }
int a_;
};
void tmain(int a)
{
A an_a{magic()};
an_a += 1;
}
int tmain(bool f, int a)
{
auto generate_zero = []() { return zero(); };
auto an_a = A();
auto an_b = A();
an_a += generate_zero();
// @todo #168
an_a += execute([]() { return one(); });
an_b = an_a;
return an_b.value();
};
}
}
Generated UML diagrams
Generated JSON models
{
"diagram_type": "sequence",
"metadata": {
"clang_uml_version": "0.3.8-18-gfd06d93",
"llvm_version": "Ubuntu clang version 15.0.7",
"schema_version": 1
},
"name": "t20031_sequence",
"participants": [
{
"id": "1045973591033429178",
"name": "clanguml::t20031::tmain(int)",
"source_location": {
"column": 6,
"file": "../../tests/t20031/t20031.cc",
"line": 39,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"type": "function"
},
{
"id": "2265790048300959619",
"name": "clanguml::t20031::magic()",
"source_location": {
"column": 5,
"file": "../../tests/t20031/t20031.cc",
"line": 5,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"type": "function"
},
{
"id": "2189754495514350927",
"name": "clanguml::t20031::tmain(bool,int)",
"source_location": {
"column": 5,
"file": "../../tests/t20031/t20031.cc",
"line": 45,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"type": "function"
},
{
"id": "2230160420908832598",
"name": "clanguml::t20031::execute(std::function<int ()>)",
"source_location": {
"column": 5,
"file": "../../tests/t20031/t20031.cc",
"line": 8,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"type": "function"
},
{
"id": "1081580052625775404",
"name": "clanguml::t20031::A",
"source_location": {
"column": 7,
"file": "../../tests/t20031/t20031.cc",
"line": 10,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"type": "class"
}
],
"sequences": [
{
"messages": [
{
"from": {
"activity_id": "1045973591033429178",
"activity_name": "clanguml::t20031::tmain(int)",
"participant_id": "1045973591033429178",
"participant_name": "clanguml::t20031::tmain(int)"
},
"name": "",
"return_type": "int",
"scope": "normal",
"source_location": {
"column": 12,
"file": "../../tests/t20031/t20031.cc",
"line": 41,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"to": {
"activity_id": "2265790048300959619",
"activity_name": "clanguml::t20031::magic()",
"participant_id": "2265790048300959619"
},
"type": "message"
}
],
"start_from": {
"id": 1045973591033429178,
"location": "clanguml::t20031::tmain(int)"
}
},
{
"messages": [
{
"from": {
"activity_id": "2189754495514350927",
"activity_name": "clanguml::t20031::tmain(bool,int)",
"participant_id": "2189754495514350927",
"participant_name": "clanguml::t20031::tmain(bool,int)"
},
"name": "",
"return_type": "int",
"scope": "normal",
"source_location": {
"column": 13,
"file": "../../tests/t20031/t20031.cc",
"line": 54,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"to": {
"activity_id": "2230160420908832598",
"activity_name": "clanguml::t20031::execute(std::function<int ()>)",
"participant_id": "2230160420908832598"
},
"type": "message"
},
{
"from": {
"activity_id": "2189754495514350927",
"activity_name": "clanguml::t20031::tmain(bool,int)",
"participant_id": "2189754495514350927",
"participant_name": "clanguml::t20031::tmain(bool,int)"
},
"name": "value() const",
"return_type": "int",
"scope": "normal",
"source_location": {
"column": 12,
"file": "../../tests/t20031/t20031.cc",
"line": 58,
"translation_unit": "../../tests/t20031/t20031.cc"
},
"to": {
"activity_id": "1089278431155817348",
"activity_name": "clanguml::t20031::A::value() const",
"participant_id": "1081580052625775404"
},
"type": "message"
}
],
"start_from": {
"id": 2189754495514350927,
"location": "clanguml::t20031::tmain(bool,int)"
}
}
],
"using_namespace": "clanguml::t20031"
}