I have recently played around with the Booch Components
(http://www.rivatech.com/booch/) and have tried to build a heterogenous
list of elements whose types are rooted at pl_element.
type Pl_Element is tagged record
Name : Bounded_String;
Distance : Long_Integer;
end record;
type Pl_Element_Ptr is access all Pl_Element;
type Pl_Element_Class_Ptr is access all Pl_Element'Class;
... pl_element operations
type Pump is new Pl_Element with record
Power : Float;
end record;
... pump operations
The generic interface of BC.Containers is
generic
type Item is private;
type Item_Ptr is access all Item;
package BC.Containers is
I hoped to instatiate BC.Containers with Pl_Element and
Pl_Element_Class_Ptr in order to build a DList of objects taht are
derived from Pl_Element. But that is not possible (the way I intended
it to do).
Is it possible to build heterogenous container classes with the booch
componants? How does one has to do it?
What is the rationale for not using something like
generic
type Item is tagged private;
type Item_Ptr is access all Item'Class;
package BC.Containers is
Rolf
[log in to unmask]