[omniORB] [beginner] pass typedef argument in python

Aryeh Leib Taurog vim at aryehleib.com
Fri Nov 11 14:31:56 GMT 2011


> On Mon, 2011-11-07 at 08:39 +0200, Aryeh Leib Taurog wrote:
>
>> module Baseball {
>>   typedef sequence<string<12>, 1000> PlayersGroup;
>>   interface PlayerStatsManager {
>>      any GetStatsForGroup(in any group);
>>   };
>> };
>>
>> The java code looks something like this:
>>
>> org.omg.CORBA.Any getStats(String[] players) {
>>     org.omg.CORBA.Any playerList = _orb.create_any();
>>     PlayersGroupHelper.insert(playerList, players);
>>     return _statsMgr.GetStatsForGroup(playersList);
>> }
>>
>> How would I do this with omniORB in python?
>
> players = ["one", "two", "three"]
> playersList = CORBA.Any(Baseball._tc_PlayersGroup, players)
> statsMgr.GetStatsForGroup(playersList)
>
> Cheers,
>
> Duncan.
>

Thank you!  I'd tried something similar, but unsuccessfully.  This works.




More information about the omniORB-list mailing list