From fc98b57b15bbce17971e8e7001a403d06f9a9d7e Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 26 Oct 2006 17:39:47 +0000 Subject: [PATCH] simplify name/number handling --- src/Instrumentation/gsdi.cxx | 23 ++--------------------- src/Instrumentation/gsdi.hxx | 3 +-- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/Instrumentation/gsdi.cxx b/src/Instrumentation/gsdi.cxx index b624e6405..acf11412d 100644 --- a/src/Instrumentation/gsdi.cxx +++ b/src/Instrumentation/gsdi.cxx @@ -36,27 +36,8 @@ GSDI::GSDI(SGPropertyNode *node) : - _name("gsdi"), - _num(0) -{ - for (int i = 0; i < node->nChildren(); ++i) { - SGPropertyNode *child = node->getChild(i); - string name = child->getName(); - - if (name == "name") { - _name = child->getStringValue(); - } else if (name == "number") { - _num = child->getIntValue(); - } else { - SG_LOG(SG_INSTR, SG_WARN, "Error in gsdi config logic"); - if (_name.length()) - SG_LOG(SG_INSTR, SG_WARN, "Section = " << _name); - } - } -} - - -GSDI::GSDI() + _name(node->getStringValue("name", "gsdi")), + _num(node->getIntValue("number", 0)) { } diff --git a/src/Instrumentation/gsdi.hxx b/src/Instrumentation/gsdi.hxx index b63566bc9..2fc8e2966 100644 --- a/src/Instrumentation/gsdi.hxx +++ b/src/Instrumentation/gsdi.hxx @@ -45,7 +45,6 @@ class GSDI : public SGSubsystem { public: GSDI(SGPropertyNode *node); - GSDI(); virtual ~GSDI(); virtual void init(); @@ -53,7 +52,7 @@ public: private: string _name; - int _num; + unsigned int _num; SGPropertyNode_ptr _serviceableN; SGPropertyNode_ptr _headingN; -- 2.39.5