comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de>
Subject: Re: API design problem - buffer scatter I/O
Date: Sun, 23 Nov 2008 00:01:53 +0100
Date: 2008-11-23T00:01:55+01:00	[thread overview]
Message-ID: <49288f63$0$31337$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <f980d11e-4113-41a8-9c24-bf2df53e18f8@a12g2000yqm.googlegroups.com>

Maciej Sobczak wrote:

> Do you have other ideas or suggestions for how to design such API?

Not sure this would meet your criteria but perhaps
you could ask the user to provide a Cursor.  The filling
procedure can fill the cells one after the other by
obtaining a pointer, say, through Element.

procedure Receive_Socket
     (Socket : Socket_Type;
      Item   : in out Cursor)
is
     while <we have data> loop
        Element(Item).all := <datum>;
        Next(Item);
     end loop;

end Receive_Socket;

where Element, by contract, would be a function
that returns a pointer to the next free
cell which would be in some of the buffers.


This, of course, shifts the problem of managing
multiple buffers elswhere...



  parent reply	other threads:[~2008-11-22 23:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22 16:05 API design problem - buffer scatter I/O Maciej Sobczak
2008-11-22 16:54 ` sjw
2008-11-22 19:43 ` george.priv
2008-11-22 22:16 ` Robert A Duff
2008-11-22 23:34   ` Maciej Sobczak
2008-11-23  0:01     ` Robert A Duff
2008-11-24  8:10       ` Brad Moore
2008-11-24  7:55   ` christoph.grein
2008-11-24 20:03     ` Robert A Duff
2008-11-25  5:59       ` christoph.grein
2008-11-25  8:34         ` Dmitry A. Kazakov
2008-11-25 14:25         ` Robert A Duff
2008-11-25 22:20       ` Randy Brukardt
2008-11-24 21:23     ` Robert A Duff
2008-11-22 23:01 ` Georg Bauhaus [this message]
2008-11-23  5:57 ` anon
2008-11-24 17:16 ` tmoran
2008-11-26  8:34   ` Maciej Sobczak
2008-11-26 20:39     ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox