comp.lang.ada
 help / color / mirror / Atom feed
From: David Bowerman <davidb@syd.csa.com.au>
Subject: Can't hide parts of ADTs in private children
Date: 1998/11/09
Date: 1998-11-09T00:00:00+00:00	[thread overview]
Message-ID: <364683EB.41C6@syd.csa.com.au> (raw)

I am implementing an Abstract Data Type (Class) in a package.  The code
goes something like this:

  package Class_X_Package is

    type Class_X is private;
    type Class_X_Ptr is access Class_X;

    ...  operations on objects of type X

  private

    type Class_X is
      record
        Component_A : Type_A;
        Component_B : Type_B;
        ...
      end record;

  end Class_X_Package;

The abstract data type (X) is complex, and Type_A, Type_B, etc hide a
lot of structure within themselves.
I would like to break the package down further, declare the types, and
generally hide the details of, Type_A, Type_B, etc (never intended to be
visible to the client) in private child packages.
But I can't do this because these types are referred to in the private
part of the parent package spec, and this isn't allowed to 'with' its
children.

Can anyone suggest another way of doing it.




             reply	other threads:[~1998-11-09  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-09  0:00 David Bowerman [this message]
1998-11-09  0:00 ` Can't hide parts of ADTs in private children Stephen Leake
1998-11-10  0:00 ` Dale Stanbrough
1998-11-16  0:00 ` Matthew Heaney
replies disabled

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