[omniORB] Passing dictionary.

Nathaniel Smith njs@uclink4.berkeley.edu
Thu Jun 20 09:15:02 2002


On Wed, Jun 19, 2002 at 10:41:23AM +0200, bjorn rohde jensen wrote:
>  I presume, the dictionary is in textual representation, so
> you should transfer the data using the string idl type to
> ensure proper character set translation during transfer,
> although you might want to use an iterator pattern for the
> transfer. One way to do it could be to have some sort of
> factory doing a look-up for the requested file and return
> a reference to a pull iterator or raise a NotFound exception.
> You could then use the iterator to pull dictionary from the
> server bit by bit. It does of course take longer time to make
> several calls than to make one.

I think you misunderstood -- "dictionary" is Python-ese for "hash
table".  It's a basic mapping type, and I've wondered what the best
way to send one down the wire is myself.  I don't really have a good
answer, though; one option would of course be to wrap it in a CORBA
object with methods "get", "set", etc., but if you want to actually
send the whole dictionary across the wire, then you'll have to do some
"marshalling" by hand.

Perhaps to send a dictionary mapping strings to strings, one could use
  struct StrStrPair { string key, value; }
  typedef sequence<StrStrPair> StrStrDictionary;
and then pack/unpack by hand on each end of the connection.

-- Nathaniel

-- 
Damn the Solar System.  Bad light; planets too distant; pestered with
comets; feeble contrivance; could make a better one myself.
  -- Lord Jeffrey

This email may be read aloud.