From 2fce43d484e4148ae858f410d51dcd9951d34374 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Sun, 18 Sep 2016 15:45:13 +0000 Subject: remove include & rename --- omegalib/omega_lib/include/basic/Map.c | 63 ---------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 omegalib/omega_lib/include/basic/Map.c (limited to 'omegalib/omega_lib/include/basic/Map.c') diff --git a/omegalib/omega_lib/include/basic/Map.c b/omegalib/omega_lib/include/basic/Map.c deleted file mode 100644 index 69cc3f7..0000000 --- a/omegalib/omega_lib/include/basic/Map.c +++ /dev/null @@ -1,63 +0,0 @@ -namespace omega { - -template MapElement:: MapElement(const MapElement& M) { - if (M.tail) tail = new MapElement(*M.tail); - else tail = 0; - k = M.k; - v = M.v; - } - -template MapElement & - MapElement:: operator=(const MapElement& M) { - if (this != &M) { - if (tail) delete tail; - if (M.tail) tail = new MapElement(*M.tail); - else tail = 0; - k = M.k; - v = M.v; - } - return *this; - } - - - - -#if ! defined linux -template Map ::Map(const V &default_value) -#else -template Map ::Map(V default_value) -#endif - : _default_value(default_value) - { - contents = 0; - } - -template Map ::~Map() - { - delete contents; - } - -template V Map::operator()(K k) const { - MapElement * P = contents; - while (P) { - if (P->k == k) return P->v; - P = P->tail; - }; - return _default_value; - } - -template V & Map::operator[](K k) { - MapElement * P = contents; - while (P) { - if (P->k == k) return P->v; - P = P->tail; - }; - P = new MapElement ; - P->k = k; - P->v = _default_value; - P->tail = contents; - contents = P; - return P->v; - } - -} // namespace -- cgit v1.2.3-70-g09d2