astah* C++ Reverse Program User Guide

19 October, 2009
Change Vision, Inc.


[Overview]

This C++ Reverse Program is created as a sample program by using astah* API. With this program, you can generate astah* models from C++ Source Code. This guide briefly describes how to use this program.
To use this program, you need to have free software called Doxygen. Because this program requires XML file that is generated by Doxygen.

[astah* API Sample Program License Agreement]

[Steps for importing C++ Source Code]

[Before you start, set up the environment]

To run this program, you need to have the environment to be able to run both J2SE and the Digester.
Also as it is mentioned above, you need to have the Doxygen installed on your PC. Because you need to have XML file that is generated from C++ Source code (.cs) by using Doxygen before you create astah* models with this program. Please refer to Doxygen's license and documents they provide for how to use Doxygen.

[Step1. Download Doxygen]

[Step2. Install Doxygen]

[Step3. Launch Doxygen]

[Step4. Set up Doxygen]

[Step5. Importing Source code by Doxygen]

[Step6. Generate astah* models from the XML]

[Configure the astah* C++ Reverse program - Config.properties]

You are able to customize C++ reverse program by modifying following file.
astah* professional(astah* UML) install folder\api\sample\sample_doxygen_c_plus\doxygen_cplus\Config.properties
jude_cplus_types_for_attribute
You can specify how you want to reverse the Property, as either Class's Attribute or Association.
Properties are reversed as Associations by default. However if you define the type in the Config.properties file, and by setting the defined type to certain properties, you can reverse them as Class's Attributes.
Put the Types with Namespace with commas between.
(i.e.) BrickOut::Form1,BrickOut::Form2

[Compile application]

If the source code of this program has been modified, you need to compile before rerunning. To compile the program, double click the following file.

astah* professional(astah* UML) install folder\api\sample\sample_doxygen_c_plus\compile.bat

[About support]

This program is provided as an sample of astah* API, so that it will not be a support subject. Your bug reports or questions regarding the environment may not be responded.

[System environments]

This program has been tested on Windows only.

Environment Download
astah* professional(astah* UML) 6.0 or later
astah* professional(astah* UML) Install Folder\lib\commons-digester.jar(version 1.5)
-
Java Running Environment (Applicable Java version for astah* professional(astah* UML) is required) astah* System Requirements
Doxygen (doxygen-1.5.8-setup.exe) Doxygen Main Page
Doxygen Download Page

[Applicable C++ items]

This program reverses all Classes, Attributes and Operations including their specified definitions.
Pointers would be reversed as a Class with * in its name. This specification may be changed in the future version.

Item Description
Default Model astah* professional(astah* UML) Install folder\template\project\C++.asta is imported as a default model.
If there is no C++.asta file at the above directory, default model won't be imported.
C++.asta is automatically created in the astah* professional(astah* UML) folder when you install astah* professional(astah* UML), and it contains main classes under std.
~destructor() Operation that its name starts with ~ (Return Type: "")
enum [Class] <<enum>> of Stereotype tab
[Attribute] <<enum constant>> of Stereotype tab
Anonymous Enum is not supported.
template <class T=B>
class A {
  T attr;
};
class E {
  A attr1;
  A<B> attr2;
  A<B*> attr3;
  A<> attr4;
};
[In JUDE/5.4.x or earlier]
Creates Class B
Creates Class A
Creates Template Parameter T with Default B to Class A
Creates TypeT's attribute, attr to Class A
Creates Class E
Creates TypeA's attribute, attr1 to Class E
Creates Actual Parameter B's Template Binding from anonymous bound class A<B> to A<T=B>
Creates Type A<B>'s Attribute, attr2 to Class E
Creates Class B*
Creates Actual ParameterB*'s Template Binding from anonymous bound class A<B*> to A<T=B>
Creates Type A<B*>'s Attribute, attr3 to Class E
Creates Type A's Attribute, attr4 to Class E
[in JUDE/5.5b1 or later][in astah*/6.0 or later]
Creates Class B
Creates Class A
Creates Template Parameter T with Default B to Class A
Creates Type T's Attribute, attr to Class A
Creates Class E
Creates Type A's Attribute, attr1 to Class E
Creates Actual ParameterB's Template Binding from anonymous bound class A<B> to A<T=B>
Creates Type A<B>'s Attribute, attr2 to Class E
Creates Actual ParameterB' and type qualifier(Actual Parameter)*'s Template Binding from anonymous bound class A<B*> to A<T=B>
Creates Type A<B*>'s Attribute, attr3 to Class E
Creates Type A's Attribute, attr4 to Class E
int b[2][2] = {{1,2},{3,4}} Attribute (Name: b, Type: int, Multiplicity: 2 , 2, Initial Value: {{1,2},{3,4}})
int *p [In JUDE/5.4.x or earlier]
Class (Name: int *) with Attribute (Name: p, Type: int *)
[in JUDE/5.5b1 or later][in astah*/6.0 or later]
Attribute (Name:p, Type:int, type qualifier:**)
int **p [In JUDE/5.4.x or earlier]
Class (Name: int **) with Attribute (Name: p, Type: int **)
[in JUDE/5.5b1 or later][in astah*/6.0 or later]
AttributeiName:p, Type:int, type qualifier:**)
int p = &a Attribute (Name: p, Type: int, InitialValue: &a)
int (*pf)(int) Class (Name:int (*)(int)) is created for Function Pointers with Operation (Name: function, Type: int, Parameter: int arg0)
Attribute (Name: pf, Type: int (*)(int)) will be created in the referred (based) class
int (*pa)[3] Class "int (*". Attribute (Name: pa, Type: int (*, Multiplicity: 3) will be created in the referred (based) class
int add(int,int) int add(int arg1, int arg2)
static [Attribute] Static of Base tab
[Operation] Static of Base tab
struct [Class] <<struct>> of stereotype tab
union [Class] <<union>> of stereotype tab
void fun(int a=1,int b=3,int c=5) void fun(int a,int b,int c). Initial value of parameter would not be set
Attributes that reside outside of Classes A class "Global" is created and attributes will be created inside
Operations that reside outside of Classes A class "Global" is created and operations will be created inside
Primitive Type [in JUDE/5.4.x or earlier]
Reversed as Classes
[in JUDE/5.5b1 or later][in astah*/6.0 or later]
Reversed as Primitive Types
Declared type with typedef Type you declared with will be used
friend [Applicable since JUDE/5.5b1]
[Class]friend of Language Tab
[Operation]friend of Language Tab
const [in JUDE/5.4.x or earlier]
[Attribute] ReadOnly of base tab
[Operation] Leaf of base tab
[in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Attribute] const of Language tab
[Operation]const of Language Tab
mutable [in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Attribute] mutable of Language Tab
Unable to convert until Doxygen 1.5.7.1. because mutable attribute of memberdef tag is always set as No by Doxygen1.5.7.1
By changing it to Yes, it enables you to convert it.
volatile [in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Attribute] volatile of Language Tab
explicit [in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Operation] explicit of Language Tab
inline [in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Operation] inline of Language Tab
virtual [in JUDE/5.5b1 or later][in astah*/6.0 or later]
[Operation] virtual of Language Tab

Following items are not currently supported.