Author Topic: c++ reverse engineering, CArray  (Read 5055 times)

kovacsp

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
c++ reverse engineering, CArray
« on: January 31, 2005, 06:36:14 am »
When reverse engineering our project, I've found a deficiency.

If I have references to other classes in CArrays or CMaps, EA doesn't create the associations for them. Maybe the reverse engineering process should keep an eye on these common templates as well as STL templates.

Is this going to be fixed?

Thanks,
Peter

eta

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • From the Netherlands
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #1 on: June 06, 2006, 04:21:11 am »
I have the same problem.
We are heavily making use of templates, but when using EA Corp. Edition these references are skipped.

Work arround for this:
typedef CArray<Test*,Test*> CTestArray;

Could be:
class CTestArray : public CArray<Test*,Test*>
{
     Test** m_pDummy;
}

Now Enterprise Architect will now the class used in the template.
But this is a crappy solution and i have to bloat all our sources with these wrapper classes.

It would be great if there is a way to get EA to understand this:
typedef CArray<Test*,Test*> CTestArray;

Maybe EA should make use of the preprocessor output of the compiler?
(We are using VS6.0)

Thanx

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #2 on: June 06, 2006, 02:55:45 pm »
What version of EA are you using?  I just tested this with build 791 and it imported the typedef.

eta

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • From the Netherlands
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #3 on: June 06, 2006, 11:37:14 pm »
I am using 790.
Maybe they fixed it last week?  ;D
I will install the update and check it now

eta

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • From the Netherlands
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #4 on: June 07, 2006, 12:02:23 am »
Quote
What version of EA are you using?  I just tested this with build 791 and it imported the typedef.


I does import the typedef in this new release.
But it does not make a association between the:
CProtocolArray (typedef CArray<CTestProtocol*,CTestProtocol*>) and the CTestProtocol class.

http://www.cyberpoint.nl/~ehart/IHC/EA_CARRAY.PNG


Based on this code:
Code: [Select]

#include <afxtempl.h>

class CTestProtocol
{
public:

CTestProtocol();

virtual ~CTestProtocol();

};

typedef CArray<CTestProtocol*,CTestProtocol*> CProtocolArray;

class AFX_EXT_CLASS CProtocolHandler  
{
public:

CProtocolHandler();

virtual ~CProtocolHandler();

protected:

CProtocolArray

m_aProtocol;
};

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #5 on: June 07, 2006, 12:19:34 pm »
nothing more could be done by EA from the strict UML view - typedef only defines, what type of elements will be stored.

From relaxed UML view, dependency from typedef class to CTestProtocol could be added, stereotype for dependency could be <<use>> or other
registertm everything to SparX

eta

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • From the Netherlands
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #6 on: June 07, 2006, 11:04:25 pm »
Quote
typedef only defines, what type of elements will be stored.

I dont understand what you mean :-[. Do you mean that my typedef just defines that the CArray will store CTestProtocol*? In that case there would be a relation for EA to detect.

When the typedef does not work, should this work then?
defining a class derived from CArray<CTestProtocol*,CTestProtocol*> ?
Code: [Select]
#include <afxtempl.h>

class CTestProtocol
{
public:

CTestProtocol();

virtual ~CTestProtocol();

};

class CProtocolArray : public CArray<CTestProtocol*,CTestProtocol*>
{
   ;
};

class AFX_EXT_CLASS CProtocolHandler  
{
public:

CProtocolHandler();

virtual ~CProtocolHandler();

protected:
CProtocolArray m_aProtocol;
};


Because this also doesn't put a link between CProtocolArray and CTestProtocol
« Last Edit: June 07, 2006, 11:07:58 pm by eta »

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: c++ reverse engineering, CArray
« Reply #7 on: June 08, 2006, 08:47:36 am »

to be short - there is no way for the EA to build any link except dependency from CProtocolArray and CTestProtocol.

You won't get any more details from reverse engineering, because here EA strictly follows UML - and UML is not for any particular coding language, it's an independent notation.
Also you won't get any links for method argument list or method body code, however any user will say, that there are some dependencies...
You will have to add dependencies manually  ::)
registertm everything to SparX