![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
On Wed, Jul 06, 2005 at 01:15:33AM -0700, Wolfram Arnold wrote: Could the macro be split into two or take an extra flag to optionally not generate the definition for the globals? I'd be glad to give this a shot, but I wanted to hear from the community if there is any reason other than lack of volunteers. This has come up before; I found mailing list articles as far back as 2001 on this. Personally, I'd say go for it. Keeping all the logic in one macro / header (i.e. custom-macros.h) is probably the most maintenance friendly, since the macro needs to be expanded for the names anyway, and you don't want to duplicate it anywhere. Something like this might be useful: // file: tables.h - define it sql_create_5(stock, ..... ); // file: stock.cpp - the only file that has the static data #define SSQLS_GENERATE_STATICS #include "tables.h" // file: client.cpp - simple user module #include "tables.h" Might take some creativity to do that, but I think it's possible. - Chris -- |
#3
| |||
| |||
|
|
While we're talking about wish-lists for version 2.0, |
|
The SSQL macro expansion will create static globals that are being defined (assinged) as part of the macro. |
#4
| |||
| |||
|
|
// file: stock.cpp - the only file that has the static data #define SSQLS_GENERATE_STATICS #include "tables.h" |
#5
| |||
| |||
|
|
You can define other sub macros conditionally though, and call them from the first. |
#6
| |||
| |||
|
|
This is a big disadvantage in my view. It adds a dependency to the user's build process, not just to mysql++'s. |
|
I would not be keen on writing XML in order to get C++. |
ate name="MyDate"/>|
I'm uncomfortable going in the other direction toward code generators, even with the above advantages. |
#7
| ||||||
| ||||||
|
|
It is the syntax, I must admit (it's so top-heavy with markup), |
|
plus needing some other dependency on my system to build. |
|
I'm reminded of Microsoft's special interface language here. |
|
Also, the idea of generating code usually tells me that something is broken in the design or abstraction somewhere. |
|
I'm not totally against code generation: I'm pondering it myself for my own CPPHP project. |

|
The syntax makes me shudder, but it's the best in the field so far, it seems. :-) |
![]() |
| Thread Tools | |
| Display Modes | |
| |