From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e490a18b9688bd9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.44.102 with SMTP id d6mr553917pbm.9.1316054410352; Wed, 14 Sep 2011 19:40:10 -0700 (PDT) Path: m9ni6522pbd.0!nntp.google.com!news1.google.com!postnews.google.com!s12g2000yqm.googlegroups.com!not-for-mail From: Alexander Korolev Newsgroups: comp.lang.ada Subject: Re: Stream_Element_Array Date: Wed, 14 Sep 2011 19:33:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <32f9a1c1-429f-4cfb-bf58-f0fc84ad9fd3@s12g2000yqm.googlegroups.com> References: <1e6rw4vto3ldb.i8d7fxixapx4.dlg@40tude.net> <28u4e86fk8gn$.ialexttobgr0$.dlg@40tude.net> <276b8d0a-5b3c-4559-a275-98620657cc2f@s30g2000pri.googlegroups.com> NNTP-Posting-Host: 96.49.119.210 Mime-Version: 1.0 X-Trace: posting.google.com 1316054410 31931 127.0.0.1 (15 Sep 2011 02:40:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Sep 2011 02:40:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s12g2000yqm.googlegroups.com; posting-host=96.49.119.210; posting-account=9aAl4woAAACPkuvNJOQxyBXxG_5lfu_0 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUARLECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; ru-ru) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5,gzip(gfe) Xref: news1.google.com comp.lang.ada:17973 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-09-14T19:33:00-07:00 List-Id: On Sep 15, 12:13=A0am, "Dmitry A. Kazakov" wrote: > On Wed, 14 Sep 2011 10:16:09 -0700 (PDT), Alexander Korolev wrote: > > I've been advised and that worked out for many in few cases to use > > Volatile_Streams.Memory_Resident_Stream. > > This is not what you need. It is a stream backed by the memory. I also > implemented such, backed by a String object, that is when you write, you = do > into the string, when you read then from the string. > > In your case the other end is not the memory but the wire. This is what > Serial_Port of GNAT.Serial_Communications is, an implementation of stream= . > > So you simply derive or aggregate a new type from/into it, place there an > output buffer of Stream_Element_Array of the maximal message size, and > Stream_Element_Array for the input, usually just one element length. > > The pattern is: > > =A0 =A0Root_Stream_Type -- abstract stream > =A0 =A0 =A0| > =A0 =A0Serial_Port -- concrete stream, transport layer > =A0 =A0 =A0| > =A0 =A0your type -- specific protocol implementation > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Dmitry, I've sent an email for your attention. Please review. Thanks, Alexander.