* Arrays of strings and Annex E
@ 1999-03-30 0:00 Michael Roe
0 siblings, 0 replies; only message in thread
From: Michael Roe @ 1999-03-30 0:00 UTC (permalink / raw)
Recently, I needed a write a server that return a variable length list of
variable-length strings as a result of a remote procedure call. If I had
been using ASN.1 and OSI protocols, I would have written something like
this:
ListOfNames ::= SEQUENCE OF IA5String
Instead of ASN.1, I was using Ada and Annex E.
So I wrote something like this:
with Ada.Strings.Unbounded;
package String_RCI is
pragma Remote_Call_Interface (String_RCI);
type List_Of_Names is array (Integer range <>) of
Ada.Strings.Unbounded.Unbounded_String;
function Get_List return List_Of_Names;
end String_RCI;
Unfortunately, this doesn't work: Unbounded_String is a private type which
can't be passed across a remote call interface in this way. I could have
used ordinary strings, but then all of the strings would have to be the
same length. For example:
type List_Of_Names is array (Integer range <>) of
String (1 .. Name_Length);
I could have written something which replicates most of the
functionality of Ada.Strings.Unbounded, but in a way which can be passed
across a remote call interface. It's a shame that the language-defined
string types like Ada.Strings.Unbounded weren't designed with Annex E in
mind.
Mike
PS. At least, I *think* this is a problem with the language definition,
rather than a misfeature of a particular implementation; if I thought
this was a bug in GNAT or GLADE I'd have reported it in the usual way
rather than discussing it in comp.lang.ada.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-03-30 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-30 0:00 Arrays of strings and Annex E Michael Roe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox