comp.lang.ada
 help / color / mirror / Atom feed
* how can i allocate an objekt with initialization???
@ 2004-12-05 16:54 Thomas Bruns
  2004-12-05 22:51 ` Stephen Leake
  2004-12-06  8:52 ` Martin Krischik
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Bruns @ 2004-12-05 16:54 UTC (permalink / raw)


Hello

i have a problem, with initialzie objekt with ada...

i want to do a new, to allocate the objekt... 

--------------------------------------------------------------
with ADA.FINALIZATION; use ADA.FINALIZATION;
package class_test_package is

 type FATHER_CLASS is new CONTROLLED with
  record
   INT1 : INTEGER;
  end record;

 type FATHER_CLASS_PTR is access FATHER_CLASS'Class;
 
 function GETINT1 return INTEGER is abstract;

end class_test_package;

with class_test_package; use class_test_package;
package class_test_package_ableitung is

type CHILD_CLASS is new FATHER_CLASS with private;

type CHILD_CLASS_PTR is access CHILD_CLASS'CLASS;
private

 procedure Initialize (OBJECT : in out KIND_CLASS);
 
 procedure Finalize  (OBJECT : in out KIND_CLASS);
 
 procedure ADJUST (OBJECT : in out KIND_CLASS);
  
 type CHILD_CLASS is new FATHER_CLASS with
  record
   INT2 : INTEGER;
  end record;

end class_test_package_ableitung;


main:

TEST : FATHER_CLASS_PTR;

begin
 TEST:= new CHILD_CLASS'(INT=>1); -- i will initialze the objekt here,but 
       -- it wrong??
--class_test.adb:11:57: expected private type "KIND_CLASS" defined at
--class_test_package_ableitung.ads:16
--class_test.adb:11:57: found a composite type

end;



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

end of thread, other threads:[~2004-12-13 11:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-05 16:54 how can i allocate an objekt with initialization??? Thomas Bruns
2004-12-05 22:51 ` Stephen Leake
2004-12-06  8:52 ` Martin Krischik
2004-12-06 10:04   ` Ole-Hjalmar Kristensen
2004-12-06 11:49     ` Adrien Plisson
2004-12-06 13:34       ` Martin Krischik
2004-12-13  6:38         ` Dave Thompson
2004-12-13 11:11           ` Martin Krischik
2004-12-06 11:55     ` Martin Krischik

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