}
FGBinding::FGBinding (const SGPropertyNode * node)
- : _command(0),
- _arg(new SGPropertyNode),
- _setting(0)
{
+ FGBinding();
read(node);
}
FGBinding::~FGBinding ()
{
-// delete _arg; // Delete the saved arguments
-// delete _command_state; // Delete the saved command state
}
void
FGBinding::read (const SGPropertyNode * node)
{
const SGPropertyNode * conditionNode = node->getChild("condition");
- if (conditionNode != 0) {
- cerr << "Adding condition to binding" << endl;
+ if (conditionNode != 0)
setCondition(fgReadCondition(conditionNode));
- }
_command_name = node->getStringValue("command", "");
if (_command_name.empty()) {
return;
}
- delete _arg;
- _arg = new SGPropertyNode;
- _setting = 0;
- copyProperties(node, _arg); // FIXME: don't use whole node!!!
+ _arg = (SGPropertyNode *)node;
}
void
private:
+ // just to be safe.
+ FGBinding (const FGBinding &binding);
+
+
string _command_name;
SGCommandMgr::command_t _command;
- mutable SGPropertyNode * _arg;
- mutable SGPropertyNode * _setting;
+ mutable SGPropertyNode_ptr _arg;
+ mutable SGPropertyNode_ptr _setting;
};