![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Below is a patch that contains a couple suggested documentation changes, as well as an explanation of how the type system works in type_info.{h,cpp}. |
|
Also in type_info.cpp, I changed part of the type lookup table, to match what I believe is intended: for every entry marked true, there should be a unique typeid() value. Where there were duplicate typeid() entries, I left the last one set as true, as that is the one used when you look at the for loop in the mysql_ti_sql_type_info_lookup constructor. |

|
+ o Document the header layout, and which headers can be included alone, + and which can't. Do this to optimize compile times, and allow + users to do the same. |
|
-/// stddef.h is not the same!) +/// stddef.h is not the same!) This template mechanism also +/// makes the typeid() unique for each C++-equivalent of nullable +/// SQL field types, which are listed in type_info.cpp. |
#3
| |||
| |||
|
|
- A smarter way to go is to wrap each #include with the idempotency guard for that header, so it is never included from mysql++.h if a previous header already included it. |
#4
| ||||
| ||||
|
|
I was able to rewrite this to be a lot clearer, I think. Some of it was just straight rewriting, but I also moved a lot of it to more appropraite places, so only the salient bits remain in type_info.cpp. The "opinion" block is now a Wishlist item, and the explanation of type()'s inner workings became the seed of a Doxygen comment in type_info.h. |
|
Also in type_info.cpp, I changed part of the type lookup table, to match I didn't study it deeply enough to know whether this is the right thing, so I've decided to trust that you know what you're doing here. ![]() |
|
+ o Document the header layout, and which headers can be included alone, + and which can't. Do this to optimize compile times, and allow + users to do the same. Have you read Lakos's "Large Scale C++" book (probably got the title wrong)? Are you proposing optimization of that sort? |
|
- A smarter way to go is to wrap each #include with the idempotency guard for that header, so it is never included from mysql++.h if a previous header already included it. You can push this concept further by doing the same in the other headers, but just doing it at the top level will probably save a significant chunk of time, and there's no sense cluttering the code for small gains. Unless I'm very wrong, the case we want to optimize for is end users building their own programs, not build time for MySQL++. Putting mysql++.h in order should recover most of the wasted time for the end-user case. |
#5
| |||
| |||
|
|
Also in type_info.cpp, I changed part of the type lookup table, to match I didn't study it deeply enough to know whether this is the right thing, so I've decided to trust that you know what you're doing here. ![]() If you can hold off the next release for a couple days, I can be even more definite I'm right, and can post a little test to prove it. |
stream &os)
stream &os);
#6
| |||
| |||
|
|
The dump was identical for both test runs, |
I hope you didn't think I required this.
#7
| |||
| |||
|
|
Chris Frey wrote: The dump was identical for both test runs, Good enough for me. In fact, I hope you did this mostly for yourself, as it was good enough for me before. I hope you didn't think I required this. |
![]() |
| Thread Tools | |
| Display Modes | |
| |