[V4REV] Constants

Robert Brenstein rjb at robelko.com
Sun Jun 19 16:35:18 CDT 2005


>  > It seems to me that it is possible to skip the enum designation when
>>  typing in the constants.
>
>Okay, I think I have got new idea how this can work.
>
>----------------
>Ivan, right now you have the single map of all constants.
>
>Let's do next:
>
>* you make MANY "maps", one for each Enum Type.
>     technically better use not std::map
>     but may just many small functions as
>
>     EOnDelete ToEnumEVOnDelete( char* inStrValue )
>
>* having this we are safe with conflict of constant names
>     I think you see why.
>
>* and we REMOVE them names of enums.
>    
>     OR more flexible way -- we support both way:
>
>         foo( EVOnDelete.kCascade )
>         foo( kCascade )
>
>Easy and effective to implement!!!

Sounds like a good plan to me ! Go for it :)

One small thing to consider yet, may be at least consult with RunRev 
team, is the issue of period in the constant name. It might be safer 
to replace it with underscore. Right now, Rev treats the whole name 
as a literal, so there is no problem, but who knows what happens when 
they add OO stuff that introduces special meaning to period. We were 
told not to use period in variable names.

Robert


More information about the Valentina-beta mailing list