[omniORB] What's the omniORBpy alternative to DynEnum?

Alex Tingle alex.tingle at bronermetals.com
Mon Mar 8 23:14:00 GMT 2004


I'm using omniORBpy. I need to be able to create an Any that contains an enumerator. I have the enumeration type's TypeCode, and the value of the enumerator as a string.

If this were C++, I'd do something like this: [1]

 DynAny_var  da=daf->create_dyn_any_from_type_code(enum_tc);
 DynEnum_var de=DynEnum::_narrow(da);
 de->set_as_string(value_string);

What's the best way to achieve this in omniORBpy?

I need to do it a lot, with lots of unpredictable TypeCodes, so synthesising IDL and loading it in each time seems unnecessarily cumbersome. Neither do I really want to have to keep track of which enumeration types & enumerators I've already seen.

-Alex Tingle

--
[1] - Basically copied from Henning & Vinoski 17.4.2.



More information about the omniORB-list mailing list