comp.lang.ada
 help / color / mirror / Atom feed
From: "Ory Segal" <orysegal@zahav.net.il>
Subject: classes and pointers
Date: Sat, 16 Dec 2000 19:37:30 -0800
Date: 2000-12-16T17:37:13+00:00	[thread overview]
Message-ID: <91g989$rlg$1@news3.inter.net.il> (raw)

Hi , can somebody please check what's wrong with my hierarchy/classes :

base_package:

 type base_type is abstract tagged record
         a : sometype;
         b : sometype;
      end record;

procedure do1(A : base_type) is abstract;
procedure do2(A : base_type) is abstract;
end base_package
****************************************
Then I have the typePackage :

type type1 is new base_package.base_type with
    record
           c : sometype;
           d: sometype;
    end record;

type type2 is new base_package.base_type with
    record
            e: sometype;
            f : sometype;
    end record;

Now , here comes implementations of do1 , do2 for both types type1,type2;
now the main progrem has "with" clause for both typePackage , base_package;
and I can create instances and fill them with values , BUT , if I want to
create a pointer (in main)
like this :
type TypePtr is access base_type'class
Pointer : TypePtr;

and then I try to call a function for that pointer , I can't seem to get the
procedures to be recognized.
how do I call the procedure ? do I use :
a) Pointer.all.do1
b) Pointer.do1

or what ? nothing works....
thank you.








             reply	other threads:[~2000-12-17  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-17  3:37 Ory Segal [this message]
2000-12-16 18:23 ` classes and pointers tmoran
2000-12-16 18:57   ` Ehud Lamm
replies disabled

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