11 messages in com.mysql.lists.plusplusRe: [PATCH] documentation and type_in...
FromSent OnAttachments
Chris Frey10 May 2005 23:57 
Warren Young12 May 2005 14:53 
Warren Young12 May 2005 15:57 
Chris Frey13 May 2005 01:16 
Warren Young13 May 2005 12:46 
Chris Frey13 May 2005 13:22 
Warren Young13 May 2005 13:28 
Warren Young13 May 2005 14:05 
Chris Frey18 May 2005 07:51 
Warren Young18 May 2005 10:02 
Chris Frey18 May 2005 13:27 
Subject:Re: [PATCH] documentation and type_info fix
From:Warren Young (mysq@etr-usa.com)
Date:05/13/2005 01:28:41 PM
List:com.mysql.lists.plusplus

Warren Young wrote:

If you want a real scare, start with mysql++.h. Eeek!

Took my own advice...<shudder>....On tracing out the dependency graph, I found that if you #include query.h, you get everything else except compare.h and custom*.h.

On studying it, I don't see how it could be any different. Query and Connection are closely tied together; no argument possible there. Query can return the various Res* objects, and those are composed of Rows, which contain data that can be converted to Fields and ColDatas, and to all the other special C++ types MySQL++ defines. You've rolled up all the major facilities of MySQL++ right there, and so naturally most of the minor headers come in, too.

Since every MySQL++ program needs query.h, it seems that the main purpose of mysql++.h is to be explicit about what's going on. Asking people to just #include query.h and telling them that it'll do what they want would be obscure. I tried using query.h instead of mysql++.h in the examples, and it doesn't improve compile times any, so mysql++.h isn't hurting us.

The fact that compare.h isn't being used within the library or examples is worth pondering. The file seems to contain functors and such for use with STL algorithms. I think we should add an example to demonstrate its purpose, and add that to the userman.

I did find one inefficiency that could be worth fixing. examples/util.h #includes mysql++.h, but most of the examples #include both util.h and mysql++.h. If I remove those redundant mysql++.h's, compile time goes down by a whole 9% on my main development machine. The question is whether that's worthwhile enough to make the example code more obscure. I don't think so. For 50%, I'd do it.

Try that change, Chris, and see what kind of time reduction you get. FWIW, the fastest build time for the examples here is 1:21.