COIN-OR::LEMON - Graph Library

Changeset 1991:d7442141d9ef in lemon-0.x for lemon/bits


Ignore:
Timestamp:
03/01/06 11:25:30 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2593
Message:

The graph adadptors can be alteration observed.
In most cases it uses the adapted graph alteration notifiers.
Only special case is now the UndirGraphAdaptor?, where
we have to proxy the signals from the graph.

The SubBidirGraphAdaptor? is removed, because it doest not
gives more feature than the EdgeSubGraphAdaptor?<UndirGraphAdaptor?<Graph>>.

The ResGraphAdaptor? is based on this composition.

Location:
lemon/bits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/edge_set_extender.h

    r1979 r1991  
    6969  public:
    7070
     71    using Parent::getNotifier;
     72
    7173    /// \brief Gives back the edge alteration notifier.
    7274    ///
     
    323325
    324326  public:
     327
     328    using Parent::getNotifier;
    325329   
    326330    EdgeNotifier& getNotifier(Edge) const {
  • lemon/bits/graph_extender.h

    r1983 r1991  
    15691569
    15701570    template <typename _Value>
    1571     class NodeMapBase : public NodeNotifier::ObserverBase {
     1571    class NodeMapBase {
    15721572    public:
    15731573      typedef BpUGraphExtender Graph;
     
    15911591
    15921592      NodeMapBase(const Graph& _g)
    1593         : graph(&_g), bNodeMap(_g), aNodeMap(_g) {
    1594         NodeNotifier::ObserverBase::attach(_g.getNotifier(Node()));
    1595       }
     1593        : aNodeMap(_g), bNodeMap(_g) {}
    15961594      NodeMapBase(const Graph& _g, const _Value& _v)
    1597         : graph(&_g), bNodeMap(_g, _v),
    1598           aNodeMap(_g, _v) {
    1599         NodeNotifier::ObserverBase::attach(_g.getNotifier(Node()));
    1600       }
    1601 
    1602       virtual ~NodeMapBase() {     
    1603         if (NodeNotifier::ObserverBase::attached()) {
    1604           NodeNotifier::ObserverBase::detach();
    1605         }
    1606       }
    1607    
     1595        : aNodeMap(_g, _v), bNodeMap(_g, _v) {}
     1596
    16081597      ConstReference operator[](const Key& node) const {
    16091598        if (Parent::aNode(node)) {
     
    16301619      }
    16311620
    1632     protected:
    1633      
    1634       virtual void add(const Node&) {}
    1635       virtual void add(const std::vector<Node>&) {}
    1636       virtual void erase(const Node&) {}
    1637       virtual void erase(const std::vector<Node>&) {}
    1638       virtual void clear() {}
    1639       virtual void build() {}
    1640 
    1641       const Graph* getGraph() const { return graph; }
    1642      
     1621      const Graph* getGraph() const {
     1622        return aNodeMap.getGraph();
     1623      }
     1624
    16431625    private:
    1644       const Graph* graph;
     1626      ANodeMap<_Value> aNodeMap;
    16451627      BNodeMap<_Value> bNodeMap;
    1646       ANodeMap<_Value> aNodeMap;
    16471628    };
    16481629   
Note: See TracChangeset for help on using the changeset viewer.