Files
clang-uml/docs/test_cases/t20025.md
2023-10-08 17:24:30 +02:00

4.8 KiB

t20025 - Skip decorator sequence diagram test case

Config

compilation_database_dir: ..
output_directory: diagrams
diagrams:
  t20025_sequence:
    type: sequence
    glob:
      - ../../tests/t20025/t20025.cc
    include:
      namespaces:
        - clanguml::t20025
    using_namespace:
      - clanguml::t20025
    from:
      - function: "clanguml::t20025::tmain()"

Source code

File t20025.cc

namespace clanguml {
namespace t20025 {

int add(int x, int y) { return x + y; }

/// Add 2 numbers
///
/// \param x
/// \param y
/// \return
/// \uml{skip}
int add2(int x, int y) { return x + x + y + y; }

struct A {
    int a()
    {
        /// TODO: this doesn't work yet...
        /// \uml{skip}
        a2();

        return a1();
    }

    /// \uml{skip}
    int a1() { return 1; }

    void a2() { }
};

int tmain()
{
    A a;

    int result{};

    result = a.a();

    result += add(1, 2);

    result += add2(2, 4);

    return result;
}
}
}

Generated PlantUML diagrams

t20025_sequence

Generated Mermaid diagrams

t20025_sequence

Generated JSON models

{
  "diagram_type": "sequence",
  "metadata": {
    "clang_uml_version": "0.4.0-2-g4ab0d29",
    "llvm_version": "Ubuntu clang version 16.0.6 (++20230710042027+7cbf1a259152-1~exp1~20230710162048.105)",
    "schema_version": 1
  },
  "name": "t20025_sequence",
  "participants": [
    {
      "id": "1268545806896171690",
      "name": "clanguml::t20025::tmain()",
      "source_location": {
        "column": 5,
        "file": "../../tests/t20025/t20025.cc",
        "line": 30,
        "translation_unit": "../../tests/t20025/t20025.cc"
      },
      "type": "function"
    },
    {
      "id": "2144852170258286289",
      "name": "clanguml::t20025::A",
      "source_location": {
        "column": 8,
        "file": "../../tests/t20025/t20025.cc",
        "line": 14,
        "translation_unit": "../../tests/t20025/t20025.cc"
      },
      "type": "class"
    },
    {
      "id": "228843323046630374",
      "name": "clanguml::t20025::add(int,int)",
      "source_location": {
        "column": 5,
        "file": "../../tests/t20025/t20025.cc",
        "line": 4,
        "translation_unit": "../../tests/t20025/t20025.cc"
      },
      "type": "function"
    }
  ],
  "sequences": [
    {
      "messages": [
        {
          "from": {
            "activity_id": "1268545806896171690",
            "activity_name": "clanguml::t20025::tmain()",
            "participant_id": "1268545806896171690",
            "participant_name": "clanguml::t20025::tmain()"
          },
          "name": "a()",
          "return_type": "int",
          "scope": "normal",
          "source_location": {
            "column": 14,
            "file": "../../tests/t20025/t20025.cc",
            "line": 36,
            "translation_unit": "../../tests/t20025/t20025.cc"
          },
          "to": {
            "activity_id": "1119830104994271584",
            "activity_name": "clanguml::t20025::A::a()",
            "participant_id": "2144852170258286289"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1119830104994271584",
            "activity_name": "clanguml::t20025::A::a()",
            "participant_id": "2144852170258286289"
          },
          "name": "a2()",
          "return_type": "void",
          "scope": "normal",
          "source_location": {
            "column": 9,
            "file": "../../tests/t20025/t20025.cc",
            "line": 19,
            "translation_unit": "../../tests/t20025/t20025.cc"
          },
          "to": {
            "activity_id": "2059622670024664066",
            "activity_name": "clanguml::t20025::A::a2()",
            "participant_id": "2144852170258286289"
          },
          "type": "message"
        },
        {
          "from": {
            "activity_id": "1268545806896171690",
            "activity_name": "clanguml::t20025::tmain()",
            "participant_id": "1268545806896171690",
            "participant_name": "clanguml::t20025::tmain()"
          },
          "name": "",
          "return_type": "int",
          "scope": "normal",
          "source_location": {
            "column": 15,
            "file": "../../tests/t20025/t20025.cc",
            "line": 38,
            "translation_unit": "../../tests/t20025/t20025.cc"
          },
          "to": {
            "activity_id": "228843323046630374",
            "activity_name": "clanguml::t20025::add(int,int)",
            "participant_id": "228843323046630374"
          },
          "type": "message"
        }
      ],
      "start_from": {
        "id": 1268545806896171690,
        "location": "clanguml::t20025::tmain()"
      }
    }
  ],
  "using_namespace": "clanguml::t20025"
}