[omniORB] need help with IDL
David Riddoch
djr@uk.research.att.com
Mon, 26 Jul 1999 15:59:22 +0100 (GMT)
On Mon, 26 Jul 1999, Rick Ethington wrote:
> i am looking for some advice about how to express a data type
> using idl. the type is similar to the nvlist with some
> differences.
>
> we refer to it as a key value set, it is a set of key value pairs.
> in our case the keys are 32 bit integers and the values have
> various types. the types can be interger, unicode string, boolean,
> integer range (structure containing 2 integers), or another
> key value set. arrays of each of the types are also permitted.
The following includes some of what you want I think. The rest should be
fairly obvious.
enum kvset_t { INT, INT_SEQ, INT_RNG, KV };
struct irange { short low, high; };
struct kvset_m {
unsigned long key;
union kvset_val switch(kvset_t) {
case INT: short i;
case INT_SEQ: sequence<short> is;
case INT_RNG: sequence<irange> ir;
case KV: sequence<kvset_m> set;
} value;
};
typedef sequence<kvset_m> kvset;
> most of the types are readily represented, but the ability
> of a kvset to contain a kvset has us puzzled. the documentation
> says something about recursive types not being supported. not
> sure if that was only for 'any' or not.
That is out of date. Recursive types are now fully supported. Where did
you read this? (So I can correct it!)
Hope that helps,
David