]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/dictionary.hh
release: 1.1.29
[lilypond.git] / flower / include / dictionary.hh
index 11bb27329bbba3ca0590e00fef7fdf37aadf7495..e29b483a4cef101004c4d667c646f4655817f74b 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the Flower Library
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
 #define DICTIONARY_HH
 
 #include "string.hh"
-#include "assoc.hh"
+#include "array.hh"
 
-template<class T>
-class Dictionary : public Assoc<String, T>
+#include "hash-table.hh"
+
+
+unsigned int string_hash (String);
+
+
+template<class V>
+struct Dict_initialiser
+{
+  char *key_;
+  V value_;
+};
+
+
+template<class V>
+class Dictionary : public Hash_table<String, V>
 {
 public:
-  
+  Dictionary ()
+    {
+      hash_func_ = string_hash;
+    }
+  Dictionary (Dict_initialiser<V> *p)
+    {
+      hash_func_ = string_hash;
+      for (Dict_initialiser<V> *q = p; q->key_; q++)
+       elem (q->key_) = q->value_;
+         
+    }
+
+  friend class Dictionary_iter<V>;
 };
 
+
 #endif // DICTIONARY_HH