All,

I'll first start with no code and examples, but I wrote a small 
framework to better write our API classes.

First lets say the problems we're having. Usage of the API classes, 
while is still low, are already becoming messy, specially related to the 
status vector.

There are status vector initialized in some places and not touched in 
another ones.

While the code was being written to be C++ friendly, again due to status 
vector it's not.

In the external engines (with the Error object), I used a way so the 
error object would be constructed directly in the call and throw when 
necessary when being destroy. See RaiseError class. We know this is bad 
practice, and I had some problems with it while changing the Jaybird part.

What the "framework" do is a way to define interfaces with some 
preprocessor code, adding some functionalities.

It creates Wrapper classes that has no status vector and do the 
necessary throws. In the same way, it allows our code to be written to 
throw instead of setting properties on status objects.

As a bonus, it generates C structs with "vtable" pointers allowing C to 
call the API.

Also, using the preprocessor or some (say sed, awk, etc) tool, someone 
may be able to "automatically" create bindings for others languages.

Comments?


Adriano


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to