lemon/bits/alteration_notifier.h
changeset 361 f58410582b9b
parent 314 2cc60866a0c9
child 440 88ed40ad0d4f
     1.1 --- a/lemon/bits/alteration_notifier.h	Tue Nov 04 21:36:46 2008 +0100
     1.2 +++ b/lemon/bits/alteration_notifier.h	Tue Nov 04 21:37:59 2008 +0100
     1.3 @@ -35,61 +35,62 @@
     1.4    // \brief Notifier class to notify observes about alterations in
     1.5    // a container.
     1.6    //
     1.7 -  // The simple graph's can be refered as two containers, one node container
     1.8 -  // and one edge container. But they are not standard containers they
     1.9 -  // does not store values directly they are just key continars for more
    1.10 -  // value containers which are the node and edge maps.
    1.11 +  // The simple graphs can be refered as two containers: a node container
    1.12 +  // and an edge container. But they do not store values directly, they
    1.13 +  // are just key continars for more value containers, which are the
    1.14 +  // node and edge maps.
    1.15    //
    1.16 -  // The graph's node and edge sets can be changed as we add or erase
    1.17 +  // The node and edge sets of the graphs can be changed as we add or erase
    1.18    // nodes and edges in the graph. LEMON would like to handle easily
    1.19    // that the node and edge maps should contain values for all nodes or
    1.20    // edges. If we want to check on every indicing if the map contains
    1.21    // the current indicing key that cause a drawback in the performance
    1.22 -  // in the library. We use another solution we notify all maps about
    1.23 +  // in the library. We use another solution: we notify all maps about
    1.24    // an alteration in the graph, which cause only drawback on the
    1.25    // alteration of the graph.
    1.26    //
    1.27 -  // This class provides an interface to the container. The \e first() and \e
    1.28 -  // next() member functions make possible to iterate on the keys of the
    1.29 -  // container. The \e id() function returns an integer id for each key.
    1.30 -  // The \e maxId() function gives back an upper bound of the ids.
    1.31 +  // This class provides an interface to a node or edge container.
    1.32 +  // The first() and next() member functions make possible
    1.33 +  // to iterate on the keys of the container.
    1.34 +  // The id() function returns an integer id for each key.
    1.35 +  // The maxId() function gives back an upper bound of the ids.
    1.36    //
    1.37    // For the proper functonality of this class, we should notify it
    1.38 -  // about each alteration in the container. The alterations have four type
    1.39 -  // as \e add(), \e erase(), \e build() and \e clear(). The \e add() and
    1.40 -  // \e erase() signals that only one or few items added or erased to or
    1.41 -  // from the graph. If all items are erased from the graph or from an empty
    1.42 -  // graph a new graph is builded then it can be signaled with the
    1.43 +  // about each alteration in the container. The alterations have four type:
    1.44 +  // add(), erase(), build() and clear(). The add() and
    1.45 +  // erase() signal that only one or few items added or erased to or
    1.46 +  // from the graph. If all items are erased from the graph or if a new graph
    1.47 +  // is built from an empty graph, then it can be signaled with the
    1.48    // clear() and build() members. Important rule that if we erase items
    1.49 -  // from graph we should first signal the alteration and after that erase
    1.50 +  // from graphs we should first signal the alteration and after that erase
    1.51    // them from the container, on the other way on item addition we should
    1.52    // first extend the container and just after that signal the alteration.
    1.53    //
    1.54    // The alteration can be observed with a class inherited from the
    1.55 -  // \e ObserverBase nested class. The signals can be handled with
    1.56 +  // ObserverBase nested class. The signals can be handled with
    1.57    // overriding the virtual functions defined in the base class.  The
    1.58    // observer base can be attached to the notifier with the
    1.59 -  // \e attach() member and can be detached with detach() function. The
    1.60 +  // attach() member and can be detached with detach() function. The
    1.61    // alteration handlers should not call any function which signals
    1.62    // an other alteration in the same notifier and should not
    1.63    // detach any observer from the notifier.
    1.64    //
    1.65 -  // Alteration observers try to be exception safe. If an \e add() or
    1.66 -  // a \e clear() function throws an exception then the remaining
    1.67 +  // Alteration observers try to be exception safe. If an add() or
    1.68 +  // a clear() function throws an exception then the remaining
    1.69    // observeres will not be notified and the fulfilled additions will
    1.70 -  // be rolled back by calling the \e erase() or \e clear()
    1.71 -  // functions. Thence the \e erase() and \e clear() should not throw
    1.72 -  // exception. Actullay, it can be throw only \ref ImmediateDetach
    1.73 -  // exception which detach the observer from the notifier.
    1.74 +  // be rolled back by calling the erase() or clear() functions.
    1.75 +  // Hence erase() and clear() should not throw exception.
    1.76 +  // Actullay, they can throw only \ref ImmediateDetach exception,
    1.77 +  // which detach the observer from the notifier.
    1.78    //
    1.79 -  // There are some place when the alteration observing is not completly
    1.80 +  // There are some cases, when the alteration observing is not completly
    1.81    // reliable. If we want to carry out the node degree in the graph
    1.82 -  // as in the \ref InDegMap and we use the reverseEdge that cause
    1.83 +  // as in the \ref InDegMap and we use the reverseArc(), then it cause
    1.84    // unreliable functionality. Because the alteration observing signals
    1.85 -  // only erasing and adding but not the reversing it will stores bad
    1.86 -  // degrees. The sub graph adaptors cannot signal the alterations because
    1.87 -  // just a setting in the filter map can modify the graph and this cannot
    1.88 -  // be watched in any way.
    1.89 +  // only erasing and adding but not the reversing, it will stores bad
    1.90 +  // degrees. Apart form that the subgraph adaptors cannot even signal
    1.91 +  // the alterations because just a setting in the filter map can modify
    1.92 +  // the graph and this cannot be watched in any way.
    1.93    //
    1.94    // \param _Container The container which is observed.
    1.95    // \param _Item The item type which is obserbved.
    1.96 @@ -103,13 +104,13 @@
    1.97      typedef _Container Container;
    1.98      typedef _Item Item;
    1.99  
   1.100 -    // \brief Exception which can be called from \e clear() and
   1.101 -    // \e erase().
   1.102 +    // \brief Exception which can be called from clear() and
   1.103 +    // erase().
   1.104      //
   1.105 -    // From the \e clear() and \e erase() function only this
   1.106 +    // From the clear() and erase() function only this
   1.107      // exception is allowed to throw. The exception immediatly
   1.108      // detaches the current observer from the notifier. Because the
   1.109 -    // \e clear() and \e erase() should not throw other exceptions
   1.110 +    // clear() and erase() should not throw other exceptions
   1.111      // it can be used to invalidate the observer.
   1.112      struct ImmediateDetach {};
   1.113  
   1.114 @@ -121,8 +122,7 @@
   1.115      //
   1.116      // The observer interface contains some pure virtual functions
   1.117      // to override. The add() and erase() functions are
   1.118 -    // to notify the oberver when one item is added or
   1.119 -    // erased.
   1.120 +    // to notify the oberver when one item is added or erased.
   1.121      //
   1.122      // The build() and clear() members are to notify the observer
   1.123      // about the container is built from an empty container or