From: stephan b. <st...@ei...> - 2003-09-11 13:05:39
|
i've got my stl version of the s11n lib working. It's not 100% API-compatible with the current libfun interface, but it's conceptually very similar and much of the code can probably be re-used as-is in libfun. http://stephan.rootonfire.org/elib/ Sample app in lib/elib/tests/funser.cpp, though it doesn't show all of the functionality. i have a more extensive example which isn't in that tarball but i can make it available if you want it. Notable changes from the libfun s11n model: - Current classloader is brain-dead and can only work with statically registered factories. - LoadableClass does not exist as such: all serializables must extend ESerializable. This is based off of the observation that we have never (AFAIR) had a LoadableClass which is also not Serializable. (i.e., everything we've loaded has been Serializable, AFAIR). - ES11nNode (SerialTree's counterpart) is more template-based. In the future i would eventually like to remove the hard-coded ESerializable-base-class requirement and move that to a template param, but i'm afraid it would make using the class too clumsy. - SerializableClass (called implClass) is now a property of ESerializable, and ES11nNode pulls the info from there. ESerializable subclasses should set their implClass() once during the ctor to ensure that the correct type is saved. It currently handles both fun-txt and fun-xml dialects, but the selection of the i/o format is not as transparent to the client as i would like (i.e., the client must know which one he wants to read/write). -- ----- stephan st...@ei... - http://www.einsurance.de "Let's do what we do best and run out of here screaming in fear!" -- Shaggy, to Scooby |