comp.lang.ada
 help / color / mirror / Atom feed
From: "Christopher Gosset" <chrg@online.no>
To: <comp.lang.ada@ada-france.org>
Subject: Protected types private part visibility , helpfull hints needed.
Date: Thu, 28 Apr 2005 13:30:12 +0200
Date: 2005-04-28T13:30:12+02:00	[thread overview]
Message-ID: <mailman.97.1114687832.24457.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <20050428025529.717ED4C40D8@lovelace.ada-france.org>

I am making a library consisting of several packages.
I wished to make all memory management and other "house-holding"
functions private by having them in private packages and to make all
details that is not a part of the "client-view" private.

So I have a package spec with a  protected type that look something like
this



	Generic 
	Type Item_Type (<>) is Private ;

	Package Protected_List is 

	Protected Type List is 
	
	Procedure  Add( Item : In Item_Type) ;
	Function Item(Index : In Positive) Return Item_Type ;

	Private 

		Internal_List_Structure : Internal_List ; ----------<
This is the problem line I would like the internal list structure to be
declared in a PRIVATE package and be visible to this private part
>-------

	End List ;


	Private 
	Type Item_Pointer is Access Item_Type ;


	End Protected_List ;


This does not work! This is because the Private part of the Protected
Type Declaration is a PART OF THE PUBLIC PART OF THE PACKAGE SPEC ! 

Is there a reason behind this design? Wouldn't it be more reasonable
that the private part of a Protected Type should be a part of the
PRIVATE part of the package spec and thus be able to use types and
procedures declared in private packages and private parts of the parent
? 

The private part of the protected type should never be visible to the
client anyway and the fact that all types and pakcages used in the
protected type private part must be Public destroys my absctraction! 

Am I correct in my assumptions or is there something I have missed? 

Helpfull hints will be appriciated! 


/CG















       reply	other threads:[~2005-04-28 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050428025529.717ED4C40D8@lovelace.ada-france.org>
2005-04-28 11:30 ` Christopher Gosset [this message]
2005-04-28 12:16   ` Protected types private part visibility , helpfull hints needed Dmitry A. Kazakov
2005-04-29  3:03   ` Jeffrey Carter
     [not found] <000101c54be5$a4aad420$9500000a@amd2600>
2005-04-29  1:22 ` Stephen Leake
replies disabled

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