I have the simple 'A class' with 3 methods:
costructor, destructor and a method wiht two
parameters.
This class is divided into two files: A.cpp and A.h.
I want to export this code to a Rose model (mdl file).
I can do that in two ways be means of Rational Rose
C++ Analizer:
1- Actions: Analize, Export to Rose.
2- Actions: CodeCycle, Export to Rose.
If I use the second way, Analizer modfied (codecycled)
the files code, and the obtained Rose model is more
fine.
. But I have some questions about generated code:
- What the meaning of lines like that?:
//-- {CycleCode: 185} file [0..389]
//-- {AddDecl: 186} module.includes preserve=yes
[0..312]
//-- {AddDecl: 187} region.unprotectedFunction
[313..326]
The format of the rose directives begin with
'//##'. Lines started with '//--', are they Rose
directives or are they coments of the codecycle
process only?
Could I remove this kind of lines in the code?.
- If I want to model documentation for class,
operation and data member . Could I use
'//##Documentation:' Rose directive in the orginal
code?. Or could I use normal C++ coments?. If I can
use both of them, which is the difference?
- When I do 'codecycle', the Log windows show this
output:
LOG window:
build -CC `-P2t2_` `-B2Project1.t2` -N0
`@E:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\cna2C7.tmp`
--- Analyzing "e:\tmp\a\a.cpp" ... [2y4]
--- Analyzing "e:\tmp\a\a.h" ... [2y4]
--- "e:\tmp\a\a.h", line 12:9; File contains
vulnerable directives
+++ Analyzed "e:\tmp\a\a.h": Ready for Rose/C++
[2yk]
--- "e:\tmp\a\a.cpp", line 5:9; Unprotected
#include
+++ Analyzed "e:\tmp\a\a.cpp": Ready for Rose/C++
[2yk]
# Done! 0 errors; 0 warnings
What the meaning of these sentences?:
- File contains vulnerable directives.
- Unprotected #include.
_______________________________________________________________
Do You Yahoo!?
Consiga gratis su direcci�n @yahoo.es en http://correo.yahoo.es
A class FILES: ORIGINAL CODE
// A.cpp: implementation of the A class.
#include "A.h"
A::A()
{
}
A::~A()
{
}
void A::method(int a, char b)
{
}
// A.h: interface for the A class.
#if !defined(AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_)
#define AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class A
{
public:
void method(int a, char b);
A();
virtual ~A();
};
#endif // !defined(AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_)
**** NOW WE USE "Codecycle"
//-- {CycleCode: 185} file [0..389]
//-- {AddDecl: 186} module.includes preserve=yes [0..312]
//## begin module.includes preserve=yes
// A.cpp: implementation of the A class.
#include "A.h"
//## end module.includes preserve=yes
//-- {AddDecl: 187} region.unprotectedFunction [313..326]
A::A()
{
//## begin A::A%A555A0E6FEED.body preserve=yes
//## end A::A%A555A0E6FEED.body
}
//-- {AddDecl: 188} region.unprotectedFunction [327..345]
A::~A()
{
//## begin A::~A%8C952A67FEED.body preserve=yes
//## end A::~A%8C952A67FEED.body
}
//-- {CycleCode: 178} file [0..480]
//-- {StartSubRegion: 181} module.ifndef [0..185]
// A.h: interface for the A class.
#if !defined(AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_)
//-- {StartSubRegion: 182} module.define [186..251]
#define AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_
//-- {InsertRegion: 184} module.vulnerableDeclarations [252..317]
//## begin module.additionalDeclarations preserve=yes
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//## end module.additionalDeclarations
//-- {AddDecl: 179} class [318..397]
class A
{
//-- {AddDecl: 180} region.generated [330..395]
public:
void method(int a, char b);
A();
virtual ~A();
};
//-- {StartSubRegion: 183} module.endif [398..480]
#endif // !defined(AFX_A_H__F24899C1_574A_4423_8F9C_92DFEE9BC873__INCLUDED_)
//-- {AddDecl: 189} region.unprotectedFunction [346..386]
void A::method(int a, char b)
{
//## begin A::method%4C7BC727FEED.body preserve=yes
//## end A::method%4C7BC727FEED.body
}
//-- {InsertRegion: 190} module.vulnerableDeclarations [387..389]