[omniORB] OmniORBpy & TypeDefs

Marcus Gruendler runner@i5.informatik.rwth-aachen.de
Tue, 22 Aug 2000 15:39:02 +0200


Stefan Seefeld wrote:
> 
> jiwils - Jimmy Wilson wrote:
> >
> > Why does the idl compiler generate unusable python classes when the typedefs
> > are used in the IDL?  I would like to use the typedefs instead of the names
> > in the cases below, but I can't.  Could someone explain why using ELEMENT
> > and Elements below would create a problem?  Since a sequence will become a
> > tuple or list, I can see that the name Elements is really for ease of use,
> > but what about the typedef for the structure?

[...]

Well, I don't think the typedef is just for ease of use.  In my case I had to
use a typedef of a sequence, because the IDL specification seems not to allow
returning sequences from operations. I really don't know why this is so. Does
anybody have a clue or am I missing something?

Here is a part of my code. The first declaration of getEntries generates a IDL
compiler error, the second one doesn't and produces working code.

typedef struct EntryDataStruct
{
	string name;
	long   type;
	long   ID;
} EntryData;

typedef sequence<EntryData> Entries;

interface RepoReader
{
	// Error:
	sequence<EntryData> getEntries(in string name);

	// Correct:
	Entries getEntries(in string name);	
}


-- 
 Marcus Gruendler
 runner@i5.informatik.rwth-aachen.de
 Chair for Information Systems & Database Technology
 RWTH-Aachen University, Germany