comp.lang.ada
 help / color / mirror / Atom feed
From: David Wallace <averon@argonet.co.uk>
Subject: Re: Can you help with an Ada 95 OO Problem
Date: 1997/01/19
Date: 1997-01-19T00:00:00+00:00	[thread overview]
Message-ID: <na.fb04c5474f.a50140averon@argonet.co.uk> (raw)
In-Reply-To: na.9173d8474e.a50140averon@argonet.co.uk


Thanks for your reply Mathew,

   On Sat 18 Jan 97 (20:26:24), mheaney@ni.net wrote:#   >
   >Try a view conversion of the designated object, to get at its primitive
   >operation:
   >
   >   Http.Headers.Init (Obj => Http.Headers.Header (Header_Ref.all));
   >
   >I'm not sure that will work, but try it and let me know (so I can
   >learn, too!).
   >  

   I had tried your suggestion above, but this will not work either. Since
   the Init operation has an access parameter, it can only be passed an 
   access type, but giving the components of the object direct visibility. 
   This is why I had tried using the type conversion Headers_Access on the 
   access parameter
   
    procedure Init (Obj : access General_Header) is

         Header_Ref : Header_Access(Obj);


   begin

      --
      -- I thought that by doing the view conversion with the acces type,
      -- the tag would be changed on the class wide type. But on 
      -- Investigation I found that this was not the case, the tag for the 
      -- class wide type, would stay the same (In John Barnes Ada 95 book). 
      -- This was when I really found myself stumped.
      --
      -- The problem is made more difficult using the access parameter, which

      -- insists on an allocated access_type being passed in. I think it 
      -- would be an easier problem to understand if it were not an access 
      -- parameter.
      --
      Init(Obj => Header_Ref);

   end Init;
        

   If you have any further Ideas, please do not hesitate to reply again. 
   I am still reading the text books to try and find out, but would still 
   appreciate help.


   Thanks

       Dave Wallace.

--
--. --. --. --. : : --- --- .---------------------------------------------.
|_| |_| | _ | | | | |_   |  |Internet provider for all Acorn RISC machines|
| | |\  | | | | |\| |    |  '---------------------------------------------'
| | | \ |_| |_| | | |__  |  averon@argonet.co.uk






  parent reply	other threads:[~1997-01-19  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-18  0:00 Can you help with an Ada 95 OO Problem David Wallace
1997-01-18  0:00 ` Matthew Heaney
1997-01-19  0:00 ` David Wallace [this message]
1997-01-21  0:00   ` Can you help with an Ada 95 OO Problem (Solution !!!) David Wallace
1997-01-20  0:00 ` Can you help with an Ada 95 OO Problem Jon S Anthony
1997-01-21  0:00 ` Jerome Desquilbet
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox