diff --git a/docs/test_cases.md b/docs/test_cases.md index 3fcedb99..4e5e3ee5 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -50,6 +50,7 @@ * [t00049](./test_cases/t00049.md) - Test case configurable type aliases * [t00050](./test_cases/t00050.md) - Test case for generating notes from comments using jinja templates * [t00051](./test_cases/t00051.md) - Test case for relative paths in lambda names + * [t00052](./test_cases/t00052.md) - Test case for template methods rendering ## Sequence diagrams * [t20001](./test_cases/t20001.md) - Basic sequence diagram test case * [t20002](./test_cases/t20002.md) - Free function sequence diagram test case diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index e36403c7..b0640122 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index eec47254..66e87fd6 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 5534f62c..0c3c90ff 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 691ca799..3811daaf 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 4ee4a473..968c20d5 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J[10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 86102710..895a00d7 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index ffb49f40..4eb98760 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,63 +70,63 @@ T - + - + values : std::vector<T> - - - - - B - - T,C<> - + + + + + B + + T,C<> + - - - + + + - - template_template : C<T> + + template_template : C<T> - - - - - B - - int,Vector - - - - - - - D - + + + + + B + + int,Vector + + + + + + + D + - + - + ints : B<int,Vector> - + add(int i) : void - D(std::tuple<Items...> * ) : void - - - - - - ints + D<Items...>(std::tuple<Items...> * ) : void + + + + + + ints diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index c20988fe..2ff8b12c 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 045fbf49..7b8bdde2 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index ab268807..f9fcba7d 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 4860b918..bad367f1 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 36ab2e21..193f8252 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> @@ -202,9 +202,9 @@ get_int_f(const ABCD::F<int> & f) : int - get_e(E<T> e) : T + get_e<T>(E<T> e) : T - get_f(const F<T> & f) : T + get_f<T>(const F<T> & f) : T diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 66a671ef..9f6f75ce 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 3e6c38ab..7415e606 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 6ebd42e9..bdde6f7f 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 029f4658..032bad47 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 540bf03b..a08761df 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 8a4273b2..5608dfa3 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index b04412e3..b5942989 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 3b2841eb..a8749696 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 9a4059cd..e7d283b8 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 29abdd7a..30d1d837 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 7f4680ca..5dacc10e 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 2e0b08d2..cbe11adc 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index a76bda37..662994aa 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index d4c492fb..cd813453 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index f154b0d2..cc3ffa3d 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index babc1db6..5c668bd8 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 2d56d837..947de837 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index deff87fc..c2c98cbe 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index f49027e5..ed38cc4f 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 0d36288b..962e6835 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 43eeb81c..1a36f31f 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 2b91e175..940582cf 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 3c65383a..e498a6a6 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 386bc2bc..f29a61df 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : ST::(anonymous_620) - + - + units : ST::(anonymous_739) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index f8c46d96..e7907ba8 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 7015851b..6ec65ebf 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index e4930743..eae4471c 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index d2547a5d..42f1a371 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 48be1c8c..3ca526bd 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index b928493e..e97b1c8a 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index a17b1c48..f18408c3 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 911fd97f..957ac8a0 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 4c511f62..08065de3 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 5460afe9..18030c01 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 6d23e980..6db25027 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 3c4bfbbf..01e6f78b 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ string_vector - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 478bfc0a..3d351e2d 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T[N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t00051_class.svg b/docs/test_cases/t00051_class.svg index 7962fbb2..5dad5f54 100644 --- a/docs/test_cases/t00051_class.svg +++ b/docs/test_cases/t00051_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,111 +9,111 @@ - - - - - B - - F,FF - + + + + + B + + F,FF + - - - + + + - - f_ : F + + f_ : F - - - + + + - - ff_ : FF + + ff_ : FF - - - B<F, FF>(F && f, FF && ff) : void - - f() : void - - ff() : void - - - - - B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - - - - B((lambda at ../../tests/t00051/t00051.cc:43:18) && f, (lambda at ../../tests/t00051/t00051.cc:43:27) && ff) : void - - f() : void - - ff() : void + + + B<F, FF>(F && f, FF && ff) : void + + f() : void + + ff() : void + + + + + B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> + + + + B((lambda at ../../tests/t00051/t00051.cc:43:18) && f, (lambda at ../../tests/t00051/t00051.cc:43:27) && ff) : void + + f() : void + + ff() : void - - - + + + - - f_ : (lambda at ../../tests/t00051/t00051.cc:43:18) + + f_ : (lambda at ../../tests/t00051/t00051.cc:43:18) - - - + + + - - ff_ : (lambda at ../../tests/t00051/t00051.cc:43:27) + + ff_ : (lambda at ../../tests/t00051/t00051.cc:43:27) - - - - - A - - - - start_thread1() : A::custom_thread1 - - start_thread2() : A::custom_thread2 - - start_thread3() : B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - - get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) + + + + + A + + + + start_thread1() : A::custom_thread1 + + start_thread2() : A::custom_thread2 + + start_thread3() : B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> + + get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) - - - - - A::custom_thread1 - - + + + + + A::custom_thread1 + + - custom_thread1(Function && f, Args &&... args) : void + custom_thread1<Function,Args...>(Function && f, Args &&... args) : void - - - - - A::custom_thread2 - - - - thread((lambda at ../../tests/t00051/t00051.cc:59:27) && ) : void + + + + + A::custom_thread2 + + + + thread((lambda at ../../tests/t00051/t00051.cc:59:27) && ) : void - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/docs/test_cases/t00052.md b/docs/test_cases/t00052.md new file mode 100644 index 00000000..206f049e --- /dev/null +++ b/docs/test_cases/t00052.md @@ -0,0 +1,57 @@ +# t00052 - Test case for template methods rendering +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t00052_class: + type: class + glob: + - ../../tests/t00052/t00052.cc + include: + namespaces: + - clanguml::t00052 + using_namespace: + - clanguml::t00052 +``` +## Source code +File t00052.cc +```cpp +#include + +namespace clanguml { +namespace t00052 { + +class A { +public: + template T a(T p) { return p; } + + template void aa(F &&f, Q q) { f(q); } +}; + +template class B { +public: + T b(T t) { return t; } + + template T bb(F &&f, T t) { return f(t); } +}; + +template class C { + template T c(P p) { return static_cast(p); } +}; + +template <> template <> int C::c(double p) +{ + return std::floor(p); +} + +struct R { + A a; + B b; + C c; +}; +} +} +``` +## Generated UML diagrams +![t00052_class](./t00052_class.svg "Test case for template methods rendering") diff --git a/docs/test_cases/t00052_class.svg b/docs/test_cases/t00052_class.svg new file mode 100644 index 00000000..01198531 --- /dev/null +++ b/docs/test_cases/t00052_class.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + A + + + + a<T>(T p) : T + + aa<F,Q>(F && f, Q q) : void + + + + + + B + + T + + + + b(T t) : T + + bb<F>(F && f, T t) : T + + + + + + C + + T + + + + c<P>(P p) : T + + + + + B + + int + + + + + + C + + int + + + + + + + R + + + + + + + + a : A + + + + + + + b : B<int> + + + + + + + c : C<int> + + + + + + + + + +a + + + +b + + + +c + + diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index 9261ef6a..3fade665 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index f0d87f24..1d2d51b7 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 54aefa87..f8cf9220 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index 92ce3a8b..b8b64286 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 78f7c400..4988e070 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 4c5fcb7d..bcf320d6 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index de5b2d02..8f407d0a 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 7c6b8f1e..92716281 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index 173c91ac..b1bc12d1 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 6c3e2a69..18a96336 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 3da953c4..ee78b4c8 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 623a3274..844d1fc6 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:66:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:79:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda ../../tests/t20012/t20012.cc:85:9)> - + R<R::(lambda ../../tests/t20012/t20012.cc:85:9)> - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:85:9) - + tmain()::(lambda ../../tests/t20012/t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 5c6b9b3d..755c5de0 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 4724e20a..b9c8e10b 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index c139cf56..c17d2fc9 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 731ef4eb..349c02f4 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index df1f4b9f..0e3d5cc4 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_a.h - + include/t20017_a.h - + include/t20017_b.h - + include/t20017_b.h - - - - - - + + + + + + tmain() - + a3(int,int) - + b1(int,int) - + a2(int,int) - + a1(int,int) - + b2<int>(int,int) diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 61a5f3b4..1b73c474 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 8fcdcbb1..65179427 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 4540d720..83b5e2de 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,7 +91,7 @@ alt - + [ @@ -100,7 +100,7 @@ - + [ @@ -109,7 +109,7 @@ - + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index a2cd9e19..f5c1e405 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + [ @@ -148,7 +148,7 @@ loop - + b2() @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 076b3951..855f323b 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index 7535f21f..579516af 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index dc4e5ec2..f5b303e1 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 8b681a83..f606fc85 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index aa655ac1..8fdcc56a 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index e8de8f54..2d8596f6 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index 31abf4e6..ab09a2fc 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + a() - + b() - + c() @@ -60,7 +60,7 @@ - + d() diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index a7a9c258..55953340 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,60 +9,60 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - + + ConnectionPool - + ConnectionPool - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - - - - - - - + + + + + + + + connect() @@ -73,21 +73,21 @@ alt - + [ send(std::string &&) ] - + encode(std::string &&) - + @@ -97,7 +97,7 @@ - + send(std::string &&) @@ -108,7 +108,7 @@ alt - + [ diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 6c5ff943..222e4af6 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,67 +9,67 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B - - - + + + diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index d5a270ac..2870cd53 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 0aa0afeb..4882306b 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index fb8d365e..4a8d014b 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE - - - - + + + + diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index d18a8636..2ee7d255 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index 09d071cc..354a795f 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + B - - + + A - - + + C - + Top A note. - + diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 2b90a795..4548ea9f 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. - + diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index b0638b65..2ee50e12 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 881ecdfb..617a7f6f 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file @@ -60,7 +60,7 @@ - - + + diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 090258c7..922129d5 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index f893732f..4cb6df6f 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + src - + dependants - + dependencies - + include - + dependants - + dependencies - - + + t1.cc - - + + t2.cc - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h diff --git a/src/class_diagram/generators/plantuml/class_diagram_generator.cc b/src/class_diagram/generators/plantuml/class_diagram_generator.cc index f139de4f..5b28bb70 100644 --- a/src/class_diagram/generators/plantuml/class_diagram_generator.cc +++ b/src/class_diagram/generators/plantuml/class_diagram_generator.cc @@ -144,6 +144,10 @@ void generator::generate(const class_ &c, std::ostream &ostr) const ostr << plantuml_common::to_plantuml(m.access()) << m.name(); + if (!m.templates().empty()) { + m.render_template_params(ostr, m_config.using_namespace(), false); + } + ostr << "("; if (m_config.generate_method_arguments() != config::method_arguments::none) { diff --git a/src/class_diagram/model/class.cc b/src/class_diagram/model/class.cc index 96b7a139..1968f85f 100644 --- a/src/class_diagram/model/class.cc +++ b/src/class_diagram/model/class.cc @@ -68,29 +68,12 @@ void class_::add_parent(class_parent &&parent) bases_.emplace_back(std::move(parent)); } -void class_::add_template(template_parameter &&tmplt) -{ - templates_.emplace_back(std::move(tmplt)); -} - const std::vector &class_::members() const { return members_; } const std::vector &class_::methods() const { return methods_; } const std::vector &class_::parents() const { return bases_; } -const std::vector &class_::templates() const -{ - return templates_; -} - -void class_::set_base_template(const std::string &full_name) -{ - base_template_full_name_ = full_name; -} - -std::string class_::base_template() const { return base_template_full_name_; } - bool operator==(const class_ &l, const class_ &r) { return l.id() == r.id(); } std::string class_::full_name_no_ns() const @@ -101,7 +84,7 @@ std::string class_::full_name_no_ns() const ostr << name(); - render_template_params(ostr, false); + render_template_params(ostr, using_namespace(), false); return ostr.str(); } @@ -114,7 +97,8 @@ std::string class_::full_name(bool relative) const std::ostringstream ostr; ostr << name_and_ns(); - render_template_params(ostr, relative); + + render_template_params(ostr, using_namespace(), relative); std::string res; @@ -129,26 +113,6 @@ std::string class_::full_name(bool relative) const return res; } -std::ostringstream &class_::render_template_params( - std::ostringstream &ostr, bool relative) const -{ - using clanguml::common::model::namespace_; - - if (!templates_.empty()) { - std::vector tnames; - std::vector tnames_simplified; - - std::transform(templates_.cbegin(), templates_.cend(), - std::back_inserter(tnames), - [ns = using_namespace(), relative]( - const auto &tmplt) { return tmplt.to_string(ns, relative); }); - - ostr << fmt::format("<{}>", fmt::join(tnames, ",")); - } - - return ostr; -} - bool class_::is_abstract() const { // TODO check if all base abstract methods are overriden diff --git a/src/class_diagram/model/class.h b/src/class_diagram/model/class.h index eb9af5ef..0fcbfa76 100644 --- a/src/class_diagram/model/class.h +++ b/src/class_diagram/model/class.h @@ -23,8 +23,9 @@ #include "common/model/element.h" #include "common/model/enums.h" #include "common/model/stylable_element.h" +#include "common/model/template_parameter.h" +#include "common/model/template_trait.h" #include "common/types.h" -#include "template_parameter.h" #include #include @@ -32,7 +33,8 @@ namespace clanguml::class_diagram::model { class class_ : public common::model::element, - public common::model::stylable_element { + public common::model::stylable_element, + public template_trait { public: class_(const common::model::namespace_ &using_namespace); @@ -55,12 +57,10 @@ public: void add_member(class_member &&member); void add_method(class_method &&method); void add_parent(class_parent &&parent); - void add_template(template_parameter &&tmplt); const std::vector &members() const; const std::vector &methods() const; const std::vector &parents() const; - const std::vector &templates() const; void set_base_template(const std::string &full_name); std::string base_template() const; @@ -85,9 +85,6 @@ public: const class_ &other, const std::string &full_name) const; private: - std::ostringstream &render_template_params( - std::ostringstream &ostr, bool relative) const; - bool is_struct_{false}; bool is_template_{false}; bool is_template_instantiation_{false}; @@ -95,7 +92,6 @@ private: std::vector members_; std::vector methods_; std::vector bases_; - std::vector templates_; std::string base_template_full_name_; std::string full_name_; diff --git a/src/class_diagram/model/class_method.cc b/src/class_diagram/model/class_method.cc index fe84369b..3a3e5868 100644 --- a/src/class_diagram/model/class_method.cc +++ b/src/class_diagram/model/class_method.cc @@ -61,4 +61,5 @@ void class_method::add_parameter(method_parameter &¶meter) { parameters_.emplace_back(std::move(parameter)); } + } // namespace clanguml::class_diagram::model diff --git a/src/class_diagram/model/class_method.h b/src/class_diagram/model/class_method.h index f047863e..d2e2b81e 100644 --- a/src/class_diagram/model/class_method.h +++ b/src/class_diagram/model/class_method.h @@ -18,6 +18,8 @@ #pragma once #include "class_element.h" +#include "common/model/template_parameter.h" +#include "common/model/template_trait.h" #include "method_parameter.h" #include @@ -25,7 +27,9 @@ namespace clanguml::class_diagram::model { -class class_method : public class_element { +using clanguml::common::model::template_trait; + +class class_method : public class_element, public template_trait { public: class_method(common::model::access_t access, const std::string &name, const std::string &type); @@ -52,6 +56,7 @@ public: private: std::vector parameters_; + bool is_pure_virtual_{false}; bool is_virtual_{false}; bool is_const_{false}; diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index c3ecdfcd..2f84b579 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -18,7 +18,6 @@ #include "translation_unit_visitor.h" #include "common/clang_utils.h" -#include "cx/util.h" #include #include @@ -26,19 +25,6 @@ namespace clanguml::class_diagram::visitor { -using clanguml::class_diagram::model::class_; -using clanguml::class_diagram::model::class_member; -using clanguml::class_diagram::model::class_method; -using clanguml::class_diagram::model::class_parent; -using clanguml::class_diagram::model::diagram; -using clanguml::class_diagram::model::enum_; -using clanguml::class_diagram::model::method_parameter; -using clanguml::class_diagram::model::template_parameter; -using clanguml::common::model::access_t; -using clanguml::common::model::namespace_; -using clanguml::common::model::relationship; -using clanguml::common::model::relationship_t; - translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm, clanguml::class_diagram::model::diagram &diagram, const clanguml::config::class_diagram &config) @@ -513,7 +499,8 @@ void translation_unit_visitor::process_class_declaration( } bool translation_unit_visitor::process_template_parameters( - const clang::ClassTemplateDecl &template_declaration, class_ &c) + const clang::TemplateDecl &template_declaration, + common::model::template_trait &c) { LOG_DBG("Processing class {} template parameters...", common::get_qualified_name(template_declaration)); @@ -966,6 +953,8 @@ void translation_unit_visitor::process_template_method( method.is_defaulted(mf.getTemplatedDecl()->isDefaulted()); method.is_static(mf.getTemplatedDecl()->isStatic()); + process_template_parameters(mf, method); + process_comment(mf, method); if (method.skip()) @@ -1368,9 +1357,8 @@ void translation_unit_visitor::process_template_specialization_argument( declaration_text.find(cls->getNameAsString()) + cls->getNameAsString().size() + 1); - auto template_params = - cx::util::parse_unexposed_template_params( - declaration_text, [](const auto &t) { return t; }); + auto template_params = common::parse_unexposed_template_params( + declaration_text, [](const auto &t) { return t; }); if (template_params.size() > argument_index) type_name = template_params[argument_index].to_string( @@ -1414,9 +1402,8 @@ void translation_unit_visitor::process_template_specialization_argument( declaration_text.find(cls->getNameAsString()) + cls->getNameAsString().size() + 1); - auto template_params = - cx::util::parse_unexposed_template_params( - declaration_text, [](const auto &t) { return t; }); + auto template_params = common::parse_unexposed_template_params( + declaration_text, [](const auto &t) { return t; }); if (template_params.size() > argument_index) type_name = template_params[argument_index].to_string( @@ -1482,7 +1469,7 @@ void translation_unit_visitor:: process_unexposed_template_specialization_parameters( const std::string &type_name, template_parameter &tp, class_ &c) { - auto template_params = cx::util::parse_unexposed_template_params( + auto template_params = common::parse_unexposed_template_params( type_name, [](const std::string &t) { return t; }); found_relationships_t relationships; @@ -2221,7 +2208,7 @@ void translation_unit_visitor::process_field( [&d = diagram()](const std::string &full_name) { if (full_name.empty()) return false; - auto [ns, name] = cx::util::split_ns(full_name); + auto [ns, name] = common::split_ns(full_name); return d.should_include(ns, name); }); } diff --git a/src/class_diagram/visitor/translation_unit_visitor.h b/src/class_diagram/visitor/translation_unit_visitor.h index 0e7dcfe8..9313087c 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.h +++ b/src/class_diagram/visitor/translation_unit_visitor.h @@ -20,6 +20,7 @@ #include "class_diagram/model/class.h" #include "class_diagram/model/diagram.h" #include "common/model/enums.h" +#include "common/model/template_trait.h" #include "common/visitor/translation_unit_visitor.h" #include "config/config.h" @@ -34,6 +35,20 @@ namespace clanguml::class_diagram::visitor { +using clanguml::class_diagram::model::class_; +using clanguml::class_diagram::model::class_member; +using clanguml::class_diagram::model::class_method; +using clanguml::class_diagram::model::class_parent; +using clanguml::class_diagram::model::diagram; +using clanguml::class_diagram::model::enum_; +using clanguml::class_diagram::model::method_parameter; +using clanguml::common::model::access_t; +using clanguml::common::model::namespace_; +using clanguml::common::model::relationship; +using clanguml::common::model::relationship_t; +using clanguml::common::model::template_parameter; +using clanguml::common::model::template_trait; + using found_relationships_t = std::vector>; @@ -108,12 +123,11 @@ private: clang::ClassTemplateSpecializationDecl *cls); void process_template_specialization_children( - const clang::ClassTemplateSpecializationDecl *cls, - clanguml::class_diagram::model::class_ &c); + const clang::ClassTemplateSpecializationDecl *cls, class_ &c); bool process_template_parameters( - const clang::ClassTemplateDecl &template_declaration, - clanguml::class_diagram::model::class_ &c); + const clang::TemplateDecl &template_declaration, + clanguml::common::model::template_trait &t); void process_template_specialization_argument( const clang::ClassTemplateSpecializationDecl *cls, @@ -171,7 +185,7 @@ private: clanguml::class_diagram::model::class_ &tinst, std::deque> &template_base_params, int arg_index, bool variadic_params, - const clanguml::class_diagram::model::template_parameter &ct) const; + const clanguml::common::model::template_parameter &ct) const; void build_template_instantiation_process_template_arguments( std::optional &parent, @@ -186,15 +200,15 @@ private: const std::string &full_template_specialization_name, const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, - model::template_parameter &argument); + common::model::template_parameter &argument); void build_template_instantiation_process_expression_argument( const clang::TemplateArgument &arg, - model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_integral_argument( const clang::TemplateArgument &arg, - model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_type_argument( std::optional &parent, @@ -202,11 +216,11 @@ private: const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, model::class_ &template_instantiation, - model::template_parameter &argument); + common::model::template_parameter &argument); void build_template_instantiation_process_template_argument( const clang::TemplateArgument &arg, - model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void ensure_lambda_type_is_relative(std::string ¶meter_type) const; @@ -220,19 +234,19 @@ private: void process_unexposed_template_specialization_parameters( const std::string &tspec, - clanguml::class_diagram::model::template_parameter &tp, + clanguml::common::model::template_parameter &tp, clanguml::class_diagram::model::class_ &c); bool find_relationships_in_unexposed_template_params( - const clanguml::class_diagram::model::template_parameter &ct, + const clanguml::common::model::template_parameter &ct, found_relationships_t &relationships); void add_incomplete_forward_declarations(); void resolve_local_to_global_ids(); - bool simplify_system_template( - model::template_parameter &ct, const std::string &full_name) const; + bool simplify_system_template(common::model::template_parameter &ct, + const std::string &full_name) const; /// Store the mapping from local clang entity id (obtained using /// getID()) method to clang-uml global id diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index d47e05cc..57cea568 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -300,4 +300,104 @@ template <> id_t to_id(const clang::TemplateArgument &template_argument) throw std::runtime_error("Cannot generate id for template argument"); } + +std::pair split_ns( + const std::string &full_name) +{ + assert(!full_name.empty()); + + auto name_before_template = ::clanguml::util::split(full_name, "<")[0]; + auto ns = common::model::namespace_{ + ::clanguml::util::split(name_before_template, "::")}; + auto name = ns.name(); + ns.pop_back(); + return {ns, name}; +} + +std::vector parse_unexposed_template_params( + const std::string ¶ms, + const std::function &ns_resolve, + int depth) +{ + using common::model::template_parameter; + + std::vector res; + + auto it = params.begin(); + while (std::isspace(*it) != 0) + ++it; + + std::string type{}; + std::vector nested_params; + bool complete_class_template_argument{false}; + + while (it != params.end()) { + if (*it == '<') { + int nested_level{0}; + auto bracket_match_begin = it + 1; + auto bracket_match_end = bracket_match_begin; + while (bracket_match_end != params.end()) { + if (*bracket_match_end == '<') { + nested_level++; + } + else if (*bracket_match_end == '>') { + if (nested_level > 0) + nested_level--; + else + break; + } + else { + } + bracket_match_end++; + } + + std::string nested_params_str( + bracket_match_begin, bracket_match_end); + + nested_params = parse_unexposed_template_params( + nested_params_str, ns_resolve, depth + 1); + + if (nested_params.empty()) + nested_params.emplace_back( + template_parameter{nested_params_str}); + + it = bracket_match_end - 1; + } + else if (*it == '>') { + complete_class_template_argument = true; + if (depth == 0) { + break; + } + } + else if (*it == ',') { + complete_class_template_argument = true; + } + else { + type += *it; + } + if (complete_class_template_argument) { + template_parameter t; + t.set_type(ns_resolve(clanguml::util::trim(type))); + type = ""; + for (auto &¶m : nested_params) + t.add_template_param(std::move(param)); + + res.emplace_back(std::move(t)); + complete_class_template_argument = false; + } + it++; + } + + if (!type.empty()) { + template_parameter t; + t.set_type(ns_resolve(clanguml::util::trim(type))); + type = ""; + for (auto &¶m : nested_params) + t.add_template_param(std::move(param)); + + res.emplace_back(std::move(t)); + } + + return res; +} } // namespace clanguml::common diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index d8d75669..1c162ae5 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -17,8 +17,11 @@ */ #pragma once -#include "cx/util.h" +#include "common/model/enums.h" +#include "common/model/namespace.h" +#include "common/model/template_parameter.h" #include "types.h" +#include "util/util.h" #include @@ -131,4 +134,12 @@ template <> id_t to_id(const clang::EnumType &type); template <> id_t to_id(const clang::TemplateSpecializationType &type); template <> id_t to_id(const std::filesystem::path &type); + +std::pair split_ns( + const std::string &full_name); + +std::vector parse_unexposed_template_params( + const std::string ¶ms, + const std::function &ns_resolve, + int depth = 0); } // namespace clanguml::common diff --git a/src/common/model/diagram_filter.cc b/src/common/model/diagram_filter.cc index 34154ca5..dc14a503 100644 --- a/src/common/model/diagram_filter.cc +++ b/src/common/model/diagram_filter.cc @@ -612,7 +612,7 @@ bool diagram_filter::should_include(const std::string &name) const if (name.empty()) return false; - auto [ns, n] = cx::util::split_ns(name); + auto [ns, n] = common::split_ns(name); return should_include(ns, n); } diff --git a/src/common/model/diagram_filter.h b/src/common/model/diagram_filter.h index 7d5ceda5..49e69df3 100644 --- a/src/common/model/diagram_filter.h +++ b/src/common/model/diagram_filter.h @@ -18,12 +18,12 @@ #pragma once #include "class_diagram/model/diagram.h" +#include "common/clang_utils.h" #include "common/model/diagram.h" #include "common/model/element.h" #include "common/model/enums.h" #include "common/model/namespace.h" #include "config/config.h" -#include "cx/util.h" #include "diagram.h" #include "include_diagram/model/diagram.h" #include "source_file.h" diff --git a/src/class_diagram/model/template_parameter.cc b/src/common/model/template_parameter.cc similarity index 97% rename from src/class_diagram/model/template_parameter.cc rename to src/common/model/template_parameter.cc index efba7a7d..ed276b6c 100644 --- a/src/class_diagram/model/template_parameter.cc +++ b/src/common/model/template_parameter.cc @@ -1,5 +1,5 @@ /** - * src/class_diagram/model/template_parameter.cc + * src/common/model/template_parameter.cc * * Copyright (c) 2021-2023 Bartek Kryza * @@ -22,7 +22,7 @@ #include -namespace clanguml::class_diagram::model { +namespace clanguml::common::model { template_parameter::template_parameter(const std::string &type, const std::string &name, std::string default_value, bool is_variadic) @@ -216,4 +216,4 @@ bool template_parameter::find_nested_relationships( return added_aggregation_relationship; } -} // namespace clanguml::class_diagram::model +} // namespace clanguml::common::model diff --git a/src/class_diagram/model/template_parameter.h b/src/common/model/template_parameter.h similarity index 96% rename from src/class_diagram/model/template_parameter.h rename to src/common/model/template_parameter.h index 5f9392fd..3ca0f173 100644 --- a/src/class_diagram/model/template_parameter.h +++ b/src/common/model/template_parameter.h @@ -1,5 +1,5 @@ /** - * src/class_diagram/model/template_parameter.h + * src/common/model/template_parameter.h * * Copyright (c) 2021-2023 Bartek Kryza * @@ -24,7 +24,7 @@ #include #include -namespace clanguml::class_diagram::model { +namespace clanguml::common::model { /// @brief Represents template parameter or template argument /// @@ -130,4 +130,4 @@ private: std::optional id_; }; -} // namespace clanguml::class_diagram::model +} // namespace clanguml::common::model diff --git a/src/common/model/template_trait.cc b/src/common/model/template_trait.cc new file mode 100644 index 00000000..878c02ce --- /dev/null +++ b/src/common/model/template_trait.cc @@ -0,0 +1,97 @@ +/** + * src/common/model/template_trait.cc + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "common/model/template_trait.h" + +namespace clanguml::common::model { + +std::ostream &template_trait::render_template_params(std::ostream &ostr, + const common::model::namespace_ &using_namespace, bool relative) const +{ + using clanguml::common::model::namespace_; + + if (!templates_.empty()) { + std::vector tnames; + std::vector tnames_simplified; + + std::transform(templates_.cbegin(), templates_.cend(), + std::back_inserter(tnames), + [ns = using_namespace, relative]( + const auto &tmplt) { return tmplt.to_string(ns, relative); }); + + ostr << fmt::format("<{}>", fmt::join(tnames, ",")); + } + + return ostr; +} + +void template_trait::set_base_template(const std::string &full_name) +{ + base_template_full_name_ = full_name; +} + +std::string template_trait::base_template() const +{ + return base_template_full_name_; +} + +void template_trait::add_template(template_parameter &&tmplt) +{ + templates_.push_back(std::move(tmplt)); +} + +bool template_trait::is_implicit() const { return is_implicit_; } + +void template_trait::set_implicit(bool implicit) { is_implicit_ = implicit; } + +const std::vector &template_trait::templates() const +{ + return templates_; +} + +int template_trait::calculate_template_specialization_match( + const template_trait &other, const std::string & /*full_name*/) const +{ + int res{}; + + // TODO: handle variadic templates + if (templates().size() != other.templates().size()) { + return res; + } + + // Iterate over all template arguments + for (auto i = 0U; i < other.templates().size(); i++) { + const auto &template_arg = templates().at(i); + const auto &other_template_arg = other.templates().at(i); + + if (template_arg == other_template_arg) { + res++; + } + else if (other_template_arg.is_specialization_of(template_arg)) { + continue; + } + else { + res = 0; + break; + } + } + + return res; +} + +} // namespace clanguml::common::model \ No newline at end of file diff --git a/src/common/model/template_trait.h b/src/common/model/template_trait.h new file mode 100644 index 00000000..9adc5315 --- /dev/null +++ b/src/common/model/template_trait.h @@ -0,0 +1,54 @@ +/** + * src/common/model/template_trait.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "common/model/element.h" +#include "common/model/template_parameter.h" + +#include +#include + +namespace clanguml::common::model { + +class template_trait { +public: + std::ostream &render_template_params(std::ostream &ostr, + const common::model::namespace_ &using_namespace, bool relative) const; + + void set_base_template(const std::string &full_name); + + std::string base_template() const; + + void add_template(template_parameter &&tmplt); + + const std::vector &templates() const; + + int calculate_template_specialization_match( + const template_trait &other, const std::string &full_name) const; + + bool is_implicit() const; + + void set_implicit(bool implicit); + +private: + std::vector templates_; + std::string base_template_full_name_; + bool is_implicit_{false}; +}; + +} // namespace clanguml::common::model diff --git a/src/cx/util.cc b/src/cx/util.cc deleted file mode 100644 index 73684113..00000000 --- a/src/cx/util.cc +++ /dev/null @@ -1,129 +0,0 @@ -/** - * src/cx/util.cc - * - * Copyright (c) 2021-2023 Bartek Kryza - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "cx/util.h" -#include "util/util.h" - -#include - -#include -#include - -namespace clanguml::cx::util { - -std::pair split_ns( - const std::string &full_name) -{ - assert(!full_name.empty()); - - auto name_before_template = ::clanguml::util::split(full_name, "<")[0]; - auto ns = common::model::namespace_{ - ::clanguml::util::split(name_before_template, "::")}; - auto name = ns.name(); - ns.pop_back(); - return {ns, name}; -} - -std::vector -parse_unexposed_template_params(const std::string ¶ms, - const std::function &ns_resolve, - int depth) -{ - using class_diagram::model::template_parameter; - - std::vector res; - - auto it = params.begin(); - while (std::isspace(*it) != 0) - ++it; - - std::string type{}; - std::vector nested_params; - bool complete_class_template_argument{false}; - - while (it != params.end()) { - if (*it == '<') { - int nested_level{0}; - auto bracket_match_begin = it + 1; - auto bracket_match_end = bracket_match_begin; - while (bracket_match_end != params.end()) { - if (*bracket_match_end == '<') { - nested_level++; - } - else if (*bracket_match_end == '>') { - if (nested_level > 0) - nested_level--; - else - break; - } - else { - } - bracket_match_end++; - } - - std::string nested_params_str( - bracket_match_begin, bracket_match_end); - - nested_params = parse_unexposed_template_params( - nested_params_str, ns_resolve, depth + 1); - - if (nested_params.empty()) - nested_params.emplace_back( - template_parameter{nested_params_str}); - - it = bracket_match_end - 1; - } - else if (*it == '>') { - complete_class_template_argument = true; - if (depth == 0) { - break; - } - } - else if (*it == ',') { - complete_class_template_argument = true; - } - else { - type += *it; - } - if (complete_class_template_argument) { - template_parameter t; - t.set_type(ns_resolve(clanguml::util::trim(type))); - type = ""; - for (auto &¶m : nested_params) - t.add_template_param(std::move(param)); - - res.emplace_back(std::move(t)); - complete_class_template_argument = false; - } - it++; - } - - if (!type.empty()) { - template_parameter t; - t.set_type(ns_resolve(clanguml::util::trim(type))); - type = ""; - for (auto &¶m : nested_params) - t.add_template_param(std::move(param)); - - res.emplace_back(std::move(t)); - } - - return res; -} - -} // namespace clanguml::cx::util diff --git a/src/cx/util.h b/src/cx/util.h deleted file mode 100644 index f56aacbe..00000000 --- a/src/cx/util.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * src/cx/util.h - * - * Copyright (c) 2021-2023 Bartek Kryza - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include "common/model/namespace.h" - -#include -#include - -namespace clanguml::cx::util { - -std::pair split_ns( - const std::string &full_name); - -std::vector -parse_unexposed_template_params(const std::string ¶ms, - const std::function &ns_resolve, - int depth = 0); - -} // namespace clanguml::cx::util diff --git a/src/package_diagram/visitor/translation_unit_visitor.cc b/src/package_diagram/visitor/translation_unit_visitor.cc index feb2d7f0..cf68dcb7 100644 --- a/src/package_diagram/visitor/translation_unit_visitor.cc +++ b/src/package_diagram/visitor/translation_unit_visitor.cc @@ -20,7 +20,6 @@ #include "common/clang_utils.h" #include "common/model/namespace.h" -#include "cx/util.h" #include diff --git a/src/sequence_diagram/model/participant.cc b/src/sequence_diagram/model/participant.cc index b898d818..aa1ef0c4 100644 --- a/src/sequence_diagram/model/participant.cc +++ b/src/sequence_diagram/model/participant.cc @@ -20,83 +20,6 @@ namespace clanguml::sequence_diagram::model { -std::ostringstream &template_trait::render_template_params( - std::ostringstream &ostr, const common::model::namespace_ &using_namespace, - bool relative) const -{ - using clanguml::common::model::namespace_; - - if (!templates_.empty()) { - std::vector tnames; - std::vector tnames_simplified; - - std::transform(templates_.cbegin(), templates_.cend(), - std::back_inserter(tnames), - [ns = using_namespace, relative]( - const auto &tmplt) { return tmplt.to_string(ns, relative); }); - - ostr << fmt::format("<{}>", fmt::join(tnames, ",")); - } - - return ostr; -} - -void template_trait::set_base_template(const std::string &full_name) -{ - base_template_full_name_ = full_name; -} - -std::string template_trait::base_template() const -{ - return base_template_full_name_; -} - -void template_trait::add_template( - class_diagram::model::template_parameter tmplt) -{ - templates_.push_back(std::move(tmplt)); -} - -bool template_trait::is_implicit() const { return is_implicit_; } - -void template_trait::set_implicit(bool implicit) { is_implicit_ = implicit; } - -const std::vector & -template_trait::templates() const -{ - return templates_; -} - -int template_trait::calculate_template_specialization_match( - const template_trait &other, const std::string & /*full_name*/) const -{ - int res{}; - - // TODO: handle variadic templates - if (templates().size() != other.templates().size()) { - return res; - } - - // Iterate over all template arguments - for (auto i = 0U; i < other.templates().size(); i++) { - const auto &template_arg = templates().at(i); - const auto &other_template_arg = other.templates().at(i); - - if (template_arg == other_template_arg) { - res++; - } - else if (other_template_arg.is_specialization_of(template_arg)) { - continue; - } - else { - res = 0; - break; - } - } - - return res; -} - std::string participant::to_string() const { return fmt::format( diff --git a/src/sequence_diagram/model/participant.h b/src/sequence_diagram/model/participant.h index 25275927..9a3e19a3 100644 --- a/src/sequence_diagram/model/participant.h +++ b/src/sequence_diagram/model/participant.h @@ -17,39 +17,16 @@ */ #pragma once -#include "class_diagram/model/template_parameter.h" #include "common/model/element.h" +#include "common/model/template_parameter.h" +#include "common/model/template_trait.h" #include #include namespace clanguml::sequence_diagram::model { -struct template_trait { - std::ostringstream &render_template_params(std::ostringstream &ostr, - const common::model::namespace_ &using_namespace, bool relative) const; - - void set_base_template(const std::string &full_name); - - std::string base_template() const; - - void add_template(class_diagram::model::template_parameter tmplt); - - const std::vector & - templates() const; - - int calculate_template_specialization_match( - const template_trait &other, const std::string &full_name) const; - - bool is_implicit() const; - - void set_implicit(bool implicit); - -private: - std::vector templates_; - std::string base_template_full_name_; - bool is_implicit_{false}; -}; +using clanguml::common::model::template_trait; struct participant : public common::model::element, public common::model::stylable_element { diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 5073fd8a..6f5cdf3b 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -18,8 +18,8 @@ #include "translation_unit_visitor.h" +#include "common/clang_utils.h" #include "common/model/namespace.h" -#include "cx/util.h" namespace clanguml::sequence_diagram::visitor { @@ -1336,7 +1336,7 @@ bool translation_unit_visitor::process_template_parameters( const clang::TemplateDecl &template_declaration, sequence_diagram::model::template_trait &c) { - using class_diagram::model::template_parameter; + using common::model::template_parameter; LOG_TRACE("Processing class {} template parameters...", common::get_qualified_name(template_declaration)); @@ -1357,7 +1357,7 @@ bool translation_unit_visitor::process_template_parameters( ct.set_default_value(""); ct.is_variadic(template_type_parameter->isParameterPack()); - c.add_template(ct); + c.add_template(std::move(ct)); } else if (clang::dyn_cast_or_null( parameter) != nullptr) { @@ -1371,7 +1371,7 @@ bool translation_unit_visitor::process_template_parameters( ct.set_default_value(""); ct.is_variadic(template_nontype_parameter->isParameterPack()); - c.add_template(ct); + c.add_template(std::move(ct)); } else if (clang::dyn_cast_or_null( parameter) != nullptr) { @@ -1385,7 +1385,7 @@ bool translation_unit_visitor::process_template_parameters( ct.set_default_value(""); ct.is_variadic(template_template_parameter->isParameterPack()); - c.add_template(ct); + c.add_template(std::move(ct)); } else { // pass @@ -1510,7 +1510,7 @@ void translation_unit_visitor:: { for (const auto &arg : template_args) { const auto argument_kind = arg.getKind(); - class_diagram::model::template_parameter argument; + common::model::template_parameter argument; if (argument_kind == clang::TemplateArgument::Template) { build_template_instantiation_process_template_argument( arg, argument); @@ -1535,14 +1535,14 @@ void translation_unit_visitor:: simplify_system_template( argument, argument.to_string(config().using_namespace(), false)); - template_instantiation.add_template(argument); + template_instantiation.add_template(std::move(argument)); } } void translation_unit_visitor:: build_template_instantiation_process_template_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const + common::model::template_parameter &argument) const { argument.is_template_parameter(true); auto arg_name = @@ -1553,7 +1553,7 @@ void translation_unit_visitor:: void translation_unit_visitor:: build_template_instantiation_process_integral_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const + common::model::template_parameter &argument) const { assert(arg.getKind() == clang::TemplateArgument::Integral); @@ -1564,7 +1564,7 @@ void translation_unit_visitor:: void translation_unit_visitor:: build_template_instantiation_process_expression_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const + common::model::template_parameter &argument) const { assert(arg.getKind() == clang::TemplateArgument::Expression); @@ -1579,7 +1579,7 @@ void translation_unit_visitor:: const std::string & /*full_template_specialization_name*/, const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const + common::model::template_parameter &argument) const { assert(arg.getKind() == clang::TemplateArgument::Type); @@ -1596,7 +1596,7 @@ void translation_unit_visitor:: const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, model::template_trait &template_instantiation, - class_diagram::model::template_parameter &argument) + common::model::template_parameter &argument) { assert(arg.getKind() == clang::TemplateArgument::Type); @@ -1685,7 +1685,7 @@ void translation_unit_visitor::process_template_specialization_argument( const auto argument_kind = arg.getKind(); if (argument_kind == clang::TemplateArgument::Type) { - class_diagram::model::template_parameter argument; + common::model::template_parameter argument; argument.is_template_parameter(false); // If this is a nested template type - add nested templates as @@ -1731,9 +1731,8 @@ void translation_unit_visitor::process_template_specialization_argument( declaration_text.find(cls->getNameAsString()) + cls->getNameAsString().size() + 1); - auto template_params = - cx::util::parse_unexposed_template_params( - declaration_text, [](const auto &t) { return t; }); + auto template_params = common::parse_unexposed_template_params( + declaration_text, [](const auto &t) { return t; }); if (template_params.size() > argument_index) type_name = template_params[argument_index].to_string( @@ -1789,9 +1788,8 @@ void translation_unit_visitor::process_template_specialization_argument( declaration_text.find(cls->getNameAsString()) + cls->getNameAsString().size() + 1); - auto template_params = - cx::util::parse_unexposed_template_params( - declaration_text, [](const auto &t) { return t; }); + auto template_params = common::parse_unexposed_template_params( + declaration_text, [](const auto &t) { return t; }); if (template_params.size() > argument_index) type_name = template_params[argument_index].to_string( @@ -1816,23 +1814,23 @@ void translation_unit_visitor::process_template_specialization_argument( simplify_system_template( argument, argument.to_string(config().using_namespace(), false)); - template_instantiation.add_template(argument); + template_instantiation.add_template(std::move(argument)); } else if (argument_kind == clang::TemplateArgument::Integral) { - class_diagram::model::template_parameter argument; + common::model::template_parameter argument; argument.is_template_parameter(false); argument.set_type(std::to_string(arg.getAsIntegral().getExtValue())); - template_instantiation.add_template(argument); + template_instantiation.add_template(std::move(argument)); } else if (argument_kind == clang::TemplateArgument::Expression) { - class_diagram::model::template_parameter argument; + common::model::template_parameter argument; argument.is_template_parameter(false); argument.set_type(common::get_source_text( arg.getAsExpr()->getSourceRange(), source_manager())); - template_instantiation.add_template(argument); + template_instantiation.add_template(std::move(argument)); } else if (argument_kind == clang::TemplateArgument::TemplateExpansion) { - class_diagram::model::template_parameter argument; + common::model::template_parameter argument; argument.is_template_parameter(true); cls->getLocation().dump(source_manager()); @@ -2040,11 +2038,10 @@ translation_unit_visitor::build_template_instantiation( void translation_unit_visitor:: process_unexposed_template_specialization_parameters( - const std::string &type_name, - class_diagram::model::template_parameter &tp, + const std::string &type_name, common::model::template_parameter &tp, model::class_ & /*c*/) const { - auto template_params = cx::util::parse_unexposed_template_params( + auto template_params = common::parse_unexposed_template_params( type_name, [](const std::string &t) { return t; }); for (auto ¶m : template_params) { @@ -2053,8 +2050,7 @@ void translation_unit_visitor:: } bool translation_unit_visitor::simplify_system_template( - class_diagram::model::template_parameter &ct, - const std::string &full_name) const + common::model::template_parameter &ct, const std::string &full_name) const { if (config().type_aliases().count(full_name) > 0) { ct.set_name(config().type_aliases().at(full_name)); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index a094559c..c67a1d75 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -30,6 +30,8 @@ namespace clanguml::sequence_diagram::visitor { +using common::model::template_parameter; + std::string to_string(const clang::FunctionTemplateDecl *decl); class translation_unit_visitor @@ -179,7 +181,7 @@ private: bool process_template_parameters( const clang::TemplateDecl &template_declaration, - sequence_diagram::model::template_trait &c); + common::model::template_trait &c); std::unique_ptr build_function_template_instantiation(const clang::FunctionDecl &pDecl); @@ -200,22 +202,22 @@ private: void build_template_instantiation_process_template_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_integral_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_expression_argument( const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_tag_argument( model::template_trait &template_instantiation, const std::string &full_template_specialization_name, const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, - class_diagram::model::template_parameter &argument) const; + common::model::template_parameter &argument) const; void build_template_instantiation_process_type_argument( model::template_trait *parent, @@ -223,7 +225,7 @@ private: const clang::TemplateDecl *template_decl, const clang::TemplateArgument &arg, model::template_trait &template_instantiation, - class_diagram::model::template_parameter &argument); + common::model::template_parameter &argument); std::unique_ptr process_template_specialization( clang::ClassTemplateSpecializationDecl *cls); @@ -235,14 +237,14 @@ private: bool in_parameter_pack = false); void process_unexposed_template_specialization_parameters( - const std::string &type_name, - class_diagram::model::template_parameter &tp, model::class_ &c) const; + const std::string &type_name, common::model::template_parameter &tp, + model::class_ &c) const; std::unique_ptr build_template_instantiation( const clang::TemplateSpecializationType &template_type_decl, model::class_ *parent); - bool simplify_system_template(class_diagram::model::template_parameter &ct, + bool simplify_system_template(common::model::template_parameter &ct, const std::string &full_name) const; std::string simplify_system_template(const std::string &full_name) const; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 19326ed0..6edf1c76 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,7 +19,6 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${LIBCLANG_CXXFLAGS} ${TEST_DISAB if(APPLE) # Without this, clang-uml test cases fail with error saying that clang cannot find stdarg.h - #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${LLVM_LIBRARY_DIR}/clang/${LLVM_PACKAGE_VERSION}/include") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -I${LLVM_LIBRARY_DIR}/clang/${LLVM_PACKAGE_VERSION}/include") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -I${LLVM_LIBRARY_DIR}/clang/${LLVM_PACKAGE_VERSION}/include") endif(APPLE) diff --git a/tests/t00051/test_case.h b/tests/t00051/test_case.h index edd2a731..2e573b29 100644 --- a/tests/t00051/test_case.h +++ b/tests/t00051/test_case.h @@ -40,8 +40,8 @@ TEST_CASE("t00051", "[test-case][class]") REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("A::custom_thread2"))); REQUIRE_THAT(puml, - (IsMethod( - "custom_thread1", "void", "Function && f, Args &&... args"))); + (IsMethod("custom_thread1", "void", + "Function && f, Args &&... args"))); REQUIRE_THAT(puml, (IsMethod("thread", "void", "(lambda at ../../tests/t00051/t00051.cc:59:27) && "))); diff --git a/tests/t00052/.clang-uml b/tests/t00052/.clang-uml new file mode 100644 index 00000000..c02dbe15 --- /dev/null +++ b/tests/t00052/.clang-uml @@ -0,0 +1,12 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t00052_class: + type: class + glob: + - ../../tests/t00052/t00052.cc + include: + namespaces: + - clanguml::t00052 + using_namespace: + - clanguml::t00052 \ No newline at end of file diff --git a/tests/t00052/t00052.cc b/tests/t00052/t00052.cc new file mode 100644 index 00000000..65079f20 --- /dev/null +++ b/tests/t00052/t00052.cc @@ -0,0 +1,35 @@ +#include + +namespace clanguml { +namespace t00052 { + +class A { +public: + template T a(T p) { return p; } + + template void aa(F &&f, Q q) { f(q); } +}; + +template class B { +public: + T b(T t) { return t; } + + template T bb(F &&f, T t) { return f(t); } +}; + +template class C { + template T c(P p) { return static_cast(p); } +}; + +template <> template <> int C::c(double p) +{ + return std::floor(p); +} + +struct R { + A a; + B b; + C c; +}; +} +} \ No newline at end of file diff --git a/tests/t00052/test_case.h b/tests/t00052/test_case.h new file mode 100644 index 00000000..e7636176 --- /dev/null +++ b/tests/t00052/test_case.h @@ -0,0 +1,50 @@ +/** + * tests/t00052/test_case.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +TEST_CASE("t00052", "[test-case][class]") +{ + auto [config, db] = load_config("t00052"); + + auto diagram = config.diagrams["t00052_class"]; + + REQUIRE(diagram->name == "t00052_class"); + + auto model = generate_class_diagram(*db, diagram); + + REQUIRE(model->name() == "t00052_class"); + + auto puml = generate_class_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all classes exist + REQUIRE_THAT(puml, IsClass(_A("A"))); + + // Check if class templates exist + REQUIRE_THAT(puml, IsClassTemplate("B", "T")); + + // Check if all methods exist + REQUIRE_THAT(puml, (IsMethod("a", "T", "T p"))); + REQUIRE_THAT(puml, (IsMethod("aa", "void", "F && f, Q q"))); + REQUIRE_THAT(puml, (IsMethod("b", "T", "T t"))); + REQUIRE_THAT(puml, (IsMethod("bb", "T", "F && f, T t"))); + + save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 3fd9bce1..8d94c572 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -245,6 +245,7 @@ using namespace clanguml::test::matchers; #include "t00049/test_case.h" #include "t00050/test_case.h" #include "t00051/test_case.h" +#include "t00052/test_case.h" /// /// Sequence diagram tests diff --git a/tests/test_cases.h b/tests/test_cases.h index 0f693234..e4f549df 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -22,8 +22,8 @@ #include "class_diagram/generators/plantuml/class_diagram_generator.h" #include "class_diagram/model/diagram.h" #include "class_diagram/visitor/translation_unit_visitor.h" +#include "common/clang_utils.h" #include "config/config.h" -#include "cx/util.h" #include "include_diagram/generators/plantuml/include_diagram_generator.h" #include "include_diagram/visitor/translation_unit_visitor.h" #include "package_diagram/generators/plantuml/package_diagram_generator.h" diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 105de191..117ff78a 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -150,6 +150,9 @@ test_cases: - name: t00051 title: Test case for relative paths in lambda names description: + - name: t00052 + title: Test case for template methods rendering + description: Sequence diagrams: - name: t20001 title: Basic sequence diagram test case diff --git a/tests/test_util.cc b/tests/test_util.cc index b4860c9f..28905eaa 100644 --- a/tests/test_util.cc +++ b/tests/test_util.cc @@ -18,7 +18,7 @@ #define CATCH_CONFIG_MAIN #include "util/util.h" -#include +#include #include @@ -96,7 +96,7 @@ TEST_CASE("Test replace_all", "[unit-test]") TEST_CASE("Test parse_unexposed_template_params", "[unit-test]") { - using namespace clanguml::cx::util; + using namespace clanguml::common; const std::string int_template_str{"ns1::ns2::class1"};