Removed debugging code.
[ginac.git] / ginac / registrar.cpp
index 34c9111884059f22ab49db86d73a7e14a6fa3fd1..c20b0448caf5aae1aabf5d4a769668c79eda75b1 100644 (file)
  */
 
 #include <string>
+#include <map>
 #include <stdexcept>
 
 #include "registrar.h"
 
 namespace GiNaC {
 
-registered_class_info *first_registered_class = NULL;
-
-/** Find registered_class_info strucure by class name. */
-static inline registered_class_info *find_registered_class_info(const std::string &class_name)
+unsigned find_tinfo_key(const std::string &class_name)
 {
-       registered_class_info *p = first_registered_class;
-       while (p) {
-               if (class_name == p->name)
-                       return p;
-               p = p->next;
-       }
-       throw (std::runtime_error("class '" + class_name + "' not registered"));
-}
-
-unsigned int find_tinfo_key(const std::string &class_name)
-{
-       registered_class_info *p = find_registered_class_info(class_name);
-       return p->tinfo_key;
+       return registered_class_info::find(class_name)->options.get_id();
 }
 
 unarch_func find_unarch_func(const std::string &class_name)
 {
-       registered_class_info *p = find_registered_class_info(class_name);
-       return p->unarchive;
+       return registered_class_info::find(class_name)->options.get_unarch_func();
 }
 
-
 } // namespace GiNaC