comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: accessibility of objects
Date: Sun, 05 Dec 2010 00:35:33 +0100
Date: 2010-12-05T00:35:33+01:00	[thread overview]
Message-ID: <87sjydt8l6.fsf@ludovic-brenta.org> (raw)
In-Reply-To: g96dnWSRONpxIGfRnZ2dnUVZ_o-dnZ2d@giganews.com

george <user@compgroups.net/> writes on comp.lang.ada:
> Hello, I have been wrestling with an issue for some time, and now Im
> looking for if someone has a good solution.
>
> I what to have a "package" where i have routins that I want to call
> from another code/package. while this first package need to store
> items/records that are defined in the calling package. Ada just wont
> let me do such construct, what shall I use. I typically get "type
> extension at deeper accessibility level than parent" or something else
> problem.  I just want this utility program to store essentially in old
> language a pointer to my object, and dont care about the structure of
> the object, and then return me the pointer att appropriate time.

How many objects does your package need to store?

If the answer is only 1 then that's a singleton and you probably don't
need any pointers or access values at all.

If the answer is "many" then I suggest you use a predefined container.
Ada 2005 has a selection of Vectors, Maps, Sets, Ordered_Sets and
Doubly_Linked_Lists; see section A.18 in the Ada 2005 Reference Manual
[1].  If you use a compiler that only supports Ada 95 then I recommend
you use the Charles library [2].

[1] http://www.adaic.com/standards/05rm/html/RM-TOC.html
[2] http://charles.tigris.org/

HTH

-- 
Ludovic Brenta.



  reply	other threads:[~2010-12-04 23:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04 22:17 accessibility of objects george
2010-12-04 23:35 ` Ludovic Brenta [this message]
2010-12-05 10:16 ` Georg Bauhaus
replies disabled

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