Hey Graeme, 2011/12/1 Graeme Gill <grae...@argyllcms.com>: > I think it means creating and destroying a temporary object (vector) > for each operation, doesn't it ?
That's right. >> That would be possible too -- provided we can solve memory management >> so that the backend remains responsible for the memory allocated for a >> returned blob value of unknown size, or copies the blob into a >> preallocated array in case the size is fixed. This will complicate >> backend design a bit since he will need to keep track of returned >> blobs until the statement is reset or the next row is fetched. > > If you can't return the backend data to the caller to allow it > to resize the object (presumably because the data will become unavailable > after the return), the then about the only option is to pass in a callback > of some type (interface class to abstract the resize ?) to the backend, > rather than relying on it being vector<unsigned char>. Messy in it's own > way, but would save creating the temporary vector<> and copying data > in and out of it for any sort of fixed sized or resizable object. I wouldn't do that, but I would define the life-time of the returned value to be valid as long as the statement is not reset or the next row of data is not fetched. > I was wondering if this was possible, but my understanding of > template syntax is sketchy. If I try implementing it along the > lines above I get the (usual screen filling cascade of almost > indecipherable error messages that result from any template problem), > ending in: Trying to fix a template error messages from distance is near impossible. I think we (I mean, you) should turn this into a feature request (redmine) so that one of us (at emweb) can tackle it. Regards, koen ------------------------------------------------------------------------------ Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest