From: rlove@antispam.neosoft.com (Robert B. Love )
Subject: Extending Nested Tagged Records
Date: 1999/12/06
Date: 1999-12-06T00:00:00+00:00 [thread overview]
Message-ID: <84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews.net> (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
----------------------------------------------------------------
next reply other threads:[~1999-12-06 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-06 0:00 Robert B. Love [this message]
1999-12-06 0:00 ` Extending Nested Tagged Records tmoran
[not found] <84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews. net>
1999-12-06 0:00 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox