comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Dynamically reallocated buffer
Date: Fri, 01 Jun 2007 07:15:07 GMT
Date: 2007-06-01T07:15:07+00:00	[thread overview]
Message-ID: <%HP7i.44715$Sa4.7177@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1180679626.254857.59070@w5g2000hsg.googlegroups.com

In <1180679626.254857.59070@w5g2000hsg.googlegroups.com>,  Maciej Sobczak <see.my.homepage@gmail.com> writes:
>I need a dynamically reallocated buffer of bytes, which I can extend
>at run-time by appending new fragments to the whole buffer. The
>purpose of the buffer is to pass it later to the subprogram that
>writes it "en bloc" to some external device.
>
>For those of you who know C++ I need something like:
>
>vector<unsigned char> buffer;
>// fill the buffer with push_back or insert at end
>// ...
>write_to_device(&buffer[0], buffer.size());

Stay away from C++. Its the same as a girl on PMS.


>
>The problem is that Ada.Containers.Vectors does not provide the
>necessary guarantees to be any useful in this context.
>
>What are your suggestions?

Did this using Ada 83 for strings vectors for my first class.  Which 
shocked my prof because he said what I had in mine could not be 
done.  The code is at the ACM code server.  Using the code it can 
be modified to work for all Ada packages.





  reply	other threads:[~2007-06-01  7:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01  6:33 Dynamically reallocated buffer Maciej Sobczak
2007-06-01  7:15 ` anon [this message]
2007-06-01 13:04   ` Maciej Sobczak
2007-06-01  7:30 ` Dmitry A. Kazakov
2007-06-01 13:08   ` Maciej Sobczak
2007-06-01 11:32 ` Georg Bauhaus
2007-06-01 14:49 ` Matthew Heaney
2007-06-02 12:38   ` Stephen Leake
2007-06-03  9:52     ` Georg Bauhaus
2007-06-05  0:25       ` 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