[Avida-cvs] [Avida2-svn] r272 - trunk/source/tools

kaben@myxo.css.msu.edu kaben at myxo.css.msu.edu
Thu Aug 4 08:36:36 PDT 2005


Author: kaben
Date: 2005-08-04 11:36:36 -0400 (Thu, 04 Aug 2005)
New Revision: 272

Modified:
   trunk/source/tools/tDictionary.hh
Log:
Added namespace specification to tDictionary, since it's defined in a header file, and we're following the convention of declaring namespaces only in source files.

Modified: trunk/source/tools/tDictionary.hh
===================================================================
--- trunk/source/tools/tDictionary.hh	2005-08-04 15:32:47 UTC (rev 271)
+++ trunk/source/tools/tDictionary.hh	2005-08-04 15:36:36 UTC (rev 272)
@@ -114,6 +114,9 @@
     // No matches found.
     return NULL;
   }
+private:
+  // disabled copy constructor.
+  tDictionary(const tDictionary &);
 public:
   tDictionary(int in_hash_size=DICTIONARY_HASH_DEFAULT)
     : dict_size(0)
@@ -130,31 +133,31 @@
 
 
   bool OK() {
-    cout << "DICT_SIZE = " << dict_size << endl;
-    cout << "HASH_SIZE = " << hash_size << endl;
+    std::cout << "DICT_SIZE = " << dict_size << std::endl;
+    std::cout << "HASH_SIZE = " << hash_size << std::endl;
     int count = 0;
-    cout << "LIST ELEMENTS:" << endl;
+    std::cout << "LIST ELEMENTS:" << std::endl;
     list_it.Reset();
     while (list_it.Next() != NULL) {
       tDictEntry<T> * cur_entry = list_it.Get();
-      cout << "  " << count << " : "
+      std::cout << "  " << count << " : "
 	   << cur_entry->id << " "
 	   << cur_entry->name << " "
 	   << cur_entry->data << " "
-	   << endl;
+	   << std::endl;
     }
-    cout << endl;
-    cout << "ARRAY CELLS: "
+    std::cout << std::endl;
+    std::cout << "ARRAY CELLS: "
 	 << cell_array.GetSize()
-	 << endl;
+	 << std::endl;
     for (int i = 0; i < hash_size; i++) {
       tListNode< tDictEntry<T> > * cur_list_node = cell_array[i];
       if (cur_list_node == NULL) {
-	cout << "  NULL" << endl;
+	std::cout << "  NULL" << std::endl;
       } else {
-	cout << "  " << cur_list_node->data->id
+	std::cout << "  " << cur_list_node->data->id
 	     << " " << cur_list_node->data->name
-	     << endl;
+	     << std::endl;
       }
     }
 
@@ -203,7 +206,7 @@
     // Determine the bin that we are going to be using.
     const int bin = HashString(name);
 
-    T out_data = NULL;
+    T out_data;
     assert(cell_array[bin] != NULL);
     list_it.Set(cell_array[bin]);
 




More information about the Avida-cvs mailing list