lemon/bits/array_map.h
changeset 2384 805c5a2a36dd
parent 2260 4274224f8a7d
child 2386 81b47fc5c444
     1.1 --- a/lemon/bits/array_map.h	Thu Mar 01 16:50:12 2007 +0000
     1.2 +++ b/lemon/bits/array_map.h	Thu Mar 01 17:14:24 2007 +0000
     1.3 @@ -79,9 +79,9 @@
     1.4      ///
     1.5      /// Graph initialized map constructor.
     1.6      explicit ArrayMap(const Graph& graph) {
     1.7 -      Parent::attach(graph.getNotifier(Item()));
     1.8 +      Parent::attach(graph.notifier(Item()));
     1.9        allocate_memory();
    1.10 -      Notifier* notifier = Parent::getNotifier();
    1.11 +      Notifier* notifier = Parent::notifier();
    1.12        Item it;
    1.13        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    1.14  	int id = notifier->id(it);;
    1.15 @@ -93,9 +93,9 @@
    1.16      ///
    1.17      /// It constructs a map and initialize all of the the map. 
    1.18      ArrayMap(const Graph& graph, const Value& value) {
    1.19 -      Parent::attach(graph.getNotifier(Item()));
    1.20 +      Parent::attach(graph.notifier(Item()));
    1.21        allocate_memory();
    1.22 -      Notifier* notifier = Parent::getNotifier();
    1.23 +      Notifier* notifier = Parent::notifier();
    1.24        Item it;
    1.25        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    1.26  	int id = notifier->id(it);;
    1.27 @@ -108,12 +108,12 @@
    1.28      /// Constructor to copy a map of the same map type.     
    1.29      ArrayMap(const ArrayMap& copy) : Parent() {
    1.30        if (copy.attached()) {
    1.31 -	attach(*copy.getNotifier());
    1.32 +	attach(*copy.notifier());
    1.33        }
    1.34        capacity = copy.capacity;
    1.35        if (capacity == 0) return;
    1.36        values = allocator.allocate(capacity);
    1.37 -      Notifier* notifier = Parent::getNotifier();
    1.38 +      Notifier* notifier = Parent::notifier();
    1.39        Item it;
    1.40        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    1.41  	int id = notifier->id(it);;
    1.42 @@ -142,7 +142,7 @@
    1.43      template <typename CMap>
    1.44      ArrayMap& operator=(const CMap& cmap) {
    1.45        checkConcept<concepts::ReadMap<Key, _Value>, CMap>();
    1.46 -      const typename Parent::Notifier* notifier = Parent::getNotifier();
    1.47 +      const typename Parent::Notifier* notifier = Parent::notifier();
    1.48        Item it;
    1.49        for (notifier->first(it); it != INVALID; notifier->next(it)) {
    1.50          set(it, cmap[it]);
    1.51 @@ -173,7 +173,7 @@
    1.52      /// The subscript operator. The map can be subscripted by the
    1.53      /// actual keys of the graph. 
    1.54      Value& operator[](const Key& key) {
    1.55 -      int id = Parent::getNotifier()->id(key);
    1.56 +      int id = Parent::notifier()->id(key);
    1.57        return values[id];
    1.58      } 
    1.59  		
    1.60 @@ -182,7 +182,7 @@
    1.61      /// The const subscript operator. The map can be subscripted by the
    1.62      /// actual keys of the graph. 
    1.63      const Value& operator[](const Key& key) const {
    1.64 -      int id = Parent::getNotifier()->id(key);
    1.65 +      int id = Parent::notifier()->id(key);
    1.66        return values[id];
    1.67      }
    1.68  
    1.69 @@ -201,7 +201,7 @@
    1.70      /// It adds a new key to the map. It called by the observer notifier
    1.71      /// and it overrides the add() member function of the observer base.     
    1.72      virtual void add(const Key& key) {
    1.73 -      Notifier* notifier = Parent::getNotifier();
    1.74 +      Notifier* notifier = Parent::notifier();
    1.75        int id = notifier->id(key);
    1.76        if (id >= capacity) {
    1.77  	int new_capacity = (capacity == 0 ? 1 : capacity);
    1.78 @@ -229,7 +229,7 @@
    1.79      /// It adds more new keys to the map. It called by the observer notifier
    1.80      /// and it overrides the add() member function of the observer base.     
    1.81      virtual void add(const std::vector<Key>& keys) {
    1.82 -      Notifier* notifier = Parent::getNotifier();
    1.83 +      Notifier* notifier = Parent::notifier();
    1.84        int max_id = -1;
    1.85        for (int i = 0; i < (int)keys.size(); ++i) {
    1.86  	int id = notifier->id(keys[i]);
    1.87 @@ -273,7 +273,7 @@
    1.88      /// Erase a key from the map. It called by the observer notifier
    1.89      /// and it overrides the erase() member function of the observer base.     
    1.90      virtual void erase(const Key& key) {
    1.91 -      int id = Parent::getNotifier()->id(key);
    1.92 +      int id = Parent::notifier()->id(key);
    1.93        allocator.destroy(&(values[id]));
    1.94      }
    1.95  
    1.96 @@ -283,7 +283,7 @@
    1.97      /// and it overrides the erase() member function of the observer base.     
    1.98      virtual void erase(const std::vector<Key>& keys) {
    1.99        for (int i = 0; i < (int)keys.size(); ++i) {
   1.100 -	int id = Parent::getNotifier()->id(keys[i]);
   1.101 +	int id = Parent::notifier()->id(keys[i]);
   1.102  	allocator.destroy(&(values[id]));
   1.103        }
   1.104      }
   1.105 @@ -293,7 +293,7 @@
   1.106      /// It buildes the map. It called by the observer notifier
   1.107      /// and it overrides the build() member function of the observer base. 
   1.108      virtual void build() {
   1.109 -      Notifier* notifier = Parent::getNotifier();
   1.110 +      Notifier* notifier = Parent::notifier();
   1.111        allocate_memory();
   1.112        Item it;
   1.113        for (notifier->first(it); it != INVALID; notifier->next(it)) {
   1.114 @@ -307,7 +307,7 @@
   1.115      /// It erase all items from the map. It called by the observer notifier
   1.116      /// and it overrides the clear() member function of the observer base.     
   1.117      virtual void clear() {	
   1.118 -      Notifier* notifier = Parent::getNotifier();
   1.119 +      Notifier* notifier = Parent::notifier();
   1.120        if (capacity != 0) {
   1.121  	Item it;
   1.122  	for (notifier->first(it); it != INVALID; notifier->next(it)) {
   1.123 @@ -322,7 +322,7 @@
   1.124    private:
   1.125        
   1.126      void allocate_memory() {
   1.127 -      int max_id = Parent::getNotifier()->maxId();
   1.128 +      int max_id = Parent::notifier()->maxId();
   1.129        if (max_id == -1) {
   1.130  	capacity = 0;
   1.131  	values = 0;