Reset: commands can be removed

This commit is contained in:
James Turner
2013-11-05 05:17:05 +00:00
parent 48f866dcc6
commit 2e8e500d4f
2 changed files with 15 additions and 0 deletions

View File

@@ -126,4 +126,15 @@ SGCommandMgr::execute (const std::string &name, const SGPropertyNode * arg) cons
return false;
}
bool SGCommandMgr::removeCommand(const std::string& name)
{
command_map::iterator it = _commands.find(name);
if (it == _commands.end())
return false;
delete it->second;
_commands.erase(it);
return true;
}
// end of commands.cxx

View File

@@ -150,6 +150,10 @@ public:
*/
virtual bool execute (const std::string &name, const SGPropertyNode * arg) const;
/**
* Remove a command registration
*/
bool removeCommand(const std::string& name);
protected:
/**
* Default constructor.