Re: Status of callback interface enhancements
Benoit Grégoire <[email protected]>
| Newsgroups | gmane.comp.finance.libofx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 26 February 2004 08:30, Kevin Tambascio wrote: > Hi, > > I am a developer with KMyMoney, and we are looking at using libofx as part > of our software, so that we can import ofx files. > > I started to write our implementation, but ran into a few issues. First > off, there is no way to register callbacks, in our case, static C++ member > functions. I don't see how they would be called with the current library. Currently they are linked at compile time. It's a design mistake I made early on (inspired by OpenSP's interface), but it is fairly simple to use. See ofxdump.cpp If the flow is currently disruptive to your object model (such as if you can't garantee that you have a necessarly object created to receive the call, just wrap the code in another object whose sole job is to remember whatever info you need to pass data to the rest of your app. > The second issue, was that when the callbacks would be called, I do not > have access to my class's instance. I know with expat, the callback > functions send you a void* that you can set in the beginning to associate > with your class's instance. This is partially implemented in CVS by Ryan P Bobko. Not complete thought. > If this is not possible/desired, have you considered a DOM-style interface, > where the document is parsed, and client's can then walk the tree? This > would avoid the problem of having to have a callback mechanism. Yes, the next major version of LibOFX will have this, and in fact will be the only way to access the data elements (except for things ike status which obviously need a callback. It's already done internally, I just need to write the API to access it. But as it's a source incompatible change it won't be released early. We need this to allow out of order access to data (such as creating all accounts before we process transactions) and to allow bidirectionnal communication. > It looks like some of this has been covered in your mailing list, but I > didn't see anything about what the final plan will be. I'm currently > trying out 0.6.6. The plan is: -The API for LibOfx 0.6.x won't change, and will likely remain the released version for months to come -The next major release will have registerable callbacks with void * user data, and well as a walkable tree for the different elements. API not done yet. Feel free to ask for any more details, or catch me on #gnucash on irc.gnome.org. I can also take a look at your code if it's in a CVS somewhere. -- Benoit Grégoire, http://step.polymtl.ca/~bock/ ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click