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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx29.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Thunderbird/30.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: On packages hierarchy References: <4vuBv.121143$pu5.79212@fx27.iad> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Mon, 28 Jul 2014 23:24:59 UTC Organization: TeraNews.com Date: Mon, 28 Jul 2014 17:24:58 -0600 X-Received-Bytes: 2270 X-Received-Body-CRC: 3459554934 Xref: news.eternal-september.org comp.lang.ada:21323 Date: 2014-07-28T17:24:58-06:00 List-Id: On 28-Jul-14 10:35, Victor Porton wrote: >> Why not just have a single stream type? > I want to make an interface to streams of Raptor C library. > > Because, as you say, we are to have a single stream type, this type should > be well-interfaces with that "single" Ada stream class. > >> >Moreover, Ada's root-stream is abstract, so you can't have objects of >> >that type. > Well, I mean object of Root_Stream_Type'Class. Again, why? Your Raptor-stream type /will/ be an concrete-instance of Root_stream_type, and a member of its class, won't it? I mean unless I'm completely misunderstanding you... Use Ada.Streams; Type Dave is new Root_Stream_Type with null record; overriding procedure Read (Stream : in out Dave; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write (Stream : in out Dave; Item : Stream_Element_Array); ---- Implementation: overriding procedure Read (Stream : in out Dave; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is null; -- Replace this with actual implementation. overriding procedure Write (Stream : in out Dave; Item : Stream_Element_Array) is null; -- Replace this with actual implementation. Perhaps reading the first and second posts on this thread will help you understand: http://computer-programming-forum.com/44-ada/07c6cd94dbb2d6b1.htm