How to add constructor, copy constructor, destructor to a new class easily on a class diagram

Hello,

Is it possible to customize menu for classes to add action like “Generate constructor, copy constructor, destructor”. Do I need to write plugin for this or only modify some XML files?

Regards,
Aleksei

Hi Aleksei,

Thanks for your post. We can prepare a sample plugin for add/copy constructor and destructor, but may I know whether you are using C++ or C#?

Best regards,
Lilian Wong

Thanks for your fast reply, Lilian.

I’m using C++, but maybe other people want the same plugin for other languages. It would be great if you add some configurable options like “Visibility for constructor: public, private or protected”, “Visibility for destructor: public, private or protected” and so on to this sample plugin .

Regards,
Aleksei

Hi Aleksei,

Sorry for my late response. Please find the sample plugin attached below, and follow the following steps to deploy the plugin:

  1. shutdown VP-UML
  2. create a “plugins” folder inside VP Suite installation directory
  3. download the attached zip and unpack it to the plugins folder
  • make sure the structure like “VP Suite/plugins/com.vp.plugin.sample.projectobfuscator/src…”
  1. start VP-UML again

After that, there will be 2 additional menu items “Add Constructor”, “Add Destructor” in popup menu of class.
Please make sure you have configured the programming language of your project to C++. Then you can right-click on a class and select the menu item, it will open the Operation Specification dialog for you to enter details of constructor/destructor. You can refer to attached image as an example.

Hope this helps. Please let me know if there is anything else I can do to help.

Best regards,
Lilian Wong

add_constructor_destructor.png
com.vp.plugin.sample.constructorsupport.zip

Hello Lilian,

Thanks for the plugin and sources . It’s working.

Regards,
Aleksei

Hi Aleksei,

You are welcome. Feel free to ask if there is anything we can help again.

Best regards,
Lilian Wong

Hello,

I’m looking for the same plugin but for C#.
Is it available?

Thanks