From: Andy Askey <ajaskey@mindspring.com>
Subject: Constructors in Ada95
Date: 2000/02/21
Date: 2000-02-22T03:44:20+00:00 [thread overview]
Message-ID: <h414bsc31c83a96l429kfeflk8rsfbk7fq@4ax.com> (raw)
Hello,
I am sure this has been asked/answered several hundred times but
nothing current appears in DejaNews.
I want to call a procedure each time an object is instantiated for a
specific class/type and pass the current instance into the procedures.
(I could call the procedure after the object is instantiated, but it
will be easier on the user of my class/type if the procedure is
automatically called after instantiation.) I looked into using a
Controlled type, but I still cannot figure out how to work on a
specific object instance's data.
For example (possible syntax errors included)...
package pkg is
type type1 is tagged private;
private
type type1 is tagged
record
i : integer := 0;
end record;
end pkg;
package body pkg is
...
begin
Proc_To_Call( This_Current_Instance : in Type1'class);
end pkg;
Any tips will be useful as I cannot find any info about this in any of
my Ada books. I have "Ada(95) as a Second Language", so if you know
of a section that discusses C++ style constructors, please help me out
with the page numbers. Also, any info on the web that deals with this
would be helpful. I do not mind reading, but I don't have a lot of
time to figure out what it is I should read to answer my immediate
question.
Thanx.
--
----------------------------------------------------
| Andy Askey |
| Software Engineer |
| Raytheon Electronic Systems |
| 353 James Record Road, Huntsville, AL 35824 |
| Phone: (256) 772-4846 Fax: (256) 772-4771 |
| andrew_j_askey@res.raytheon.com |
----------------------------------------------------
--
Andy Askey
ajaskey@mindspring.com
next reply other threads:[~2000-02-21 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-21 0:00 Andy Askey [this message]
2000-02-22 0:00 ` Constructors in Ada95 Simon Wright
2000-02-22 0:00 ` David
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox