COIN-OR::LEMON - Graph Library

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


Ignore:
Timestamp:
03/01/07 18:14:24 (13 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/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;
Note: See TracChangeset for help on using the changeset viewer.