[omniORB] Injecting Enum Name/Values into Enum's Namespace

Luke Deller ldeller at xplantechnology.com
Wed Sep 21 16:24:14 BST 2005


Hi Jeff,

What you're seeing is correct behaviour according to the Python Language
mapping ( http://www.omg.org/technology/documents/formal/python.htm ),
section 1.3.3, which begins:

        An enumeration is mapped into a number of constant objects in
        the name space where the enumeration is defined.  An application
        may only test for equivalence of two enumeration values, and not
        assume that they behave like numbers.

This behaviour is consistent with C++ enums.  I imagine that the java
language mapping differs because java packages can only contain classes
and not objects.

> Then to get the value, I have to do this:
> 
> >>> FOO.value()
> 2

This is a non-standard extension.  Strictly speaking, you shouldn't need
to convert FOO to a number.

> I am using the following options for IDL compile:
> 
> omniidl -Cstubs -nc -nf -bpython -Wbinline *.idl
> 
> Inline is the only way i can access it in an OO way, it seems. Let me 
> know where I am messed up.

I'm not quite sure what you mean about -Wbinline?

Regards,
Luke.

**********************************************************************************************

Important Note
This email (including any attachments) contains information which is
confidential and may be subject to legal privilege.  If you are not
the intended recipient you must not use, distribute or copy this
email.  If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this
email are not necessarily the views of XPlan Technology.

It is the duty of the recipient to virus scan and otherwise test the
information provided before loading onto any computer system.
Xplan Technology does not warrant that the
information is free of a virus or any other defect or error.
**********************************************************************************************




More information about the omniORB-list mailing list