[gme-users] Ordering in GME Enumeration Values?
zolmol at isis.vanderbilt.edu
Fri Oct 27 11:44:16 CDT 2006
If you don't specify explicit values for enum items then each distinct item's value becomes the item itself.
defined in the meta as an enumeration, might look like in the xmp file:
<enumitem dispname = "1" value = "1"></enumitem>
<enumitem dispname = "2" value = "2"></enumitem>
<enumitem dispname = "3" value = "3"></enumitem>
Another definition (explicit value assignment):
results in the following xmp:
<enumitem dispname = "One" value = "1"></enumitem>
<enumitem dispname = "Two" value = "2"></enumitem>
<enumitem dispname = "Three" value = "3"></enumitem>
Values are comparable in such cases, because from Bon2 you can ask
They are not comparable, in case of the
definition, where values will be "One", "Two", ..., so you must use
myAttr->getStringValue() in such cases.
So the C++ comparison trick is possible only in certain cases, when integer-convertible values are found in the enum.
From: gme-users-bounces at list.isis.vanderbilt.edu on behalf of Joe H.
Sent: Fri 10/27/2006 7:44 AM
Subject: [gme-users] Ordering in GME Enumeration Values?
I have a question concerning enumeration values modeled in GME. Do the
values take on ascending order like they do in C/C++? For example, if I
specify an enumeration in GME with values of yellow, red, and then blue can
I do a comparison to see if an enumeration value is less than blue? This
would be very helpful for me in defining my OCL constraints but I wasn't
sure if GME supports this.
More information about the gme-users