Name

GroveWatcherBase — Base class for dynamic tracking of the changes in the grove.

Synopsis

class GroveWatcherBase {
public:
  

  enum NotificationMask { NOTIFY_GENERIC =  001, NOTIFY_NODE_DESTROYED =  002, 
                          NOTIFY_CHILD_INSERTED =  004, NOTIFY_CHILD_REMOVED =  010, 
                          NOTIFY_ATTRIBUTE_CHANGED =  0100, NOTIFY_ATTRIBUTE_ADDED =  0200, 
                          NOTIFY_ATTRIBUTE_REMOVED =  0400, NOTIFY_TEXT_CHANGED =  01000, 
                          NOTIFY_NS_MAPPING_CHANGED =  02000, NOTIFY_ALL =  0xFFFF };
  // construct/copy/destruct
  ~GroveWatcherBase();

  // public member functions

  void nodeDestroyed(const GroveNode &) ;
  void childInserted(const GroveNode &) ;
  void childRemoved(const GroveNode &, const GroveNode &) ;
  void attributeChanged(const GroveAttr &) ;
  void attributeRemoved(const GroveElement &, const GroveAttr &) ;
  void attributeAdded(const GroveAttr &) ;
  void textChanged(const GroveText &) ;
  void genericNotify(const GroveNode &, void *) ;
  void nsMappingChanged(const GroveNodeWithNamespace &, const SString &) ;
};

Description

GroveWatcherBase construct/copy/destruct

  1. ~GroveWatcherBase();


GroveWatcherBase public member functions

  1. void nodeDestroyed(const GroveNode & ) ;

    Happens when node was destroyed. Actually this notification is called from node destructor, so be careful not to use node pointer for anything except synchronizing state (the pointer is OK, but node parent pointer is already zeroized etc.)


  2. void childInserted(const GroveNode & ) ;

    Happens when this node is inserted into node->parent().


  3. void childRemoved(const GroveNode & , const GroveNode & ) ;

    Happens when child os removed from node children list. Note that child pointer is still valid, but parent pointer is already zeroized.


  4. void attributeChanged(const GroveAttr & ) ;

    Attr-only event: called when value of attribute node is changed. node always has an Element as a parent.


  5. void attributeRemoved(const GroveElement & , const GroveAttr & ) ;

    Attr-only event: called immediately BEFORE attribute node is removed from it's parent element attribute list.


  6. void attributeAdded(const GroveAttr & ) ;

    Attr-only: called when attribute node is added to the parent element.


  7. void textChanged(const GroveText & ) ;

    Happens when text node is changed.


  8. void genericNotify(const GroveNode & , void * ) ;

    Generic notification.


  9. void nsMappingChanged(const GroveNodeWithNamespace & , const SString & ) ;

    Happens when namespace maping is changed.