Files
clang-uml/docs/test_cases/t20017.md
2023-05-04 22:32:47 +02:00

5.1 KiB

t20017 - Test case for combine_free_functions_into_file_participants option

Config

compilation_database_dir: ..
output_directory: puml
diagrams:
  t20017_sequence:
    type: sequence
    combine_free_functions_into_file_participants: true
    relative_to: ../../tests/t20017
    glob:
      - ../../tests/t20017/t20017.cc
    include:
      namespaces:
        - clanguml::t20017
      paths:
        - .
    using_namespace:
      - clanguml::t20017
    start_from:
      - function: "clanguml::t20017::tmain()"

Source code

File t20017_b.cc

#include "include/t20017_b.h"

namespace clanguml {
namespace t20017 {
int b1(int x, int y) { return x - y; }
}
}

File t20017.cc

#include "include/t20017_a.h"
#include "include/t20017_b.h"

namespace clanguml {
namespace t20017 {
int tmain() { return b2(a1(a2(a3(1, 2), b1(3, 4)), 5), 6); }
}
}

Generated UML diagrams

t20017_sequence

Generated JSON models

{
  "diagram_type": "sequence",
  "metadata": {
    "clang_uml_version": "0.3.4-28-g3eb1c47",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t20017_sequence",
  "participants": [
    {
      "id": "294332401323799021",
      "name": "t20017.cc",
      "source_location": {
        "file": "t20017.cc",
        "line": 6
      },
      "type": "function"
    },
    {
      "id": "1591222867263639510",
      "name": "include/t20017_a.h",
      "source_location": {
        "file": "include/t20017_a.h",
        "line": 7
      },
      "type": "function"
    },
    {
      "id": "1113611539183189365",
      "name": "include/t20017_b.h",
      "source_location": {
        "file": "include/t20017_b.h",
        "line": 5
      },
      "type": "function"
    }
  ],
  "sequences": [
    {
      "messages": [
        {
          "from": {
            "activity_id": "1484746432546296115",
            "activity_name": "clanguml::t20017::tmain()",
            "participant_id": "294332401323799021"
          },
          "name": "a3(int,int)",
          "return_type": "",
          "scope": "normal",
          "source_location": {
            "file": "t20017.cc",
            "line": 6
          },
          "to": {
            "activity_id": "1681392050252260928",
            "activity_name": "clanguml::t20017::a3(int,int)",
            "participant_id": "1591222867263639510"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1484746432546296115",
            "activity_name": "clanguml::t20017::tmain()",
            "participant_id": "294332401323799021"
          },
          "name": "b1(int,int)",
          "return_type": "",
          "scope": "normal",
          "source_location": {
            "file": "t20017.cc",
            "line": 6
          },
          "to": {
            "activity_id": "1714277838806105702",
            "activity_name": "clanguml::t20017::b1(int,int)",
            "participant_id": "1113611539183189365"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1484746432546296115",
            "activity_name": "clanguml::t20017::tmain()",
            "participant_id": "294332401323799021"
          },
          "name": "a2(int,int)",
          "return_type": "",
          "scope": "normal",
          "source_location": {
            "file": "t20017.cc",
            "line": 6
          },
          "to": {
            "activity_id": "291553542743365259",
            "activity_name": "clanguml::t20017::a2(int,int)",
            "participant_id": "1591222867263639510"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1484746432546296115",
            "activity_name": "clanguml::t20017::tmain()",
            "participant_id": "294332401323799021"
          },
          "name": "a1(int,int)",
          "return_type": "",
          "scope": "normal",
          "source_location": {
            "file": "t20017.cc",
            "line": 6
          },
          "to": {
            "activity_id": "113759676939330212",
            "activity_name": "clanguml::t20017::a1(int,int)",
            "participant_id": "1591222867263639510"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1484746432546296115",
            "activity_name": "clanguml::t20017::tmain()",
            "participant_id": "294332401323799021"
          },
          "name": "b2<int>(int,int)",
          "return_type": "",
          "scope": "normal",
          "source_location": {
            "file": "t20017.cc",
            "line": 6
          },
          "to": {
            "activity_id": "775081116464505528",
            "activity_name": "clanguml::t20017::b2<int>(int,int)",
            "participant_id": "1113611539183189365"
          },
          "type": "message"
        }
      ],
      "start_from": {
        "id": 1484746432546296115,
        "location": "clanguml::t20017::tmain()"
      }
    }
  ],
  "using_namespace": "clanguml::t20017"
}