COIN-OR::LEMON - Graph Library

Changeset 2384:805c5a2a36dd in lemon-0.x for lemon/bits


Ignore:
Timestamp:
03/01/07 18:14:24 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3215
Message:

getNotifier to notifier renaming

Location:
lemon/bits
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/alteration_notifier.h

    r2305 r2384  
    144144      /// Default constructor for ObserverBase.
    145145      ///
    146       ObserverBase() : notifier(0) {}
     146      ObserverBase() : _notifier(0) {}
    147147
    148148      /// \brief Constructor which attach the observer into notifier.
    149149      ///
    150150      /// Constructor which attach the observer into notifier.
    151       ObserverBase(AlterationNotifier& _notifier) {
    152         attach(_notifier);
     151      ObserverBase(AlterationNotifier& notifier) {
     152        attach(notifier);
    153153      }
    154154
     
    159159      ObserverBase(const ObserverBase& copy) {
    160160        if (copy.attached()) {
    161           attach(*copy.getNotifier());
     161          attach(*copy._notifier());
    162162        }
    163163      }
     
    174174      /// This member attaches the observer into an AlterationNotifier.
    175175      ///
    176       void attach(AlterationNotifier& _notifier) {
    177         _notifier.attach(*this);
     176      void attach(AlterationNotifier& notifier) {
     177        notifier.attach(*this);
    178178      }
    179179     
     
    183183      ///
    184184      void detach() {
    185         notifier->detach(*this);
     185        _notifier->detach(*this);
    186186      }
    187187     
     
    192192      /// attached into.
    193193      ///
    194       Notifier* getNotifier() const { return const_cast<Notifier*>(notifier); }
     194      Notifier* notifier() const { return const_cast<Notifier*>(_notifier); }
    195195     
    196196      /// Gives back true when the observer is attached into a notifier.
    197       bool attached() const { return notifier != 0; }
     197      bool attached() const { return _notifier != 0; }
    198198
    199199    private:
     
    203203    protected:
    204204     
    205       Notifier* notifier;
    206       typename std::list<ObserverBase*>::iterator index;
     205      Notifier* _notifier;
     206      typename std::list<ObserverBase*>::iterator _index;
    207207
    208208      /// \brief The member function to notificate the observer about an
     
    262262
    263263    typedef std::list<ObserverBase*> Observers;
    264     Observers observers;
     264    Observers _observers;
    265265
    266266               
     
    294294    ~AlterationNotifier() {
    295295      typename Observers::iterator it;
    296       for (it = observers.begin(); it != observers.end(); ++it) {
    297         (*it)->notifier = 0;
     296      for (it = _observers.begin(); it != _observers.end(); ++it) {
     297        (*it)->_notifier = 0;
    298298      }
    299299    }
     
    347347
    348348    void attach(ObserverBase& observer) {
    349       observer.index = observers.insert(observers.begin(), &observer);
    350       observer.notifier = this;
     349      observer._index = _observers.insert(_observers.begin(), &observer);
     350      observer._notifier = this;
    351351    }
    352352
    353353    void detach(ObserverBase& observer) {
    354       observers.erase(observer.index);
    355       observer.index = observers.end();
    356       observer.notifier = 0;
     354      _observers.erase(observer._index);
     355      observer._index = _observers.end();
     356      observer._notifier = 0;
    357357    }
    358358
     
    368368      typename Observers::reverse_iterator it;
    369369      try {
    370         for (it = observers.rbegin(); it != observers.rend(); ++it) {
     370        for (it = _observers.rbegin(); it != _observers.rend(); ++it) {
    371371          (*it)->add(item);
    372372        }
    373373      } catch (...) {
    374374        typename Observers::iterator jt;
    375         for (jt = it.base(); jt != observers.end(); ++jt) {
     375        for (jt = it.base(); jt != _observers.end(); ++jt) {
    376376          (*jt)->erase(item);
    377377        }
     
    389389      typename Observers::reverse_iterator it;
    390390      try {
    391         for (it = observers.rbegin(); it != observers.rend(); ++it) {
     391        for (it = _observers.rbegin(); it != _observers.rend(); ++it) {
    392392          (*it)->add(items);
    393393        }
    394394      } catch (...) {
    395395        typename Observers::iterator jt;
    396         for (jt = it.base(); jt != observers.end(); ++jt) {
     396        for (jt = it.base(); jt != _observers.end(); ++jt) {
    397397          (*jt)->erase(items);
    398398        }
     
    408408    ///
    409409    void erase(const Item& item) throw() {
    410       typename Observers::iterator it = observers.begin();
    411       while (it != observers.end()) {
     410      typename Observers::iterator it = _observers.begin();
     411      while (it != _observers.end()) {
    412412        try {
    413413          (*it)->erase(item);
    414414          ++it;
    415415        } catch (const ImmediateDetach&) {
    416           it = observers.erase(it);
    417           (*it)->index = observers.end();
    418           (*it)->notifier = 0;
     416          it = _observers.erase(it);
     417          (*it)->_index = _observers.end();
     418          (*it)->_notifier = 0;
    419419        }
    420420      }
     
    428428    ///
    429429    void erase(const std::vector<Item>& items) {
    430       typename Observers::iterator it = observers.begin();
    431       while (it != observers.end()) {
     430      typename Observers::iterator it = _observers.begin();
     431      while (it != _observers.end()) {
    432432        try {
    433433          (*it)->erase(items);
    434434          ++it;
    435435        } catch (const ImmediateDetach&) {
    436           it = observers.erase(it);
    437           (*it)->index = observers.end();
    438           (*it)->notifier = 0;
     436          it = _observers.erase(it);
     437          (*it)->_index = _observers.end();
     438          (*it)->_notifier = 0;
    439439        }
    440440      }
     
    449449      typename Observers::reverse_iterator it;
    450450      try {
    451         for (it = observers.rbegin(); it != observers.rend(); ++it) {
     451        for (it = _observers.rbegin(); it != _observers.rend(); ++it) {
    452452          (*it)->build();
    453453        }
    454454      } catch (...) {
    455455        typename Observers::iterator jt;
    456         for (jt = it.base(); jt != observers.end(); ++jt) {
     456        for (jt = it.base(); jt != _observers.end(); ++jt) {
    457457          (*jt)->clear();
    458458        }
     
    467467    /// from the container.
    468468    void clear() {
    469       typename Observers::iterator it = observers.begin();
    470       while (it != observers.end()) {
     469      typename Observers::iterator it = _observers.begin();
     470      while (it != _observers.end()) {
    471471        try {
    472472          (*it)->clear();
    473473          ++it;
    474474        } catch (const ImmediateDetach&) {
    475           it = observers.erase(it);
    476           (*it)->index = observers.end();
    477           (*it)->notifier = 0;
     475          it = _observers.erase(it);
     476          (*it)->_index = _observers.end();
     477          (*it)->_notifier = 0;
    478478        }
    479479      }
  • lemon/bits/array_map.h

    r2260 r2384  
    8080    /// Graph initialized map constructor.
    8181    explicit ArrayMap(const Graph& graph) {
    82       Parent::attach(graph.getNotifier(Item()));
     82      Parent::attach(graph.notifier(Item()));
    8383      allocate_memory();
    84       Notifier* notifier = Parent::getNotifier();
     84      Notifier* notifier = Parent::notifier();
    8585      Item it;
    8686      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    9494    /// It constructs a map and initialize all of the the map.
    9595    ArrayMap(const Graph& graph, const Value& value) {
    96       Parent::attach(graph.getNotifier(Item()));
     96      Parent::attach(graph.notifier(Item()));
    9797      allocate_memory();
    98       Notifier* notifier = Parent::getNotifier();
     98      Notifier* notifier = Parent::notifier();
    9999      Item it;
    100100      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    109109    ArrayMap(const ArrayMap& copy) : Parent() {
    110110      if (copy.attached()) {
    111         attach(*copy.getNotifier());
     111        attach(*copy.notifier());
    112112      }
    113113      capacity = copy.capacity;
    114114      if (capacity == 0) return;
    115115      values = allocator.allocate(capacity);
    116       Notifier* notifier = Parent::getNotifier();
     116      Notifier* notifier = Parent::notifier();
    117117      Item it;
    118118      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    143143    ArrayMap& operator=(const CMap& cmap) {
    144144      checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    145       const typename Parent::Notifier* notifier = Parent::getNotifier();
     145      const typename Parent::Notifier* notifier = Parent::notifier();
    146146      Item it;
    147147      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    174174    /// actual keys of the graph.
    175175    Value& operator[](const Key& key) {
    176       int id = Parent::getNotifier()->id(key);
     176      int id = Parent::notifier()->id(key);
    177177      return values[id];
    178178    }
     
    183183    /// actual keys of the graph.
    184184    const Value& operator[](const Key& key) const {
    185       int id = Parent::getNotifier()->id(key);
     185      int id = Parent::notifier()->id(key);
    186186      return values[id];
    187187    }
     
    202202    /// and it overrides the add() member function of the observer base.     
    203203    virtual void add(const Key& key) {
    204       Notifier* notifier = Parent::getNotifier();
     204      Notifier* notifier = Parent::notifier();
    205205      int id = notifier->id(key);
    206206      if (id >= capacity) {
     
    230230    /// and it overrides the add() member function of the observer base.     
    231231    virtual void add(const std::vector<Key>& keys) {
    232       Notifier* notifier = Parent::getNotifier();
     232      Notifier* notifier = Parent::notifier();
    233233      int max_id = -1;
    234234      for (int i = 0; i < (int)keys.size(); ++i) {
     
    274274    /// and it overrides the erase() member function of the observer base.     
    275275    virtual void erase(const Key& key) {
    276       int id = Parent::getNotifier()->id(key);
     276      int id = Parent::notifier()->id(key);
    277277      allocator.destroy(&(values[id]));
    278278    }
     
    284284    virtual void erase(const std::vector<Key>& keys) {
    285285      for (int i = 0; i < (int)keys.size(); ++i) {
    286         int id = Parent::getNotifier()->id(keys[i]);
     286        int id = Parent::notifier()->id(keys[i]);
    287287        allocator.destroy(&(values[id]));
    288288      }
     
    294294    /// and it overrides the build() member function of the observer base.
    295295    virtual void build() {
    296       Notifier* notifier = Parent::getNotifier();
     296      Notifier* notifier = Parent::notifier();
    297297      allocate_memory();
    298298      Item it;
     
    308308    /// and it overrides the clear() member function of the observer base.     
    309309    virtual void clear() {     
    310       Notifier* notifier = Parent::getNotifier();
     310      Notifier* notifier = Parent::notifier();
    311311      if (capacity != 0) {
    312312        Item it;
     
    323323     
    324324    void allocate_memory() {
    325       int max_id = Parent::getNotifier()->maxId();
     325      int max_id = Parent::notifier()->maxId();
    326326      if (max_id == -1) {
    327327        capacity = 0;
  • lemon/bits/debug_map.h

    r2333 r2384  
    112112    /// It adds all the items of the graph to the map.
    113113    DebugMap(const Graph& graph) {
    114       Parent::attach(graph.getNotifier(Item()));
    115       container.resize(Parent::getNotifier()->maxId() + 1);
    116       flag.resize(Parent::getNotifier()->maxId() + 1, false);
    117       const typename Parent::Notifier* notifier = Parent::getNotifier();
    118       Item it;
    119       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    120         flag[Parent::getNotifier()->id(it)] = true;
     114      Parent::attach(graph.notifier(Item()));
     115      container.resize(Parent::notifier()->maxId() + 1);
     116      flag.resize(Parent::notifier()->maxId() + 1, false);
     117      const typename Parent::Notifier* notifier = Parent::notifier();
     118      Item it;
     119      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     120        flag[Parent::notifier()->id(it)] = true;
    121121      }
    122122    }
     
    127127    /// It adds all the items of the graph to the map.
    128128    DebugMap(const Graph& graph, const Value& value) {
    129       Parent::attach(graph.getNotifier(Item()));
    130       container.resize(Parent::getNotifier()->maxId() + 1, value);
    131       flag.resize(Parent::getNotifier()->maxId() + 1, false);
    132       const typename Parent::Notifier* notifier = Parent::getNotifier();
    133       Item it;
    134       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    135         flag[Parent::getNotifier()->id(it)] = true;
     129      Parent::attach(graph.notifier(Item()));
     130      container.resize(Parent::notifier()->maxId() + 1, value);
     131      flag.resize(Parent::notifier()->maxId() + 1, false);
     132      const typename Parent::Notifier* notifier = Parent::notifier();
     133      Item it;
     134      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     135        flag[Parent::notifier()->id(it)] = true;
    136136      }
    137137    }
     
    142142    DebugMap(const DebugMap& _copy) : Parent() {
    143143      if (_copy.attached()) {
    144         Parent::attach(*_copy.getNotifier());
     144        Parent::attach(*_copy.notifier());
    145145        container = _copy.container;
    146146      }
    147       flag.resize(Parent::getNotifier()->maxId() + 1, false);
    148       const typename Parent::Notifier* notifier = Parent::getNotifier();
    149       Item it;
    150       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    151         flag[Parent::getNotifier()->id(it)] = true;
    152         LEMON_ASSERT(_copy.flag[Parent::getNotifier()->id(it)], MapError());
     147      flag.resize(Parent::notifier()->maxId() + 1, false);
     148      const typename Parent::Notifier* notifier = Parent::notifier();
     149      Item it;
     150      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     151        flag[Parent::notifier()->id(it)] = true;
     152        LEMON_ASSERT(_copy.flag[Parent::notifier()->id(it)], MapError());
    153153      }
    154154    }
     
    158158    /// Destructor.
    159159    ~DebugMap() {
    160       const typename Parent::Notifier* notifier = Parent::getNotifier();
     160      const typename Parent::Notifier* notifier = Parent::notifier();
    161161      if (notifier != 0) {
    162162        Item it;
    163163        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    164           LEMON_ASSERT(flag[Parent::getNotifier()->id(it)], MapError());
    165           flag[Parent::getNotifier()->id(it)] = false;
     164          LEMON_ASSERT(flag[Parent::notifier()->id(it)], MapError());
     165          flag[Parent::notifier()->id(it)] = false;
    166166        }
    167167      }
     
    192192    DebugMap& operator=(const CMap& cmap) {
    193193      checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    194       const typename Parent::Notifier* notifier = Parent::getNotifier();
     194      const typename Parent::Notifier* notifier = Parent::notifier();
    195195      Item it;
    196196      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    207207    /// actual items of the graph.     
    208208    Reference operator[](const Key& key) {
    209       LEMON_ASSERT(flag[Parent::getNotifier()->id(key)], MapError());
    210       return container[Parent::getNotifier()->id(key)];
     209      LEMON_ASSERT(flag[Parent::notifier()->id(key)], MapError());
     210      return container[Parent::notifier()->id(key)];
    211211    }
    212212               
     
    216216    /// actual items of the graph.
    217217    ConstReference operator[](const Key& key) const {
    218       LEMON_ASSERT(flag[Parent::getNotifier()->id(key)], MapError());
    219       return container[Parent::getNotifier()->id(key)];
     218      LEMON_ASSERT(flag[Parent::notifier()->id(key)], MapError());
     219      return container[Parent::notifier()->id(key)];
    220220    }
    221221
     
    235235    /// and it overrides the add() member function of the observer base.     
    236236    virtual void add(const Key& key) {
    237       int id = Parent::getNotifier()->id(key);
     237      int id = Parent::notifier()->id(key);
    238238      if (id >= (int)container.size()) {
    239239        container.resize(id + 1);
    240240        flag.resize(id + 1, false);
    241241      }
    242       LEMON_ASSERT(!flag[Parent::getNotifier()->id(key)], MapError());
    243       flag[Parent::getNotifier()->id(key)] = true;
     242      LEMON_ASSERT(!flag[Parent::notifier()->id(key)], MapError());
     243      flag[Parent::notifier()->id(key)] = true;
    244244      if (strictCheck) {
    245245        std::vector<bool> fl(flag.size(), false);
    246         const typename Parent::Notifier* notifier = Parent::getNotifier();
    247         Item it;
    248         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    249           int id = Parent::getNotifier()->id(it);
     246        const typename Parent::Notifier* notifier = Parent::notifier();
     247        Item it;
     248        for (notifier->first(it); it != INVALID; notifier->next(it)) {
     249          int id = Parent::notifier()->id(it);
    250250          fl[id] = true;
    251251        }
     
    261261      int max = container.size() - 1;
    262262      for (int i = 0; i < (int)keys.size(); ++i) {
    263         int id = Parent::getNotifier()->id(keys[i]);
     263        int id = Parent::notifier()->id(keys[i]);
    264264        if (id >= max) {
    265265          max = id;
     
    269269      flag.resize(max + 1, false);
    270270      for (int i = 0; i < (int)keys.size(); ++i) {
    271         LEMON_ASSERT(!flag[Parent::getNotifier()->id(keys[i])], MapError());
    272         flag[Parent::getNotifier()->id(keys[i])] = true;
     271        LEMON_ASSERT(!flag[Parent::notifier()->id(keys[i])], MapError());
     272        flag[Parent::notifier()->id(keys[i])] = true;
    273273      }
    274274      if (strictCheck) {
    275275        std::vector<bool> fl(flag.size(), false);
    276         const typename Parent::Notifier* notifier = Parent::getNotifier();
    277         Item it;
    278         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    279           int id = Parent::getNotifier()->id(it);
     276        const typename Parent::Notifier* notifier = Parent::notifier();
     277        Item it;
     278        for (notifier->first(it); it != INVALID; notifier->next(it)) {
     279          int id = Parent::notifier()->id(it);
    280280          fl[id] = true;
    281281        }
     
    291291      if (strictCheck) {
    292292        std::vector<bool> fl(flag.size(), false);
    293         const typename Parent::Notifier* notifier = Parent::getNotifier();
    294         Item it;
    295         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    296           int id = Parent::getNotifier()->id(it);
     293        const typename Parent::Notifier* notifier = Parent::notifier();
     294        Item it;
     295        for (notifier->first(it); it != INVALID; notifier->next(it)) {
     296          int id = Parent::notifier()->id(it);
    297297          fl[id] = true;
    298298        }
    299299        LEMON_ASSERT(fl == flag, MapError());
    300300      }
    301       container[Parent::getNotifier()->id(key)] = Value();
    302       LEMON_ASSERT(flag[Parent::getNotifier()->id(key)], MapError());
    303       flag[Parent::getNotifier()->id(key)] = false;
     301      container[Parent::notifier()->id(key)] = Value();
     302      LEMON_ASSERT(flag[Parent::notifier()->id(key)], MapError());
     303      flag[Parent::notifier()->id(key)] = false;
    304304    }
    305305
     
    311311      if (strictCheck) {
    312312        std::vector<bool> fl(flag.size(), false);
    313         const typename Parent::Notifier* notifier = Parent::getNotifier();
    314         Item it;
    315         for (notifier->first(it); it != INVALID; notifier->next(it)) {
    316           int id = Parent::getNotifier()->id(it);
     313        const typename Parent::Notifier* notifier = Parent::notifier();
     314        Item it;
     315        for (notifier->first(it); it != INVALID; notifier->next(it)) {
     316          int id = Parent::notifier()->id(it);
    317317          fl[id] = true;
    318318        }
     
    320320      }
    321321      for (int i = 0; i < (int)keys.size(); ++i) {
    322         container[Parent::getNotifier()->id(keys[i])] = Value();
    323         LEMON_ASSERT(flag[Parent::getNotifier()->id(keys[i])], MapError());
    324         flag[Parent::getNotifier()->id(keys[i])] = false;
     322        container[Parent::notifier()->id(keys[i])] = Value();
     323        LEMON_ASSERT(flag[Parent::notifier()->id(keys[i])], MapError());
     324        flag[Parent::notifier()->id(keys[i])] = false;
    325325      }
    326326    }
     
    336336        }
    337337      }
    338       int size = Parent::getNotifier()->maxId() + 1;
     338      int size = Parent::notifier()->maxId() + 1;
    339339      container.reserve(size);
    340340      container.resize(size);
    341341      flag.reserve(size);
    342342      flag.resize(size, false);
    343       const typename Parent::Notifier* notifier = Parent::getNotifier();
    344       Item it;
    345       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    346         int id = Parent::getNotifier()->id(it);
     343      const typename Parent::Notifier* notifier = Parent::notifier();
     344      Item it;
     345      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     346        int id = Parent::notifier()->id(it);
    347347        LEMON_ASSERT(!flag[id], MapError());
    348348        flag[id] = true;
     
    355355    /// and it overrides the clear() member function of the observer base.     
    356356    virtual void clear() {
    357       const typename Parent::Notifier* notifier = Parent::getNotifier();
    358       Item it;
    359       for (notifier->first(it); it != INVALID; notifier->next(it)) {
    360         int id = Parent::getNotifier()->id(it);
     357      const typename Parent::Notifier* notifier = Parent::notifier();
     358      Item it;
     359      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     360        int id = Parent::notifier()->id(it);
    361361        LEMON_ASSERT(flag[id], MapError());
    362362        flag[id] = false;
  • lemon/bits/edge_set_extender.h

    r2046 r2384  
    8282  public:
    8383
    84     using Parent::getNotifier;
     84    using Parent::notifier;
    8585
    8686    /// \brief Gives back the edge alteration notifier.
    8787    ///
    8888    /// Gives back the edge alteration notifier.
    89     EdgeNotifier& getNotifier(Edge) const {
     89    EdgeNotifier& notifier(Edge) const {
    9090      return edge_notifier;
    9191    }
     
    247247    Edge addEdge(const Node& from, const Node& to) {
    248248      Edge edge = Parent::addEdge(from, to);
    249       getNotifier(Edge()).add(edge);
     249      notifier(Edge()).add(edge);
    250250      return edge;
    251251    }
    252252   
    253253    void clear() {
    254       getNotifier(Edge()).clear();
     254      notifier(Edge()).clear();
    255255      Parent::clear();
    256256    }
    257257
    258258    void erase(const Edge& edge) {
    259       getNotifier(Edge()).erase(edge);
     259      notifier(Edge()).erase(edge);
    260260      Parent::erase(edge);
    261261    }
     
    341341  public:
    342342
    343     using Parent::getNotifier;
     343    using Parent::notifier;
    344344   
    345     EdgeNotifier& getNotifier(Edge) const {
     345    EdgeNotifier& notifier(Edge) const {
    346346      return edge_notifier;
    347347    }
    348348
    349     UEdgeNotifier& getNotifier(UEdge) const {
     349    UEdgeNotifier& notifier(UEdge) const {
    350350      return uedge_notifier;
    351351    }
     
    590590    UEdge addEdge(const Node& from, const Node& to) {
    591591      UEdge uedge = Parent::addEdge(from, to);
    592       getNotifier(UEdge()).add(uedge);
    593       getNotifier(Edge()).add(Parent::direct(uedge, true));
    594       getNotifier(Edge()).add(Parent::direct(uedge, false));
     592      notifier(UEdge()).add(uedge);
     593      notifier(Edge()).add(Parent::direct(uedge, true));
     594      notifier(Edge()).add(Parent::direct(uedge, false));
    595595      return uedge;
    596596    }
    597597   
    598598    void clear() {
    599       getNotifier(Edge()).clear();
    600       getNotifier(UEdge()).clear();
     599      notifier(Edge()).clear();
     600      notifier(UEdge()).clear();
    601601      Parent::clear();
    602602    }
    603603
    604604    void erase(const UEdge& uedge) {
    605       getNotifier(Edge()).erase(Parent::direct(uedge, true));
    606       getNotifier(Edge()).erase(Parent::direct(uedge, false));
    607       getNotifier(UEdge()).erase(uedge);
     605      notifier(Edge()).erase(Parent::direct(uedge, true));
     606      notifier(Edge()).erase(Parent::direct(uedge, false));
     607      notifier(UEdge()).erase(uedge);
    608608      Parent::erase(uedge);
    609609    }
  • lemon/bits/graph_extender.h

    r2329 r2384  
    8787  public:
    8888
    89     NodeNotifier& getNotifier(Node) const {
     89    NodeNotifier& notifier(Node) const {
    9090      return node_notifier;
    9191    }
    9292   
    93     EdgeNotifier& getNotifier(Edge) const {
     93    EdgeNotifier& notifier(Edge) const {
    9494      return edge_notifier;
    9595    }
     
    267267    Node addNode() {
    268268      Node node = Parent::addNode();
    269       getNotifier(Node()).add(node);
     269      notifier(Node()).add(node);
    270270      return node;
    271271    }
     
    273273    Edge addEdge(const Node& from, const Node& to) {
    274274      Edge edge = Parent::addEdge(from, to);
    275       getNotifier(Edge()).add(edge);
     275      notifier(Edge()).add(edge);
    276276      return edge;
    277277    }
    278278
    279279    void clear() {
    280       getNotifier(Edge()).clear();
    281       getNotifier(Node()).clear();
     280      notifier(Edge()).clear();
     281      notifier(Node()).clear();
    282282      Parent::clear();
    283283    }
     
    286286    void build(const Graph& graph, NodeRefMap& nodeRef, EdgeRefMap& edgeRef) {
    287287      Parent::build(graph, nodeRef, edgeRef);
    288       getNotifier(Node()).build();
    289       getNotifier(Edge()).build();
     288      notifier(Node()).build();
     289      notifier(Edge()).build();
    290290    }
    291291
     
    304304      }
    305305
    306       getNotifier(Node()).erase(node);
     306      notifier(Node()).erase(node);
    307307      Parent::erase(node);
    308308    }
    309309   
    310310    void erase(const Edge& edge) {
    311       getNotifier(Edge()).erase(edge);
     311      notifier(Edge()).erase(edge);
    312312      Parent::erase(edge);
    313313    }
     
    398398  public:
    399399
    400     NodeNotifier& getNotifier(Node) const {
     400    NodeNotifier& notifier(Node) const {
    401401      return node_notifier;
    402402    }
    403403   
    404     EdgeNotifier& getNotifier(Edge) const {
     404    EdgeNotifier& notifier(Edge) const {
    405405      return edge_notifier;
    406406    }
    407407
    408     UEdgeNotifier& getNotifier(UEdge) const {
     408    UEdgeNotifier& notifier(UEdge) const {
    409409      return uedge_notifier;
    410410    }
     
    673673    Node addNode() {
    674674      Node node = Parent::addNode();
    675       getNotifier(Node()).add(node);
     675      notifier(Node()).add(node);
    676676      return node;
    677677    }
     
    679679    UEdge addEdge(const Node& from, const Node& to) {
    680680      UEdge uedge = Parent::addEdge(from, to);
    681       getNotifier(UEdge()).add(uedge);
     681      notifier(UEdge()).add(uedge);
    682682      std::vector<Edge> edges;
    683683      edges.push_back(Parent::direct(uedge, true));
    684684      edges.push_back(Parent::direct(uedge, false));     
    685       getNotifier(Edge()).add(edges);
     685      notifier(Edge()).add(edges);
    686686      return uedge;
    687687    }
    688688   
    689689    void clear() {
    690       getNotifier(Edge()).clear();
    691       getNotifier(UEdge()).clear();
    692       getNotifier(Node()).clear();
     690      notifier(Edge()).clear();
     691      notifier(UEdge()).clear();
     692      notifier(Node()).clear();
    693693      Parent::clear();
    694694    }
     
    698698               UEdgeRefMap& uEdgeRef) {
    699699      Parent::build(graph, nodeRef, uEdgeRef);
    700       getNotifier(Node()).build();
    701       getNotifier(UEdge()).build();
    702       getNotifier(Edge()).build();
     700      notifier(Node()).build();
     701      notifier(UEdge()).build();
     702      notifier(Edge()).build();
    703703    }
    704704
     
    717717      }
    718718
    719       getNotifier(Node()).erase(node);
     719      notifier(Node()).erase(node);
    720720      Parent::erase(node);
    721721    }
     
    725725      edges.push_back(Parent::direct(uedge, true));
    726726      edges.push_back(Parent::direct(uedge, false));     
    727       getNotifier(Edge()).erase(edges);
    728       getNotifier(UEdge()).erase(uedge);
     727      notifier(Edge()).erase(edges);
     728      notifier(UEdge()).erase(uedge);
    729729      Parent::erase(uedge);
    730730    }
     
    824824  public:
    825825
    826     NodeNotifier& getNotifier(Node) const {
     826    NodeNotifier& notifier(Node) const {
    827827      return node_notifier;
    828828    }
    829829
    830     ANodeNotifier& getNotifier(ANode) const {
     830    ANodeNotifier& notifier(ANode) const {
    831831      return anode_notifier;
    832832    }
    833833
    834     BNodeNotifier& getNotifier(BNode) const {
     834    BNodeNotifier& notifier(BNode) const {
    835835      return bnode_notifier;
    836836    }
    837837
    838     EdgeNotifier& getNotifier(Edge) const {
     838    EdgeNotifier& notifier(Edge) const {
    839839      return edge_notifier;
    840840    }
    841841
    842     UEdgeNotifier& getNotifier(UEdge) const {
     842    UEdgeNotifier& notifier(UEdge) const {
    843843      return uedge_notifier;
    844844    }
     
    12841284    Node addANode() {
    12851285      Node node = Parent::addANode();
    1286       getNotifier(ANode()).add(node);
    1287       getNotifier(Node()).add(node);
     1286      notifier(ANode()).add(node);
     1287      notifier(Node()).add(node);
    12881288      return node;
    12891289    }
     
    12911291    Node addBNode() {
    12921292      Node node = Parent::addBNode();
    1293       getNotifier(BNode()).add(node);
    1294       getNotifier(Node()).add(node);
     1293      notifier(BNode()).add(node);
     1294      notifier(Node()).add(node);
    12951295      return node;
    12961296    }
     
    12981298    UEdge addEdge(const Node& source, const Node& target) {
    12991299      UEdge uedge = Parent::addEdge(source, target);
    1300       getNotifier(UEdge()).add(uedge);
     1300      notifier(UEdge()).add(uedge);
    13011301   
    13021302      std::vector<Edge> edges;
    13031303      edges.push_back(Parent::direct(uedge, true));
    13041304      edges.push_back(Parent::direct(uedge, false));
    1305       getNotifier(Edge()).add(edges);
     1305      notifier(Edge()).add(edges);
    13061306   
    13071307      return uedge;
     
    13091309
    13101310    void clear() {
    1311       getNotifier(Edge()).clear();
    1312       getNotifier(UEdge()).clear();
    1313       getNotifier(Node()).clear();
    1314       getNotifier(BNode()).clear();
    1315       getNotifier(ANode()).clear();
     1311      notifier(Edge()).clear();
     1312      notifier(UEdge()).clear();
     1313      notifier(Node()).clear();
     1314      notifier(BNode()).clear();
     1315      notifier(ANode()).clear();
    13161316      Parent::clear();
    13171317    }
     
    13221322               BNodeRefMap& bNodeRef, UEdgeRefMap& uEdgeRef) {
    13231323      Parent::build(graph, aNodeRef, bNodeRef, uEdgeRef);
    1324       getNotifier(ANode()).build();
    1325       getNotifier(BNode()).build();
    1326       getNotifier(Node()).build();
    1327       getNotifier(UEdge()).build();
    1328       getNotifier(Edge()).build();
     1324      notifier(ANode()).build();
     1325      notifier(BNode()).build();
     1326      notifier(Node()).build();
     1327      notifier(UEdge()).build();
     1328      notifier(Edge()).build();
    13291329    }
    13301330
     
    13371337          Parent::firstFromANode(uedge, node);
    13381338        }
    1339         getNotifier(ANode()).erase(node);
     1339        notifier(ANode()).erase(node);
    13401340      } else {
    13411341        Parent::firstFromBNode(uedge, node);
     
    13441344          Parent::firstFromBNode(uedge, node);
    13451345        }
    1346         getNotifier(BNode()).erase(node);
    1347       }
    1348 
    1349       getNotifier(Node()).erase(node);
     1346        notifier(BNode()).erase(node);
     1347      }
     1348
     1349      notifier(Node()).erase(node);
    13501350      Parent::erase(node);
    13511351    }
     
    13551355      edges.push_back(Parent::direct(uedge, true));
    13561356      edges.push_back(Parent::direct(uedge, false));
    1357       getNotifier(Edge()).erase(edges);
    1358       getNotifier(UEdge()).erase(uedge);
     1357      notifier(Edge()).erase(edges);
     1358      notifier(UEdge()).erase(uedge);
    13591359      Parent::erase(uedge);
    13601360    }
  • lemon/bits/map_extender.h

    r2260 r2384  
    8484
    8585      explicit MapIt(Map& _map) : map(_map) {
    86         map.getNotifier()->first(*this);
     86        map.notifier()->first(*this);
    8787      }
    8888
     
    9191
    9292      MapIt& operator++() {
    93         map.getNotifier()->next(*this);
     93        map.notifier()->next(*this);
    9494        return *this;
    9595      }
     
    124124
    125125      explicit ConstMapIt(Map& _map) : map(_map) {
    126         map.getNotifier()->first(*this);
     126        map.notifier()->first(*this);
    127127      }
    128128
     
    131131
    132132      ConstMapIt& operator++() {
    133         map.getNotifier()->next(*this);
     133        map.notifier()->next(*this);
    134134        return *this;
    135135      }
     
    153153
    154154      explicit ItemIt(Map& _map) : map(_map) {
    155         map.getNotifier()->first(*this);
     155        map.notifier()->first(*this);
    156156      }
    157157
     
    160160
    161161      ItemIt& operator++() {
    162         map.getNotifier()->next(*this);
     162        map.notifier()->next(*this);
    163163        return *this;
    164164      }
  • lemon/bits/vector_map.h

    r2260 r2384  
    9191    /// It adds all the items of the graph to the map.
    9292    VectorMap(const Graph& graph) {
    93       Parent::attach(graph.getNotifier(Item()));
    94       container.resize(Parent::getNotifier()->maxId() + 1);
     93      Parent::attach(graph.notifier(Item()));
     94      container.resize(Parent::notifier()->maxId() + 1);
    9595    }
    9696
     
    100100    /// It adds all the items of the graph to the map.
    101101    VectorMap(const Graph& graph, const Value& value) {
    102       Parent::attach(graph.getNotifier(Item()));
    103       container.resize(Parent::getNotifier()->maxId() + 1, value);
     102      Parent::attach(graph.notifier(Item()));
     103      container.resize(Parent::notifier()->maxId() + 1, value);
    104104    }
    105105
     
    109109    VectorMap(const VectorMap& _copy) : Parent() {
    110110      if (_copy.attached()) {
    111         Parent::attach(*_copy.getNotifier());
     111        Parent::attach(*_copy.notifier());
    112112        container = _copy.container;
    113113      }
     
    135135    VectorMap& operator=(const CMap& cmap) {
    136136      checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    137       const typename Parent::Notifier* notifier = Parent::getNotifier();
     137      const typename Parent::Notifier* notifier = Parent::notifier();
    138138      Item it;
    139139      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     
    150150    /// actual items of the graph.     
    151151    Reference operator[](const Key& key) {
    152       return container[Parent::getNotifier()->id(key)];
     152      return container[Parent::notifier()->id(key)];
    153153    }
    154154               
     
    158158    /// actual items of the graph.
    159159    ConstReference operator[](const Key& key) const {
    160       return container[Parent::getNotifier()->id(key)];
     160      return container[Parent::notifier()->id(key)];
    161161    }
    162162
     
    176176    /// and it overrides the add() member function of the observer base.     
    177177    virtual void add(const Key& key) {
    178       int id = Parent::getNotifier()->id(key);
     178      int id = Parent::notifier()->id(key);
    179179      if (id >= (int)container.size()) {
    180180        container.resize(id + 1);
     
    189189      int max = container.size() - 1;
    190190      for (int i = 0; i < (int)keys.size(); ++i) {
    191         int id = Parent::getNotifier()->id(keys[i]);
     191        int id = Parent::notifier()->id(keys[i]);
    192192        if (id >= max) {
    193193          max = id;
     
    202202    /// and it overrides the erase() member function of the observer base.     
    203203    virtual void erase(const Key& key) {
    204       container[Parent::getNotifier()->id(key)] = Value();
     204      container[Parent::notifier()->id(key)] = Value();
    205205    }
    206206
     
    211211    virtual void erase(const std::vector<Key>& keys) {
    212212      for (int i = 0; i < (int)keys.size(); ++i) {
    213         container[Parent::getNotifier()->id(keys[i])] = Value();
     213        container[Parent::notifier()->id(keys[i])] = Value();
    214214      }
    215215    }
     
    220220    /// and it overrides the build() member function of the observer base.
    221221    virtual void build() {
    222       int size = Parent::getNotifier()->maxId() + 1;
     222      int size = Parent::notifier()->maxId() + 1;
    223223      container.reserve(size);
    224224      container.resize(size);
Note: See TracChangeset for help on using the changeset viewer.