Hi all,

This is how we deal with enums in my project.

1. I model the enum as a class (just as Eric said), using attributes as
enumerated values, without defining any type, and optionaly using the
attribute value to specify the value for the enumerated item.

2. I set the "ClassKey" C++ property for the class to "enum".

3. I launch the home made attached script, which scans the whole model for
classes which have the "ClassKey" property set to "enum", and stores the
explicit C++ enum code in their "ImplementationType" property .

4. All I have to do is generate the code, since Rose will replace the usual
class generation with the "ImplementationType" content.

Hope it helps

Regards,

Mathieu Girard
Software Architect

Ubi Soft Entertainment

P.S.
This script works with Rose98, I do not know how it will work on recent
releases.

-----Message d'origine-----
De: David R. Stockwell [mailto:[EMAIL PROTECTED]]
Date: jeudi 28 d�cembre 2000 23:01
�: Aker, Eric
Cc: '[EMAIL PROTECTED]'
Objet: Re: (ROSE) enum types



Eric,

Thanks for the help.  Yes according to the Rose help file, enum is not
supported as part of it's code generation for VC++ (at least thats the way I
believe the file reads).   I'd expect the true msvc to support it as it's a
standard type.

I'll take a look at your suggestions and see what can be done.

Thanks

David Stockwell
----- Original Message -----
From: "Aker, Eric" <[EMAIL PROTECTED]>
To: "'David R. Stockwell'" <[EMAIL PROTECTED]>;
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Sent: Thursday, December 28, 2000 5:04 PM
Subject: RE: (ROSE) enum types


> Since you start with saying that enum is not supported in CV++ ???
>
> I would model them as attributes.
> Stereotype the class as <<enum>>
>
>
> In the classic C++ code generator you would set the enum type and values
> in the code generation properties.
>
>
>
> -----Original Message-----
> From: David R. Stockwell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 28, 2000 9:24 AM
> To: '[EMAIL PROTECTED]'
> Subject: (ROSE) enum types
>
>
> Hello all,
>
> I noticed in the help file, enum types are unsupported for VC++.
>
> How do I specify an enum type in my rose model?  According to help I
> just name the class as
>
> <<enum>> myenumtype
>
>
> How/where do I put the (items and)  values associated with each of the
> enumerated items?
>
> as in
>
> enum x
> {
>    x_unassigned = 0,
>    x_something=1,
>    x_other = 2,
>    // etc
> };
>
> Thanks in advance
>
> David Stockwell
>

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

GenerateC++Enum.ebs

Reply via email to