Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jlucca

Pages: [1]
1
General Board / Re: Importing C++ with inline methods
« on: March 24, 2002, 11:40:17 am »

Glad I could help. Thanks for being so prompt!  :)


2
General Board / Importing C++ with inline methods
« on: March 22, 2002, 02:29:11 pm »
I imported a C++ .h file into EA class diagram. The class had the constructor and a few other methods implemented inline.

After import, EA created a class diagram with only an empty default constructor. No other methods or attributes were imported.

To retrace my steps:

1. Created a C++ header file with the following class details:

class JLObject
{

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

protected:
     static int mCount;
};
int JLObject::mCount = 0;


2. Created a class (logical) diagram in EA and imported the above file.

3. The resulting class diagram is blank.

Anything I did wrong?

Thanks in advance,
JLucca

3
General Board / Re: Pure Virtual Methods and Reverse Engineering
« 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

4
General Board / 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?

Pages: [1]