comp.lang.ada
 help / color / mirror / Atom feed
* Extending Nested Tagged Records
@ 1999-12-06  0:00 Robert B. Love 
  1999-12-06  0:00 ` tmoran
  0 siblings, 1 reply; 3+ messages in thread
From: Robert B. Love  @ 1999-12-06  0:00 UTC (permalink / raw)



Can a tagged record owning a tagged record type have the inner
record extended?  In trying to understand how the type extension
mechanism in Ada 95 works I'm replacing nested variant records with 
tagged types.  Does this even make sense?  Or is a complete redesign
the better way to go?

Here is a code snippet--

type telemetry_type is tagged 
	record
		speed: real;
		error_flag: boolean;
	end record;


type motorized_device is tagged
	record
		speed: real;
		torque : real;
		current_cmd : cmd_type;
		telemetry: telemetry_type;   -- this is what I want 
	end record;                         -- to extend

type device_1 is new motorized_device with
	record
		shaft_position: real;
		shaft_load : real;
	end record;

type device_2 is new motorized_device with
	record
		latch_angle: real;
		end_of_travel_switch: boolean;
	end record

In the definitions of device_1 and device_2 how can I extend the
telemetry type?



--
----------------------------------------------------------------
 Bob Love                                   
 rlove@neosoft.com                            
----------------------------------------------------------------





^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews. net>]

end of thread, other threads:[~1999-12-06  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-06  0:00 Extending Nested Tagged Records Robert B. Love 
1999-12-06  0:00 ` tmoran
     [not found] <84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews. net>
1999-12-06  0:00 ` Matthew Heaney

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