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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,dbbbb21ed7f581b,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g27g2000yqn.googlegroups.com!not-for-mail From: xorque Newsgroups: comp.lang.ada Subject: Operation can be dispatching in only one type Date: Fri, 13 Nov 2009 12:12:18 -0800 (PST) Organization: http://groups.google.com Message-ID: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> NNTP-Posting-Host: 78.143.202.207 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1258143139 6938 127.0.0.1 (13 Nov 2009 20:12:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 Nov 2009 20:12:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g27g2000yqn.googlegroups.com; posting-host=78.143.202.207; posting-account=D9GNUgoAAAAmg7CCIh9FhKHNAJmHypsp User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.0.13) Gecko/2009081019 Firefox/3.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8093 Date: 2009-11-13T12:12:18-08:00 List-Id: Hello. I'm trying to write an archive/directory abstraction in a similar vein to PhysicsFS but am at a bit of a loss as to how to design the archiver interface: with Path; package Archiver is type Archiver_t is abstract tagged limited private; type Archiver_Class_Access_t is access Archiver_t'Class; procedure Init (Archiver : out Archiver_t) is abstract; function Can_Mount (Archiver : in Archiver_t; Path : in Path.Real_t) return Boolean is abstract; type File_t is abstract tagged limited private; type File_Class_Access_t is access File_t'Class; procedure Open (Archiver : in Archiver_t; Path : in Path.Virtual_t; File : out File_t) is abstract; procedure Close (File : in out File_t) is abstract; private type Archiver_t is abstract tagged limited null record; type File_t is abstract tagged limited null record; end Archiver; The idea of the above is that the main part of the library only deals with archivers and "files" (which might only really be pointers to entries in Zip files, for example) by 'Class. The problem with the above is that: archiver.ads:18:13: operation can be dispatching in only one type Hopefully someone here knows a better way to handle this.