1
0
Fork 0

simplify name/number handling

This commit is contained in:
mfranz 2006-10-26 17:39:47 +00:00
parent e63b8b3351
commit fc98b57b15
2 changed files with 3 additions and 23 deletions

View file

@ -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))
{
}

View file

@ -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;