DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17945>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17945 Allow custom implementation of DOMNode interface to enable reference counting over nodes (and thus their early disposal) Summary: Allow custom implementation of DOMNode interface to enable reference counting over nodes (and thus their early disposal) Product: Xerces-C++ Version: 2.1.0 Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] This change will provide a custom implementer to know the lifetime of a node held by a client. The client has to use the DOMNodeSPtr type instead of a DOMNode* (respective DOMElementSPtr instead of DOMElement*) to automatically indicate the local usage. If a node should have an extended life time, a DOMNodeSPtr can be used at the storage location. Note that this is an extension that does not require to be used. This means, it�s an absolute low impact extension. This extension will allow a custom implementer to destroy nodes as they are not referenced anymore. This would also allow Xerces to support massive file-documents, since it can read as requested, and release memory as not needed anymore. This feature has been asked for several times in this list, and this extension would allow the Xerces implementation to do that. Changes: 1. Added 2 functions to DOMNode interface (with empty implementation), namely: virtual void incRefCount() {} and virtual void decRefCount() {} This will be useful in a scenario when one is using xerces implementation and also implementing the DOMNode interface himself and memory model of that custom implementation is different from xerces (eg. delete the node when you are done with it). Implementing these functions will enable reference counting on DOMNodes and thus their disposal when one is done with them. For a xerces node a call to these functions will do nothing while for a node element belonging to custom implementation calling them will do reference counting on that element. 2. Introduce a smart pointer encapsulating DOMNode/DOMElement which takes care of reference counting automatically and use it instead of DOMNode* or a DOMElement* at various places in xerces. To start with code for DOMWriterImpl class is modified." Please contact me, if you have any questions or doubt why that should be included. My custom implementation needsthat extension and I thought it might be useful for others. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
