comp.lang.ada
 help / color / mirror / Atom feed
* How to test object hierarchy
@ 2003-12-18 18:24 Pierre Favier
  2003-12-19  0:15 ` Stephen Leake
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Pierre Favier @ 2003-12-18 18:24 UTC (permalink / raw)


I am wondering how to test for two objects which types both derive from a
common root type if one of them derives from the other. In short, I am trying
to run something like the following code which does not compile because
the Class attribute applies to types or subtypes but not to objects:

   procedure Test_Hierarchy (Obj1 : in Root_Object'Class;
                             Obj2 : in Root_Object'Class) is
   begin

      if Obj1 in Obj2'Class then

         -- Do something

      else

         -- Do something else

      end if;

   end Test_Hierarchy;

Any suggestions on how to achieve the intended effect?



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

end of thread, other threads:[~2003-12-23 10:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-18 18:24 How to test object hierarchy Pierre Favier
2003-12-19  0:15 ` Stephen Leake
2003-12-19  7:45   ` Pierre Favier
2003-12-19 10:53 ` Dmitry A. Kazakov
2003-12-19 14:35   ` Hyman Rosen
2003-12-19 17:07     ` Dmitry A. Kazakov
2003-12-19 23:26     ` Robert A Duff
2003-12-20 18:20       ` Robert I. Eachus
2003-12-19 17:25   ` Georg Bauhaus
2003-12-20 11:13     ` Dmitry A. Kazakov
2003-12-21  4:34       ` Georg Bauhaus
2003-12-21 13:43         ` Dmitry A. Kazakov
2003-12-21 19:58           ` Dmytry Lavrov
2003-12-22  1:19             ` Robert I. Eachus
2003-12-22 10:09               ` Dmitry A. Kazakov
2003-12-22 17:33                 ` Robert I. Eachus
2003-12-23 10:49                   ` Dmitry A. Kazakov
2003-12-22 10:05             ` Dmitry A. Kazakov
2003-12-19 17:24 ` Nick Roberts

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