List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:May 13 2005 8:29pm
Subject:Re: [PATCH] documentation and type_info fix
View as plain text  
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.
Thread
[PATCH] documentation and type_info fixChris Frey11 May
  • Re: [PATCH] documentation and type_info fixWarren Young12 May
    • Re: [PATCH] documentation and type_info fixWarren Young13 May
    • Re: [PATCH] documentation and type_info fixChris Frey13 May
      • Re: [PATCH] documentation and type_info fixWarren Young13 May
        • Re: [PATCH] documentation and type_info fixChris Frey13 May
        • Re: [PATCH] documentation and type_info fixWarren Young13 May
          • Re: [PATCH] documentation and type_info fixWarren Young13 May
      • Re: [PATCH] documentation and type_info fixChris Frey18 May
        • Re: [PATCH] documentation and type_info fixWarren Young18 May
          • Re: [PATCH] documentation and type_info fixChris Frey18 May