Files
clang-uml/docs/test_cases/t20013.md
2022-12-06 00:36:13 +01:00

1018 B

t20013 - Function and method arguments in sequence diagrams test case

Config

compilation_database_dir: ..
output_directory: puml
diagrams:
  t20013_sequence:
    type: sequence
    glob:
      - ../../tests/t20013/t20013.cc
    include:
      namespaces:
        - clanguml::t20013
    using_namespace:
      - clanguml::t20013
    start_from:
      - function: "clanguml::t20013::tmain(int,char **)"

Source code

File t20013.cc

namespace clanguml {
namespace t20013 {

struct A {
    int a1(int i) { return i; }
    double a2(double d) { return d; }
    const char *a3(const char *s) { return s; }
};

struct B {
    int b(int i) { return a.a1(i); }
    double b(double d) { return a.a2(d); }
    const char *b(const char *s) { return a.a3(s); }

    A a;
};

void tmain(int argc, char **argv)
{
    B b;

    b.b(1);
    b.b(2.0);
    b.b("three");
}
}
}

Generated UML diagrams

t20013_sequence