On Mon, May 30, 2005 at 04:23:56PM +0200, Byrial Jensen wrote:
> You have a good point. However the functions Row::parent(), Row::size(),
> Row::operator bool(), Row::operator[]() and Row::lookup_by_name() are
> already now dependent on the parent Result object - it gives undefined
> behavour to use these functions after the destruction of the Result.
>
> The only useful member function left which now can be used without the
> parent is Row::raw_data().
Good point.
> If the lifetime of a Row object really is expected to be able to extend
> the lifetime of the parent Result object, I would suggest a rewrite to
> remove the current dependencies.
I'm favouring a speedy iterator which gives a dependent row object,
and could then be copied into a standalone Row at the user's discretion.
But I'd need to study the code a bit more to untangle it fully. An argument
could be made that SSQLS serves the copying purpose of Row, and that Row
should be dependent anyway, since it is a core object. This would make sense
and be consistent with the rest of the library, where things depend on
connection in hidden ways.
- Chris