staruml / staruml-cpp

C++ extension for StarUML
MIT License
174 stars 67 forks source link

can't generate expected association or composition relationship code #35

Open XDinEuro opened 2 years ago

XDinEuro commented 2 years ago

Hi, the code generator is amazing, but I found something missing.

When I draw a diagram like this Screenshot from 2022-02-10 09-29-55

I get code for Class1 is

#ifndef _CLASS1_H
#define _CLASS1_H

class Class1 {
};

#endif //_CLASS1_H

and Class2 is

#ifndef _CLASS2_H
#define _CLASS2_H

class Class2 {
};

#endif //_CLASS2_H

I thought I have a aggregation relationship from Class1 to Class2, so I expect code for Class2 should be

#ifndef _CLASS2_H
#define _CLASS2_H

#include "Class1.h"
class Class2 {
public
  Class1* Class1Ptr;
};

#endif //_CLASS2_H

This will be helpful if it automatic generate those header dependency relationship and create class association relationship.

Look forward to your reply!