Book a Demo

Author Topic: Pure Virtual Methods and Reverse Engineering  (Read 5119 times)

jlucca

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Pure Virtual Methods and Reverse Engineering
« on: March 20, 2002, 11:40:27 am »
I added a pure virtual method (abstract and pure checked) to my class and Generated code (forward engineer):

The header file code looks as follows:

    virtual bool SetFromString(char* Src) =0;

If I then immediately Reverse engineer (Synchronize), EA unchecks the "Abstract" checkbox for any pure virtual methods. The methods are no longer "pure virtual". The class diagram reflects this in that it no longer shows the methods in italics.

When I again Generate code by forward engineering it) the header code is changed and the "virtaul" keyword dissappears as follows:

    bool SetFromString(char* Src) =0;

Any way to prevent this? Am I doing something wrong?

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Pure Virtual Methods and Reverse Engineering
« Reply #1 on: March 21, 2002, 04:00:14 pm »
Hi,

I checked thru the code and there was a problem in some cases importing abstract methods. I have corrected the problem and the fix will be in the next minor update of EA (due out early next week) - look for a build number > 475

Geoff Sparks

jlucca

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Pure Virtual Methods and Reverse Engineering
« Reply #2 on: March 22, 2002, 02:23:21 pm »
I downloaded Build 475 and still removes the "virtual" key word when I synchronize or import. To be more specific, this is what I do and what happens:

1. Write a class header:

class JLObject{
public:
     JLObject();
     virtual ~JLObject();
     virtual bool SaveToFile(ofstream& Dest);
     virtual bool LoadFromFile(ifstream& Src) =0;
     virtual bool GetAsString(char* Dest) =0;
     virtual bool SetFromString(char* Src) =0;
     static int GetCount();

protected:
     static int mCount;
};

2. Import into EA from C++ source file.

3. Right away I notice two things. a) The mCount variable is not imported as static; b)the methods are no longer abstract, although 'pure' is still seleced

Hope this helps.
JLucca

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Pure Virtual Methods and Reverse Engineering
« Reply #3 on: March 22, 2002, 04:34:32 pm »
Hi again,

Sorry - I may not have been clear in my note - the changes are in the next build/release of EA - ie. greater than 475 which is the current build.

The static variable problem is also covered in the next build.

The next release is due out Monday or Tuesday of next week and will probably be build 477 if nothing major happens between now and then :-)

Regards,
Geoff Sparks