summaryrefslogtreecommitdiff
path: root/omegalib/omega/include/basic/Map.c
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-19 11:36:10 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-19 11:36:10 -0600
commit62f7acd88465f4f20b9b25c3f7edd4e3b7ce453b (patch)
tree224cc286126ae2bb9674973f0ccaee07e324433f /omegalib/omega/include/basic/Map.c
parent7115fd7bf9d36cc003e818825dd75fa8bf3eb69e (diff)
downloadchill-62f7acd88465f4f20b9b25c3f7edd4e3b7ce453b.tar.gz
chill-62f7acd88465f4f20b9b25c3f7edd4e3b7ce453b.tar.bz2
chill-62f7acd88465f4f20b9b25c3f7edd4e3b7ce453b.zip
rm template.c
Diffstat (limited to 'omegalib/omega/include/basic/Map.c')
-rw-r--r--omegalib/omega/include/basic/Map.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/omegalib/omega/include/basic/Map.c b/omegalib/omega/include/basic/Map.c
deleted file mode 100644
index 69cc3f7..0000000
--- a/omegalib/omega/include/basic/Map.c
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace omega {
-
-template<class K, class V> MapElement<K,V>:: MapElement(const MapElement<K,V>& M) {
- if (M.tail) tail = new MapElement<K,V>(*M.tail);
- else tail = 0;
- k = M.k;
- v = M.v;
- }
-
-template<class K, class V> MapElement<K,V> &
- MapElement<K,V>:: operator=(const MapElement<K,V>& M) {
- if (this != &M) {
- if (tail) delete tail;
- if (M.tail) tail = new MapElement<K,V>(*M.tail);
- else tail = 0;
- k = M.k;
- v = M.v;
- }
- return *this;
- }
-
-
-
-
-#if ! defined linux
-template <class K, class V> Map <K,V>::Map(const V &default_value)
-#else
-template <class K, class V> Map <K,V>::Map(V default_value)
-#endif
- : _default_value(default_value)
- {
- contents = 0;
- }
-
-template <class K, class V> Map <K,V>::~Map()
- {
- delete contents;
- }
-
-template <class K, class V> V Map<K,V>::operator()(K k) const {
- MapElement <K,V> * P = contents;
- while (P) {
- if (P->k == k) return P->v;
- P = P->tail;
- };
- return _default_value;
- }
-
-template <class K, class V> V & Map<K,V>::operator[](K k) {
- MapElement <K,V> * P = contents;
- while (P) {
- if (P->k == k) return P->v;
- P = P->tail;
- };
- P = new MapElement <K,V>;
- P->k = k;
- P->v = _default_value;
- P->tail = contents;
- contents = P;
- return P->v;
- }
-
-} // namespace