This extension for StarUML(http://staruml.io) support to generate Cpp code from UML model.
- converted to folder.
- converted to Cpp Class. (as a separate
.h
file) visibility
to one of modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.isFinalSpecialization
andisLeaf
property tofinal
modifier.- Default constructor is generated.
- All contained types (UMLClass, UMLInterface, UMLEnumeration) are generated as inner type definition.
- TemplateParameter to Cpp Template.
- A class with the stereotype of 'noclass' will be written as a bare C-style file (both '.h' and '.cpp'), with no class declaration
- converted to Cpp Field.
visibility
property to one of modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.name
property to field identifier.type
property to field type.multiplicity
property to vector type.isStatic
property tostatic
modifier.isLeaf
property tofinal
modifier.defaultValue
property to initial value.- Documentation property to JavaDoc comment.
- A 'public'
visibility
attribute with the stereotype 'extern' will be declared as 'extern', and will occur in the generated '.h' file before the class declaration
- converted to Cpp Methods.
visibility
to one of modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.name
property to method identifier.isAbstract
property tovirtual
modifier. (TODO need options to create pure-virtual function or virtual function)isStatic
property tostatic
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
toconst
modifier of parameter.
- converted to Cpp Class. (as a separate
.h
file) visibility
property to one of modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.- all method will treated as pure virtaul.
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 modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.- UMLEnumerationLiteral to literals of enum.
- converted to Cpp Field.
visibility
property to one of modifierspublic
,protected
,private
. If visibility is not setted, consider asprotected
.name
property to field identifier.type
property to field type.- If
multiplicity
is one of0..*
,1..*
,*
, then collection type (std::vector<T>
) is used. defaultValue
property to initial value.
- UMLDependency to a UMLArtifactInstance - target
name
property is converted to '#include' in source element's generated '.cpp' file.- if Dependency has no stereotype, or is not stereotyped 'hinclude', the '#include' is put into the source element's '.cpp' file
- if Dependency is stereotyped with 'hinclude', then the '#include' is put into the source element's '.h' file
- target UMLArtifactInstance
name
property is appended with '.h' in the generated '#include'
- UMLDependency target
name
property is converted to '#include' in source element's generated '.cpp' file.- if Dependency has no stereotype, or is not stereotyped 'hinclude', the '#include' is put into the source elment's '.cpp' file
- if Dependency is stereotyped with 'hinclude', then the '#include' is put into the source element's '.h' file
- target element's
name
property is appended with '.h' in the generated '#include'
- converted to Cpp Inheritance (
:
). - Allowed for UMLClass to UMLClass, and UMLClass to UMLInterface.
- Click the menu (
Tools > C++ > Reverse Code...
) - Select a folder containing C# source files to be converted to UML model elements.
CppReverse
model will be created in the Project.
Belows are the rules to convert from C++ source code to UML model elements.
- converted to UMLPackage.
- converted to UMLClass.
- Class name to
name
property. - Type parameters to UMLTemplateParameter.
- Access modifier
public
,protected
andprivate
tovisibility
property. abstract
modifier toisAbstract
property.- Constructors to UMLOperation with stereotype
<<constructor>>
. - All contained types (UMLClass, UMLInterface, UMLEnumeration) are generated as inner type definition.
-
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 toT
with multiplicity*
.T
(User-Defined Types) :type
property refers to theT
type.- Otherwise :
type
property has the type name as string.
- Primitive Types :
-
Access modifier
public
,protected
andprivate
tovisibility
property. -
static
modifier toisStatic
property. -
Initial value to
defaultValue
property.
-
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 toT
with multiplicity*
.T
(User-Defined Types) :reference
property refers to theT
type.- Otherwise : converted to UMLAttribute, not UMLAssociation.
-
Access modifier
public
,protected
andprivate
tovisibility
property.
- converted to UMLOperation.
- Type parameters to UMLTemplateParameter.
- Access modifier
public
,protected
andprivate
tovisibility
property. static
modifier toisStatic
property.abstract
modifier toisAbstract
property.
- converted to UMLEnumeration.
- Enum name to
name
property. - Type parameters to UMLTemplateParameter.
- Access modifier
public
,protected
andprivate
tovisibility
property.
Licensed under the MIT license (see LICENSE file).