Files
clang-uml/docs/test_cases/t20036.md
2024-05-22 22:48:33 +02:00

16 KiB

t20036 - Test case for rendering all call chains leading to an activity (to)

Config

diagrams:
  t20036_sequence:
    type: sequence
    glob:
      - t20036.cc
    include:
      namespaces:
        - clanguml::t20036
    using_namespace: clanguml::t20036
    to:
      - function: "clanguml::t20036::A::a2()"

Source code

File tests/t20036/t20036.cc

#include <cstdint>

namespace clanguml {
namespace t20036 {
struct A {
    void a1() { }
    void a2() { }
    void a3() { }
};

struct B {
    void b1() { a.a2(); }
    void b2() { a.a2(); }
    void b3() { a.a3(); }

    A a;
};

struct C {
    void c1() { b.b1(); }
    void c2() { b.b2(); }
    void c3()
    {
        if (reinterpret_cast<uint64_t>(&b) == 0xbadc0de)
            c3();
        else
            c2();
    }

    void c4() { b.b2(); }

    B b;
};

struct D {
    void d1() { c.c2(); }
    void d2() { c.c2(); }
    void d3() { a.a2(); }

    A a;
    C c;
};
}
}

Generated PlantUML diagrams

t20036_sequence

Generated Mermaid diagrams

t20036_sequence

Generated JSON models

{
  "diagram_type": "sequence",
  "name": "t20036_sequence",
  "participants": [
    {
      "activities": [
        {
          "display_name": "c1()",
          "full_name": "clanguml::t20036::C::c1()",
          "id": "1742507735898803374",
          "name": "c1",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 20,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "c2()",
          "full_name": "clanguml::t20036::C::c2()",
          "id": "128745191811378037",
          "name": "c2",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 21,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "c4()",
          "full_name": "clanguml::t20036::C::c4()",
          "id": "1735839766717973272",
          "name": "c4",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 30,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "c3()",
          "full_name": "clanguml::t20036::C::c3()",
          "id": "1523531372012294984",
          "name": "c3",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 22,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        }
      ],
      "display_name": "C",
      "full_name": "clanguml::t20036::C",
      "id": "589458700000736705",
      "name": "C",
      "namespace": "clanguml::t20036",
      "source_location": {
        "column": 8,
        "file": "t20036.cc",
        "line": 19,
        "translation_unit": "t20036.cc"
      },
      "type": "class"
    },
    {
      "activities": [
        {
          "display_name": "b1()",
          "full_name": "clanguml::t20036::B::b1()",
          "id": "203660950902052846",
          "name": "b1",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 12,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "b2()",
          "full_name": "clanguml::t20036::B::b2()",
          "id": "1726094580455938498",
          "name": "b2",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 13,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        }
      ],
      "display_name": "B",
      "full_name": "clanguml::t20036::B",
      "id": "607147607288902300",
      "name": "B",
      "namespace": "clanguml::t20036",
      "source_location": {
        "column": 8,
        "file": "t20036.cc",
        "line": 11,
        "translation_unit": "t20036.cc"
      },
      "type": "class"
    },
    {
      "activities": [
        {
          "display_name": "a2()",
          "full_name": "clanguml::t20036::A::a2()",
          "id": "2124074228514438863",
          "name": "a2",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 7,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        }
      ],
      "display_name": "A",
      "full_name": "clanguml::t20036::A",
      "id": "399722216848214287",
      "name": "A",
      "namespace": "clanguml::t20036",
      "source_location": {
        "column": 8,
        "file": "t20036.cc",
        "line": 5,
        "translation_unit": "t20036.cc"
      },
      "type": "class"
    },
    {
      "activities": [
        {
          "display_name": "d1()",
          "full_name": "clanguml::t20036::D::d1()",
          "id": "701488875613014930",
          "name": "d1",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 36,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "d3()",
          "full_name": "clanguml::t20036::D::d3()",
          "id": "1897648539724183065",
          "name": "d3",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 38,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        },
        {
          "display_name": "d2()",
          "full_name": "clanguml::t20036::D::d2()",
          "id": "1534436779969087203",
          "name": "d2",
          "namespace": "",
          "source_location": {
            "column": 10,
            "file": "t20036.cc",
            "line": 37,
            "translation_unit": "t20036.cc"
          },
          "type": "method"
        }
      ],
      "display_name": "D",
      "full_name": "clanguml::t20036::D",
      "id": "847434467114564641",
      "name": "D",
      "namespace": "clanguml::t20036",
      "source_location": {
        "column": 8,
        "file": "t20036.cc",
        "line": 35,
        "translation_unit": "t20036.cc"
      },
      "type": "class"
    }
  ],
  "sequences": [
    {
      "message_chains": [
        {
          "messages": [
            {
              "from": {
                "activity_id": "1742507735898803374",
                "participant_id": "589458700000736705"
              },
              "name": "b1()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 20,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "203660950902052846",
                "participant_id": "607147607288902300"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "203660950902052846",
                "participant_id": "607147607288902300"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 12,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        },
        {
          "messages": [
            {
              "from": {
                "activity_id": "701488875613014930",
                "participant_id": "847434467114564641"
              },
              "name": "c2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 36,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "name": "b2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 21,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 13,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        },
        {
          "messages": [
            {
              "from": {
                "activity_id": "1897648539724183065",
                "participant_id": "847434467114564641"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 38,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        },
        {
          "messages": [
            {
              "from": {
                "activity_id": "1735839766717973272",
                "participant_id": "589458700000736705"
              },
              "name": "b2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 30,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 13,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        },
        {
          "messages": [
            {
              "from": {
                "activity_id": "1523531372012294984",
                "participant_id": "589458700000736705"
              },
              "name": "c2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 13,
                "file": "t20036.cc",
                "line": 27,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "name": "b2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 21,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 13,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        },
        {
          "messages": [
            {
              "from": {
                "activity_id": "1534436779969087203",
                "participant_id": "847434467114564641"
              },
              "name": "c2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 37,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "128745191811378037",
                "participant_id": "589458700000736705"
              },
              "name": "b2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 21,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "type": "message"
            },
            {
              "from": {
                "activity_id": "1726094580455938498",
                "participant_id": "607147607288902300"
              },
              "name": "a2()",
              "return_type": "void",
              "scope": "normal",
              "source_location": {
                "column": 17,
                "file": "t20036.cc",
                "line": 13,
                "translation_unit": "t20036.cc"
              },
              "to": {
                "activity_id": "2124074228514438863",
                "participant_id": "399722216848214287"
              },
              "type": "message"
            }
          ]
        }
      ],
      "to": {
        "id": 2124074228514438863,
        "location": "clanguml::t20036::A::a2()"
      }
    }
  ],
  "using_namespace": "clanguml::t20036"
}