Changeset 1682 for code/branches/core3/src/core/Identifier.cc
- Timestamp:
- Aug 30, 2008, 12:40:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/Identifier.cc
r1676 r1682 37 37 38 38 #include "Factory.h" 39 #include "ConfigValueContainer.h" 39 40 #include "ConsoleCommand.h" 40 41 #include "CommandExecutor.h" … … 77 78 delete this->children_; 78 79 delete this->directChildren_; 80 delete this->objects_; 81 82 if (this->factory_) 83 delete this->factory_; 84 85 for (std::map<std::string, ConsoleCommand*>::iterator it = this->consoleCommands_.begin(); it != this->consoleCommands_.end(); ++it) 86 delete (it->second); 87 for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it) 88 delete (it->second); 89 for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it) 90 delete (it->second); 91 for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it) 92 delete (it->second); 79 93 } 80 94 … … 153 167 154 168 /** 169 @brief Destroys all Identifiers. Called when exiting the program. 170 */ 171 void Identifier::destroyAllIdentifiers() 172 { 173 for (std::map<std::string, Identifier*>::iterator it = Identifier::getIdentifierMapIntern().begin(); it != Identifier::getIdentifierMapIntern().end(); ++it) 174 delete (it->second); 175 } 176 177 /** 155 178 @brief Sets the name of the class. 156 179 @param name The name … … 282 305 { 283 306 COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl; 307 delete (it->second); 284 308 } 285 309 … … 329 353 { 330 354 COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl; 355 delete (it->second); 331 356 } 332 357 … … 367 392 else 368 393 return 0; 394 } 395 396 /** 397 @brief Returns a XMLPortParamContainer that loads a parameter of this class. 398 @param paramname The name of the parameter 399 @return The container 400 */ 401 XMLPortParamContainer* Identifier::getXMLPortParamContainer(const std::string& paramname) 402 { 403 std::map<std::string, XMLPortParamContainer*>::const_iterator it = xmlportParamContainers_.find(paramname); 404 if (it != xmlportParamContainers_.end()) 405 return ((*it).second); 406 else 407 return 0; 408 } 409 410 /** 411 @brief Adds a new XMLPortParamContainer that loads a parameter of this class. 412 @param paramname The name of the parameter 413 @param container The container 414 */ 415 void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) 416 { 417 this->xmlportParamContainers_[paramname] = container; 418 } 419 420 /** 421 @brief Returns a XMLPortObjectContainer that attaches an object to this class. 422 @param sectionname The name of the section that contains the attachable objects 423 @return The container 424 */ 425 XMLPortObjectContainer* Identifier::getXMLPortObjectContainer(const std::string& sectionname) 426 { 427 std::map<std::string, XMLPortObjectContainer*>::const_iterator it = xmlportObjectContainers_.find(sectionname); 428 if (it != xmlportObjectContainers_.end()) 429 return ((*it).second); 430 else 431 return 0; 432 } 433 434 /** 435 @brief Adds a new XMLPortObjectContainer that attaches an object to this class. 436 @param sectionname The name of the section that contains the attachable objects 437 @param container The container 438 */ 439 void Identifier::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) 440 { 441 this->xmlportObjectContainers_[sectionname] = container; 369 442 } 370 443
Note: See TracChangeset
for help on using the changeset viewer.