Changeset 7388 in orxonox.OLD for trunk/src/lib/shell/shell_command_class.cc
- Timestamp:
- Apr 26, 2006, 11:19:29 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command_class.cc
r7386 r7388 24 24 #include "compiler.h" 25 25 26 #include <stdio.h>27 #include <string.h>28 29 26 namespace OrxShell 30 27 { … … 53 50 ShellCommandClass::~ShellCommandClass() 54 51 { 55 while( this->commandList.size() > 0)56 { 57 delete this->commandList. front();58 this->commandList.pop_ front();52 while(!this->commandList.empty()) 53 { 54 delete this->commandList.back(); 55 this->commandList.pop_back(); 59 56 } 60 57 } … … 73 70 if (className == (*elem)->getName()) 74 71 { 75 std:: list<ShellCommand*>::iterator command;72 std::vector<ShellCommand*>::iterator command; 76 73 for(command = (*elem)->commandList.begin(); command != (*elem)->commandList.end(); command++) 77 74 stringList.push_back((*command)->getName()); … … 194 191 { 195 192 PRINT(0)("Class:'%s' registered %d commands: \n", (*classIT)->className.c_str(), (*classIT)->commandList.size()); 196 std:: list<ShellCommand*>::const_iterator cmdIT;193 std::vector<ShellCommand*>::const_iterator cmdIT; 197 194 for (cmdIT = (*classIT)->commandList.begin(); cmdIT != (*classIT)->commandList.end(); cmdIT++) 198 195 { … … 216 213 } 217 214 215 void ShellCommandClass::registerCommand(ShellCommand* command) 216 { 217 this->commandList.push_back(command); 218 } 219 220 221 void ShellCommandClass::unregisterCommand(ShellCommand* command) 222 { 223 std::vector<ShellCommand*>::iterator delC = std::find(this->commandList.begin(), this->commandList.end(), command); 224 this->commandList.erase(delC); 225 } 226 227 228 218 229 } 230 231 232 233
Note: See TracChangeset
for help on using the changeset viewer.