COIN-OR::LEMON - Graph Library

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


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.