GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Liteom/staruml-cpp: C++ extension for StarUML

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

71 Commits
71 Commits

Folders and files

NameName
Last commit message
Last commit date
grammar
grammar
 
 
menus
menus
 
 
preferences
preferences
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
code-analyzer.js
code-analyzer.js
 
 
code-generator.js
code-generator.js
 
 
codegen-utils.js
codegen-utils.js
 
 
main.js
main.js
 
 
package.json
package.json
 
 

Repository files navigation

C++ Extension for StarUML

This extension for StarUML(http://staruml.io) support to generate C++ code from UML model and to reverse C++ code to UML model. Install this extension from Extension Manager of StarUML.

⚠️ This extensions do not provide perfect reverse engineering which is a test and temporal feature. If you need a complete reverse engineering feature, please check other professional reverse engineering tools.

UMLPackage

  • converted to folder.

UMLClass

  • converted to Cpp Class. (as a separate .h file)
  • visibility to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • isFinalSpecialization and isLeaf property to final modifier.
  • Default constructor is generated.
  • All contained types (UMLClass, UMLInterface, UMLEnumeration) are generated as inner type definition.
  • TemplateParameter to Cpp Template.

UMLAttribute

  • converted to Cpp Field.
  • visibility property to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • name property to field identifier.
  • type property to field type.
  • multiplicity property to vector type.
  • isStatic property to static modifier.
  • isLeaf property to final modifier.
  • defaultValue property to initial value.
  • Documentation property to JavaDoc comment.

UMLOperation

  • converted to Cpp Methods.
  • visibility to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • name property to method identifier.
  • isAbstract property to virtual modifier. (TODO need options to create pure-virtual function or virtual function)
  • isStatic property to static modifier.
  • UMLParameter to Cpp Method Parameters.
  • UMLParameter's name property to parameter identifier.
  • UMLParameter's type property to type of parameter.
  • UMLParameter with direction = return to return type of method. When no return parameter, void is used.
  • UMLParameter with isReadOnly = true to const modifier of parameter.

UMLInterface

  • converted to Cpp Class. (as a separate .h file)
  • visibility property to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • all method will treated as pure virtaul.

UMLEnumeration

Weekdays
Monday
Tuesday
Saturday

converts

/* Test header @ toori67
 * This is Test
 * also test
 * also test again
 */
#ifndef (_WEEKDAYS_H)
#define _WEEKDAYS_H

enum Weekdays { Monday,Tuesday,Saturday };

#endif //_WEEKDAYS_H
  • converted to Cpp Enum. (as a separate .h file)
  • visibility property to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • UMLEnumerationLiteral to literals of enum.

UMLAssociationEnd

  • converted to Cpp Field.
  • visibility property to one of modifiers public, protected, private. If visibility is not setted, consider as protected.
  • name property to field identifier.
  • type property to field type.
  • If multiplicity is one of 0..*, 1..*, *, then collection type (std::vector<T> ) is used.
  • defaultValue property to initial value.

UMLGeneralization & UMLInterfaceRealization

  • converted to Cpp Inheritance (:).
  • Allowed for UMLClass to UMLClass, and UMLClass to UMLInterface.

C++ Reverse Engineering

  1. Click the menu (Tools > C++ > Reverse Code...)
  2. Select a folder containing C++ source files to be converted to UML model elements.
  3. CppReverse model will be created in the Project.

Belows are the rules to convert from C++ source code to UML model elements.

C++ Namespace

  • converted to UMLPackage.

C++ Class

  • converted to UMLClass.
  • Class name to name property.
  • Type parameters to UMLTemplateParameter.
  • Access modifier public, protected and private to visibility property.
  • abstract modifier to isAbstract property.
  • Constructors to UMLOperation with stereotype <<constructor>>.
  • All contained types (UMLClass, UMLInterface, UMLEnumeration) are generated as inner type definition.

C++ Field (to UMLAttribute)

  • converted to UMLAttribute if "Use Association" is off in Preferences.

  • Field type to type property.

    • Primitive Types : type property has the primitive type name as string.
    • T[](array) or its decendants: type property refers to T with multiplicity *.
    • T (User-Defined Types) : type property refers to the T type.
    • Otherwise : type property has the type name as string.
  • Access modifier public, protected and private to visibility property.

  • static modifier to isStatic property.

  • Initial value to defaultValue property.

C++ Field (to UMLAssociation)

  • converted to (Directed) UMLAssociation if "Use Association" is on in Preferences and there is a UML type element (UMLClass, UMLInterface, or UMLEnumeration) correspond to the field type.

  • Field type to end2.reference property.

    • T[](array) or its decendants: reference property refers to T with multiplicity *.
    • T (User-Defined Types) : reference property refers to the T type.
    • Otherwise : converted to UMLAttribute, not UMLAssociation.
  • Access modifier public, protected and private to visibility property.

C++ Method

  • converted to UMLOperation.
  • Type parameters to UMLTemplateParameter.
  • Access modifier public, protected and private to visibility property.
  • static modifier to isStatic property.
  • abstract modifier to isAbstract property.

C++ Enum

  • converted to UMLEnumeration.
  • Enum name to name property.
  • Type parameters to UMLTemplateParameter.
  • Access modifier public, protected and private to visibility property.

Licensed under the MIT license (see LICENSE file).

About

C++ extension for StarUML

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.