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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,306c0e782f999b0e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-17 18:13:50 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!feeder.qis.net!btnet-peer!btnet-peer0!btnet-peer1!btnet!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Alexey V. Litvinov" Newsgroups: comp.lang.ada Subject: Booch components Date: Wed, 18 Oct 2000 12:11:38 +1100 Organization: ENST, France Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable X-Trace: menuisier.enst.fr 971831606 30492 137.194.161.2 (18 Oct 2000 01:13:26 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: 18 Oct 2000 01:13:26 GMT To: Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0beta5 Precedence: bulk List-Id: comp.lang.ada mail<->news gateway Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:1354 Date: 2000-10-18T01:13:26+00:00 When I tried to use Booch components in my program, I encountered some trouble with next code (It's abstraction of database table as file of simular entities.=20 With little diffirent mechanism of deleting/appending of records from Dbase-like. Because I'll have little couple=20 of deleted records with my application and I don't wish=20 make packing of table, I decide use unbounded queue for list=20 of deleted records and use values from it when I need to=20 append new records). with Ada.Direct_IO; generic type RecDataType is private; FileName : String; package DB_Table is type RecCountType is private; type RecPosvCountType is private; --. --. --. -- routines to read/write/append/etc... --. private package Table_IO is new Ada.Direct_IO(RecDataType); type RecCountType is new Table_IO.Count; type RecPosvCountType is new Table_IO.Positive_Count; =20 type DEItem is record Pos: Table_IO.Positive_Count; end record; package DE_IO is new Ada.Direct_IO(DEItem); TableFile : Table_IO.File_Type; DEFile : DE_IO.File_Type; end DB_Table;=20 with Ada.Direct_IO; with BC; with BC.Containers; with BC.Containers.Queues; with BC.Containers.Queues.Unbounded; with BC.Support.Unmanaged_Storage; package body DB_Table is =20 package Unmanaged_Storage renames BC.Support.Unmanaged_Storage; Storage: Unmanaged_Storage.Pool; package Containers is new BC.Containers(Item =3D> DEItem); package Queues is new Containers.Queues; package UBQueue is new Queues.Unbounded (Unmanaged_Storage.Pool, = Storage); --. --. --. -- routines to read/write/append/etc... --. end DB_Table; After compliling with GNAT 3.13p: gcc -c -gnatf db_table.adb db_table.adb:13:04: instantiation error at bc-containers.ads:132 db_table.adb:13:04: parent type must not be outside generic body gnatmake: "db_table.adb" compilation error But this trouble arising only if my package is generic, when I made=20 just simular simple package compling was saccessful. Good Old Question: knew somebody what I'm doing wrong,=20 or why things are going wrong? PS: at bc.containers.ads:132 we have private -- We need access to Items; but we must make sure that no actual -- allocations occur using this type. type Item_Ptr is access all Item; for Item_Ptr'Storage_Size use 0; type Container is abstract new Ada.Finalization.Controlled with null = record; -- Private primitive operations. -- These should ideally be abstract; instead, we provide = implementations, -- but they raise Should_Have_Been_Overridden.