Sciweavers

JOOP
1998

Implementing Constructor Calls with Parameters in Ada 95

14 years 3 days ago
Implementing Constructor Calls with Parameters in Ada 95
Ada ‘95 does not provide for a constructor mechanism with parameters for initializing newly created objects. The package Ada.Finalization provides an initialize procedure which is automatically called at object creation time, but that procedure takes only one argument, i.e. the object being operated upon. This is hardly useful, since initialization of any kind usually requires additional information, which needs to be supplied through arguments. One way to get around the parameter problem is to specify a tagged type with discriminants that is derived from the limited_controlled type. The parameters that are meant to be given to the initialize procedure are then given as discriminants to the tagged record object. We describe this technique with a concrete example and explore its limitations and implications.
Zeki O. Bayram
Added 22 Dec 2010
Updated 22 Dec 2010
Type Journal
Year 1998
Where JOOP
Authors Zeki O. Bayram
Comments (0)