From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: API design considerations - variable-length array in record type
Date: Mon, 08 Oct 2012 23:10:48 -0400
Date: 2012-10-08T23:10:48-04:00 [thread overview]
Message-ID: <85fw5ojq6f.fsf@stephe-leake.org> (raw)
In-Reply-To: c40023e6-e7d1-431f-8759-5ac224c0aa1f@googlegroups.com
Maciej Sobczak <see.my.homepage@gmail.com> writes:
> Hi,
>
> I am working on the API design where there is a need for a record type
> with field(s) that are arrays of some predefined type (say, Integer).
> So, an example record type might look like this:
>
> type R is record
> X : Integer;
> Y : Unbounded_String;
> Z : Array_Of_Integers_That_We_Talk_About_Here;
> end record;
>
> A straightforward choice is a predefined instantiation of
> Ada.Containers.Vectors for Integer and this would be probably the
> least surprising, especially in the context of Y : Unbounded_String,
> but at the same time I'm open to consider some more lightweight
> alternatives.
> The problem is - any other alternative I can think of leads to the
> complication of API in the form of introducing
> Ada.Finalization.Controlled to the picture.
>
> Do you have some favourite solutions?
Ada.Containers.Bounded_Vectors meets these requirements.
--
-- Stephe
next prev parent reply other threads:[~2012-10-09 3:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 9:03 API design considerations - variable-length array in record type Maciej Sobczak
2012-10-08 11:13 ` Simon Wright
2012-10-08 11:29 ` Egil Høvik
2012-10-08 11:53 ` Maciej Sobczak
2012-10-08 14:37 ` Tero Koskinen
2012-10-09 2:02 ` Shark8
2012-10-09 5:16 ` Adam Beneschan
2012-10-09 5:45 ` Shark8
2012-10-09 5:42 ` Niklas Holsti
2012-10-09 3:10 ` Stephen Leake [this message]
2012-10-09 7:47 ` Maciej Sobczak
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox