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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,84278745d02bb495 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Dynamic Dispatch Example Date: 1999/06/03 Message-ID: #1/1 X-Deja-AN: 485217385 Content-Transfer-Encoding: 7bit References: Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Date: 1999-06-03T00:00:00+00:00 List-Id: Cameron McAllister wrote in message news:Pine.OSF.4.10.9906031352450.27920-100000@student.uq.edu.au... > Anyone have an Ada example of dynamic dispatching. > > i.e. one function that is different for a type and all its subtypes > > getting REally wierd errors, just need to check the dynamic dispatch. > look at the small demo application at ftp://ada95.com/pub/pet_store.tgz or ftp://ada95.com/pub/pet_store.tar.gz The two files are identical (hard-linked) because Windows isn't friendly to the .tar.gz extension, and Netscape on UNIX isn't friendly to .tgz extension. The type hierarchy has an abstract type at the root of the class, then another abstract derived type, and then concrete (i.e., non- abstract) derived types. There is an example of an abstract function which must be overridden for each concrete derived type, and an example of a classwide function which is the same for all types derived from the root type. I hope this example helps.