Book a Demo

Author Topic: C++ nested enum  (Read 2420 times)

thn

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
C++ nested enum
« on: June 06, 2003, 09:36:16 am »
EA Newbie question to follow:

When I reversed engineered code containing the following:

class Class2
{
public:    
   enum Class2Enums
   {
         enum1,
         enum2,
         enum3,
         enumSentinel
   };
 ...
}


EA produced an enumeration stereotyped class called Class2Enums and connected it with the Class2 with the nesting link.  This seemed right, but when I proceeded to generate code for the Class2 object, the enumeration class was generated as a separate stand-alone enumeration e.g.
enum Class2Enums
{
   enum1,
   enum2,
   enum3,
   enumSentinel
};


that overwrote the contents of the Class2 header file.  I was expecting the forward engineering to produce the same code as the reverse engineering input.  Instead I ended up with a header file containing a single enumeration.

Help Please.

TomN