From 3547b1082098934d583f2c483c8eb5a59e9c2bbb Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Sep 2008 23:34:58 +0000 Subject: * Lots of documentation for the Inkscape::XML namespace * Doxygen fixes for a few files * Garbage-collected allocator for STL containers (bzr r6877) --- src/xml/composite-node-observer.h | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'src/xml/composite-node-observer.h') diff --git a/src/xml/composite-node-observer.h b/src/xml/composite-node-observer.h index 7b5a24d53..826467dc4 100644 --- a/src/xml/composite-node-observer.h +++ b/src/xml/composite-node-observer.h @@ -1,7 +1,7 @@ -/* +/** @file * Inkscape::XML::CompositeNodeObserver - combine multiple observers - * - * Copyright 2005 MenTaLguY + */ +/* Copyright 2005 MenTaLguY * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,6 +25,14 @@ namespace XML { class NodeEventVector; +/** + * @brief An observer that relays notifications to multiple other observers + * + * This special observer keeps a list of other observer objects and sends + * the notifications it receives to all of them. The implementation of the class + * allows an observer to remove itself from this object during a method call. + * For the documentation of callback methods, see NodeObserver. + */ class CompositeNodeObserver : public NodeObserver, public GC::Managed<> { public: struct ObserverRecord : public GC::Managed<> { @@ -38,9 +46,25 @@ public: CompositeNodeObserver() : _iterating(0), _active_marked(0), _pending_marked(0) {} + /** + * @brief Add an observer to the list + * @param observer The observer object to add + */ void add(NodeObserver &observer); - void addListener(NodeEventVector const &vector, void *data); + /** + * @brief Remove an observer from the list + * @param observer The observer object to remove + */ void remove(NodeObserver &observer); + /** + * @brief Add a set of callbacks with associated data + * @deprecated Use add() instead + */ + void addListener(NodeEventVector const &vector, void *data); + /** + * @brief Remove a set of callbacks by its associated data + * @deprecated Use remove() instead + */ void removeListenerByData(void *data); void notifyChildAdded(Node &node, Node &child, Node *prev); @@ -69,9 +93,8 @@ private: void _finishIteration(); }; -} - -} +} // namespace XML +} // namespace Inkscape #endif /* -- cgit v1.2.3