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.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,823a848589d002c9,start X-Google-Attributes: gid103376,public From: Yves Malette Subject: Classwide Container Date: 1998/06/08 Message-ID: <357BFD07.37A379C3@gbr.msd.ray.com>#1/1 X-Deja-AN: 360709257 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: sel Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-06-08T00:00:00+00:00 List-Id: I am having trouble creating an array of classes..... that is the simplest way I can say it .... I have included a snippet of code which can better explain my attempts..... type Base_Message_Rtype is tagged --base class record null; end record; type External_Message_Rtype is new Base_Message_Rtype with --some new class of message record with their respective functions Sent_To : Send_Ptype := Send_Method'Access; Pending : Pending_Ptype := Pending_Method'Access; end record; type Message_Array_Rtype is array (Messages) of Base_Message_Rtype'Class; -- an array that can contain message classes forever as they become available... the above example does'nt compile ( BASE_MESSAGE_RTYPE'CLASS must be constrained ).. which I can agree with...... but I have spent three weeks with my trusty Cohen book and I know I can constrain it by merely turning my message_array component into a pointe..(oopss...access type)..... type Node_Pointer_Type is access Base_Message_Rtype'Class; type Message_Array_Rtype is array (Message_Etype) of Node_Pointer_Type; this will compile, but unfortunately I can only access the methods from my base class and not the classwide access expected in the near future....... (Base_Message_Rtype'Class) I trying create a simple classwide container............................ I am almost their...any help would be appreciated New Ada Guy .... -- Thanks in advance. Yves Bernard Malette "Expect GREAT Things!" "Disclaimer about my views and my employer goes here" +-------------------------------------------------------+ | Raytheon Electronic Systems ph (617) 274 3683 | | Mail Stop: S1E-K116 | | 180 Hartwell Road ybm@gbr.msd.ray.com | | Bedford, MA 01730-2498 | +-------------------------------------------------------+