From: stephan b. <st...@ei...> - 2003-11-17 17:21:13
|
On Sunday 16 November 2003 12:53, Rusty Ballinger wrote: > > Speaking of zaurus: have you got a cross-compiler working? > > No, not yet--my problem is that I haven't been able to connect to the > Zaurus over USB yet, and I'm resisting the temptation to just buy a > card reader. LOL! > > The code i've got isn't compatible at all, but writing a wrapper around > > it also wouldn't be too difficult, i think. > > ? Maybe I was looking at an old version of the API, but I though > there were serialize() & deserialize() methods taking a reference to > a serializer & const deserializer, and you just called get("key", > value) or put("key", value) on your various member data. At the time > the only API difference was that you didn't have to call > setSerializableClass() in serialize(). (Oh, and the "SERIALIZER" > macro probably had a different name, or wasn't necessary.) You're pretty much correct. i renamed de/serialize() to s7e() and d9e(), but ONLY for extremely pedantic reasons involving testing the ability to supply your own interface. To change the method names a client simply must supply a two-method base type and run one macro, then extend his Serializables from that base type. There is an example of this at: http://s11n.net/s11n/samples.php near the bottom of the page. To summarize: - serializableClass class stuff goes away: that's handled via the INSTANTIATOR (aka, SERIALIZABLE_REGISTER) macro and some template voodoo. - clients can either use the default Serializable implementation or provide their own (requires about 15 lines of code). A behind-the-scenes adapter class maps the client's API into the core API. e.g., you can call your de/ serialize() methods do_save() and do_load() if you like, as long as their const-ness and parameters match the lib's conventions. In fact they can even have the same name, and constness figures out which one will be called. (In practice doing so is very confusing, however, and does not translate well to other languages which don't support const.) - Serializables from different heirarchies & with different interfaces can interact with each other transparently via the s11n API, as the adapter classes take care of the API translation. i haven't yet had a chance to commit this. We've had about 5x normal traffic on our web/app servers and they've done nothing by die die die since about 2 weeks now, and that's kept all of us working 24/7. :( -- ----- st...@ei... - http://www.einsurance.de Student: "Master, you must teach me the way of liberation!" Master: "Tell me who it is that binds you." Student: "No one binds me!" Master: "Then why do you seek liberation?" |