comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Dynamically reallocated buffer
Date: Thu, 31 May 2007 23:33:46 -0700
Date: 2007-05-31T23:33:46-07:00	[thread overview]
Message-ID: <1180679626.254857.59070@w5g2000hsg.googlegroups.com> (raw)

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());

The problem is that Ada.Containers.Vectors does not provide the
necessary guarantees to be any useful in this context.

What are your suggestions?

--
Maciej Sobczak
http://www.msobczak.com/




             reply	other threads:[~2007-06-01  6:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01  6:33 Maciej Sobczak [this message]
2007-06-01  7:15 ` Dynamically reallocated buffer anon
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