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: 103376,740e91341085efe3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: defaultuserbr@yahoo.com Newsgroups: comp.lang.ada Subject: Re: Some help for a C++ guy Date: 8 Apr 2005 10:49:17 -0700 Organization: http://groups.google.com Message-ID: <1112982557.068751.125740@o13g2000cwo.googlegroups.com> References: <1112912062.146885.324110@o13g2000cwo.googlegroups.com> <1112915932.818249.246780@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: 130.76.96.17 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1112982564 2913 127.0.0.1 (8 Apr 2005 17:49:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 8 Apr 2005 17:49:24 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=130.76.96.17; posting-account=jWLFKg0AAAA9UYjCwxeOEw3zdPk7tNz5 Xref: g2news1.google.com comp.lang.ada:10344 Date: 2005-04-08T10:49:17-07:00 List-Id: Simon Wright wrote: > It sounds from your original question as though you want to use tagged > types, roughly the equivalent of classes & inheritance in C++. Here's my current attempt: with MIL_STD_1553; with OS_Types; package Message_Handler is package M1553 renames MIL_STD_1553; type Handler is tagged record Data_Buf_Ptr : M1553.Data_Buf_VPtr_T := new M1553.Data_Buf; Stat_Buf_Ptr : M1553.Status_Buf_VPtr_T := new M1553.Status_Buf_T; end record; -- the following are the primitive operations of the type procedure Message_Callback (Status : in M1553.IO_Status_T); function Num_Message_Callbacks return OS_Types.Unsigned_Word; function Num_Errors return OS_Types.Unsigned_Word; end Message_Handler; That compiles OK. In the client test package, I have: with Message_Handler; pragma Elaborate_All(Message_Handler); Handlers : Array (0..1) of Message_Handler.Handler; That's all good too. However, the first place that uses something from Message_Handler: Callbacks := Handlers(0).Num_Message_Callbacks; Fails to compile, with an error message: no selector "Num_Message_Callbacks" for type Handler defined at message_handler.ads So obviously I'm either defining things wrong or using what I have defined incorrectly. Brian