comp.lang.ada
 help / color / mirror / Atom feed
* Classwide-type assignments
@ 1998-10-12  0:00 jsanchor
  1998-10-13  0:00 ` Niklas Holsti
  0 siblings, 1 reply; 3+ messages in thread
From: jsanchor @ 1998-10-12  0:00 UTC (permalink / raw)


Hello there:

I have asked this question before but with no luck, maybe today I'll get an
answer.

I have been trying to assign classwide types with no luck.
type PARENT_TYPE is abstract tagged
record
   checksum : NATURAL32;
end record;

type PTR_TO_DATA is access all PARENT_TYPE'class;

package CONVERT_TO_NVM_TYPE is new
      SYSTEM.Address_to_Access_Conversions(PARENT_TYPE'class);
--------------------------------------------------------------
type RAM_TYPE is new PARENT_TYPE with
record
   number_1 : integer;
end record;

RAM_object : aliased RAM_TYPE;
RAM_ptr    : CONVERT_TO_NVM_TYPE.Object_Pointer;

RAM_ptr    := CONVERT_TO_NVM_TYPE.To_Pointer(RAM_object.all'address);
ptr_to_RAM := PTR_TO_DATA(ptr_to_data); --casting
-----------------------------------------------------------

NVM_Address        : constant SYSTEM.Address :=
      SYSTEM.STORAGE_ELEMENTS.To_Address(16#00E00000#);

NVM_ptr    : CONVERT_TO_NVM_TYPE.Object_Pointer;

--get an access type to the location in NVM where data is stored.
NVM_ptr    := CONVERT_TO_NVM_TYPE.To_Pointer(NVM_Address);
ptr_to_NVM := PTR_TO_DATA(NVM_PTR);

AND then,


ptr_to_NVM.all := ptr_to_RAM.all; <-- the following statement compiles.

But nothing happens, when I run the code.

HAs anybody done this kind of thing before??
Thank you in advance.

Jay S.



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-10-15  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-12  0:00 Classwide-type assignments jsanchor
1998-10-13  0:00 ` Niklas Holsti
1998-10-15  0:00   ` Classwide-type assignments [longish] Niklas Holsti

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