Reset: commands can be removed
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user