From 0ef91aa905df33bc013b223513982da898a8bed3 Mon Sep 17 00:00:00 2001
From: Steve Reinhardt <stever@eecs.umich.edu>
Date: Mon, 5 Apr 2004 11:00:48 -0700
Subject: Changes to config to allow everything (including 'children' and
 'type') to be specified via instance name and not just config class.  Old
 code only did instance-name lookup for SimObject parameters.  This feature
 makes life easier for transitioning to the Python script-based config.

sim/builder.cc:
    Use ConfigNode::find to look for "type" parameter so it can
    be found if set under instance name (not config class).
sim/param.cc:
    Make Param<bool> accept "1" for true and "0" for false.

--HG--
extra : convert_revision : f40d0878d0f03b2e216f0506c05d0e52db608cca
---
 sim/builder.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'sim/builder.cc')

diff --git a/sim/builder.cc b/sim/builder.cc
index e2345556e..110c42f25 100644
--- a/sim/builder.cc
+++ b/sim/builder.cc
@@ -32,6 +32,7 @@
 #include "base/misc.hh"
 #include "sim/builder.hh"
 #include "sim/configfile.hh"
+#include "sim/config_node.hh"
 #include "sim/host.hh"
 #include "sim/sim_object.hh"
 #include "sim/universe.hh"
@@ -153,7 +154,7 @@ SimObjectClass::createObject(IniFile &configDB,
     // (specified by 'type=' parameter)
     string simObjClassName;
 
-    if (!configDB.findDefault(configClassName, "type", simObjClassName)) {
+    if (!configNode->find("type", simObjClassName)) {
         cerr << "Configuration class '" << configClassName << "' not found."
              << endl;
         abort();
-- 
cgit v1.2.3