[omniORB] How to do TypeCodes in omniORBpy?

Duncan Grisby dgrisby@uk.research.att.com
Thu, 12 Apr 2001 16:09:42 +0100


On Thursday 12 April, Craig Rodrigues wrote:

> Section 1.3.8 is a bit vague about TypeCodes
> for basic IDL types.
> 
> Is CORBA.tk_string the typecode for a string?
> Or is it CORBA.TCKind.tk_string?

CORBA.tk_string is the TypeCode kind for string, not the TypeCode
itself. The TypeCode is CORBA.TC_string.

The relevant bit of section 1.3.8 of the Python mapping is the third
sentence: "In addition, the type code constants defined in section
10.7.2 are available as Python variables in the module CORBA, with the
names given in section 10.7.2."  I agree that it doesn't exactly make
it clear.

> What I want to do is:
> 
> any1 = CORBA.Any ( type code for string, "someString")
> an2 = CORBA.Any ( type code for long, 35)

any1 = CORBA.Any (CORBA.TC_string, "someString")
any2 = CORBA.Any (CORBA.TC_long, 35)

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --