
I've introduced a new API for monitoring changes to subtrees of a given XML tree. It extends the existing change notification API for XML::Node by providing an attachment point for NodeObservers to observe changes to an entire subtree in the document, instead of just a single node.
The main difference is that rather than registering a NodeObserver with a Node via Node::addObserver, you create a Subtree object for that node and add the observer to it instead.
XML::Node *some_node; XML::NodeObserver &observer;
...
XML::Subtree *subtree = new XML::Subtree(*some_node); subtree->addObserver(observer);
...
subtree->removeObserver(observer); delete subtree; // XML::Subtree is manually manged
I'm going to do a more efficient implementation of XML::Subtree eventually, but that shouldn't alter the API given here.
-mental
participants (1)
-
MenTaLguY