{ 0 , 0 }
};
-class cl_list *registered_errors= NIL;
+static class cl_error_registry error_registry;
+
+class cl_list *cl_error_registry::registered_errors= NIL;
/*
*/
type= typ;
on= be_on;
set_name(aname, "not-known");
- if (!registered_errors)
- registered_errors= new cl_list(2, 2, "registered errors");
- registered_errors->add(this);
}
cl_error_class::cl_error_class(enum error_type typ, char *aname,
type= typ;
on= be_on;
set_name(aname, "not-known");
- if (!registered_errors)
- registered_errors= new cl_list(2, 2, "registered errors");
- registered_errors->add(this);
if (parent)
parent->add_child(this);
}
/*
*/
-class cl_error_class *cl_error::error_class_base;
-
cl_error::cl_error(void):
cl_base()
{
- if (NULL == error_class_base)
- error_class_base = new cl_error_class(err_error, "non-classified", ERROR_ON);
- //type= err_unknown;
- classification= error_class_base;
+ classification= error_registry.find("non-classified");
}
cl_error::~cl_error(void)
return(get_id_string(error_type_names, type, "untyped"));
}
+cl_error_registry::cl_error_registry(void)
+{
+ if (NULL == error_registry.find("non-classified"))
+ register_error(new cl_error_class(err_error, "non-classified", ERROR_ON));
+}
+
/* End of sim.src/error.cc */