Skip to content

magiczoo/Cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cpp Extension for StarUML 2

This extension for StarUML(http://staruml.io) support to generate Cpp code from UML model.

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.
  • isFinalSpecification 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.

Licensed under the MIT license (see LICENSE file).

About

C++ extension for StarUML 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 97.6%
  • C++ 2.2%
  • Shell 0.2%