Topic: Variable Length Classes
Author: vincer@iaccess.za (Vincent Risi)
Date: 24 Jul 1994 11:47:09 GMT Raw View
> Ulf Schuenemann responded
> I'm not sure what you intend to do with this class (and what you
> mean by 'variable length classes') When you know the size that a
> tA should have at the point of construction, you can use a
> templateclass:
The problem I am describing is a real one where the class has to be of
variable size. This is generally used with comms between programs where
messages can be of varying sizes, which can only be determined at
runtime. You can address the problem by imposing a fixed maximum size.
Often however these messages get layered with each layer incorporating
their own headers. Sure we can have pointers to data buffers but then
this means we have multiple data blocks.
|--Header--|--Pointer--|
|--Data-...-|
instead of
|--Header--|--Data-...-|
Templates are all well and good but they are still only a compile time
thing.
Vince Risi
==========